Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Keyboard shortcuts to switch between composite video sources: F1/F2/F…

…3 to select green/blue/red inputs (respectively)
  • Loading branch information...
commit 9516be91fd0e7b8c875b3ed159e695017bbea20d 1 parent 1047f8b
Sébastien Bourdeauducq sbourdeauducq authored
Showing with 22 additions and 1 deletion.
  1. +21 −0 src/gui/guirender.c
  2. +1 −1  src/shortcuts.c
21 src/gui/guirender.c
View
@@ -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;
@@ -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;
2  src/shortcuts.c
View
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.