aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorvektor <devnull@localhost>2004-09-21 01:17:04 +0000
committervektor <devnull@localhost>2004-09-21 01:17:04 +0000
commitfa4ee8c73d6c8f43374bc6f12821b429d28b129f (patch)
treedb1cb98c9cb6107f07f0b1aaca808a4dfbbb3b9f /src
parent464f4d739559c86071eb4b719a5143dcad4d8e67 (diff)
20 Sep 2004 Billy Biggs <vektor@dumbterm.net>
* tvtime/src/videoinput.h: Call it saturation not colour. * tvtime/src/videoinput.c: Ibid. * tvtime/src/commands.h: Ibid. * tvtime/src/commands.c: Ibid. * tvtime/src/station.h: Ibid. * tvtime/src/station.c: Ibid. * tvtime/src/tvtimeconf.h: Ibid. * tvtime/src/tvtimeconf.c: Ibid. * tvtime/src/utils.h: Ibid. * tvtime/src/utils.c: Ibid. * tvtime/src/tvtimeglyphs.h: Ibid. * tvtime/src/tvtime.c: Ibid. * tvtime/docs/tvtime-command.1: Ibid.
Diffstat (limited to 'src')
-rw-r--r--src/commands.c85
-rw-r--r--src/commands.h2
-rw-r--r--src/station.c28
-rw-r--r--src/station.h4
-rw-r--r--src/tvtime.c4
-rw-r--r--src/tvtimeconf.c14
-rw-r--r--src/tvtimeconf.h2
-rw-r--r--src/tvtimeglyphs.h2
-rw-r--r--src/utils.c11
-rw-r--r--src/utils.h4
-rw-r--r--src/videoinput.c16
-rw-r--r--src/videoinput.h6
12 files changed, 94 insertions, 84 deletions
diff --git a/src/commands.c b/src/commands.c
index d87d919..ba393ed 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -64,7 +64,6 @@ static menu_names_t menu_table[] = {
{ "picture", MENU_REDIRECT, "picture-tuner" },
{ "input", MENU_REDIRECT, "input-ntsc" },
{ "favorites", MENU_FAVORITES, 0 },
- { "color", MENU_REDIRECT, "colour" }
};
static int tvtime_num_builtin_menus( void )
@@ -111,7 +110,7 @@ struct commands_s {
int picturemode;
int brightness;
int contrast;
- int colour;
+ int saturation;
int hue;
int boost;
@@ -471,7 +470,7 @@ static void reinit_tuner( commands_t *cmd )
if( config_get_save_restore_picture( cmd->cfg ) ) {
int brightness = station_get_current_brightness( cmd->stationmgr );
int contrast = station_get_current_contrast( cmd->stationmgr );
- int colour = station_get_current_colour( cmd->stationmgr );
+ int saturation = station_get_current_saturation( cmd->stationmgr );
int hue = station_get_current_hue( cmd->stationmgr );
if( brightness >= 0 ) {
@@ -484,10 +483,10 @@ static void reinit_tuner( commands_t *cmd )
} else {
videoinput_set_contrast( cmd->vidin, cmd->contrast );
}
- if( colour >= 0 ) {
- videoinput_set_colour( cmd->vidin, colour );
+ if( saturation >= 0 ) {
+ videoinput_set_saturation( cmd->vidin, saturation );
} else {
- videoinput_set_colour( cmd->vidin, cmd->colour );
+ videoinput_set_saturation( cmd->vidin, cmd->saturation );
}
if( hue >= 0 ) {
videoinput_set_hue( cmd->vidin, hue );
@@ -561,8 +560,8 @@ static void reinit_tuner( commands_t *cmd )
if( cmd->contrast >= 0 ) {
videoinput_set_contrast( cmd->vidin, cmd->contrast );
}
- if( cmd->colour >= 0 ) {
- videoinput_set_colour( cmd->vidin, cmd->colour );
+ if( cmd->saturation >= 0 ) {
+ videoinput_set_saturation( cmd->vidin, cmd->saturation );
}
if( cmd->hue >= 0 ) {
videoinput_set_hue( cmd->vidin, cmd->hue );
@@ -576,9 +575,9 @@ static void reinit_tuner( commands_t *cmd )
menu_set_value (commands_get_menu (cmd, "contrast"),
videoinput_get_contrast (cmd->vidin),
TVTIME_ICON_CONTRAST);
- menu_set_value (commands_get_menu (cmd, "colour"),
- videoinput_get_colour (cmd->vidin),
- TVTIME_ICON_COLOUR);
+ menu_set_value (commands_get_menu (cmd, "saturation"),
+ videoinput_get_saturation (cmd->vidin),
+ TVTIME_ICON_SATURATION);
menu_set_value (commands_get_menu (cmd, "hue"),
videoinput_get_hue (cmd->vidin),
TVTIME_ICON_HUE);
@@ -1043,7 +1042,7 @@ commands_t *commands_new( config_t *cfg, videoinput_t *vidin,
cmd->picturemode = 3;
cmd->brightness = config_get_global_brightness( cfg );
cmd->contrast = config_get_global_contrast( cfg );
- cmd->colour = config_get_global_colour( cfg );
+ cmd->saturation = config_get_global_saturation( cfg );
cmd->hue = config_get_global_hue( cfg );
cmd->displayinfo = 0;
@@ -1505,9 +1504,9 @@ commands_t *commands_new( config_t *cfg, videoinput_t *vidin,
menu_set_text( menu, 2, string );
menu_set_enter_command( menu, 2, TVTIME_SHOW_MENU, "contrast" );
- snprintf( string, sizeof( string ), TVTIME_ICON_COLOUR " %s", _("Colour") );
+ snprintf( string, sizeof( string ), TVTIME_ICON_SATURATION " %s", _("Saturation") );
menu_set_text( menu, 3, string );
- menu_set_enter_command( menu, 3, TVTIME_SHOW_MENU, "colour" );
+ menu_set_enter_command( menu, 3, TVTIME_SHOW_MENU, "saturation" );
snprintf( string, sizeof( string ), TVTIME_ICON_HUE " %s", _("Hue") );
menu_set_text( menu, 4, string );
@@ -1555,9 +1554,9 @@ commands_t *commands_new( config_t *cfg, videoinput_t *vidin,
menu_set_text( menu, 2, string );
menu_set_enter_command( menu, 2, TVTIME_SHOW_MENU, "contrast" );
- snprintf( string, sizeof( string ), TVTIME_ICON_COLOUR " %s", _("Colour") );
+ snprintf( string, sizeof( string ), TVTIME_ICON_SATURATION " %s", _("Saturation") );
menu_set_text( menu, 3, string );
- menu_set_enter_command( menu, 3, TVTIME_SHOW_MENU, "colour" );
+ menu_set_enter_command( menu, 3, TVTIME_SHOW_MENU, "saturation" );
snprintf( string, sizeof( string ), TVTIME_ICON_HUE " %s", _("Hue") );
menu_set_text( menu, 4, string );
@@ -1668,9 +1667,9 @@ commands_t *commands_new( config_t *cfg, videoinput_t *vidin,
TVTIME_ICON_CONTRAST);
}
- menu = menu_new( "colour" );
+ menu = menu_new( "saturation" );
snprintf( string, sizeof( string ), "%s - %s - %s",
- _("Setup"), _("Picture"), _("Colour") );
+ _("Setup"), _("Picture"), _("Saturation") );
menu_set_text( menu, 0, string );
menu_set_back_command( menu, TVTIME_SHOW_MENU, "picture" );
snprintf( string, sizeof( string ), TVTIME_ICON_TVLOGO " %s: ---",
@@ -1682,12 +1681,12 @@ commands_t *commands_new( config_t *cfg, videoinput_t *vidin,
snprintf( string, sizeof( string ), TVTIME_ICON_PLUSBUTTON " %s",
_("Increase") );
menu_set_text( menu, 2, string );
- menu_set_enter_command( menu, 2, TVTIME_COLOUR_UP, "" );
+ menu_set_enter_command( menu, 2, TVTIME_SATURATION_UP, "" );
snprintf( string, sizeof( string ), TVTIME_ICON_MINUSBUTTON " %s",
_("Decrease") );
menu_set_text( menu, 3, string );
- menu_set_enter_command( menu, 3, TVTIME_COLOUR_DOWN, "" );
+ menu_set_enter_command( menu, 3, TVTIME_SATURATION_DOWN, "" );
snprintf( string, sizeof( string ), TVTIME_ICON_PLAINLEFTARROW " %s",
_("Back") );
@@ -1696,9 +1695,9 @@ commands_t *commands_new( config_t *cfg, videoinput_t *vidin,
commands_add_menu( cmd, menu );
if( vidin ) {
- menu_set_value (commands_get_menu (cmd, "colour" ),
- videoinput_get_colour (cmd->vidin),
- TVTIME_ICON_COLOUR);
+ menu_set_value (commands_get_menu (cmd, "saturation" ),
+ videoinput_get_saturation (cmd->vidin),
+ TVTIME_ICON_SATURATION);
}
menu = menu_new( "hue" );
@@ -2903,10 +2902,10 @@ void commands_handle( commands_t *cmd, int tvtime_cmd, const char *arg )
} else {
videoinput_set_contrast( cmd->vidin, 50 );
}
- if( cmd->colour >= 0 ) {
- videoinput_set_colour( cmd->vidin, cmd->colour );
+ if( cmd->saturation >= 0 ) {
+ videoinput_set_saturation( cmd->vidin, cmd->saturation );
} else {
- videoinput_set_colour( cmd->vidin, 50 );
+ videoinput_set_saturation( cmd->vidin, 50 );
}
if( cmd->hue >= 0 ) {
videoinput_set_hue( cmd->vidin, cmd->hue );
@@ -2922,9 +2921,9 @@ void commands_handle( commands_t *cmd, int tvtime_cmd, const char *arg )
menu_set_value( commands_get_menu( cmd, "contrast" ),
videoinput_get_brightness( cmd->vidin ),
TVTIME_ICON_CONTRAST );
- menu_set_value( commands_get_menu( cmd, "colour" ),
+ menu_set_value( commands_get_menu( cmd, "saturation" ),
videoinput_get_brightness( cmd->vidin ),
- TVTIME_ICON_COLOUR );
+ TVTIME_ICON_SATURATION );
menu_set_value( commands_get_menu( cmd, "hue" ),
videoinput_get_brightness( cmd->vidin ),
TVTIME_ICON_HUE );
@@ -3144,15 +3143,15 @@ void commands_handle( commands_t *cmd, int tvtime_cmd, const char *arg )
}
break;
- case TVTIME_COLOUR_UP:
- case TVTIME_COLOUR_DOWN:
+ case TVTIME_SATURATION_UP:
+ case TVTIME_SATURATION_DOWN:
if( cmd->vidin ) {
- videoinput_set_colour_relative( cmd->vidin, (tvtime_cmd == TVTIME_COLOUR_UP) ? 1 : -1 );
+ videoinput_set_saturation_relative( cmd->vidin, (tvtime_cmd == TVTIME_SATURATION_UP) ? 1 : -1 );
if( cmd->osd ) {
- int colour = videoinput_get_colour( cmd->vidin );
- tvtime_osd_show_data_bar( cmd->osd, _("Colour"), colour );
- menu_set_value (commands_get_menu (cmd, "colour"),
- colour, TVTIME_ICON_COLOUR);
+ int saturation = videoinput_get_saturation( cmd->vidin );
+ tvtime_osd_show_data_bar( cmd->osd, _("Saturation"), saturation );
+ menu_set_value (commands_get_menu (cmd, "saturation"),
+ saturation, TVTIME_ICON_SATURATION);
commands_refresh_menu( cmd );
}
}
@@ -3168,8 +3167,8 @@ void commands_handle( commands_t *cmd, int tvtime_cmd, const char *arg )
int cur = videoinput_get_contrast( cmd->vidin );
tvtime_osd_show_data_bar( cmd->osd, _("Contrast"), cur );
} else if( cmd->picturemode == 2 ) {
- int cur = videoinput_get_colour( cmd->vidin );
- tvtime_osd_show_data_bar( cmd->osd, _("Colour"), cur );
+ int cur = videoinput_get_saturation( cmd->vidin );
+ tvtime_osd_show_data_bar( cmd->osd, _("Saturation"), cur );
} else if( cmd->picturemode == 3 ) {
int cur = videoinput_get_hue( cmd->vidin );
tvtime_osd_show_data_bar( cmd->osd, _("Hue"), cur );
@@ -3183,7 +3182,7 @@ void commands_handle( commands_t *cmd, int tvtime_cmd, const char *arg )
} else if( cmd->picturemode == 1 ) {
commands_handle( cmd, TVTIME_CONTRAST_UP, "" );
} else if( cmd->picturemode == 2 ) {
- commands_handle( cmd, TVTIME_COLOUR_UP, "" );
+ commands_handle( cmd, TVTIME_SATURATION_UP, "" );
} else if( cmd->picturemode == 3 ) {
commands_handle( cmd, TVTIME_HUE_UP, "" );
}
@@ -3195,7 +3194,7 @@ void commands_handle( commands_t *cmd, int tvtime_cmd, const char *arg )
} else if( cmd->picturemode == 1 ) {
commands_handle( cmd, TVTIME_CONTRAST_DOWN, "" );
} else if( cmd->picturemode == 2 ) {
- commands_handle( cmd, TVTIME_COLOUR_DOWN, "" );
+ commands_handle( cmd, TVTIME_SATURATION_DOWN, "" );
} else if( cmd->picturemode == 3 ) {
commands_handle( cmd, TVTIME_HUE_DOWN, "" );
}
@@ -3205,7 +3204,7 @@ void commands_handle( commands_t *cmd, int tvtime_cmd, const char *arg )
if( cmd->vidin && config_get_save_restore_picture( cmd->cfg ) ) {
cmd->brightness = videoinput_get_brightness( cmd->vidin );
cmd->contrast = videoinput_get_contrast( cmd->vidin );
- cmd->colour = videoinput_get_colour( cmd->vidin );
+ cmd->saturation = videoinput_get_saturation( cmd->vidin );
cmd->hue = videoinput_get_hue( cmd->vidin );
if( cmd->osd ) {
tvtime_osd_show_message( cmd->osd,
@@ -3217,7 +3216,7 @@ void commands_handle( commands_t *cmd, int tvtime_cmd, const char *arg )
if( cmd->stationmgr && cmd->vidin && config_get_save_restore_picture( cmd->cfg ) ) {
station_set_current_brightness( cmd->stationmgr, videoinput_get_brightness( cmd->vidin ) );
station_set_current_contrast( cmd->stationmgr, videoinput_get_contrast( cmd->vidin ) );
- station_set_current_colour( cmd->stationmgr, videoinput_get_colour( cmd->vidin ) );
+ station_set_current_saturation( cmd->stationmgr, videoinput_get_saturation( cmd->vidin ) );
station_set_current_hue( cmd->stationmgr, videoinput_get_hue( cmd->vidin ) );
if( cmd->osd ) {
char message[ 128 ];
@@ -3622,9 +3621,9 @@ int commands_get_global_contrast( commands_t *cmd )
return cmd->contrast;
}
-int commands_get_global_colour( commands_t *cmd )
+int commands_get_global_saturation( commands_t *cmd )
{
- return cmd->colour;
+ return cmd->saturation;
}
int commands_get_global_hue( commands_t *cmd )
diff --git a/src/commands.h b/src/commands.h
index 53c90d0..f8f331b 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -89,7 +89,7 @@ const char *commands_get_new_norm( commands_t *cmd );
int commands_get_new_input_width( commands_t *cmd );
int commands_get_global_brightness( commands_t *cmd );
int commands_get_global_contrast( commands_t *cmd );
-int commands_get_global_colour( commands_t *cmd );
+int commands_get_global_saturation( commands_t *cmd );
int commands_get_global_hue( commands_t *cmd );
int commands_set_freq_table( commands_t *cmd );
const char *commands_get_new_freq_table( commands_t *cmd );
diff --git a/src/station.c b/src/station.c
index 8d6f907..bb7026f 100644
--- a/src/station.c
+++ b/src/station.c
@@ -45,7 +45,7 @@ struct station_info_s
const band_entry_t *channel;
int brightness;
int contrast;
- int colour;
+ int saturation;
int hue;
int finetune;
@@ -121,7 +121,7 @@ static station_info_t *station_info_new( int pos, const char *name,
memset( i->xmltvid, 0, sizeof( i->xmltvid ) );
i->brightness = -1;
i->contrast = -1;
- i->colour = -1;
+ i->saturation = -1;
i->hue = -1;
i->finetune = 0;
@@ -282,11 +282,15 @@ int station_readconfig( station_mgr_t *mgr )
xmlChar *audio = xmlGetProp( station, BAD_CAST "audio" );
xmlChar *brightness = xmlGetProp( station, BAD_CAST "brightness" );
xmlChar *contrast = xmlGetProp( station, BAD_CAST "contrast" );
- xmlChar *colour = xmlGetProp( station, BAD_CAST "colour" );
+ xmlChar *saturation = xmlGetProp( station, BAD_CAST "colour" );
xmlChar *hue = xmlGetProp( station, BAD_CAST "hue" );
xmlChar *finetune = xmlGetProp( station, BAD_CAST "finetune" );
xmlChar *xmltvid = xmlGetProp( station, BAD_CAST "xmltvid" );
+ if( !saturation ) {
+ saturation = xmlGetProp( station, BAD_CAST "saturation" );
+ }
+
/* Only band and channel are required. */
if( band && channel ) {
int pos, active;
@@ -322,7 +326,7 @@ int station_readconfig( station_mgr_t *mgr )
}
if( brightness ) station_set_current_brightness( mgr, atoi( (char *) brightness ) );
if( contrast ) station_set_current_contrast( mgr, atoi( (char *) contrast ) );
- if( colour ) station_set_current_colour( mgr, atoi( (char *) colour ) );
+ if( saturation ) station_set_current_saturation( mgr, atoi( (char *) saturation ) );
if( hue ) station_set_current_hue( mgr, atoi( (char *) hue ) );
if( finetune ) station_set_current_finetune( mgr, atoi( (char *) finetune ) );
if( xmltvid ) station_set_current_xmltv_id( mgr, (char *) xmltvid );
@@ -332,7 +336,7 @@ int station_readconfig( station_mgr_t *mgr )
if( finetune ) xmlFree( finetune );
if( brightness ) xmlFree( brightness );
if( contrast ) xmlFree( contrast );
- if( colour ) xmlFree( colour );
+ if( saturation ) xmlFree( saturation );
if( hue ) xmlFree( hue );
if( norm ) xmlFree( norm );
if( audio ) xmlFree( audio );
@@ -828,10 +832,10 @@ void station_set_current_contrast( station_mgr_t *mgr, int val )
}
}
-void station_set_current_colour( station_mgr_t *mgr, int val )
+void station_set_current_saturation( station_mgr_t *mgr, int val )
{
if( mgr->current ) {
- mgr->current->colour = val;
+ mgr->current->saturation = val;
}
}
@@ -860,10 +864,10 @@ int station_get_current_contrast( station_mgr_t *mgr )
}
}
-int station_get_current_colour( station_mgr_t *mgr )
+int station_get_current_saturation( station_mgr_t *mgr )
{
if( mgr->current ) {
- return mgr->current->colour;
+ return mgr->current->saturation;
} else {
return -1;
}
@@ -1111,9 +1115,9 @@ int station_writeconfig( station_mgr_t *mgr )
snprintf( buf, sizeof( buf ), "%d", rp->contrast );
xmlSetProp( node, BAD_CAST "contrast", BAD_CAST buf );
}
- if( rp->colour >= 0 ) {
- snprintf( buf, sizeof( buf ), "%d", rp->colour );
- xmlSetProp( node, BAD_CAST "colour", BAD_CAST buf );
+ if( rp->saturation >= 0 ) {
+ snprintf( buf, sizeof( buf ), "%d", rp->saturation );
+ xmlSetProp( node, BAD_CAST "saturation", BAD_CAST buf );
}
if( rp->hue >= 0 ) {
snprintf( buf, sizeof( buf ), "%d", rp->hue );
diff --git a/src/station.h b/src/station.h
index 133b260..edef3a3 100644
--- a/src/station.h
+++ b/src/station.h
@@ -174,7 +174,7 @@ int station_get_current_audio_norm( station_mgr_t *mgr );
*/
int station_get_current_brightness( station_mgr_t *mgr );
int station_get_current_contrast( station_mgr_t *mgr );
-int station_get_current_colour( station_mgr_t *mgr );
+int station_get_current_saturation( station_mgr_t *mgr );
int station_get_current_hue( station_mgr_t *mgr );
/**
@@ -252,7 +252,7 @@ void station_set_current_audio_norm( station_mgr_t *mgr, int dk );
*/
void station_set_current_brightness( station_mgr_t *mgr, int val );
void station_set_current_contrast( station_mgr_t *mgr, int val );
-void station_set_current_colour( station_mgr_t *mgr, int val );
+void station_set_current_saturation( station_mgr_t *mgr, int val );
void station_set_current_hue( station_mgr_t *mgr, int val );
/**
diff --git a/src/tvtime.c b/src/tvtime.c
index 3aecc2f..fd0ba42 100644
--- a/src/tvtime.c
+++ b/src/tvtime.c
@@ -2499,8 +2499,8 @@ int tvtime_main( rtctimer_t *rtctimer, int read_stdin, int realtime,
config_save( ct, "DefaultBrightness", number );
snprintf( number, 4, "%d", commands_get_global_contrast( commands ) );
config_save( ct, "DefaultContrast", number );
- snprintf( number, 4, "%d", commands_get_global_colour( commands ) );
- config_save( ct, "DefaultColour", number );
+ snprintf( number, 4, "%d", commands_get_global_saturation( commands ) );
+ config_save( ct, "DefaultSaturation", number );
snprintf( number, 4, "%d", commands_get_global_hue( commands ) );
config_save( ct, "DefaultHue", number );
diff --git a/src/tvtimeconf.c b/src/tvtimeconf.c
index e72337b..831894d 100644
--- a/src/tvtimeconf.c
+++ b/src/tvtimeconf.c
@@ -67,7 +67,7 @@ struct config_s
int picsaverestore;
int brightness;
int contrast;
- int colour;
+ int saturation;
int hue;
int invert;
int cc;
@@ -205,7 +205,11 @@ static void parse_option( config_t *ct, xmlNodePtr node )
}
if( !xmlStrcasecmp( name, BAD_CAST "DefaultColour" ) ) {
- ct->colour = atoi( curval );
+ ct->saturation = atoi( curval );
+ }
+
+ if( !xmlStrcasecmp( name, BAD_CAST "DefaultSaturation" ) ) {
+ ct->saturation = atoi( curval );
}
if( !xmlStrcasecmp( name, BAD_CAST "DefaultHue" ) ) {
@@ -710,7 +714,7 @@ config_t *config_new( void )
ct->picsaverestore = 1;
ct->brightness = -1;
ct->contrast = -1;
- ct->colour = -1;
+ ct->saturation = -1;
ct->hue = -1;
ct->invert = 0;
ct->cc = 0;
@@ -1587,9 +1591,9 @@ int config_get_global_contrast( config_t *ct )
return ct->contrast;
}
-int config_get_global_colour( config_t *ct )
+int config_get_global_saturation( config_t *ct )
{
- return ct->colour;
+ return ct->saturation;
}
int config_get_global_hue( config_t *ct )
diff --git a/src/tvtimeconf.h b/src/tvtimeconf.h
index 1c55458..117c25a 100644
--- a/src/tvtimeconf.h
+++ b/src/tvtimeconf.h
@@ -176,7 +176,7 @@ const char *config_get_mixer_device( config_t *ct );
int config_get_save_restore_picture( config_t *ct );
int config_get_global_brightness( config_t *ct );
int config_get_global_contrast( config_t *ct );
-int config_get_global_colour( config_t *ct );
+int config_get_global_saturation( config_t *ct );
int config_get_global_hue( config_t *ct );
const char *config_get_audio_mode( config_t *ct );
const char *config_get_xmltv_file( config_t *ct );
diff --git a/src/tvtimeglyphs.h b/src/tvtimeglyphs.h
index 9971be9..c8aa05c 100644
--- a/src/tvtimeglyphs.h
+++ b/src/tvtimeglyphs.h
@@ -24,7 +24,7 @@
#define TVTIME_ICON_PLAINLEFTARROW "\xe2\x86\x90" /* Plain Left Arrow */
#define TVTIME_ICON_CONTRAST "\xe2\x97\x90" /* Contrast */
#define TVTIME_ICON_HUE "\xe2\x97\xaf" /* Hue */
-#define TVTIME_ICON_COLOUR "\xe2\x98\xb0" /* Colour */
+#define TVTIME_ICON_SATURATION "\xe2\x98\xb0" /* Saturation */
#define TVTIME_ICON_BRIGHTNESS "\xe2\x98\x80" /* Brightness */
#define TVTIME_ICON_TVLOGO "\xee\x80\x80" /* TV Logo */
#define TVTIME_ICON_TIMELOGO01 "\xee\x80\x81" /* Time Logo 01 */
diff --git a/src/utils.c b/src/utils.c
index 17d24be..75556fa 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -450,11 +450,11 @@ static command_names_t command_table[] = {
{ "CHANNEL_SKIP", TVTIME_CHANNEL_SKIP },
{ "CHANNEL_UP", TVTIME_CHANNEL_INC },
- { "COLOR_DOWN", TVTIME_COLOUR_DOWN },
- { "COLOR_UP", TVTIME_COLOUR_UP },
+ { "COLOR_DOWN", TVTIME_SATURATION_DOWN },
+ { "COLOR_UP", TVTIME_SATURATION_UP },
- { "COLOUR_DOWN", TVTIME_COLOUR_DOWN },
- { "COLOUR_UP", TVTIME_COLOUR_UP },
+ { "COLOUR_DOWN", TVTIME_SATURATION_DOWN },
+ { "COLOUR_UP", TVTIME_SATURATION_UP },
{ "CONTRAST_DOWN", TVTIME_CONTRAST_DOWN },
{ "CONTRAST_UP", TVTIME_CONTRAST_UP },
@@ -502,6 +502,9 @@ static command_names_t command_table[] = {
{ "RIGHT", TVTIME_RIGHT },
{ "RUN_COMMAND", TVTIME_RUN_COMMAND },
+ { "SATURATION_DOWN", TVTIME_SATURATION_DOWN },
+ { "SATURATION_UP", TVTIME_SATURATION_UP },
+
{ "SAVE_PICTURE_GLOBAL", TVTIME_SAVE_PICTURE_GLOBAL },
{ "SAVE_PICTURE_CHANNEL", TVTIME_SAVE_PICTURE_CHANNEL },
diff --git a/src/utils.h b/src/utils.h
index 65516a7..16d4f4d 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -150,8 +150,8 @@ enum tvtime_commands
TVTIME_BRIGHTNESS_UP,
TVTIME_CONTRAST_DOWN,
TVTIME_CONTRAST_UP,
- TVTIME_COLOUR_DOWN,
- TVTIME_COLOUR_UP,
+ TVTIME_SATURATION_DOWN,
+ TVTIME_SATURATION_UP,
TVTIME_FINETUNE_DOWN,
TVTIME_FINETUNE_UP,
TVTIME_TOGGLE_BARS,
diff --git a/src/videoinput.c b/src/videoinput.c
index fb56709..1f602a0 100644
--- a/src/videoinput.c
+++ b/src/videoinput.c
@@ -1053,7 +1053,7 @@ void videoinput_set_contrast_relative( videoinput_t *vidin, int offset )
videoinput_set_contrast( vidin, videoinput_get_contrast( vidin ) + offset );
}
-int videoinput_get_colour( videoinput_t *vidin )
+int videoinput_get_saturation( videoinput_t *vidin )
{
if( vidin->isv4l2 ) {
return (int) ((videoinput_get_control_v4l2( vidin, V4L2_CID_SATURATION ) * 100.0) + 0.5);
@@ -1068,26 +1068,26 @@ int videoinput_get_colour( videoinput_t *vidin )
return 0;
}
-void videoinput_set_colour( videoinput_t *vidin, int newcolour )
+void videoinput_set_saturation( videoinput_t *vidin, int newsaturation )
{
- if( newcolour > 100 ) newcolour = 100;
- if( newcolour < 0 ) newcolour = 50;
+ if( newsaturation > 100 ) newsaturation = 100;
+ if( newsaturation < 0 ) newsaturation = 50;
if( vidin->isv4l2 ) {
- videoinput_set_control_v4l2( vidin, V4L2_CID_SATURATION, ((double) newcolour) / 100.0 );
+ videoinput_set_control_v4l2( vidin, V4L2_CID_SATURATION, ((double) newsaturation) / 100.0 );
} else {
struct video_picture grab_pict;
if( ioctl( vidin->grab_fd, VIDIOCGPICT, &grab_pict ) >= 0 ) {
- grab_pict.colour = (int) (((((double) newcolour) / 100.0) * 65535.0) + 0.5);
+ grab_pict.colour = (int) (((((double) newsaturation) / 100.0) * 65535.0) + 0.5);
ioctl( vidin->grab_fd, VIDIOCSPICT, &grab_pict );
}
}
}
-void videoinput_set_colour_relative( videoinput_t *vidin, int offset )
+void videoinput_set_saturation_relative( videoinput_t *vidin, int offset )
{
- videoinput_set_colour( vidin, videoinput_get_colour( vidin ) + offset );
+ videoinput_set_saturation( vidin, videoinput_get_saturation( vidin ) + offset );
}
static void videoinput_do_mute( videoinput_t *vidin, int mute )
diff --git a/src/videoinput.h b/src/videoinput.h
index 111d115..cc83c63 100644
--- a/src/videoinput.h
+++ b/src/videoinput.h
@@ -173,9 +173,9 @@ void videoinput_set_brightness_relative( videoinput_t *vidin, int offset );
int videoinput_get_contrast( videoinput_t *vidin );
void videoinput_set_contrast( videoinput_t *vidin, int newcont );
void videoinput_set_contrast_relative( videoinput_t *vidin, int offset );
-int videoinput_get_colour( videoinput_t *vidin );
-void videoinput_set_colour( videoinput_t *vidin, int newcolour );
-void videoinput_set_colour_relative( videoinput_t *vidin, int offset );
+int videoinput_get_saturation( videoinput_t *vidin );
+void videoinput_set_saturation( videoinput_t *vidin, int newcolour );
+void videoinput_set_saturation_relative( videoinput_t *vidin, int offset );
/**
* Sets the frequency to tune in to. (ie. the station to watch)

Privacy Policy