diff --git a/apps/action.h b/apps/action.h index 7f476a8a88..29023720cc 100644 --- a/apps/action.h +++ b/apps/action.h @@ -44,7 +44,7 @@ enum { CONTEXT_WPS = 1, CONTEXT_TREE = 2, CONTEXT_RECORD = 3, - CONTEXT_MAINMENU = 4, + CONTEXT_MAINMENU = 4, /* uses CONTEXT_TREE and ACTION_TREE_* */ CONTEXT_ID3DB = 5, /* Add new contexts here, no need to explicitly define a value for them */ CONTEXT_LIST, @@ -123,6 +123,10 @@ enum { /* list and tree page up/down */ ACTION_LISTTREE_PGUP,/* optional */ ACTION_LISTTREE_PGDOWN,/* optional */ +#ifdef HAVE_VOLUME_IN_LIST + ACTION_LIST_VOLUP, + ACTION_LIST_VOLDOWN, +#endif /* tree */ ACTION_TREE_ROOT_INIT, @@ -152,13 +156,13 @@ enum { ACTION_REC_F3, /* main menu */ + /* These are not strictly actions, but must be here + so they dont conflict with real actions in the menu code */ ACTION_REQUEST_MENUITEM, ACTION_EXIT_MENUITEM, ACTION_EXIT_AFTER_THIS_MENUITEM, /* if a menu returns this the menu will exit once the subitem returns */ ACTION_ENTER_MENUITEM, - ACTION_MENU_WPS, - ACTION_MENU_STOP, /* id3db */ diff --git a/apps/gui/list.c b/apps/gui/list.c index 7f25903cae..52cbee2128 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -33,6 +33,7 @@ #include "statusbar.h" #include "textarea.h" #include "lang.h" +#include "sound.h" #ifdef HAVE_LCD_CHARCELLS #define SCROLL_LIMIT 1 @@ -924,6 +925,21 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, switch(button) { +#ifdef HAVE_VOLUME_IN_LIST + case ACTION_LIST_VOLUP: + global_settings.volume += 2; + /* up two because the falthrough brings it down one */ + case ACTION_LIST_VOLDOWN: + global_settings.volume--; + + if (global_settings.volume < sound_min(SOUND_VOLUME)) + global_settings.volume = sound_min(SOUND_VOLUME); + if (global_settings.volume > sound_max(SOUND_VOLUME)) + global_settings.volume = sound_max(SOUND_VOLUME); + sound_set_volume(global_settings.volume); + settings_save(); + return button; +#endif case ACTION_STD_PREV: case ACTION_STD_PREVREPEAT: gui_synclist_select_previous(lists); diff --git a/apps/keymaps/keymap-av300.c b/apps/keymaps/keymap-av300.c index 22e1fcc9a1..f390b84b92 100644 --- a/apps/keymaps/keymap-av300.c +++ b/apps/keymaps/keymap-av300.c @@ -236,6 +236,7 @@ const struct button_mapping* get_context_mapping( int context ) case CONTEXT_BOOKMARKSCREEN: return button_context_bmark; case CONTEXT_TREE: + case CONTEXT_MAINMENU: if (global_settings.hold_lr_for_scroll_in_list) return button_context_tree_scroll_lr; /* else fall through to CUSTOM|1 */ @@ -254,7 +255,6 @@ const struct button_mapping* get_context_mapping( int context ) case CONTEXT_STD: case CONTEXT_LIST: - case CONTEXT_MAINMENU: default: return button_context_standard; } diff --git a/apps/keymaps/keymap-e200.c b/apps/keymaps/keymap-e200.c index b67a7a415f..6bbad1a86c 100644 --- a/apps/keymaps/keymap-e200.c +++ b/apps/keymaps/keymap-e200.c @@ -48,11 +48,6 @@ static const struct button_mapping button_context_standard[] = { LAST_ITEM_IN_LIST }; /* button_context_standard */ -static const struct button_mapping button_context_menu[] = { - { ACTION_MENU_WPS, BUTTON_UP, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_menu */ static const struct button_mapping button_context_wps[] = { { ACTION_WPS_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP }, @@ -237,8 +232,6 @@ const struct button_mapping* get_context_mapping(int context) { case CONTEXT_STD: return button_context_standard; - case CONTEXT_MAINMENU: - return button_context_menu; case CONTEXT_WPS: return button_context_wps; @@ -246,6 +239,7 @@ const struct button_mapping* get_context_mapping(int context) case CONTEXT_LIST: return button_context_list; case CONTEXT_TREE: + case CONTEXT_MAINMENU: if (global_settings.hold_lr_for_scroll_in_list) return button_context_listtree_scroll_without_combo; else diff --git a/apps/keymaps/keymap-gigabeat.c b/apps/keymaps/keymap-gigabeat.c index 90fe30d1cf..56fb8de24f 100644 --- a/apps/keymaps/keymap-gigabeat.c +++ b/apps/keymaps/keymap-gigabeat.c @@ -104,6 +104,13 @@ static const struct button_mapping button_context_list[] = { { ACTION_LISTTREE_PGDOWN, BUTTON_POWER|BUTTON_DOWN, BUTTON_POWER }, { ACTION_LISTTREE_PGDOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_POWER|BUTTON_DOWN }, { ACTION_LISTTREE_PGDOWN, BUTTON_POWER|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, +#ifdef HAVE_VOLUME_IN_LIST + { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, + { ACTION_LIST_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, + { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, + { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, +#endif + LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) }; /* button_context_list */ @@ -116,15 +123,6 @@ static const struct button_mapping button_context_tree[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST) }; /* button_context_tree */ -static const struct button_mapping button_context_menu[] = { - { ACTION_MENU_WPS, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, - { ACTION_MENU_STOP, BUTTON_A, BUTTON_NONE }, - { ACTION_MENU_STOP, BUTTON_A|BUTTON_REL, BUTTON_A }, - { ACTION_MENU_STOP, BUTTON_A|BUTTON_REPEAT, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_tree */ - static const struct button_mapping button_context_listtree_scroll_with_combo[] = { { ACTION_NONE, BUTTON_POWER, BUTTON_NONE }, { ACTION_TREE_PGLEFT, BUTTON_POWER|BUTTON_LEFT, BUTTON_POWER }, @@ -271,13 +269,12 @@ const struct button_mapping* get_context_mapping(int context) { case CONTEXT_STD: return button_context_standard; - case CONTEXT_MAINMENU: - return button_context_menu; case CONTEXT_WPS: return button_context_wps; case CONTEXT_LIST: return button_context_list; + case CONTEXT_MAINMENU: case CONTEXT_TREE: if (global_settings.hold_lr_for_scroll_in_list) return button_context_listtree_scroll_without_combo; diff --git a/apps/keymaps/keymap-h10.c b/apps/keymaps/keymap-h10.c index c0e5614fcd..be3dc74b04 100644 --- a/apps/keymaps/keymap-h10.c +++ b/apps/keymaps/keymap-h10.c @@ -62,12 +62,6 @@ static const struct button_mapping remote_button_context_standard[] = { LAST_ITEM_IN_LIST }; /* remote_button_context_standard */ -static const struct button_mapping button_context_menu[] = { - { ACTION_MENU_WPS, BUTTON_PLAY, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_menu */ - static const struct button_mapping button_context_wps[] = { { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT,BUTTON_PLAY }, @@ -358,8 +352,6 @@ const struct button_mapping* get_context_mapping(int context) { case CONTEXT_STD: return button_context_standard; - case CONTEXT_MAINMENU: - return button_context_menu; case CONTEXT_WPS: return button_context_wps; @@ -367,6 +359,7 @@ const struct button_mapping* get_context_mapping(int context) case CONTEXT_LIST: return button_context_list; case CONTEXT_TREE: + case CONTEXT_MAINMENU: if (global_settings.hold_lr_for_scroll_in_list) return button_context_listtree_scroll_without_combo; else diff --git a/apps/keymaps/keymap-h1x0_h3x0.c b/apps/keymaps/keymap-h1x0_h3x0.c index 2640e8c336..b31ce6e6db 100644 --- a/apps/keymaps/keymap-h1x0_h3x0.c +++ b/apps/keymaps/keymap-h1x0_h3x0.c @@ -65,13 +65,6 @@ static const struct button_mapping button_context_standard[] = { LAST_ITEM_IN_LIST }; /* button_context_standard */ -static const struct button_mapping button_context_menu[] = { - { ACTION_MENU_WPS, BUTTON_ON, BUTTON_NONE }, - { ACTION_MENU_STOP, BUTTON_OFF, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_menu */ - static const struct button_mapping button_context_wps[] = { { ACTION_WPS_PLAY, BUTTON_ON|BUTTON_REL, BUTTON_ON }, { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, @@ -721,17 +714,11 @@ static const struct button_mapping button_context_radio_h300lcdremote[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) }; -static const struct button_mapping button_context_menu_remote[] = { - { ACTION_MENU_WPS, BUTTON_RC_ON, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST|CONTEXT_REMOTE) -}; /* the actual used tables */ static const struct button_mapping *remote_btn_ctxt_std = 0, *remote_btn_ctxt_wps = 0, - *remote_btn_ctxt_menu = button_context_menu_remote, *remote_btn_ctxt_list = 0, *remote_btn_ctxt_tree = 0, *remote_btn_ctxt_listtree_scroll_w_cmb = 0, @@ -880,8 +867,6 @@ static const struct button_mapping* get_context_mapping_remote(int context) { case CONTEXT_STD: return remote_btn_ctxt_std; - case CONTEXT_MAINMENU: - return remote_btn_ctxt_menu; case CONTEXT_WPS: /* common for all remotes */ return button_context_wps_remotescommon; @@ -891,6 +876,7 @@ static const struct button_mapping* get_context_mapping_remote(int context) case CONTEXT_LIST: return remote_btn_ctxt_list; case CONTEXT_TREE: + case CONTEXT_MAINMENU: if (global_settings.hold_lr_for_scroll_in_list) return remote_btn_ctxt_listtree_scroll_wo_cmb; else @@ -929,14 +915,13 @@ const struct button_mapping* get_context_mapping(int context) { case CONTEXT_STD: return button_context_standard; - case CONTEXT_MAINMENU: - return button_context_menu; case CONTEXT_WPS: return button_context_wps; case CONTEXT_LIST: return button_context_list; case CONTEXT_TREE: + case CONTEXT_MAINMENU: if (global_settings.hold_lr_for_scroll_in_list) return button_context_listtree_scroll_without_combo; else diff --git a/apps/keymaps/keymap-ipod.c b/apps/keymaps/keymap-ipod.c index 8b08f0cbd4..4e0fc1b862 100644 --- a/apps/keymaps/keymap-ipod.c +++ b/apps/keymaps/keymap-ipod.c @@ -60,12 +60,6 @@ static const struct button_mapping button_context_tree[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) }; /* button_context_tree */ -static const struct button_mapping button_context_menu[] = { - { ACTION_MENU_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, - { ACTION_MENU_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_menu */ static const struct button_mapping button_context_tree_scroll_lr[] = { { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, @@ -190,6 +184,7 @@ const struct button_mapping* get_context_mapping(int context) return button_context_wps; case CONTEXT_TREE: + case CONTEXT_MAINMENU: if (global_settings.hold_lr_for_scroll_in_list) return button_context_tree_scroll_lr; /* else fall through to CUSTOM|CONTEXT_TREE */ @@ -198,8 +193,6 @@ const struct button_mapping* get_context_mapping(int context) case CONTEXT_LIST: return button_context_standard; - case CONTEXT_MAINMENU: - return button_context_menu; case CONTEXT_SETTINGS_EQ: case CONTEXT_SETTINGS_COLOURCHOOSER: diff --git a/apps/keymaps/keymap-ondio.c b/apps/keymaps/keymap-ondio.c index 17b7fe4aba..506444e094 100644 --- a/apps/keymaps/keymap-ondio.c +++ b/apps/keymaps/keymap-ondio.c @@ -88,12 +88,6 @@ static const struct button_mapping button_context_tree[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) }; /* button_context_listtree */ -static const struct button_mapping button_context_menu[] = { - { ACTION_MENU_WPS, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_menu */ - static const struct button_mapping button_context_tree_scroll_lr[] = { { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, @@ -205,6 +199,7 @@ const struct button_mapping* get_context_mapping( int context ) case CONTEXT_PITCHSCREEN: return button_context_pitchscreen; case CONTEXT_TREE: + case CONTEXT_MAINMENU: if (global_settings.hold_lr_for_scroll_in_list) return button_context_tree_scroll_lr; /* else fall through to CUSTOM|CONTEXT_TREE */ @@ -218,8 +213,6 @@ const struct button_mapping* get_context_mapping( int context ) case CONTEXT_FM: return button_context_radio; #endif - case CONTEXT_MAINMENU: - return button_context_menu; case CONTEXT_LIST: default: return button_context_standard; diff --git a/apps/keymaps/keymap-player.c b/apps/keymaps/keymap-player.c index af28bc9e48..1c0536d242 100644 --- a/apps/keymaps/keymap-player.c +++ b/apps/keymaps/keymap-player.c @@ -79,12 +79,6 @@ static const struct button_mapping button_context_tree[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) }; /* button_context_listtree */ -static const struct button_mapping button_context_menu[] = { - { ACTION_MENU_WPS, BUTTON_ON, BUTTON_NONE }, - - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_menu */ - static const struct button_mapping button_context_yesno[] = { { ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE }, @@ -157,11 +151,10 @@ const struct button_mapping* get_context_mapping( int context ) return button_context_yesno; case CONTEXT_TREE: + case CONTEXT_MAINMENU: return button_context_tree; case CONTEXT_BOOKMARKSCREEN: return button_context_bmark; - case CONTEXT_MAINMENU: - return button_context_menu; case CONTEXT_STD: case CONTEXT_LIST: default: diff --git a/apps/keymaps/keymap-recorder.c b/apps/keymaps/keymap-recorder.c index fc781afa46..6f9aff635a 100644 --- a/apps/keymaps/keymap-recorder.c +++ b/apps/keymaps/keymap-recorder.c @@ -112,12 +112,6 @@ static const struct button_mapping button_context_tree[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) }; /* button_context_listtree */ -static const struct button_mapping button_context_menu[] = { - { ACTION_MENU_WPS, BUTTON_ON|BUTTON_REL, BUTTON_ON }, - { ACTION_MENU_STOP, BUTTON_OFF, BUTTON_NONE }, - { ACTION_NONE, BUTTON_ON, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_listtree */ static const struct button_mapping button_context_tree_scroll_lr[] = { { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, @@ -290,6 +284,7 @@ const struct button_mapping* get_context_mapping( int context ) case CONTEXT_BOOKMARKSCREEN: return button_context_bmark; case CONTEXT_TREE: + case CONTEXT_MAINMENU: if (global_settings.hold_lr_for_scroll_in_list) return button_context_tree_scroll_lr; /* else fall through to CUSTOM|1 */ @@ -306,8 +301,6 @@ const struct button_mapping* get_context_mapping( int context ) case CONTEXT_FM: return button_context_radio; - case CONTEXT_MAINMENU: - return button_context_menu; case CONTEXT_STD: case CONTEXT_LIST: default: diff --git a/apps/keymaps/keymap-x5.c b/apps/keymaps/keymap-x5.c index 1c88244053..b637e1ddd1 100644 --- a/apps/keymaps/keymap-x5.c +++ b/apps/keymaps/keymap-x5.c @@ -131,13 +131,6 @@ static const struct button_mapping remote_button_context_keyboard[] = { LAST_ITEM_IN_LIST }; /* button_context_keyboard_h100remote */ -/** Main Menu Context Menu **/ -static const struct button_mapping button_context_mainmenu[] = { - { ACTION_NONE, BUTTON_POWER, BUTTON_NONE }, - { ACTION_MENU_WPS, BUTTON_PLAY, BUTTON_NONE }, - LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) -}; /* button_context_mainmenu */ - static const struct button_mapping remote_button_context_mainmenu[] = { { ACTION_STD_CANCEL, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, { ACTION_STD_OK, BUTTON_RC_VOL_UP, BUTTON_NONE }, @@ -412,8 +405,6 @@ const struct button_mapping* get_context_mapping( int context ) case CONTEXT_KEYBOARD: return button_context_keyboard; - case CONTEXT_MAINMENU: - return button_context_mainmenu; case CONTEXT_PITCHSCREEN: return button_context_pitchscreen; @@ -435,6 +426,7 @@ const struct button_mapping* get_context_mapping( int context ) return button_context_settings_time; case CONTEXT_TREE: + case CONTEXT_MAINMENU: if (global_settings.hold_lr_for_scroll_in_list) return button_context_tree_scroll_lr; /* else fall through to CONTEXT_TREE|CONTEXT_CUSTOM */ diff --git a/apps/menu.c b/apps/menu.c index 5722d1fae6..b1ba9ea0e0 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -468,12 +468,12 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected) { talk_menu_item(menu, &lists); } - else if (action == ACTION_MENU_WPS) + else if (action == ACTION_TREE_WPS) { ret = GO_TO_PREVIOUS_MUSIC; done = true; } - else if (action == ACTION_MENU_STOP) + else if (action == ACTION_TREE_STOP) { if (audio_status() && !global_settings.party_mode) { diff --git a/firmware/export/config-gigabeat.h b/firmware/export/config-gigabeat.h index fd97264707..588c92df6d 100644 --- a/firmware/export/config-gigabeat.h +++ b/firmware/export/config-gigabeat.h @@ -23,6 +23,9 @@ /* 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 + /* LCD dimensions */ #define LCD_WIDTH 240 #define LCD_HEIGHT 320