Index: apps/action.h =================================================================== --- apps/action.h (revision 23303) +++ apps/action.h (working copy) @@ -143,7 +143,16 @@ ACTION_LIST_VOLUP, ACTION_LIST_VOLDOWN, #endif - +#ifdef HAVE_MUSIC_CONTROL_IN_LIST + ACTION_LIST_PLAY, + ACTION_LIST_SKIPPREV, + ACTION_LIST_SKIPNEXT, + ACTION_LIST_NEXTDIR, + ACTION_LIST_SEEKBACK, + ACTION_LIST_SEEKFWD, + ACTION_LIST_STOPSEEK, +#endif + /* tree */ ACTION_TREE_ROOT_INIT, ACTION_TREE_PGLEFT,/* optional */ Index: apps/gui/list.c =================================================================== --- apps/gui/list.c (revision 23303) +++ apps/gui/list.c (working copy) @@ -651,6 +651,40 @@ setvol(); return true; #endif +#ifdef HAVE_MUSIC_CONTROL_IN_LIST + case ACTION_LIST_PLAY: + if (audio_status() & AUDIO_STATUS_PAUSE) { + audio_resume(); + } else { + audio_pause(); + } + return true; + + case ACTION_LIST_SKIPPREV: + audio_prev(); + return true; + + case ACTION_LIST_SKIPNEXT: + audio_next(); + return true; + + case ACTION_LIST_NEXTDIR: + audio_next_dir(); + return true; + + case ACTION_LIST_SEEKFWD: + ffwd_rew(ACTION_WPS_SEEKFWD); + return true; + + case ACTION_LIST_SEEKBACK: + ffwd_rew(ACTION_WPS_SEEKBACK); + return true; + + case ACTION_LIST_STOPSEEK: + ffwd_rew(ACTION_WPS_STOPSEEK); + return true; +#endif + case ACTION_STD_PREV: case ACTION_STD_PREVREPEAT: gui_list_select_at_offset(lists, -next_item_modifier); Index: apps/keymaps/keymap-cowond2.c =================================================================== --- apps/keymaps/keymap-cowond2.c (revision 23303) +++ apps/keymaps/keymap-cowond2.c (working copy) @@ -63,10 +63,27 @@ { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, { ACTION_WPS_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, + /* Make the player more usable whilst in your pocket, with the hold switch on */ + { ACTION_WPS_VOLDOWN, BUTTON_HOLDMINUS|BUTTON_REL, BUTTON_HOLDMINUS }, + { ACTION_WPS_VOLUP, BUTTON_HOLDPLUS|BUTTON_REL, BUTTON_HOLDPLUS }, + { ACTION_WPS_PLAY, BUTTON_HOLDMENU|BUTTON_REL, BUTTON_HOLDMENU }, + { ACTION_WPS_SKIPPREV, BUTTON_HOLDMINUS|BUTTON_REL, BUTTON_HOLDMINUS|BUTTON_REPEAT }, + { ACTION_WPS_SKIPNEXT, BUTTON_HOLDPLUS|BUTTON_REL, BUTTON_HOLDPLUS|BUTTON_REPEAT }, + { ACTION_WPS_ABSETB_NEXTDIR,BUTTON_HOLDMENU|BUTTON_REPEAT, BUTTON_HOLDMENU }, + LAST_ITEM_IN_LIST }; /* button_context_wps */ static const struct button_mapping button_context_list[] = { + + /* Make the player more usable whilst in your pocket, with the hold switch on */ + { ACTION_LIST_VOLDOWN, BUTTON_HOLDMINUS|BUTTON_REL, BUTTON_HOLDMINUS }, + { ACTION_LIST_VOLUP, BUTTON_HOLDPLUS|BUTTON_REL, BUTTON_HOLDPLUS }, + { ACTION_LIST_PLAY, BUTTON_HOLDMENU|BUTTON_REL, BUTTON_HOLDMENU }, + { ACTION_LIST_SKIPPREV, BUTTON_HOLDMINUS|BUTTON_REL, BUTTON_HOLDMINUS|BUTTON_REPEAT }, + { ACTION_LIST_SKIPNEXT, BUTTON_HOLDPLUS|BUTTON_REL, BUTTON_HOLDPLUS|BUTTON_REPEAT }, + { ACTION_LIST_NEXTDIR, BUTTON_HOLDMENU|BUTTON_REPEAT, BUTTON_HOLDMENU }, + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) }; /* button_context_list */ Index: firmware/export/config-cowond2.h =================================================================== --- firmware/export/config-cowond2.h (revision 23303) +++ firmware/export/config-cowond2.h (working copy) @@ -55,6 +55,11 @@ /* define this if you would like tagcache to build on this target */ #define HAVE_TAGCACHE +/* define this if the target has volume keys which can be used in the lists */ +#define HAVE_VOLUME_IN_LIST +/* define this if the target has play/pause and skip next/prev keys which can be used to control music playback while in the lists */ +#define HAVE_MUSIC_CONTROL_IN_LIST + /* FM Tuner */ #define CONFIG_TUNER LV24020LP #define HAVE_TUNER_PWR_CTRL Index: firmware/target/arm/tcc780x/cowond2/button-cowond2.c =================================================================== --- firmware/target/arm/tcc780x/cowond2/button-cowond2.c (revision 23303) +++ firmware/target/arm/tcc780x/cowond2/button-cowond2.c (working copy) @@ -62,9 +62,6 @@ backlight_hold_changed(hold_button); #endif - if (hold_button) - return BUTTON_NONE; - if (GPIOB & 0x4) { adc = adc_read(ADC_BUTTONS); @@ -87,6 +84,20 @@ } } + /* Thankfully the hold mode is software-controlled so we can make combination buttons */ + if (button_hold()) + { + if (btn == BUTTON_MINUS) { + return BUTTON_HOLDMINUS; + } else if (btn == BUTTON_PLUS) { + return BUTTON_HOLDPLUS; + } else if (btn == BUTTON_MENU) { + return BUTTON_HOLDMENU; + } else { + return BUTTON_NONE; + } + } + btn |= touchscreen_read_device(data, &old_data); if (!(GPIOA & 0x4)) Index: firmware/target/arm/tcc780x/cowond2/button-target.h =================================================================== --- firmware/target/arm/tcc780x/cowond2/button-target.h (revision 23303) +++ firmware/target/arm/tcc780x/cowond2/button-target.h (working copy) @@ -37,6 +37,11 @@ #define BUTTON_MINUS 0x00000004 #define BUTTON_MENU 0x00000008 +/* Main unit's buttons whilst hold switch is on */ +#define BUTTON_HOLDPLUS 0x00004000 +#define BUTTON_HOLDMINUS 0x00008000 +#define BUTTON_HOLDMENU 0x00010000 + /* Compatibility hacks for flipping. Needs a somewhat better fix. */ #define BUTTON_LEFT BUTTON_MIDLEFT #define BUTTON_RIGHT BUTTON_MIDRIGHT