Index: apps/action.h
===================================================================
--- apps/action.h (Revision 16784)
+++ apps/action.h (Arbeitskopie)
@@ -122,6 +122,9 @@
ACTION_WPS_ABSETA_PREVDIR, /* these should be safe to put together seen as */
ACTION_WPS_ABSETB_NEXTDIR, /* you shouldnt want to change dir in ab-mode */
ACTION_WPS_ABRESET,
+ ACTION_WPS_USER1, /* optional, for user-settable button */
+ ACTION_WPS_USER2, /* optional, for user-settable button */
+ ACTION_WPS_USER3, /* optional, for user-settable button */
/* list and tree page up/down */
ACTION_LISTTREE_PGUP,/* optional */
@@ -137,6 +140,9 @@
ACTION_TREE_PGRIGHT,/* optional */
ACTION_TREE_STOP,
ACTION_TREE_WPS,
+ ACTION_TREE_USER1, /* optional, for user-settable button */
+ ACTION_TREE_USER2, /* optional, for user-settable button */
+ ACTION_TREE_USER3, /* optional, for user-settable button */
/* radio */
ACTION_FM_MENU,
Index: apps/tree.c
===================================================================
--- apps/tree.c (Revision 16784)
+++ apps/tree.c (Arbeitskopie)
@@ -52,6 +52,7 @@
#include "plugin.h"
#include "power.h"
#include "action.h"
+#include "user_action.h"
#include "talk.h"
#include "filetypes.h"
#include "misc.h"
@@ -723,6 +724,24 @@
return GO_TO_RECSCREEN;
#endif
+ /* Rincewind Code */
+ /* user-settable actions, used only for rec-button currently */
+ case ACTION_TREE_USER1:
+ case ACTION_TREE_USER2:
+ case ACTION_TREE_USER3:
+ /* break if user has set action for this button == none */
+ if (user_action_none(button))
+ break;
+ static int user_action_ret;
+ if (*tc.dirfilter < NUM_FILTER_MODES)
+ {
+ user_action_ret = user_action(button);
+ if (user_action_ret != GO_TO_PREVIOUS && user_action_ret != GO_TO_FILEBROWSER)
+ return user_action_ret;
+ restore = true;
+ }
+ break;
+
case ACTION_TREE_WPS:
return GO_TO_PREVIOUS_MUSIC;
break;
Index: apps/lang/english.lang
===================================================================
--- apps/lang/english.lang (Revision 16784)
+++ apps/lang/english.lang (Arbeitskopie)
@@ -5811,6 +5811,258 @@
+ id: LANG_BUTTON_CONFIG
+ desc: in system menu
+ user:
+
+ *: "Button Config"
+
+
+ *: "Button Config"
+
+
+ *: "Button Config"
+
+
+
+ id: LANG_BUTTON_WPS
+ desc: in button config menu
+ user:
+
+ *: "in While Playing Screen"
+
+
+ *: "in While Playing Screen"
+
+
+ *: "Custom button in While Playing Screen"
+
+
+
+ id: LANG_BUTTON_TREE
+ desc: in button config menu
+ user:
+
+ *: "in File Browser"
+
+
+ *: "in File Browser"
+
+
+ *: "Custom button in File Browser"
+
+
+
+ id: LANG_REC_BUTTON_SHORT
+ desc: in button config menu
+ user:
+
+ *: "on short press REC"
+
+
+ *: "on short press REC"
+
+
+ *: "Action on short press Rec"
+
+
+
+ id: LANG_REC_BUTTON_LONG
+ desc: in button config menu
+ user:
+
+ *: "on long press REC"
+
+
+ *: "on long press REC"
+
+
+ *: "Action on long press Rec"
+
+
+
+ id: LANG_REC_BUTTON_PLAY
+ desc: in button config menu
+ user:
+
+ *: "on PLAY + REC"
+
+
+ *: "on PLAY + REC"
+
+
+ *: "Action on Play and Rec"
+
+
+
+ id: LANG_BT_NONE
+ desc: option for Rec button config
+ user:
+
+ *: "none"
+
+
+ *: "none"
+
+
+ *: "none"
+
+
+
+ id: LANG_BT_PLAYLIST
+ desc: option for Rec button config
+ user:
+
+ *: "Current playlist"
+
+
+ *: "Current playlist"
+
+
+ *: "Current playlist"
+
+
+
+ id: LANG_BT_PLUGINS
+ desc: option for Rec button config
+ user:
+
+ *: "Plugins"
+
+
+ *: "Plugins"
+
+
+ *: "Plugins"
+
+
+
+ id: LANG_BT_PLUGINS_GAMES
+ desc: option for Rec button config
+ user:
+
+ *: "Plugins/Games"
+
+
+ *: "Plugins/Games"
+
+
+ *: "Plugins/Games"
+
+
+
+ id: LANG_BT_PLUGINS_APPS
+ desc: option for Rec button config
+ user:
+
+ *: "Plugins/Apps"
+
+
+ *: "Plugins/Apps"
+
+
+ *: "Plugins/Apps"
+
+
+
+ id: LANG_BT_PLUGINS_DEMOS
+ desc: option for Rec button config
+ user:
+
+ *: "Plugins/Demos"
+
+
+ *: "Plugins/Demos"
+
+
+ *: "Plugins/Demos"
+
+
+
+ id: LANG_BT_THEMES
+ desc: option for Rec button config
+ user:
+
+ *: "Themes"
+
+
+ *: "Themes"
+
+
+ *: "Themes"
+
+
+
+ id: LANG_BT_RECORDING
+ desc: option for Rec button config
+ user:
+
+ *: "Recording Screen"
+
+
+ *: "Recording Screen"
+
+
+ *: "Recording Screen"
+
+
+
+ id: LANG_BT_INSTANT_REC
+ desc: option for Rec button config
+ user:
+
+ *: "Start recording instantly"
+
+
+ *: "Start recording instantly"
+
+
+ *: "Start recording instantly"
+
+
+
+ id: LANG_BT_INSERT
+ desc: option for Rec button config
+ user:
+
+ *: "Insert"
+
+
+ *: "Insert"
+
+
+ *: "Insert"
+
+
+
+ id: LANG_BT_INSERT_NEXT
+ desc: option for Rec button config
+ user:
+
+ *: "Insert Next"
+
+
+ *: "Insert Next"
+
+
+ *: "Insert Next"
+
+
+
+ id: LANG_BT_RADIO
+ desc: option for Rec button config
+ user:
+
+ *: "FM Radio"
+
+
+ *: "FM Radio"
+
+
+ *: "Radio"
+
+
+
id: LANG_BITRATE
desc: bits-kilobits per unit time
user:
Index: apps/onplay.c
===================================================================
--- apps/onplay.c (Revision 16784)
+++ apps/onplay.c (Arbeitskopie)
@@ -63,6 +63,7 @@
#ifdef HAVE_TAGCACHE
#include "tagtree.h"
#endif
+#include "root_menu.h"
#include "cuesheet.h"
#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
@@ -1208,3 +1209,26 @@
return context == CONTEXT_WPS ? ONPLAY_OK : ONPLAY_RELOAD_DIR;
}
}
+
+/* Rincewind Code */
+int user_button_insert(char* file, int attr, int from, int which, bool queue)
+{
+ context = from;
+ selected_file = file;
+ selected_file_attr = attr;
+ onplay_result = ONPLAY_OK;
+ switch (which)
+ {
+ case 1:
+ add_to_playlist(PLAYLIST_INSERT, queue);
+ break;
+ case 2:
+ add_to_playlist(PLAYLIST_INSERT_FIRST, queue);
+ break;
+ }
+
+ if (onplay_result == ONPLAY_START_PLAY)
+ return GO_TO_WPS;
+ else
+ return GO_TO_PREVIOUS;
+}
Index: apps/gui/gwps.c
===================================================================
--- apps/gui/gwps.c (Revision 16784)
+++ apps/gui/gwps.c (Arbeitskopie)
@@ -27,6 +27,7 @@
#include "font.h"
#include "backlight.h"
#include "action.h"
+#include "user_action.h"
#include "kernel.h"
#include "filetypes.h"
#include "debug.h"
@@ -265,6 +266,37 @@
restore = true;
break;
+ /* Rincewind Code */
+ /* user-setteble actions, used only for rec-button on irivers Hxx currently */
+ case ACTION_WPS_USER1:
+ case ACTION_WPS_USER2:
+ case ACTION_WPS_USER3:
+ /* break if user has set action for this button == none */
+ if (user_action_none(button))
+ break;
+
+ FOR_NB_SCREENS(i)
+ gui_wps[i].display->stop_scroll();
+#ifdef HAVE_LCD_COLOR
+ show_main_backdrop();
+#endif
+ static int user_action_ret;
+ user_action_ret = user_action(button);
+ if (user_action_ret != GO_TO_PREVIOUS && user_action_ret != GO_TO_PREVIOUS_MUSIC && user_action_ret != GO_TO_WPS)
+ return user_action_ret;
+
+#ifdef HAVE_LCD_COLOR
+ show_wps_backdrop();
+#endif
+#ifdef HAVE_LCD_BITMAP
+ FOR_NB_SCREENS(i)
+ {
+ gui_wps_set_margin(&gui_wps[i]);
+ }
+#endif
+ restore = true;
+ break;
+
case ACTION_WPS_BROWSE:
#ifdef HAVE_LCD_CHARCELLS
status_set_record(false);
Index: apps/settings.h
===================================================================
--- apps/settings.h (Revision 16784)
+++ apps/settings.h (Arbeitskopie)
@@ -212,6 +212,7 @@
#if CONFIG_CODEC == SWCODEC
SETTINGS_SAVE_EQPRESET,
#endif
+
};
bool settings_save_config(int options);
@@ -650,6 +651,19 @@
#endif
#endif /* HAVE_BACKLIGHT */
+ /* Rincewind Code */
+#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
+ || (CONFIG_KEYPAD == SANSA_E200_PAD)
+ /* 0=none 1=playlist 2=plugins 3=plugins/games 4=plugins/apps 5=plugins/demos 6=themes 7=recording screen 8=instant rec 9=Radio */
+ int user_action_wps1;
+ int user_action_wps2;
+ int user_action_wps3;
+ /* 0=none 1=playlist 2=plugins 3=plugins/games 4=plugins/apps 5=plugins/demos 6=themes 7=recording screen 8=instant rec 9=Radio 10=Insert 11=Insert next 12=Queue 13=Queue next */
+ int user_action_tree1;
+ int user_action_tree2;
+ int user_action_tree3;
+#endif
+
#ifdef HAVE_LCD_BITMAP
unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */
#endif
Index: apps/menus/settings_menu.c
===================================================================
--- apps/menus/settings_menu.c (Revision 16784)
+++ apps/menus/settings_menu.c (Arbeitskopie)
@@ -344,6 +344,26 @@
#endif
MENUITEM_SETTING(start_screen, &global_settings.start_in_screen, NULL);
+/* Rincewind Code */
+#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
+ || (CONFIG_KEYPAD == SANSA_E200_PAD)
+MENUITEM_SETTING(user_action_wps1, &global_settings.user_action_wps1, NULL);
+MENUITEM_SETTING(user_action_wps2, &global_settings.user_action_wps2, NULL);
+MENUITEM_SETTING(user_action_wps3, &global_settings.user_action_wps3, NULL);
+
+MENUITEM_SETTING(user_action_tree1, &global_settings.user_action_tree1, NULL);
+MENUITEM_SETTING(user_action_tree2, &global_settings.user_action_tree2, NULL);
+MENUITEM_SETTING(user_action_tree3, &global_settings.user_action_tree3, NULL);
+
+MAKE_MENU(button_wps, ID2P(LANG_BUTTON_WPS), 0, Icon_NOICON,
+ &user_action_wps1, &user_action_wps2, &user_action_wps3);
+MAKE_MENU(button_tree, ID2P(LANG_BUTTON_TREE), 0, Icon_NOICON,
+ &user_action_tree1, &user_action_tree2, &user_action_tree3);
+
+MAKE_MENU(button_config, ID2P(LANG_BUTTON_CONFIG), 0, Icon_NOICON,
+ &button_wps, &button_tree);
+#endif
+
#ifdef HAVE_BUTTON_LIGHT
MENUITEM_SETTING(buttonlight_timeout, &global_settings.buttonlight_timeout, NULL);
#endif
@@ -382,6 +402,10 @@
#ifdef HAVE_BUTTON_LIGHT
&buttonlight_timeout,
#endif
+#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
+ || (CONFIG_KEYPAD == SANSA_E200_PAD)
+ &button_config,
+#endif
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
&buttonlight_brightness,
#endif
Index: apps/onplay.h
===================================================================
--- apps/onplay.h (Revision 16784)
+++ apps/onplay.h (Arbeitskopie)
@@ -20,7 +20,7 @@
#define _ONPLAY_H_
int onplay(char* file, int attr, int from_screen);
-
+int user_button_insert(char* file, int attr, int from, int which, bool queue);
enum {
ONPLAY_MAINMENU = -1,
ONPLAY_OK = 0,
Index: apps/settings_list.c
===================================================================
--- apps/settings_list.c (Revision 16784)
+++ apps/settings_list.c (Arbeitskopie)
@@ -1149,6 +1149,49 @@
#endif
#endif
OFFON_SETTING(0,cuesheet,LANG_CUESHEET_ENABLE,false,"cuesheet support", NULL),
+
+ /* Rincewind Code */
+#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
+ || (CONFIG_KEYPAD == SANSA_E200_PAD)
+ CHOICE_SETTING(0, user_action_wps1, LANG_REC_BUTTON_SHORT,1,
+ "user-defined button action wps 1",
+ "none,Current Playlist,Plugins,Plugins/Games,Plugins/Apps,Plugins/Demos,Themes,Recording Screen,Instant Recording,FM Radio",NULL, 10,
+ ID2P(LANG_BT_NONE), ID2P(LANG_BT_PLAYLIST), ID2P(LANG_BT_PLUGINS), ID2P(LANG_BT_PLUGINS_GAMES),
+ ID2P(LANG_BT_PLUGINS_APPS), ID2P(LANG_BT_PLUGINS_DEMOS), ID2P(LANG_BT_THEMES),
+ ID2P(LANG_BT_RECORDING), ID2P(LANG_BT_INSTANT_REC), ID2P(LANG_BT_RADIO)),
+ CHOICE_SETTING(0, user_action_wps2, LANG_REC_BUTTON_LONG,4,
+ "user-defined button action wps 2",
+ "none,Current Playlist,Plugins,Plugins/Games,Plugins/Apps,Plugins/Demos,Themes,Recording Screen,Instant Recording,FM Radio",NULL, 10,
+ ID2P(LANG_BT_NONE), ID2P(LANG_BT_PLAYLIST), ID2P(LANG_BT_PLUGINS),
+ ID2P(LANG_BT_PLUGINS_GAMES), ID2P(LANG_BT_PLUGINS_APPS), ID2P(LANG_BT_PLUGINS_DEMOS), ID2P(LANG_BT_THEMES),
+ ID2P(LANG_BT_RECORDING), ID2P(LANG_BT_INSTANT_REC), ID2P(LANG_BT_RADIO)),
+ CHOICE_SETTING(0, user_action_wps3, LANG_REC_BUTTON_PLAY,0,
+ "user-defined button action wps 3",
+ "none,Current Playlist,Plugins,Plugins/Games,Plugins/Apps,Plugins/Demos,Themes,Recording Screen,Instant Recording,FM Radio",NULL, 10,
+ ID2P(LANG_BT_NONE), ID2P(LANG_BT_PLAYLIST), ID2P(LANG_BT_PLUGINS),
+ ID2P(LANG_BT_PLUGINS_GAMES), ID2P(LANG_BT_PLUGINS_APPS), ID2P(LANG_BT_PLUGINS_DEMOS), ID2P(LANG_BT_THEMES),
+ ID2P(LANG_BT_RECORDING), ID2P(LANG_BT_INSTANT_REC), ID2P(LANG_BT_RADIO)),
+
+ CHOICE_SETTING(0, user_action_tree1, LANG_REC_BUTTON_SHORT,6,
+ "user-defined button action tree 1",
+ "none,Current Playlist,Plugins,Plugins/Games,Plugins/Apps,Plugins/Demos,Themes,Recording Screen,Instant Recording,FM Radio,Insert,Insert Next,Queue,Queue Next",NULL, 14,
+ ID2P(LANG_BT_NONE), ID2P(LANG_BT_PLAYLIST), ID2P(LANG_BT_PLUGINS),
+ ID2P(LANG_BT_PLUGINS_GAMES), ID2P(LANG_BT_PLUGINS_APPS), ID2P(LANG_BT_PLUGINS_DEMOS), ID2P(LANG_BT_THEMES),
+ ID2P(LANG_BT_RECORDING), ID2P(LANG_BT_INSTANT_REC), ID2P(LANG_BT_RADIO), ID2P(LANG_BT_INSERT), ID2P(LANG_BT_INSERT_NEXT), ID2P(LANG_QUEUE), ID2P(LANG_QUEUE_FIRST)),
+ CHOICE_SETTING(0, user_action_tree2, LANG_REC_BUTTON_LONG,4,
+ "user-defined button action tree 2",
+ "none,Current Playlist,Plugins,Plugins/Games,Plugins/Apps,Plugins/Demos,Themes,Recording Screen,Instant Recording,FM Radio,Insert,Insert Next,Queue,Queue Next",NULL, 14,
+ ID2P(LANG_BT_NONE), ID2P(LANG_BT_PLAYLIST), ID2P(LANG_BT_PLUGINS),
+ ID2P(LANG_BT_PLUGINS_GAMES), ID2P(LANG_BT_PLUGINS_APPS), ID2P(LANG_BT_PLUGINS_DEMOS), ID2P(LANG_BT_THEMES),
+ ID2P(LANG_BT_RECORDING), ID2P(LANG_BT_INSTANT_REC), ID2P(LANG_BT_RADIO), ID2P(LANG_BT_INSERT), ID2P(LANG_BT_INSERT_NEXT), ID2P(LANG_QUEUE), ID2P(LANG_QUEUE_FIRST)),
+ CHOICE_SETTING(0, user_action_tree3, LANG_REC_BUTTON_PLAY,0,
+ "user-defined button action tree 3",
+ "none,Current Playlist,Plugins,Plugins/Games,Plugins/Apps,Plugins/Demos,Themes,Recording Screen,Instant Recording,FM Radio,Insert,Insert Next,Queue,Queue Next",NULL, 14,
+ ID2P(LANG_BT_NONE), ID2P(LANG_BT_PLAYLIST), ID2P(LANG_BT_PLUGINS),
+ ID2P(LANG_BT_PLUGINS_GAMES), ID2P(LANG_BT_PLUGINS_APPS), ID2P(LANG_BT_PLUGINS_DEMOS), ID2P(LANG_BT_THEMES),
+ ID2P(LANG_BT_RECORDING), ID2P(LANG_BT_INSTANT_REC), ID2P(LANG_BT_RADIO), ID2P(LANG_BT_INSERT), ID2P(LANG_BT_INSERT_NEXT), ID2P(LANG_QUEUE), ID2P(LANG_QUEUE_FIRST)),
+#endif
+
CHOICE_SETTING(0, start_in_screen, LANG_START_SCREEN, 1,
"start in screen", "previous,root,files,db,wps,menu,"
#ifdef HAVE_RECORDING
Index: apps/user_action.c
===================================================================
--- apps/user_action.c (Revision 0)
+++ apps/user_action.c (Revision 0)
@@ -0,0 +1,167 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id:$
+ *
+ * Copyright (C) 2007 by Simon Menzel
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#include "settings.h"
+#include "playlist_viewer.h"
+#include "tree.h"
+#include "statusbar.h"
+#ifdef HAVE_RECORDING
+#include "recording.h"
+#endif
+#include "lang.h"
+#include "action.h"
+#include "root_menu.h"
+#ifdef HAVE_TAGCACHE
+#include "tagtree.h"
+#endif
+#include "onplay.h"
+#include "sprintf.h"
+#include "filetypes.h"
+
+static int get_user_action(int button)
+{
+ if (button == ACTION_WPS_USER1)
+ return global_settings.user_action_wps1;
+ else if (button == ACTION_TREE_USER1)
+ return global_settings.user_action_tree1;
+ else if (button == ACTION_WPS_USER2)
+ return global_settings.user_action_wps2;
+ else if (button == ACTION_TREE_USER2)
+ return global_settings.user_action_tree2;
+ else if (button == ACTION_WPS_USER3)
+ return global_settings.user_action_wps3;
+ else if (button == ACTION_TREE_USER3)
+ return global_settings.user_action_tree3;
+ else
+ return 0;
+}
+
+static int insert_action(int which, bool queue)
+{
+ struct tree_context* tc = tree_get_context();
+ char buf[MAX_PATH];
+ int attr = 0;
+ int curr_context;
+ int ret;
+ struct entry *dircache = tc->dircache;
+
+#ifdef HAVE_TAGCACHE
+ if (*(tc->dirfilter) == SHOW_ID3DB)
+ {
+ curr_context = CONTEXT_ID3DB;
+ if (tagtree_get_attr(tc) == FILE_ATTR_AUDIO)
+ {
+ attr = FILE_ATTR_AUDIO;
+ tagtree_get_filename(tc, buf, sizeof(buf));
+ }
+ else
+ attr = ATTR_DIRECTORY;
+ }
+ else
+#endif
+ {
+ curr_context = CONTEXT_TREE;
+ attr = dircache[tc->selected_item].attr;
+
+ if (tc->currdir[1]) /* Not in / */
+ snprintf(buf, sizeof buf, "%s/%s",
+ tc->currdir,
+ dircache[tc->selected_item].name);
+ else /* In / */
+ snprintf(buf, sizeof buf, "/%s",
+ dircache[tc->selected_item].name);
+ }
+
+ ret = user_button_insert(buf, attr, curr_context, which, queue);
+
+ /* not tested with tagcache! */
+ /* move to next track in browser */
+ tc->selected_item++;
+ return ret;
+}
+
+int user_action(int button) {
+ int ret = GO_TO_PREVIOUS;
+ switch (get_user_action(button))
+ {
+ case 0: /* none */
+ ret = GO_TO_PREVIOUS;
+ break;
+ case 1: /* Playlist */
+ gui_syncstatusbar_draw(&statusbars,true);
+ if (playlist_viewer())
+ ret = GO_TO_ROOT;
+ else
+ ret = GO_TO_PREVIOUS;
+ break;
+ case 2: /* plugins */
+ ret = GO_TO_BROWSEPLUGINS;
+ break;
+ case 3: /* plugins/games */
+ ret = rockbox_browse(PLUGIN_GAMES_DIR, SHOW_PLUGINS);
+ break;
+ case 4: /* plugins/apps */
+ ret = rockbox_browse(PLUGIN_APPS_DIR, SHOW_PLUGINS);
+ break;
+ case 5: /* plugins/demos */
+ ret = rockbox_browse(PLUGIN_DEMOS_DIR, SHOW_PLUGINS);
+ break;
+ case 6: /* themes */
+ gui_syncstatusbar_draw(&statusbars,true);
+ ret = rockbox_browse(THEME_DIR, SHOW_CFG);
+ break;
+#ifdef HAVE_RECORDING
+ case 7: /* recording screen */
+ ret = GO_TO_RECSCREEN;
+ break;
+ case 8: /* instant recording */
+ recording_start_automatic = true;
+ ret = GO_TO_RECSCREEN;
+ break;
+#endif
+#if CONFIG_TUNER
+ case 9: /* FM Radio */
+ ret = GO_TO_FM;
+ break;
+#endif
+ case 10: /* Insert */
+ ret = insert_action(1, false);
+ break;
+ case 11:
+ ret = insert_action(2, false);
+ break;
+ case 12:
+ ret = insert_action(1, true);
+ break;
+ case 13:
+ ret = insert_action(2, true);
+ break;
+ default:
+ ret = GO_TO_PREVIOUS;
+ }
+ return ret;
+}
+
+bool user_action_none(int button)
+{
+ if (get_user_action(button) == 0)
+ return true;
+ else
+ return false;
+}
+
Index: apps/user_action.h
===================================================================
--- apps/user_action.h (Revision 0)
+++ apps/user_action.h (Revision 0)
@@ -0,0 +1,28 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id:$
+ *
+ * Copyright (C) 2007 by Simon Menzel
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+#ifndef REC_BUTTON_H
+#define REC_BUTTON_H
+
+/* Calls the user action for the button (action is taken from settings) */
+/* returns a GO_TO_xxx number */
+int user_action(int button);
+/* check if user action is "none" */
+bool user_action_none(int button);
+
+#endif
Index: apps/SOURCES
===================================================================
--- apps/SOURCES (Revision 16784)
+++ apps/SOURCES (Arbeitskopie)
@@ -45,6 +45,7 @@
#endif
filetree.c
scrobbler.c
+user_action.c
screen_access.c
gui/buttonbar.c
Index: apps/keymaps/keymap-h1x0_h3x0.c
===================================================================
--- apps/keymaps/keymap-h1x0_h3x0.c (Revision 16784)
+++ apps/keymaps/keymap-h1x0_h3x0.c (Arbeitskopie)
@@ -61,7 +61,7 @@
{ ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
{ ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
{ ACTION_STD_OK, BUTTON_ON|BUTTON_REL, BUTTON_NONE },
- { ACTION_STD_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE },
+ /* { ACTION_STD_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE }, */
LAST_ITEM_IN_LIST
}; /* button_context_standard */
@@ -89,8 +89,11 @@
{ ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
{ ACTION_WPS_ABRESET, BUTTON_ON|BUTTON_SELECT, BUTTON_ON },
{ ACTION_WPS_ID3SCREEN, BUTTON_ON|BUTTON_MODE, BUTTON_NONE },
- { ACTION_WPS_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE },
-
+ /* { ACTION_WPS_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE }, */
+ { ACTION_WPS_USER1, BUTTON_REC|BUTTON_REL, BUTTON_REC },
+ { ACTION_WPS_USER2, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
+ { ACTION_WPS_USER3, BUTTON_ON|BUTTON_REC, BUTTON_NONE },
+
LAST_ITEM_IN_LIST
}; /* button_context_wps */
@@ -109,6 +112,9 @@
{ ACTION_TREE_WPS, BUTTON_ON|BUTTON_REL, BUTTON_ON },
{ ACTION_TREE_STOP, BUTTON_OFF, BUTTON_NONE },
{ ACTION_TREE_STOP, BUTTON_OFF|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_TREE_USER1, BUTTON_REC|BUTTON_REL, BUTTON_REC },
+ { ACTION_TREE_USER2, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
+ { ACTION_TREE_USER3, BUTTON_ON|BUTTON_REC, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST)
}; /* button_context_tree */
Index: apps/keymaps/keymap-e200.c
===================================================================
--- apps/keymaps/keymap-e200.c (Revision 16784)
+++ apps/keymaps/keymap-e200.c (Arbeitskopie)
@@ -37,7 +37,7 @@
{ ACTION_STD_NEXTREPEAT, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_MENU, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
- { ACTION_STD_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE },
+ /* { ACTION_STD_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE }, */
{ ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
{ ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
@@ -78,11 +78,14 @@
{ ACTION_WPS_QUICKSCREEN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
{ ACTION_WPS_MENU, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
- { ACTION_WPS_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE },
+ /* { ACTION_WPS_REC, BUTTON_REC|BUTTON_REPEAT, BUTTON_NONE }, */
{ ACTION_WPS_PITCHSCREEN, BUTTON_SELECT|BUTTON_UP, BUTTON_SELECT },
{ ACTION_WPS_ID3SCREEN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_SELECT },
-
+ { ACTION_WPS_USER1, BUTTON_REC|BUTTON_REL, BUTTON_REC },
+ { ACTION_WPS_USER2, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
+ { ACTION_WPS_USER3, BUTTON_UP|BUTTON_REC, BUTTON_NONE },
+
LAST_ITEM_IN_LIST
}; /* button_context_wps */
@@ -112,6 +115,9 @@
static const struct button_mapping button_context_tree[] = {
{ ACTION_TREE_WPS, BUTTON_UP|BUTTON_REL, BUTTON_UP },
{ ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_TREE_USER1, BUTTON_REC|BUTTON_REL, BUTTON_REC },
+ { ACTION_TREE_USER2, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
+ { ACTION_TREE_USER3, BUTTON_UP|BUTTON_REC, BUTTON_NONE },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
}; /* button_context_tree */