minor actions cleanup:

- CONTEXT_MAINMENU is not actually needed, use CONTEXT_TREE which does the same actions
- (gigabeat) use vol+/- in the lists to control volume (every list!) (FS#6982 in a better way)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13062 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2007-04-08 01:33:01 +00:00
parent eef96946e1
commit a053e58894
14 changed files with 46 additions and 90 deletions

View file

@ -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 */

View file

@ -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);

View file

@ -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;
}

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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;

View file

@ -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:

View file

@ -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:

View file

@ -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 */

View file

@ -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)
{

View file

@ -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