Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Keyboard shortcuts to switch between composite video sources: F1/F2/F…
…3 to select green/blue/red inputs (respectively)
  • Loading branch information
Sebastien Bourdeauducq committed Nov 25, 2011
1 parent 1047f8b commit 9516be9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/gui/guirender.c
Expand Up @@ -106,6 +106,18 @@ static void adjust_contrast(int amount)
cp_notify_changed();
}

static void set_video_format(int new_format)
{
int format;

format = config_read_int("vin_format", VIDEO_FORMAT_CVBS6);
if((format != VIDEO_FORMAT_CVBS6) && (format != VIDEO_FORMAT_CVBS5) && (format != VIDEO_FORMAT_CVBS4))
return;
config_write_int("vin_format", new_format);
videoinreconf_request(VIDEO_SET_FORMAT, new_format);
cp_notify_changed();
}

static void input_cb(mtk_event *e, int count)
{
int i;
Expand All @@ -120,6 +132,15 @@ static void input_cb(mtk_event *e, int count)
}
if(e[i].type == EVENT_TYPE_PRESS) {
switch(e[i].press.code) {
case MTK_KEY_F1:
set_video_format(VIDEO_FORMAT_CVBS6);
break;
case MTK_KEY_F2:
set_video_format(VIDEO_FORMAT_CVBS5);
break;
case MTK_KEY_F3:
set_video_format(VIDEO_FORMAT_CVBS4);
break;
case MTK_KEY_F5:
adjust_brightness(5);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/shortcuts.c
Expand Up @@ -79,7 +79,7 @@ static void shortcuts_callback(mtk_event *e, int count)
clean_shutdown(0);
else if(ctrl && (e[i].press.code == MTK_KEY_F1))
switch_resolution();
else if(ctrl && (e[i].press.code == MTK_KEY_F2))
else if(ctrl && (e[i].press.code == MTK_KEY_PAUSE))
fbgrab(NULL);
else if(e[i].press.code == MTK_KEY_F9) {
f9_pressed = 1;
Expand Down

0 comments on commit 9516be9

Please sign in to comment.