diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2010-06-15 08:38:23 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2010-06-15 08:38:23 +0000 |
commit | 9a7a542de2cac4293a7834ecaebaa4dd14206683 (patch) | |
tree | cc8c3cab6b5b9adecc50ef0564a8c9c06037a575 | |
parent | dddd15746fce3a8610a60a6e7e84cf6fa8479f15 (diff) | |
download | rockbox-9a7a542de2cac4293a7834ecaebaa4dd14206683.tar.gz rockbox-9a7a542de2cac4293a7834ecaebaa4dd14206683.zip |
first step of making touch regions usable in all skins, not just the WPS.. no user viewable changes just yet
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26854 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/action.h | 1 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 29 | ||||
-rw-r--r-- | apps/gui/wps.c | 20 |
3 files changed, 42 insertions, 8 deletions
diff --git a/apps/action.h b/apps/action.h index 8e93f30d2a..afaf73e1c9 100644 --- a/apps/action.h +++ b/apps/action.h | |||
@@ -106,6 +106,7 @@ enum { | |||
106 | ACTION_STD_QUICKSCREEN, | 106 | ACTION_STD_QUICKSCREEN, |
107 | ACTION_STD_KEYLOCK, | 107 | ACTION_STD_KEYLOCK, |
108 | ACTION_STD_REC, | 108 | ACTION_STD_REC, |
109 | ACTION_STD_HOTKEY, | ||
109 | 110 | ||
110 | ACTION_F3, /* just so everything works again, possibly change me */ | 111 | ACTION_F3, /* just so everything works again, possibly change me */ |
111 | /* code context actions */ | 112 | /* code context actions */ |
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 365a1e6a26..d5a5f46cb0 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -1497,16 +1497,29 @@ static int parse_albumart_display(const char *wps_bufptr, | |||
1497 | 1497 | ||
1498 | struct touchaction {const char* s; int action;}; | 1498 | struct touchaction {const char* s; int action;}; |
1499 | static const struct touchaction touchactions[] = { | 1499 | static const struct touchaction touchactions[] = { |
1500 | {"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP }, | 1500 | /* generic actions, convert to screen actions on use */ |
1501 | {"prev", ACTION_WPS_SKIPPREV }, {"next", ACTION_WPS_SKIPNEXT }, | 1501 | {"prev", ACTION_STD_PREV }, {"next", ACTION_STD_NEXT }, |
1502 | {"ffwd", ACTION_WPS_SEEKFWD }, {"rwd", ACTION_WPS_SEEKBACK }, | 1502 | {"rwd", ACTION_STD_PREVREPEAT }, {"ffwd", ACTION_STD_PREVREPEAT }, |
1503 | {"menu", ACTION_WPS_MENU }, {"browse", ACTION_WPS_BROWSE }, | 1503 | {"hotkey", ACTION_STD_HOTKEY}, {"select", ACTION_STD_OK }, |
1504 | {"menu", ACTION_STD_MENU }, {"cancel", ACTION_STD_CANCEL }, | ||
1505 | {"contextmenu", ACTION_STD_CONTEXT},{"quickscreen", ACTION_STD_QUICKSCREEN }, | ||
1506 | /* not really WPS specific, but no equivilant ACTION_STD_* */ | ||
1507 | {"voldown", ACTION_WPS_VOLDOWN}, {"volup", ACTION_WPS_VOLUP}, | ||
1508 | |||
1509 | /* WPS specific actions */ | ||
1510 | {"browse", ACTION_WPS_BROWSE }, | ||
1511 | {"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP }, | ||
1504 | {"shuffle", ACTION_TOUCH_SHUFFLE }, {"repmode", ACTION_TOUCH_REPMODE }, | 1512 | {"shuffle", ACTION_TOUCH_SHUFFLE }, {"repmode", ACTION_TOUCH_REPMODE }, |
1505 | {"quickscreen", ACTION_WPS_QUICKSCREEN },{"contextmenu", ACTION_WPS_CONTEXT }, | 1513 | {"pitch", ACTION_WPS_PITCHSCREEN}, {"playlist", ACTION_WPS_VIEW_PLAYLIST }, |
1506 | {"playlist", ACTION_WPS_VIEW_PLAYLIST }, {"pitch", ACTION_WPS_PITCHSCREEN}, | 1514 | |
1507 | {"voldown", ACTION_WPS_VOLDOWN}, {"volup", ACTION_WPS_VOLUP}, | 1515 | #if CONFIG_TUNER |
1508 | {"hotkey", ACTION_WPS_HOTKEY} | 1516 | /* FM screen actions */ |
1517 | /* Also allow browse, play, stop from WPS codes */ | ||
1518 | {"mode", ACTION_FM_MODE }, {"record", ACTION_FM_RECORD }, | ||
1519 | {"presets", ACTION_FM_PRESET}, | ||
1520 | #endif | ||
1509 | }; | 1521 | }; |
1522 | |||
1510 | static int parse_touchregion(const char *wps_bufptr, | 1523 | static int parse_touchregion(const char *wps_bufptr, |
1511 | struct wps_token *token, struct wps_data *wps_data) | 1524 | struct wps_token *token, struct wps_data *wps_data) |
1512 | { | 1525 | { |
diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 33e9b2167f..0c7975a01a 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c | |||
@@ -728,8 +728,28 @@ int wps_get_touchaction(struct wps_data *data) | |||
728 | if (released) | 728 | if (released) |
729 | wps_disarm_touchregions(data); | 729 | wps_disarm_touchregions(data); |
730 | 730 | ||
731 | /* Now we need to convert buttons to the WPS context */ | ||
732 | switch (returncode) | ||
733 | { | ||
734 | case ACTION_STD_PREV: | ||
735 | return ACTION_WPS_SKIPPREV; | ||
736 | case ACTION_STD_PREVREPEAT: | ||
737 | return ACTION_WPS_SEEKBACK; | ||
738 | case ACTION_STD_NEXT: | ||
739 | return ACTION_WPS_SKIPNEXT; | ||
740 | case ACTION_STD_NEXTREPEAT: | ||
741 | return ACTION_WPS_SEEKFWD; | ||
742 | case ACTION_STD_MENU: | ||
743 | return ACTION_WPS_MENU; | ||
744 | case ACTION_STD_CONTEXT: | ||
745 | return ACTION_WPS_CONTEXT; | ||
746 | case ACTION_STD_QUICKSCREEN: | ||
747 | return ACTION_WPS_QUICKSCREEN; | ||
748 | } | ||
749 | |||
731 | if (returncode != ACTION_NONE) | 750 | if (returncode != ACTION_NONE) |
732 | return returncode; | 751 | return returncode; |
752 | |||
733 | 753 | ||
734 | if ((last_action == ACTION_WPS_SEEKBACK || last_action == ACTION_WPS_SEEKFWD)) | 754 | if ((last_action == ACTION_WPS_SEEKBACK || last_action == ACTION_WPS_SEEKFWD)) |
735 | return ACTION_WPS_STOPSEEK; | 755 | return ACTION_WPS_STOPSEEK; |