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
This commit is contained in:
parent
dddd15746f
commit
9a7a542de2
3 changed files with 42 additions and 8 deletions
|
@ -106,6 +106,7 @@ enum {
|
||||||
ACTION_STD_QUICKSCREEN,
|
ACTION_STD_QUICKSCREEN,
|
||||||
ACTION_STD_KEYLOCK,
|
ACTION_STD_KEYLOCK,
|
||||||
ACTION_STD_REC,
|
ACTION_STD_REC,
|
||||||
|
ACTION_STD_HOTKEY,
|
||||||
|
|
||||||
ACTION_F3, /* just so everything works again, possibly change me */
|
ACTION_F3, /* just so everything works again, possibly change me */
|
||||||
/* code context actions */
|
/* code context actions */
|
||||||
|
|
|
@ -1497,16 +1497,29 @@ static int parse_albumart_display(const char *wps_bufptr,
|
||||||
|
|
||||||
struct touchaction {const char* s; int action;};
|
struct touchaction {const char* s; int action;};
|
||||||
static const struct touchaction touchactions[] = {
|
static const struct touchaction touchactions[] = {
|
||||||
{"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP },
|
/* generic actions, convert to screen actions on use */
|
||||||
{"prev", ACTION_WPS_SKIPPREV }, {"next", ACTION_WPS_SKIPNEXT },
|
{"prev", ACTION_STD_PREV }, {"next", ACTION_STD_NEXT },
|
||||||
{"ffwd", ACTION_WPS_SEEKFWD }, {"rwd", ACTION_WPS_SEEKBACK },
|
{"rwd", ACTION_STD_PREVREPEAT }, {"ffwd", ACTION_STD_PREVREPEAT },
|
||||||
{"menu", ACTION_WPS_MENU }, {"browse", ACTION_WPS_BROWSE },
|
{"hotkey", ACTION_STD_HOTKEY}, {"select", ACTION_STD_OK },
|
||||||
{"shuffle", ACTION_TOUCH_SHUFFLE }, {"repmode", ACTION_TOUCH_REPMODE },
|
{"menu", ACTION_STD_MENU }, {"cancel", ACTION_STD_CANCEL },
|
||||||
{"quickscreen", ACTION_WPS_QUICKSCREEN },{"contextmenu", ACTION_WPS_CONTEXT },
|
{"contextmenu", ACTION_STD_CONTEXT},{"quickscreen", ACTION_STD_QUICKSCREEN },
|
||||||
{"playlist", ACTION_WPS_VIEW_PLAYLIST }, {"pitch", ACTION_WPS_PITCHSCREEN},
|
/* not really WPS specific, but no equivilant ACTION_STD_* */
|
||||||
{"voldown", ACTION_WPS_VOLDOWN}, {"volup", ACTION_WPS_VOLUP},
|
{"voldown", ACTION_WPS_VOLDOWN}, {"volup", ACTION_WPS_VOLUP},
|
||||||
{"hotkey", ACTION_WPS_HOTKEY}
|
|
||||||
|
/* WPS specific actions */
|
||||||
|
{"browse", ACTION_WPS_BROWSE },
|
||||||
|
{"play", ACTION_WPS_PLAY }, {"stop", ACTION_WPS_STOP },
|
||||||
|
{"shuffle", ACTION_TOUCH_SHUFFLE }, {"repmode", ACTION_TOUCH_REPMODE },
|
||||||
|
{"pitch", ACTION_WPS_PITCHSCREEN}, {"playlist", ACTION_WPS_VIEW_PLAYLIST },
|
||||||
|
|
||||||
|
#if CONFIG_TUNER
|
||||||
|
/* FM screen actions */
|
||||||
|
/* Also allow browse, play, stop from WPS codes */
|
||||||
|
{"mode", ACTION_FM_MODE }, {"record", ACTION_FM_RECORD },
|
||||||
|
{"presets", ACTION_FM_PRESET},
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static int parse_touchregion(const char *wps_bufptr,
|
static int parse_touchregion(const char *wps_bufptr,
|
||||||
struct wps_token *token, struct wps_data *wps_data)
|
struct wps_token *token, struct wps_data *wps_data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -728,9 +728,29 @@ int wps_get_touchaction(struct wps_data *data)
|
||||||
if (released)
|
if (released)
|
||||||
wps_disarm_touchregions(data);
|
wps_disarm_touchregions(data);
|
||||||
|
|
||||||
|
/* Now we need to convert buttons to the WPS context */
|
||||||
|
switch (returncode)
|
||||||
|
{
|
||||||
|
case ACTION_STD_PREV:
|
||||||
|
return ACTION_WPS_SKIPPREV;
|
||||||
|
case ACTION_STD_PREVREPEAT:
|
||||||
|
return ACTION_WPS_SEEKBACK;
|
||||||
|
case ACTION_STD_NEXT:
|
||||||
|
return ACTION_WPS_SKIPNEXT;
|
||||||
|
case ACTION_STD_NEXTREPEAT:
|
||||||
|
return ACTION_WPS_SEEKFWD;
|
||||||
|
case ACTION_STD_MENU:
|
||||||
|
return ACTION_WPS_MENU;
|
||||||
|
case ACTION_STD_CONTEXT:
|
||||||
|
return ACTION_WPS_CONTEXT;
|
||||||
|
case ACTION_STD_QUICKSCREEN:
|
||||||
|
return ACTION_WPS_QUICKSCREEN;
|
||||||
|
}
|
||||||
|
|
||||||
if (returncode != ACTION_NONE)
|
if (returncode != ACTION_NONE)
|
||||||
return returncode;
|
return returncode;
|
||||||
|
|
||||||
|
|
||||||
if ((last_action == ACTION_WPS_SEEKBACK || last_action == ACTION_WPS_SEEKFWD))
|
if ((last_action == ACTION_WPS_SEEKBACK || last_action == ACTION_WPS_SEEKFWD))
|
||||||
return ACTION_WPS_STOPSEEK;
|
return ACTION_WPS_STOPSEEK;
|
||||||
last_action = ACTION_TOUCHSCREEN;
|
last_action = ACTION_TOUCHSCREEN;
|
||||||
|
|
Loading…
Reference in a new issue