[asterisk-commits] rizzo: trunk r94638 - in /trunk: channels/ configs/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Dec 22 16:44:32 CST 2007


Author: rizzo
Date: Sat Dec 22 16:44:31 2007
New Revision: 94638

URL: http://svn.digium.com/view/asterisk?view=rev&rev=94638
Log:
Change the name of config file entries for keypad regions
from 'keypad_entry' to 'region'. Fix the example file accordingly.
Also make some fixes in the code do reset entries on reload of the keypad.

The recently committed kpad2.jpg has the correct names.


Modified:
    trunk/channels/console_video.c
    trunk/configs/oss.conf.sample

Modified: trunk/channels/console_video.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/console_video.c?view=diff&rev=94638&r1=94637&r2=94638
==============================================================================
--- trunk/channels/console_video.c (original)
+++ trunk/channels/console_video.c Sat Dec 22 16:44:31 2007
@@ -2926,6 +2926,8 @@
 		 * You can add it to a jpeg file using wrjpgcom
 		 */
 		do { /* only once, in fact */
+			const char region[] = "region";
+			int reg_len = strlen(region);
 			const unsigned char *s, *e;
 
 			fd = open(env->keypad_file, O_RDONLY);
@@ -2945,8 +2947,10 @@
 			}
 			e = (const unsigned char *)p + l;
 			for (s = p; s < e - 20 ; s++) {
-				if (!memcmp(s, "keypad_entry", 12)) { /* keyword found */
+				if (!memcmp(s, region, reg_len)) { /* keyword found */
 					ast_log(LOG_WARNING, "found entry\n");
+					/* reset previous entries */
+					keypad_cfg_read(&env->gui, "reset");
 					break;
 				}
 			}
@@ -2957,9 +2961,9 @@
 					continue;
 				if (*s > 127)	/* likely end of comment */
 					break;
-				if (memcmp(s, "keypad_entry", 12)) /* keyword not found */
+				if (memcmp(s, region, reg_len)) /* keyword not found */
 					break;
-				s += 12;
+				s += reg_len;
 				l = MIN(sizeof(buf), e - s);
 				ast_copy_string(buf, s, l);
 				s1 = ast_skip_blanks(buf);	/* between token and '=' */
@@ -3148,7 +3152,6 @@
 		if (gui->kp) {
 			gui->kp_used = 0;
 		}
-		ret = 1;
 		break;
 	case 5: /* token circle xc yc diameter */
 		if (strcasecmp(s2, "circle"))	/* invalid */
@@ -3286,7 +3289,7 @@
         CV_F("local_size", video_geom(&env->out.loc_dpy, val));
         CV_F("remote_size", video_geom(&env->in.rem_dpy, val));
         CV_STR("keypad", env->keypad_file);
-        CV_F("keypad_entry", keypad_cfg_read(&env->gui, val));
+        CV_F("region", keypad_cfg_read(&env->gui, val));
         CV_STR("keypad_mask", env->keypad_mask);
 	CV_STR("keypad_font", env->keypad_font);
         CV_UINT("fps", env->out.fps);

Modified: trunk/configs/oss.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/oss.conf.sample?view=diff&rev=94638&r1=94637&r2=94638
==============================================================================
--- trunk/configs/oss.conf.sample (original)
+++ trunk/configs/oss.conf.sample Sat Dec 22 16:44:31 2007
@@ -102,7 +102,7 @@
 ; which is a lot more convenient to manage.
 ; E.g. for jpeg you can write them with wrjpgcom (part of libjpeg).
 ; The format to define keys is
-;	keypad_entry = <event> <shape> x0 y0 x1 y1 h
+;	region = <event> <shape> x0 y0 x1 y1 h
 ; where <event> is the event to be generated (a digit, pickup, hangup,...)
 ; <shape> is the shape of the region (currently 'rect' and 'circle' are
 ; supported, the latter is really an ellipse),  x0 y0 x1 y1 are the
@@ -112,23 +112,23 @@
 ;
 [my_skin](!)
     keypad = /tmp/keypad.jpg
-    keypad_entry = 1 rect   19  18    67  18  28
-    keypad_entry = 2 rect   84  18   133  18  28
-    keypad_entry = 3 rect  152  18   201  18  28
-    keypad_entry = 4 rect   19  60    67  60  28
-    keypad_entry = 5 rect   84  60   133  60  28
-    keypad_entry = 6 rect  152  60   201  60  28
-    keypad_entry = 7 rect   19 103    67 103  28
-    keypad_entry = 8 rect   84 103   133 103  28
-    keypad_entry = 9 rect  152 103   201 103  28
-    keypad_entry = * rect   19 146    67 146  28
-    keypad_entry = 0 rect   84 146   133 146  28
-    keypad_entry = # rect  152 146   201 146  28
-    keypad_entry = pickup rect  229 15  267 15 40
-    keypad_entry = hangup rect  230 66  270 64 40
-    keypad_entry = mute circle  232 141 264 141 33   
-    keypad_entry = sendvideo circle  235 185 266 185 33
-    keypad_entry = autoanswer rect 228 212 275 212 50
+    region = 1 rect   19  18    67  18  28
+    region = 2 rect   84  18   133  18  28
+    region = 3 rect  152  18   201  18  28
+    region = 4 rect   19  60    67  60  28
+    region = 5 rect   84  60   133  60  28
+    region = 6 rect  152  60   201  60  28
+    region = 7 rect   19 103    67 103  28
+    region = 8 rect   84 103   133 103  28
+    region = 9 rect  152 103   201 103  28
+    region = * rect   19 146    67 146  28
+    region = 0 rect   84 146   133 146  28
+    region = # rect  152 146   201 146  28
+    region = pickup rect  229 15  267 15 40
+    region = hangup rect  230 66  270 64 40
+    region = mute circle  232 141 264 141 33   
+    region = sendvideo circle  235 185 266 185 33
+    region = autoanswer rect 228 212 275 212 50
 
 ; uncomment this line to add video support
 ; [default](+,my_video,my_skin)




More information about the asterisk-commits mailing list