Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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 authored November 25, 2011
21  src/gui/guirender.c
@@ -106,6 +106,18 @@ static void adjust_contrast(int amount)
106 106
 	cp_notify_changed();
107 107
 }
108 108
 
  109
+static void set_video_format(int new_format)
  110
+{
  111
+	int format;
  112
+	
  113
+	format = config_read_int("vin_format", VIDEO_FORMAT_CVBS6);
  114
+	if((format != VIDEO_FORMAT_CVBS6) && (format != VIDEO_FORMAT_CVBS5) && (format != VIDEO_FORMAT_CVBS4))
  115
+		return;
  116
+	config_write_int("vin_format", new_format);
  117
+	videoinreconf_request(VIDEO_SET_FORMAT, new_format);
  118
+	cp_notify_changed();
  119
+}
  120
+
109 121
 static void input_cb(mtk_event *e, int count)
110 122
 {
111 123
 	int i;
@@ -120,6 +132,15 @@ static void input_cb(mtk_event *e, int count)
120 132
 		}
121 133
 		if(e[i].type == EVENT_TYPE_PRESS) {
122 134
 			switch(e[i].press.code) {
  135
+				case MTK_KEY_F1:
  136
+					set_video_format(VIDEO_FORMAT_CVBS6);
  137
+					break;
  138
+				case MTK_KEY_F2:
  139
+					set_video_format(VIDEO_FORMAT_CVBS5);
  140
+					break;
  141
+				case MTK_KEY_F3:
  142
+					set_video_format(VIDEO_FORMAT_CVBS4);
  143
+					break;
123 144
 				case MTK_KEY_F5:
124 145
 					adjust_brightness(5);
125 146
 					break;
2  src/shortcuts.c
@@ -79,7 +79,7 @@ static void shortcuts_callback(mtk_event *e, int count)
79 79
 				clean_shutdown(0);
80 80
 			else if(ctrl && (e[i].press.code == MTK_KEY_F1))
81 81
 				switch_resolution();
82  
-			else if(ctrl && (e[i].press.code == MTK_KEY_F2))
  82
+			else if(ctrl && (e[i].press.code == MTK_KEY_PAUSE))
83 83
 				fbgrab(NULL);
84 84
 			else if(e[i].press.code == MTK_KEY_F9) {
85 85
 				f9_pressed = 1;

0 notes on commit 9516be9

Please sign in to comment.
Something went wrong with that request. Please try again.