summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-01-13 10:56:23 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-01-13 10:56:23 +0000
commit605e2d0e90b335897cc1e29c575a27dabc778491 (patch)
tree55cb67f5e7abc0fe1f5d62090ffda4abb4948959 /apps/gui/skin_engine
parentded64f1db58e15bb310da2c685afed6b3dbce4b5 (diff)
downloadrockbox-605e2d0e90b335897cc1e29c575a27dabc778491.tar.gz
rockbox-605e2d0e90b335897cc1e29c575a27dabc778491.zip
New Touchscreen region type... 'mute' which un/mutes volume without pausing playback
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29046 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine')
-rw-r--r--apps/gui/skin_engine/skin_parser.c12
-rw-r--r--apps/gui/skin_engine/wps_internals.h5
2 files changed, 14 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 5a90873d86..e23f84207e 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -880,6 +880,7 @@ static const struct touchaction touchactions[] = {
880 { "resumeplayback", ACTION_TREE_WPS}, /* returns to previous music, WPS/FM */ 880 { "resumeplayback", ACTION_TREE_WPS}, /* returns to previous music, WPS/FM */
881 /* not really WPS specific, but no equivilant ACTION_STD_* */ 881 /* not really WPS specific, but no equivilant ACTION_STD_* */
882 {"voldown", ACTION_WPS_VOLDOWN}, {"volup", ACTION_WPS_VOLUP}, 882 {"voldown", ACTION_WPS_VOLDOWN}, {"volup", ACTION_WPS_VOLUP},
883 {"mute", ACTION_TOUCH_MUTE },
883 884
884 /* generic settings changers */ 885 /* generic settings changers */
885 {"setting_inc", ACTION_SETTINGS_INC}, {"setting_dec", ACTION_SETTINGS_DEC}, 886 {"setting_inc", ACTION_SETTINGS_INC}, {"setting_dec", ACTION_SETTINGS_DEC},
@@ -945,7 +946,7 @@ static int parse_touchregion(struct skin_element *element,
945 region->wvp = curr_vp; 946 region->wvp = curr_vp;
946 region->armed = false; 947 region->armed = false;
947 region->reverse_bar = false; 948 region->reverse_bar = false;
948 region->extradata = NULL; 949 region->data = NULL;
949 action = element->params[4].data.text; 950 action = element->params[4].data.text;
950 951
951 strcpy(temp, action); 952 strcpy(temp, action);
@@ -998,7 +999,7 @@ static int parse_touchregion(struct skin_element *element,
998 break; 999 break;
999 if (j==nb_settings) 1000 if (j==nb_settings)
1000 return WPS_ERROR_INVALID_PARAM; 1001 return WPS_ERROR_INVALID_PARAM;
1001 region->extradata = (void*)&settings[j]; 1002 region->data = (void*)&settings[j];
1002 } 1003 }
1003 } 1004 }
1004 break; 1005 break;
@@ -1011,6 +1012,13 @@ static int parse_touchregion(struct skin_element *element,
1011 if (!item) 1012 if (!item)
1012 return WPS_ERROR_INVALID_PARAM; 1013 return WPS_ERROR_INVALID_PARAM;
1013 add_to_ll_chain(&wps_data->touchregions, item); 1014 add_to_ll_chain(&wps_data->touchregions, item);
1015
1016 if (region->action == ACTION_TOUCH_MUTE)
1017 {
1018 region->value = global_settings.volume;
1019 }
1020
1021
1014 return 0; 1022 return 0;
1015} 1023}
1016#endif 1024#endif
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index 24edde7b93..02585f22b2 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -196,7 +196,10 @@ struct touchregion {
196 int action; /* action this button will return */ 196 int action; /* action this button will return */
197 bool armed; /* A region is armed on press. Only armed regions are triggered 197 bool armed; /* A region is armed on press. Only armed regions are triggered
198 on repeat or release. */ 198 on repeat or release. */
199 void* extradata; 199 union { /* Extra data, action dependant */
200 void* data;
201 int value;
202 };
200}; 203};
201#endif 204#endif
202 205