Index: apps/action.h =================================================================== --- apps/action.h (revision 23340) +++ 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 23340) +++ 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 23340) +++ 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: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (revision 23340) +++ apps/lang/english.lang (working copy) @@ -13075,35 +13075,64 @@ swcodec: "Release Time" + id: LANG_HOLD_STAT + desc: in the Rockbox Info screen user: core + *: "Enable button functions on hold?" + *: "Enable button functions on hold?" + *: "Enable button functions on hold?" + id: LANG_D2WPSHOLD + desc: in the Rockbox Info screen + user: core + + *: "Buttons in WPS" + + + *: "Buttons in WPS" + + + *: "Buttons in WPS" + + + id: VOICE_EXT_SBS desc: spoken only, for file extension user: core Index: apps/lang/russian.lang =================================================================== --- apps/lang/russian.lang (revision 23340) +++ apps/lang/russian.lang (working copy) @@ -12370,3 +12370,115 @@ touchscreen: "Режим сенсороного экрана" + + id: LANG_HOLD_STAT + desc: in the Rockbox Info screen + user: core + + *: "Enable button functions on hold?" + + + *: "Включить кнопки при блоке?" + + + *: "Включить кнопки при блоке?" + + + + id: LANG_D2WPSHOLD + desc: in the Rockbox Info screen + user: core + + *: "Buttons in WPS" + + + *: "Настройки кнопок при блокировке" + + + *: "Настройки кнопок при блокировке" + + Index: apps/menus/settings_menu.c =================================================================== --- apps/menus/settings_menu.c (revision 23340) +++ apps/menus/settings_menu.c (working copy) @@ -395,6 +395,13 @@ MENUITEM_FUNCTION(browse_langs, 0, ID2P(LANG_LANGUAGE), language_browse, NULL, NULL, Icon_Language); +/* HOLDCTRLS MENU */ +#ifdef HAVE_MUSIC_CONTROL_IN_LIST +MENUITEM_SETTING(holdwps_stat, &global_settings.holdwps_stat, NULL); +MAKE_MENU(holdwps_menue, ID2P(LANG_D2WPSHOLD), 0, Icon_NOICON,&holdwps_stat); +#endif +/* HOLDCTRLS MENU */ + MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0, Icon_General_settings_menu, &playlist_settings, &file_menu, @@ -402,7 +409,10 @@ &tagcache_menu, #endif &display_menu, &system_menu, - &bookmark_settings_menu, &browse_langs, &voice_settings_menu + &bookmark_settings_menu, &browse_langs, &voice_settings_menu, +#ifdef HAVE_MUSIC_CONTROL_IN_LIST + &holdwps_menue +#endif ); /* SETTINGS MENU */ /***********************************/ Index: apps/settings.h =================================================================== --- apps/settings.h (revision 23340) +++ apps/settings.h (working copy) @@ -800,6 +800,9 @@ int compressor_release_time; #endif +#ifdef HAVE_MUSIC_CONTROL_IN_LIST + bool holdwps_stat; +#endif }; /** global variables **/ Index: apps/settings_list.c =================================================================== --- apps/settings_list.c (revision 23340) +++ apps/settings_list.c (working copy) @@ -1645,6 +1645,10 @@ #endif /* Customizable list */ +#ifdef HAVE_MUSIC_CONTROL_IN_LIST + OFFON_SETTING(0, holdwps_stat, LANG_HOLD_STAT, false,"use plusminus", NULL), +#endif + #ifdef HAVE_LCD_BITMAP VIEWPORT_SETTING(ui_vp_config, "ui viewport"), #ifdef HAVE_REMOTE_LCD Index: firmware/export/config-cowond2.h =================================================================== --- firmware/export/config-cowond2.h (revision 23340) +++ 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 23340) +++ firmware/target/arm/tcc780x/cowond2/button-cowond2.c (working copy) @@ -26,6 +26,7 @@ #include "backlight.h" #include "touchscreen-target.h" #include +#include "settings.h" void button_init_device(void) { @@ -62,9 +63,6 @@ backlight_hold_changed(hold_button); #endif - if (hold_button) - return BUTTON_NONE; - if (GPIOB & 0x4) { adc = adc_read(ADC_BUTTONS); @@ -87,6 +85,21 @@ } } + /* Thankfully the hold mode is software-controlled so we can make combination buttons */ + /*repeating holdwps_stat because we need to work on button_none*/ + if (button_hold()) + { + if ((btn == BUTTON_MINUS) & (global_settings.holdwps_stat)) { + return BUTTON_HOLDMINUS; + } else if ((btn == BUTTON_PLUS) & (global_settings.holdwps_stat)) { + return BUTTON_HOLDPLUS; + } else if ((btn == BUTTON_MENU) & (global_settings.holdwps_stat)) { + 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 23340) +++ 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