mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +00:00
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. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@94638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2926,6 +2926,8 @@ static void sdl_setup(struct video_desc *env)
|
|||||||
* You can add it to a jpeg file using wrjpgcom
|
* You can add it to a jpeg file using wrjpgcom
|
||||||
*/
|
*/
|
||||||
do { /* only once, in fact */
|
do { /* only once, in fact */
|
||||||
|
const char region[] = "region";
|
||||||
|
int reg_len = strlen(region);
|
||||||
const unsigned char *s, *e;
|
const unsigned char *s, *e;
|
||||||
|
|
||||||
fd = open(env->keypad_file, O_RDONLY);
|
fd = open(env->keypad_file, O_RDONLY);
|
||||||
@@ -2945,8 +2947,10 @@ static void sdl_setup(struct video_desc *env)
|
|||||||
}
|
}
|
||||||
e = (const unsigned char *)p + l;
|
e = (const unsigned char *)p + l;
|
||||||
for (s = p; s < e - 20 ; s++) {
|
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");
|
ast_log(LOG_WARNING, "found entry\n");
|
||||||
|
/* reset previous entries */
|
||||||
|
keypad_cfg_read(&env->gui, "reset");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2957,9 +2961,9 @@ static void sdl_setup(struct video_desc *env)
|
|||||||
continue;
|
continue;
|
||||||
if (*s > 127) /* likely end of comment */
|
if (*s > 127) /* likely end of comment */
|
||||||
break;
|
break;
|
||||||
if (memcmp(s, "keypad_entry", 12)) /* keyword not found */
|
if (memcmp(s, region, reg_len)) /* keyword not found */
|
||||||
break;
|
break;
|
||||||
s += 12;
|
s += reg_len;
|
||||||
l = MIN(sizeof(buf), e - s);
|
l = MIN(sizeof(buf), e - s);
|
||||||
ast_copy_string(buf, s, l);
|
ast_copy_string(buf, s, l);
|
||||||
s1 = ast_skip_blanks(buf); /* between token and '=' */
|
s1 = ast_skip_blanks(buf); /* between token and '=' */
|
||||||
@@ -3148,7 +3152,6 @@ static int keypad_cfg_read(struct gui_info *gui, const char *val)
|
|||||||
if (gui->kp) {
|
if (gui->kp) {
|
||||||
gui->kp_used = 0;
|
gui->kp_used = 0;
|
||||||
}
|
}
|
||||||
ret = 1;
|
|
||||||
break;
|
break;
|
||||||
case 5: /* token circle xc yc diameter */
|
case 5: /* token circle xc yc diameter */
|
||||||
if (strcasecmp(s2, "circle")) /* invalid */
|
if (strcasecmp(s2, "circle")) /* invalid */
|
||||||
@@ -3286,7 +3289,7 @@ int console_video_config(struct video_desc **penv,
|
|||||||
CV_F("local_size", video_geom(&env->out.loc_dpy, val));
|
CV_F("local_size", video_geom(&env->out.loc_dpy, val));
|
||||||
CV_F("remote_size", video_geom(&env->in.rem_dpy, val));
|
CV_F("remote_size", video_geom(&env->in.rem_dpy, val));
|
||||||
CV_STR("keypad", env->keypad_file);
|
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_mask", env->keypad_mask);
|
||||||
CV_STR("keypad_font", env->keypad_font);
|
CV_STR("keypad_font", env->keypad_font);
|
||||||
CV_UINT("fps", env->out.fps);
|
CV_UINT("fps", env->out.fps);
|
||||||
|
@@ -102,7 +102,7 @@
|
|||||||
; which is a lot more convenient to manage.
|
; which is a lot more convenient to manage.
|
||||||
; E.g. for jpeg you can write them with wrjpgcom (part of libjpeg).
|
; E.g. for jpeg you can write them with wrjpgcom (part of libjpeg).
|
||||||
; The format to define keys is
|
; 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,...)
|
; where <event> is the event to be generated (a digit, pickup, hangup,...)
|
||||||
; <shape> is the shape of the region (currently 'rect' and 'circle' are
|
; <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
|
; supported, the latter is really an ellipse), x0 y0 x1 y1 are the
|
||||||
@@ -112,23 +112,23 @@
|
|||||||
;
|
;
|
||||||
[my_skin](!)
|
[my_skin](!)
|
||||||
keypad = /tmp/keypad.jpg
|
keypad = /tmp/keypad.jpg
|
||||||
keypad_entry = 1 rect 19 18 67 18 28
|
region = 1 rect 19 18 67 18 28
|
||||||
keypad_entry = 2 rect 84 18 133 18 28
|
region = 2 rect 84 18 133 18 28
|
||||||
keypad_entry = 3 rect 152 18 201 18 28
|
region = 3 rect 152 18 201 18 28
|
||||||
keypad_entry = 4 rect 19 60 67 60 28
|
region = 4 rect 19 60 67 60 28
|
||||||
keypad_entry = 5 rect 84 60 133 60 28
|
region = 5 rect 84 60 133 60 28
|
||||||
keypad_entry = 6 rect 152 60 201 60 28
|
region = 6 rect 152 60 201 60 28
|
||||||
keypad_entry = 7 rect 19 103 67 103 28
|
region = 7 rect 19 103 67 103 28
|
||||||
keypad_entry = 8 rect 84 103 133 103 28
|
region = 8 rect 84 103 133 103 28
|
||||||
keypad_entry = 9 rect 152 103 201 103 28
|
region = 9 rect 152 103 201 103 28
|
||||||
keypad_entry = * rect 19 146 67 146 28
|
region = * rect 19 146 67 146 28
|
||||||
keypad_entry = 0 rect 84 146 133 146 28
|
region = 0 rect 84 146 133 146 28
|
||||||
keypad_entry = # rect 152 146 201 146 28
|
region = # rect 152 146 201 146 28
|
||||||
keypad_entry = pickup rect 229 15 267 15 40
|
region = pickup rect 229 15 267 15 40
|
||||||
keypad_entry = hangup rect 230 66 270 64 40
|
region = hangup rect 230 66 270 64 40
|
||||||
keypad_entry = mute circle 232 141 264 141 33
|
region = mute circle 232 141 264 141 33
|
||||||
keypad_entry = sendvideo circle 235 185 266 185 33
|
region = sendvideo circle 235 185 266 185 33
|
||||||
keypad_entry = autoanswer rect 228 212 275 212 50
|
region = autoanswer rect 228 212 275 212 50
|
||||||
|
|
||||||
; uncomment this line to add video support
|
; uncomment this line to add video support
|
||||||
; [default](+,my_video,my_skin)
|
; [default](+,my_video,my_skin)
|
||||||
|
Reference in New Issue
Block a user