forked from len0rd/rockbox
ipod: Support IAP remote MENU/SELECT/UP/DOWN keys in MODE2
Only the primary contexts (standard, wps, quckscreen, tree, radio) handle the new keys so far. Todo contexts: Settings, keyboard, pitchscreen, bookmark, & recording. Available docs for MODE4 don't list anything other than playback controls, so it's not clear if there is a path forward here. Change-Id: I91908092f75d96813e2e155e447129ba15f58051
This commit is contained in:
parent
17a8a54780
commit
57713f6308
5 changed files with 92 additions and 12 deletions
|
@ -187,6 +187,17 @@ void iap_handlepkt_mode2(const unsigned int len, const unsigned char *buf)
|
|||
REMOTE_BUTTON(BUTTON_RC_RIGHT);
|
||||
if(buf[4] & 32) /* frwd */
|
||||
REMOTE_BUTTON(BUTTON_RC_LEFT);
|
||||
if(buf[4] & 64) /* menu */
|
||||
REMOTE_BUTTON(BUTTON_RC_MENU);
|
||||
if(buf[4] & 128) /* select */
|
||||
REMOTE_BUTTON(BUTTON_RC_SELECT);
|
||||
}
|
||||
else if(len >= 6 && buf[5] != 0)
|
||||
{
|
||||
if(buf[5] & 1) /* up */
|
||||
REMOTE_BUTTON(BUTTON_RC_UP);
|
||||
if (buf[5] & 2) /* down */
|
||||
REMOTE_BUTTON(BUTTON_RC_DOWN);
|
||||
}
|
||||
|
||||
/* power on released */
|
||||
|
|
|
@ -309,11 +309,20 @@ static const struct button_mapping button_context_usb_hid_mode_mouse[] = {
|
|||
*****************************************************************************/
|
||||
|
||||
static const struct button_mapping remote_button_context_standard[] = {
|
||||
{ ACTION_STD_PREV, BUTTON_RC_UP, BUTTON_NONE },
|
||||
{ ACTION_STD_PREVREPEAT, BUTTON_RC_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_STD_NEXT, BUTTON_RC_DOWN, BUTTON_NONE },
|
||||
{ ACTION_STD_NEXTREPEAT, BUTTON_RC_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
{ ACTION_STD_PREV, BUTTON_RC_LEFT, BUTTON_NONE },
|
||||
{ ACTION_STD_NEXT, BUTTON_RC_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_STD_CANCEL, BUTTON_RC_STOP, BUTTON_NONE },
|
||||
{ ACTION_STD_OK, BUTTON_RC_PLAY, BUTTON_NONE },
|
||||
|
||||
{ ACTION_STD_MENU, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU },
|
||||
{ ACTION_STD_QUICKSCREEN, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU },
|
||||
{ ACTION_STD_CONTEXT, BUTTON_RC_SELECT|BUTTON_REPEAT, BUTTON_RC_SELECT },
|
||||
|
||||
LAST_ITEM_IN_LIST
|
||||
}; /* remote_button_context_standard */
|
||||
|
||||
|
@ -322,7 +331,7 @@ static const struct button_mapping remote_button_context_wps[] = {
|
|||
{ ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
// RC_UP and RC_DOWN?
|
||||
{ ACTION_WPS_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
|
||||
{ ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_WPS_SKIPNEXT, BUTTON_RC_RIGHT|BUTTON_REL, BUTTON_RC_RIGHT },
|
||||
|
@ -331,6 +340,12 @@ static const struct button_mapping remote_button_context_wps[] = {
|
|||
{ ACTION_WPS_SKIPPREV, BUTTON_RC_LEFT|BUTTON_REL, BUTTON_RC_LEFT },
|
||||
{ ACTION_WPS_SEEKBACK, BUTTON_RC_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_WPS_STOPSEEK, BUTTON_RC_LEFT|BUTTON_REL, BUTTON_RC_LEFT|BUTTON_REPEAT },
|
||||
{ ACTION_WPS_BROWSE, BUTTON_RC_SELECT|BUTTON_REL, BUTTON_RC_SELECT },
|
||||
{ ACTION_WPS_CONTEXT, BUTTON_RC_SELECT|BUTTON_REPEAT, BUTTON_RC_SELECT },
|
||||
{ ACTION_WPS_HOTKEY, BUTTON_RC_SELECT|BUTTON_PLAY, BUTTON_NONE },
|
||||
{ ACTION_WPS_MENU, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU },
|
||||
{ ACTION_WPS_QUICKSCREEN, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU },
|
||||
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||
}; /* remote_button_context_wps */
|
||||
|
@ -338,14 +353,42 @@ static const struct button_mapping remote_button_context_wps[] = {
|
|||
static const struct button_mapping remote_button_context_tree[] = {
|
||||
{ ACTION_TREE_WPS, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
|
||||
{ ACTION_TREE_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
|
||||
{ ACTION_TREE_HOTKEY, BUTTON_RC_SELECT|BUTTON_PLAY, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||
}; /* remote_button_context_tree */
|
||||
|
||||
static const struct button_mapping remote_button_context_quickscreen[] = {
|
||||
{ ACTION_QS_TOP, BUTTON_RC_MENU, BUTTON_NONE },
|
||||
{ ACTION_QS_TOP, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_QS_DOWN, BUTTON_RC_PLAY, BUTTON_NONE },
|
||||
{ ACTION_QS_DOWN, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_QS_LEFT, BUTTON_RC_LEFT, BUTTON_NONE },
|
||||
{ ACTION_QS_LEFT, BUTTON_RC_LEFT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_QS_RIGHT, BUTTON_RC_RIGHT, BUTTON_NONE },
|
||||
{ ACTION_QS_RIGHT, BUTTON_RC_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_STD_CANCEL, BUTTON_RC_SELECT|BUTTON_REL, BUTTON_RC_SELECT },
|
||||
{ ACTION_QS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
|
||||
{ ACTION_QS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_QS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
|
||||
{ ACTION_QS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||
}; /* button_context_quickscreen */
|
||||
|
||||
#if CONFIG_TUNER
|
||||
static const struct button_mapping remote_button_context_radio[] = {
|
||||
{ ACTION_FM_MENU, BUTTON_RC_SELECT | BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_FM_STOP, BUTTON_RC_PLAY | BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_FM_MODE, BUTTON_RC_SELECT, BUTTON_NONE },
|
||||
{ ACTION_FM_EXIT, BUTTON_RC_MENU | BUTTON_REL, BUTTON_RC_MENU },
|
||||
|
||||
{ ACTION_FM_PLAY, BUTTON_RC_PLAY | BUTTON_REL, BUTTON_RC_PLAY },
|
||||
{ ACTION_SETTINGS_INC, BUTTON_RC_UP, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_INCREPEAT,BUTTON_RC_UP|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_DEC, BUTTON_RC_DOWN, BUTTON_NONE },
|
||||
{ ACTION_SETTINGS_DECREPEAT,BUTTON_RC_DOWN|BUTTON_REPEAT,BUTTON_NONE },
|
||||
|
||||
{ ACTION_STD_NEXT, BUTTON_RC_RIGHT|BUTTON_REL, BUTTON_RC_RIGHT },
|
||||
{ ACTION_STD_NEXTREPEAT, BUTTON_RC_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
|
||||
{ ACTION_STD_PREV, BUTTON_RC_LEFT|BUTTON_REL, BUTTON_RC_LEFT },
|
||||
|
@ -355,6 +398,12 @@ static const struct button_mapping remote_button_context_tree[] = {
|
|||
}; /* remote_button_context_radio */
|
||||
#endif
|
||||
|
||||
static const struct button_mapping remote_button_context_yesno[] = {
|
||||
{ ACTION_YESNO_ACCEPT, BUTTON_RC_SELECT, BUTTON_NONE },
|
||||
{ ACTION_STD_CANCEL, BUTTON_RC_PLAY, BUTTON_NONE },
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||
}; /* button_context_yesno */
|
||||
|
||||
static const struct button_mapping* get_context_mapping_remote( int context )
|
||||
{
|
||||
context ^= CONTEXT_REMOTE;
|
||||
|
@ -364,13 +413,18 @@ static const struct button_mapping* get_context_mapping_remote( int context )
|
|||
case CONTEXT_WPS:
|
||||
return remote_button_context_wps;
|
||||
case CONTEXT_TREE:
|
||||
case CONTEXT_MAINMENU:
|
||||
case CONTEXT_CUSTOM|CONTEXT_TREE:
|
||||
return remote_button_context_tree;
|
||||
case CONTEXT_QUICKSCREEN:
|
||||
return remote_button_context_quickscreen;
|
||||
|
||||
#if CONFIG_TUNER
|
||||
case CONTEXT_FM:
|
||||
return remote_button_context_radio;
|
||||
#endif
|
||||
case CONTEXT_YESNOSCREEN:
|
||||
return remote_button_context_yesno;
|
||||
default:
|
||||
return remote_button_context_standard;
|
||||
}
|
||||
|
|
|
@ -47,15 +47,20 @@ void ipod_4g_button_int(void);
|
|||
|
||||
/* Remote control's buttons */
|
||||
#ifdef IPOD_ACCESSORY_PROTOCOL
|
||||
#define BUTTON_RC_DOWN 0x01000000
|
||||
#define BUTTON_RC_UP 0x00800000
|
||||
#define BUTTON_RC_SELECT 0x00400000
|
||||
#define BUTTON_RC_MENU 0x00200000
|
||||
#define BUTTON_RC_PLAY 0x00100000
|
||||
#define BUTTON_RC_STOP 0x00080000
|
||||
|
||||
#define BUTTON_RC_LEFT 0x00040000
|
||||
#define BUTTON_RC_RIGHT 0x00020000
|
||||
#define BUTTON_RC_VOL_UP 0x00010000
|
||||
#define BUTTON_RC_VOL_DOWN 0x00008000
|
||||
|
||||
#define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_STOP\
|
||||
#define BUTTON_REMOTE (BUTTON_RC_UP|BUTTON_RC_DOWN \
|
||||
|BUTTON_RC_SELECT|BUTTON_RC_PLAY \
|
||||
|BUTTON_RC_PLAY|BUTTON_RC_STOP \
|
||||
|BUTTON_RC_LEFT|BUTTON_RC_RIGHT\
|
||||
|BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN)
|
||||
#endif
|
||||
|
|
|
@ -47,15 +47,20 @@ void ipod_4g_button_int(void);
|
|||
|
||||
/* Remote control's buttons */
|
||||
#ifdef IPOD_ACCESSORY_PROTOCOL
|
||||
#define BUTTON_RC_DOWN 0x01000000
|
||||
#define BUTTON_RC_UP 0x00800000
|
||||
#define BUTTON_RC_SELECT 0x00400000
|
||||
#define BUTTON_RC_MENU 0x00200000
|
||||
#define BUTTON_RC_PLAY 0x00100000
|
||||
#define BUTTON_RC_STOP 0x00080000
|
||||
|
||||
#define BUTTON_RC_LEFT 0x00040000
|
||||
#define BUTTON_RC_RIGHT 0x00020000
|
||||
#define BUTTON_RC_VOL_UP 0x00010000
|
||||
#define BUTTON_RC_VOL_DOWN 0x00008000
|
||||
|
||||
#define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_STOP\
|
||||
#define BUTTON_REMOTE (BUTTON_RC_UP|BUTTON_RC_DOWN \
|
||||
|BUTTON_RC_SELECT|BUTTON_RC_PLAY \
|
||||
|BUTTON_RC_PLAY|BUTTON_RC_STOP \
|
||||
|BUTTON_RC_LEFT|BUTTON_RC_RIGHT\
|
||||
|BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN)
|
||||
#endif
|
||||
|
|
|
@ -47,15 +47,20 @@ void ipod_4g_button_int(void);
|
|||
|
||||
/* Remote control's buttons */
|
||||
#ifdef IPOD_ACCESSORY_PROTOCOL
|
||||
#define BUTTON_RC_DOWN 0x01000000
|
||||
#define BUTTON_RC_UP 0x00800000
|
||||
#define BUTTON_RC_SELECT 0x00400000
|
||||
#define BUTTON_RC_MENU 0x00200000
|
||||
#define BUTTON_RC_PLAY 0x00100000
|
||||
#define BUTTON_RC_STOP 0x00080000
|
||||
|
||||
#define BUTTON_RC_LEFT 0x00040000
|
||||
#define BUTTON_RC_RIGHT 0x00020000
|
||||
#define BUTTON_RC_VOL_UP 0x00010000
|
||||
#define BUTTON_RC_VOL_DOWN 0x00008000
|
||||
|
||||
#define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_STOP\
|
||||
#define BUTTON_REMOTE (BUTTON_RC_UP|BUTTON_RC_DOWN \
|
||||
|BUTTON_RC_SELECT|BUTTON_RC_PLAY \
|
||||
|BUTTON_RC_PLAY|BUTTON_RC_STOP \
|
||||
|BUTTON_RC_LEFT|BUTTON_RC_RIGHT\
|
||||
|BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue