summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/SOURCES8
-rw-r--r--apps/action.c92
-rw-r--r--apps/action.h12
-rw-r--r--apps/debug_menu.c53
-rw-r--r--apps/filetree.c22
-rw-r--r--apps/filetree.h2
-rw-r--r--apps/gui/bitmap/list.c2
-rw-r--r--apps/gui/skin_engine/skin_parser.c27
-rw-r--r--apps/gui/skin_engine/skin_touchsupport.c33
-rw-r--r--apps/gui/skin_engine/wps_internals.h2
-rw-r--r--apps/gui/wps.c6
-rw-r--r--apps/gui/yesno.c5
-rw-r--r--apps/iap/iap-lingo4.c3
-rw-r--r--apps/keymaps/keymap-c100.c400
-rw-r--r--apps/keymaps/keymap-erosq.c40
-rw-r--r--apps/keymaps/keymap-fiiom3k.c82
-rw-r--r--apps/keymaps/keymap-iaudio67.c330
-rw-r--r--apps/keymaps/keymap-ifp7xx.c185
-rw-r--r--apps/keymaps/keymap-logikdax.c318
-rw-r--r--apps/lang/english-us.lang22
-rw-r--r--apps/lang/english.lang23
-rw-r--r--apps/lang/italiano.lang6
-rw-r--r--apps/lang/nederlands.lang6
-rw-r--r--apps/lang/polski.lang42
-rw-r--r--apps/lang/russian.lang6
-rw-r--r--apps/lang/slovak.lang6
-rw-r--r--apps/lang/srpski.lang6
-rw-r--r--apps/main.c11
-rw-r--r--apps/menu.c2
-rw-r--r--apps/menus/playlist_menu.c62
-rw-r--r--apps/menus/settings_menu.c3
-rw-r--r--apps/onplay.c1
-rw-r--r--apps/plugin.c1
-rw-r--r--apps/plugin.h1
-rw-r--r--apps/plugins/battery_bench.c14
-rw-r--r--apps/plugins/blackjack.c20
-rw-r--r--apps/plugins/calculator.c188
-rw-r--r--apps/plugins/calendar.c10
-rw-r--r--apps/plugins/chessbox/chessbox_pgn.h14
-rw-r--r--apps/plugins/chessclock.c21
-rw-r--r--apps/plugins/chopper.c6
-rw-r--r--apps/plugins/clix.c8
-rw-r--r--apps/plugins/cube.c20
-rw-r--r--apps/plugins/doom/doomdef.c2
-rw-r--r--apps/plugins/doom/doomdef.h2
-rw-r--r--apps/plugins/doom/i_video.c10
-rw-r--r--apps/plugins/doom/m_misc.c2
-rw-r--r--apps/plugins/fractals/fractal.h14
-rw-r--r--apps/plugins/greyscale.c8
-rw-r--r--apps/plugins/imageviewer/imageviewer_button.h11
-rw-r--r--apps/plugins/invadrox.c7
-rw-r--r--apps/plugins/jewels.c20
-rw-r--r--apps/plugins/lib/grey_core.c1
-rw-r--r--apps/plugins/lib/pluginlib_actions.c22
-rw-r--r--apps/plugins/lua/include_lua/create_kbd_layout.lua107
-rw-r--r--apps/plugins/lua/include_lua/menubuttons.lua59
-rw-r--r--apps/plugins/lua/include_lua/menucoresettings.lua78
-rw-r--r--apps/plugins/lua/include_lua/print.lua14
-rw-r--r--apps/plugins/lua/include_lua/printmenus.lua91
-rw-r--r--apps/plugins/lua/include_lua/printsubmenu.lua314
-rw-r--r--apps/plugins/lua/include_lua/printtable.lua61
-rw-r--r--apps/plugins/lua/include_lua/rbsettings.lua7
-rw-r--r--apps/plugins/lua/include_lua/temploader.lua63
-rw-r--r--apps/plugins/lua/lauxlib.c37
-rw-r--r--apps/plugins/lua/loadlib.c4
-rw-r--r--apps/plugins/lua/lparser.c5
-rw-r--r--apps/plugins/lua/lua.make13
-rwxr-xr-xapps/plugins/lua/rbdefines_helper.pl2
-rw-r--r--apps/plugins/lua/rockaux.c80
-rw-r--r--apps/plugins/lua/rocklib.c16
-rw-r--r--apps/plugins/lua_scripts/print_buttons.lua70
-rw-r--r--apps/plugins/lua_scripts/print_lua_func.lua72
-rw-r--r--apps/plugins/lua_scripts/submenu_demo.lua121
-rw-r--r--apps/plugins/midi/midiplay.c8
-rw-r--r--apps/plugins/mp3_encoder.c6
-rw-r--r--apps/plugins/mpegplayer/mpeg_settings.c8
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c9
-rw-r--r--apps/plugins/pacbox/pacbox.h12
-rw-r--r--apps/plugins/pegbox.c17
-rw-r--r--apps/plugins/pictureflow/pictureflow.c19
-rw-r--r--apps/plugins/plugin.lds19
-rw-r--r--apps/plugins/pong.c8
-rw-r--r--apps/plugins/reversi/reversi-gui.h9
-rw-r--r--apps/plugins/rockblox.c22
-rw-r--r--apps/plugins/rockboy/cpu.c50
-rw-r--r--apps/plugins/rockboy/rockboy.c10
-rw-r--r--apps/plugins/sokoban.c14
-rw-r--r--apps/plugins/stopwatch.c17
-rw-r--r--apps/plugins/sudoku/sudoku.h10
-rw-r--r--apps/plugins/text_viewer/tv_button.h23
-rw-r--r--apps/plugins/xobox.c9
-rw-r--r--apps/plugins/zxbox/keymaps.h16
-rw-r--r--apps/plugins/zxbox/zxbox_keyb.c77
-rw-r--r--apps/settings.c1
-rw-r--r--apps/settings.h1
-rw-r--r--apps/settings_list.c2
-rw-r--r--apps/tagcache.c7
-rw-r--r--apps/tree.c2
98 files changed, 1703 insertions, 2107 deletions
diff --git a/apps/SOURCES b/apps/SOURCES
index 80133ebd27..5c49f0bbbc 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -197,8 +197,6 @@ keymaps/keymap-gigabeat.c
keymaps/keymap-gigabeat-s.c
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
keymaps/keymap-h10.c
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-keymaps/keymap-ifp7xx.c
#elif CONFIG_KEYPAD == SANSA_E200_PAD
keymaps/keymap-e200.c
#elif CONFIG_KEYPAD == SANSA_C200_PAD
@@ -231,12 +229,6 @@ keymaps/keymap-sa9200.c
keymaps/keymap-hdd1630.c
#elif CONFIG_KEYPAD == PHILIPS_HDD6330_PAD
keymaps/keymap-hdd6330.c
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-keymaps/keymap-iaudio67.c
-#elif CONFIG_KEYPAD == SANSA_C100_PAD
-keymaps/keymap-c100.c
-#elif CONFIG_KEYPAD == LOGIK_DAX_PAD
-keymaps/keymap-logikdax.c
#elif CONFIG_KEYPAD == SANSA_FUZE_PAD
keymaps/keymap-fuze.c
#elif CONFIG_KEYPAD == ONDAVX747_PAD
diff --git a/apps/action.c b/apps/action.c
index 34897b938c..5533c00241 100644
--- a/apps/action.c
+++ b/apps/action.c
@@ -128,21 +128,25 @@ static bool is_action_filtered(int action, unsigned int mask, int context)
case ACTION_FM_PLAY:
match = has_flag(mask, SEL_ACTION_PLAY);
break;
- case ACTION_STD_PREVREPEAT:
- case ACTION_STD_NEXTREPEAT:
+ //case ACTION_STD_PREVREPEAT: // seek not exempted outside of WPS
+ //case ACTION_STD_NEXTREPEAT:
case ACTION_WPS_SEEKBACK:
case ACTION_WPS_SEEKFWD:
case ACTION_WPS_STOPSEEK:
match = has_flag(mask, SEL_ACTION_SEEK);
break;
- case ACTION_STD_PREV:
- case ACTION_STD_NEXT:
+ //case ACTION_STD_PREV: // skip/scrollwheel not exempted outside of WPS
+ //case ACTION_STD_NEXT:
case ACTION_WPS_SKIPNEXT:
case ACTION_WPS_SKIPPREV:
case ACTION_FM_NEXT_PRESET:
case ACTION_FM_PREV_PRESET:
match = has_flag(mask, SEL_ACTION_SKIP);
break;
+#ifdef HAVE_VOLUME_IN_LIST
+ case ACTION_LIST_VOLUP: // volume exempted outside of WPS if the device supports it
+ case ACTION_LIST_VOLDOWN:
+#endif
case ACTION_WPS_VOLUP:
case ACTION_WPS_VOLDOWN:
match = has_flag(mask, SEL_ACTION_VOL);
@@ -586,6 +590,13 @@ static inline void action_code_lookup(action_last_t *last, action_cur_t *cur)
cur->is_prebutton = false;
+#ifdef HAVE_LOCKED_ACTIONS
+ /* This only applies to the first context, to allow locked contexts to
+ * specify a fall through to their non-locked version */
+ if (is_keys_locked())
+ context |= CONTEXT_LOCKED;
+#endif
+
for(;;)
{
/* logf("context = %x",context); */
@@ -672,6 +683,20 @@ static inline int do_auto_softlock(action_last_t *last, action_cur_t *cur)
if (is_timeout)
{
do_key_lock(true);
+
+#if defined(HAVE_TOUCHPAD)
+ /* if the touchpad is supposed to be off and the current buttonpress
+ * is from the touchpad, nullify both button and action. */
+ if (!has_flag(action_last.softlock_mask, SEL_ACTION_ENABLED) ||
+ has_flag(action_last.softlock_mask, SEL_ACTION_NOTOUCH))
+ {
+ cur->button = touchpad_filter(cur->button);
+ if (cur->button == BUTTON_NONE)
+ {
+ action = ACTION_NONE;
+ }
+ }
+#endif
}
else if (action == ACTION_STD_KEYLOCK)
{
@@ -724,8 +749,11 @@ static inline void do_softlock(action_last_t *last, action_cur_t *cur)
#else
int action = cur->action;
- if (!last->screen_has_lock)
- { /* no need to check softlock return immediately */
+ /* check to make sure we don't get stuck without a way to unlock - if locked,
+ * we can still use unlock_combo to unlock */
+ if (!last->screen_has_lock && !last->keys_locked)
+ {
+ /* no need to check softlock return immediately */
return;
}
@@ -1169,7 +1197,7 @@ void set_selective_backlight_actions(bool selective, unsigned int mask,
#ifndef HAS_BUTTON_HOLD
bool is_keys_locked(void)
{
- return (action_last.screen_has_lock && action_last.keys_locked);
+ return (action_last.keys_locked);
}
/* Enable selected actions to bypass a locked state */
@@ -1185,7 +1213,57 @@ void set_selective_softlock_actions(bool selective, unsigned int mask)
action_last.softlock_mask = SEL_ACTION_NONE;
}
}
+
+
+void action_autosoftlock_init(void)
+{
+ action_cur_t cur;
+ int i = 0;
+
+ if (action_last.unlock_combo == BUTTON_NONE)
+ {
+ /* search CONTEXT_WPS, should be here */
+ cur.items = get_context_mapping(CONTEXT_WPS);
+ while (cur.items[i].button_code != BUTTON_NONE)
+ {
+ if (cur.items[i].action_code == ACTION_STD_KEYLOCK)
+ {
+ action_last.unlock_combo = cur.items[i].button_code;
+ break;
+ }
+ i = i + 1;
+ }
+
+ /* not there... let's try std
+ * I doubt any targets will need this, but... */
+ if (action_last.unlock_combo == BUTTON_NONE)
+ {
+ i = 0;
+ cur.items = get_context_mapping(CONTEXT_STD);
+ while (cur.items[i].button_code != BUTTON_NONE)
+ {
+ if (cur.items[i].action_code == ACTION_STD_KEYLOCK)
+ {
+ action_last.unlock_combo = cur.items[i].button_code;
+ break;
+ }
+ i = i + 1;
+ }
+ }
+ }
+
+ /* if we have autolock and alwaysautolock, go ahead and arm it */
+ if (has_flag(action_last.softlock_mask, SEL_ACTION_AUTOLOCK) &&
+ has_flag(action_last.softlock_mask, SEL_ACTION_ALWAYSAUTOLOCK) &&
+ (action_last.unlock_combo != BUTTON_NONE))
+ {
+ action_last.softlock_mask = action_last.softlock_mask | SEL_ACTION_ALOCK_OK;
+ }
+
+ return;
+}
#endif /* !HAS_BUTTON_HOLD */
+
/*
*******************************************************************************
* END EXPORTED ACTION FUNCTIONS ***********************************************
diff --git a/apps/action.h b/apps/action.h
index e4ad29504b..ad91f31535 100644
--- a/apps/action.h
+++ b/apps/action.h
@@ -32,6 +32,9 @@
#define CONTEXT_CUSTOM 0x40000000 /* | this against anything to get your context number */
#define CONTEXT_CUSTOM2 0x20000000 /* as above */
#define CONTEXT_PLUGIN 0x10000000 /* for plugins using get_custom_action */
+#ifdef HAVE_LOCKED_ACTIONS
+#define CONTEXT_LOCKED 0x04000000 /* flag to use alternate keymap when screen is locked */
+#endif
#define LAST_ITEM_IN_LIST { CONTEXT_STOPSEARCHING, BUTTON_NONE, BUTTON_NONE }
#define LAST_ITEM_IN_LIST__NEXTLIST(a) { a, BUTTON_NONE, BUTTON_NONE }
@@ -65,10 +68,17 @@
#if !defined(HAS_BUTTON_HOLD)
/* returns true if keys_locked and screen_has_lock */
bool is_keys_locked(void);
+
/* Enable selected actions to bypass a locked state
* mask is combination of Selective action selection flags */
void set_selective_softlock_actions(bool selective, unsigned int mask);
-#endif
+
+/* search the standard and wps contexts for ACTION_STD_KEYLOCK,
+ * load it into unlock_combo if we find it,
+ * also arm autolock if enabled. */
+void action_autosoftlock_init(void);
+
+#endif /* !defined(HAS_BUTTON_HOLD) */
#if defined(HAVE_BACKLIGHT)
/* Enable selected actions to leave the backlight off
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 42d16a4e82..9bbbfaec99 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -126,10 +126,6 @@
#include "bootdata.h"
#endif
-#ifdef FIIO_M3K
-#include "installer.h"
-#endif
-
static const char* threads_getname(int selected_item, void *data,
char *buffer, size_t buffer_len)
{
@@ -2495,52 +2491,6 @@ static bool dbg_boot_data(void)
}
#endif /* defined(HAVE_BOOTDATA) && !defined(SIMULATOR) */
-#if defined(FIIO_M3K) && !defined(SIMULATOR)
-/* Note: this is temporary and should NOT be merged, ensure it is removed */
-static int fiio_debug_menu_action_callback(int action, struct gui_synclist *lists)
-{
- if(action == ACTION_REDRAW) {
- simplelist_set_line_count(0);
- simplelist_addline("Back to menu");
- simplelist_addline("Install bootloader");
- simplelist_addline("Dump bootloader");
- action = ACTION_REDRAW;
- }
-
- if(action == ACTION_STD_OK) {
- int sel = gui_synclist_get_sel_pos(lists);
- int rc = 0;
- switch(sel) {
- case 1:
- rc = install_bootloader("/boot.install");
- break;
- case 2:
- rc = dump_bootloader("/boot.dump");
- break;
- default:
- break;
- }
-
- if(sel == 1 || sel == 2) {
- const char* msg = installer_strerror(rc);
- splashf(3*HZ, "(%d) %s", rc, msg);
- }
-
- action = ACTION_STD_CANCEL;
- }
-
- return action;
-}
-
-static bool dbg_fiio_menu(void)
-{
- struct simplelist_info info;
- simplelist_info_init(&info, "FiiO debug menu", 3, NULL);
- info.action_callback = fiio_debug_menu_action_callback;
- return simplelist_show_list(&info);
-}
-#endif
-
/****** The menu *********/
static const struct {
unsigned char *desc; /* string or ID */
@@ -2648,9 +2598,6 @@ static const struct {
#if defined(HAVE_BOOTDATA) && !defined(SIMULATOR)
{"Boot data", dbg_boot_data },
#endif
-#if defined(FIIO_M3K) && !defined(SIMULATOR)
- {"FiiO debug menu", dbg_fiio_menu},
-#endif
};
static int menu_action_callback(int btn, struct gui_synclist *lists)
diff --git a/apps/filetree.c b/apps/filetree.c
index f8a1263e7f..5c6443cc34 100644
--- a/apps/filetree.c
+++ b/apps/filetree.c
@@ -86,12 +86,12 @@ int ft_build_playlist(struct tree_context* c, int start_index)
* or started via bookmark autoload, true otherwise.
*
* Pointers to both the full pathname and the separated parts needed to
- * avoid allocating yet another path buffer on the stack (and save some
+ * avoid allocating yet another path buffer on the stack (and save some
* code; the caller typically needs to create the full pathname anyway)...
*/
-bool ft_play_playlist(char* pathname, char* dirname, char* filename)
+bool ft_play_playlist(char* pathname, char* dirname, char* filename, bool skip_dyn_warning)
{
- if (global_settings.party_mode && audio_status())
+ if (global_settings.party_mode && audio_status())
{
splash(HZ, ID2P(LANG_PARTY_MODE));
return false;
@@ -105,9 +105,13 @@ bool ft_play_playlist(char* pathname, char* dirname, char* filename)
splash(0, ID2P(LANG_WAIT));
/* about to create a new current playlist...
- allow user to cancel the operation */
- if (!warn_on_pl_erase())
- return false;
+ * allow user to cancel the operation.
+ * Do not show if skip_dyn_warning is true */
+ if (!skip_dyn_warning)
+ {
+ if (!warn_on_pl_erase())
+ return false;
+ }
if (playlist_create(dirname, filename) != -1)
{
@@ -115,11 +119,11 @@ bool ft_play_playlist(char* pathname, char* dirname, char* filename)
{
playlist_shuffle(current_tick, -1);
}
-
+
playlist_start(0, 0, 0);
return true;
}
-
+
return false;
}
@@ -465,7 +469,7 @@ int ft_enter(struct tree_context* c)
switch ( file_attr & FILE_ATTR_MASK ) {
case FILE_ATTR_M3U:
- play = ft_play_playlist(buf, c->currdir, file->name);
+ play = ft_play_playlist(buf, c->currdir, file->name, false);
if (play)
{
diff --git a/apps/filetree.h b/apps/filetree.h
index fb329813c1..178ba0e973 100644
--- a/apps/filetree.h
+++ b/apps/filetree.h
@@ -26,6 +26,6 @@ int ft_load(struct tree_context* c, const char* tempdir);
int ft_enter(struct tree_context* c);
int ft_exit(struct tree_context* c);
int ft_build_playlist(struct tree_context* c, int start_index);
-bool ft_play_playlist(char* pathname, char* dirname, char* filename);
+bool ft_play_playlist(char* pathname, char* dirname, char* filename, bool skip_dyn_warning);
#endif
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index 6f6a8c1f7f..a82595fb37 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -734,7 +734,7 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * list)
if (list_display_title(list, screen))
line -= 1; /* adjust for the list title */
}
- if (line >= list->nb_items)
+ if (list_start_item+line >= list->nb_items)
return ACTION_NONE;
list->selected_item = list_start_item+line;
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 7f3f4d62e1..7bcd25d258 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -1148,7 +1148,6 @@ static int parse_progressbar_tag(struct skin_element* element,
{
struct touchregion *region = skin_buffer_alloc(sizeof(*region));
struct skin_token_list *item;
- int wpad, hpad;
if (!region)
return 0;
@@ -1163,24 +1162,24 @@ static int parse_progressbar_tag(struct skin_element* element,
/* try to add some extra space on either end to make pressing the
* full bar easier. ~5% on either side
*/
- wpad = pb->width * 5 / 100;
- if (wpad > 10)
- wpad = 10;
- hpad = pb->height * 5 / 100;
- if (hpad > 10)
- hpad = 10;
-
- region->x = pb->x - wpad;
+ region->wpad = pb->width * 5 / 100;
+ if (region->wpad > 10)
+ region->wpad = 10;
+ region->hpad = pb->height * 5 / 100;
+ if (region->hpad > 10)
+ region->hpad = 10;
+
+ region->x = pb->x;
if (region->x < 0)
region->x = 0;
- region->width = pb->width + 2 * wpad;
+ region->width = pb->width;
if (region->x + region->width > curr_vp->vp.x + curr_vp->vp.width)
region->width = curr_vp->vp.x + curr_vp->vp.width - region->x;
- region->y = pb->y - hpad;
+ region->y = pb->y;
if (region->y < 0)
region->y = 0;
- region->height = pb->height + 2 * hpad;
+ region->height = pb->height;
if (region->y + region->height > curr_vp->vp.y + curr_vp->vp.height)
region->height = curr_vp->vp.y + curr_vp->vp.height - region->y;
@@ -1541,6 +1540,10 @@ static int parse_touchregion(struct skin_element *element,
/* should probably do some bounds checking here with the viewport... but later */
region->action = ACTION_NONE;
+ /* padding is only for bars, user defined regions have no need of it */
+ region->wpad = 0;
+ region->hpad = 0;
+
if (get_param(element, 0)->type == STRING)
{
region->label = PTRTOSKINOFFSET(skin_buffer, get_param_text(element, 0));
diff --git a/apps/gui/skin_engine/skin_touchsupport.c b/apps/gui/skin_engine/skin_touchsupport.c
index 7a03e83c36..045bc809c8 100644
--- a/apps/gui/skin_engine/skin_touchsupport.c
+++ b/apps/gui/skin_engine/skin_touchsupport.c
@@ -92,6 +92,18 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset,
* are relative to a preceding viewport */
vx = x - wvp->vp.x;
vy = y - wvp->vp.y;
+
+ /* project touches in the padding region so they clamp to the
+ * edge of the region instead */
+ if(r->x - r->wpad <= vx && vx < r->x)
+ vx = r->x;
+ else if(r->x + r->width <= vx && vx < r->x + r->width + r->wpad)
+ vx = r->x + r->width - 1;
+ if(r->y - r->hpad <= vy && vy < r->y)
+ vy = r->y;
+ else if(r->y + r->height <= vy && vy < r->y + r->height + r->hpad)
+ vy = r->y + r->height - 1;
+
/* now see if the point is inside this region */
if (vx >= r->x && vx < r->x+r->width &&
vy >= r->y && vy < r->y+r->height)
@@ -109,12 +121,21 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset,
{
struct progressbar *bar =
SKINOFFSETTOPTR(skin_buffer, r->bar);
- if(r->width > r->height)
- *edge_offset = vx*100/r->width;
- else /* vertical bars are bottom-up by default */
- *edge_offset = 100 - vy*100/r->height;
+ if(r->width > r->height) {
+ if(r->width > 1)
+ *edge_offset = vx*1000/(r->width - 1);
+ else
+ *edge_offset = 0;
+ } else {
+ /* vertical bars are bottom-up by default */
+ if(r->height > 1)
+ *edge_offset = 1000 - vy*1000/(r->height - 1);
+ else
+ *edge_offset = 0;
+ }
+
if (r->reverse_bar || (bar && bar->invert_fill_direction))
- *edge_offset = 100 - *edge_offset;
+ *edge_offset = 1000 - *edge_offset;
}
temp = r;
returncode = r->action;
@@ -294,7 +315,7 @@ int skin_get_touchaction(struct wps_data *data, int* edge_offset,
{
int val, count;
get_setting_info_for_bar(bar->setting_id, &count, &val);
- val = *edge_offset * count / 100;
+ val = *edge_offset * count / 1000;
update_setting_value_from_touch(bar->setting_id, val);
}
}
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index dcad598dab..bf368bc4f3 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -201,6 +201,8 @@ struct touchregion {
short int y; /* y-pos */
short int width; /* width */
short int height; /* height */
+ short int wpad; /* padding to width */
+ short int hpad; /* padding to height */
bool reverse_bar; /* if true 0% is the left or top */
bool allow_while_locked;
enum {
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index b42e386a91..35716087c2 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -182,7 +182,7 @@ static int skintouch_to_wps(struct wps_data *data)
return ACTION_WPS_HOTKEY;
#endif
case ACTION_TOUCH_SCROLLBAR:
- skin_get_global_state()->id3->elapsed = skin_get_global_state()->id3->length*offset/100;
+ skin_get_global_state()->id3->elapsed = skin_get_global_state()->id3->length*offset/1000;
audio_pre_ff_rewind();
audio_ff_rewind(skin_get_global_state()->id3->elapsed);
return ACTION_TOUCHSCREEN;
@@ -190,8 +190,10 @@ static int skintouch_to_wps(struct wps_data *data)
{
const int min_vol = sound_min(SOUND_VOLUME);
const int max_vol = sound_max(SOUND_VOLUME);
- global_settings.volume = (offset * (max_vol - min_vol)) / 100;
+ const int step_vol = sound_steps(SOUND_VOLUME);
+ global_settings.volume = (offset * (max_vol - min_vol)) / 1000;
global_settings.volume += min_vol;
+ global_settings.volume -= (global_settings.volume % step_vol);
setvol();
}
return ACTION_TOUCHSCREEN;
diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c
index a50b2f1921..669f8ca09a 100644
--- a/apps/gui/yesno.c
+++ b/apps/gui/yesno.c
@@ -201,8 +201,13 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
result=YESNO_YES;
break;
case ACTION_NONE:
+ case ACTION_UNKNOWN:
case SYS_CHARGER_DISCONNECTED:
case SYS_BATTERY_UPDATE:
+ case SYS_TIMEOUT:
+#if CONFIG_CHARGING
+ case SYS_CHARGER_CONNECTED:
+#endif
/* ignore some SYS events that can happen */
continue;
default:
diff --git a/apps/iap/iap-lingo4.c b/apps/iap/iap-lingo4.c
index b601501b3d..4ec5c462a1 100644
--- a/apps/iap/iap-lingo4.c
+++ b/apps/iap/iap-lingo4.c
@@ -108,7 +108,8 @@ static void seek_to_playlist(unsigned long index)
MAX_PATH);
ft_play_playlist(selected_playlist,
global_settings.playlist_catalog_dir,
- strrchr(selected_playlist, '/') + 1);
+ strrchr(selected_playlist, '/') + 1,
+ false);
}
static unsigned long nbr_total_playlists(void)
diff --git a/apps/keymaps/keymap-c100.c b/apps/keymaps/keymap-c100.c
deleted file mode 100644
index 9949f0c1c2..0000000000
--- a/apps/keymaps/keymap-c100.c
+++ /dev/null
@@ -1,400 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (C) 2007 Mark Arigo
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-/* Button Code Definitions for Sandisk c100 target */
-
-#include "config.h"
-#include "action.h"
-#include "button.h"
-#include "settings.h"
-
-/* {Action Code, Button code, Prereq button code } */
-
-/*
- * The format of the list is as follows
- * { Action Code, Button code, Prereq button code }
- * if there's no need to check the previous button's value, use BUTTON_NONE
- * Insert LAST_ITEM_IN_LIST at the end of each mapping
- */
-static const struct button_mapping button_context_standard[] = {
- { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_standard */
-
-
-static const struct button_mapping button_context_wps[] = {
- { ACTION_WPS_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP },
- { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
-
- { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL,BUTTON_RIGHT|BUTTON_REPEAT },
-
- { ACTION_WPS_ABSETB_NEXTDIR,BUTTON_POWER|BUTTON_RIGHT, BUTTON_POWER },
- { ACTION_WPS_ABSETA_PREVDIR,BUTTON_POWER|BUTTON_LEFT, BUTTON_POWER },
- { ACTION_WPS_ABRESET, BUTTON_POWER|BUTTON_UP, BUTTON_POWER },
-
- { ACTION_WPS_MENU, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
- { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_WPS_PITCHSCREEN, BUTTON_SELECT|BUTTON_VOLUP, BUTTON_SELECT },
- { ACTION_WPS_ID3SCREEN, BUTTON_SELECT|BUTTON_VOLDOWN, BUTTON_SELECT },
- { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_WPS_HOTKEY, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE },
- { ACTION_WPS_QUICKSCREEN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_wps */
-
-static const struct button_mapping button_context_settings[] = {
- { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
- { ACTION_SETTINGS_RESET, BUTTON_SELECT, BUTTON_NONE },
- { ACTION_SETTINGS_INC, BUTTON_VOLUP, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT,BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_SETTINGS_DEC, BUTTON_VOLDOWN, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT,BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_settings */
-
-static const struct button_mapping button_context_list[] = {
-#ifdef HAVE_VOLUME_IN_LIST
- { ACTION_LIST_VOLUP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_LIST_VOLUP, BUTTON_VOLUP, BUTTON_NONE },
- { ACTION_LIST_VOLDOWN, BUTTON_VOLDOWN, BUTTON_NONE },
- { ACTION_LIST_VOLDOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
-#endif
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
-}; /* button_context_list */
-
-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_HOTKEY, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
-}; /* button_context_tree */
-
-static const struct button_mapping button_context_listtree_scroll_without_combo[] = {
- { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
-}; /* button_context_listtree_scroll_without_combo */
-
-static const struct button_mapping button_context_listtree_scroll_with_combo[] = {
-// { ACTION_TREE_PGLEFT, BUTTON_REC|BUTTON_LEFT, BUTTON_NONE },
-// { ACTION_TREE_ROOT_INIT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_REC|BUTTON_LEFT },
-// { ACTION_TREE_PGLEFT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-// { ACTION_TREE_PGRIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_NONE },
-// { ACTION_TREE_PGRIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
-}; /* button_context_listtree_scroll_with_combo */
-
-static const struct button_mapping button_context_yesno[] = {
- { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_settings_yesno */
-
-static const struct button_mapping button_context_quickscreen[] = {
- { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
- { ACTION_QS_TOP, BUTTON_UP|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_quickscreen */
-
-static const struct button_mapping button_context_settings_right_is_inc[] = {
- { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT,BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_settings_right_is_inc */
-
-static const struct button_mapping button_context_pitchscreen[] = {
- { ACTION_PS_INC_SMALL, BUTTON_VOLUP, BUTTON_NONE },
- { ACTION_PS_INC_BIG, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_DEC_SMALL, BUTTON_VOLDOWN, BUTTON_NONE },
- { ACTION_PS_DEC_BIG, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
- { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
- { ACTION_PS_RESET, BUTTON_SELECT, BUTTON_NONE },
- { ACTION_PS_EXIT, BUTTON_POWER, BUTTON_NONE },
- { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_pitchscreen */
-
-/** FM Radio Screen **/
-#if CONFIG_TUNER
-static const struct button_mapping button_context_radio[] = {
- { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_FM_MENU, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_FM_PRESET, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
- { ACTION_FM_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
- { ACTION_FM_MODE, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
- { ACTION_FM_EXIT, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE },
- { ACTION_FM_PLAY, BUTTON_UP|BUTTON_REL, BUTTON_UP },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
-}; /* button_context_radio */
-#endif
-
-static const struct button_mapping button_context_keyboard[] = {
- { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
-// { ACTION_KBD_CURSOR_LEFT, BUTTON_REC|BUTTON_LEFT, BUTTON_NONE },
-// { ACTION_KBD_CURSOR_LEFT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT,BUTTON_NONE },
-// { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_NONE },
-// { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
-
- { ACTION_KBD_UP, BUTTON_VOLUP, BUTTON_NONE },
- { ACTION_KBD_UP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_DOWN, BUTTON_VOLDOWN, BUTTON_NONE },
- { ACTION_KBD_DOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
-
-// { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_VOLDOWN, BUTTON_NONE },
-// { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_VOLDOWN|BUTTON_REPEAT,BUTTON_NONE },
-// { ACTION_KBD_PAGE_FLIP, BUTTON_REC|BUTTON_SELECT, BUTTON_REC },
-
- { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE },
- { ACTION_KBD_DONE, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_KBD_ABORT, BUTTON_POWER, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_keyboard */
-
-static const struct button_mapping button_context_bmark[] = {
-// { ACTION_BMS_DELETE, BUTTON_REC, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
-}; /* button_context_bmark */
-
-#ifdef USB_ENABLE_HID
-static const struct button_mapping button_context_usb_hid[] = {
- { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
- { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_usb_hid */
-
-static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
- { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOLUP, BUTTON_NONE },
- { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOLDOWN, BUTTON_NONE },
- { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_UP|BUTTON_REL, BUTTON_UP },
- { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
-}; /* button_context_usb_hid_mode_multimedia */
-
-static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
- { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_UP|BUTTON_REL, BUTTON_UP },
- { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
- { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
- { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOLUP, BUTTON_NONE },
- { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOLDOWN, BUTTON_NONE },
- { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
-}; /* button_context_usb_hid_mode_presentation */
-
-static const struct button_mapping button_context_usb_hid_mode_browser[] = {
- { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOLUP, BUTTON_NONE },
- { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOLDOWN, BUTTON_NONE },
- { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_UP|BUTTON_REL, BUTTON_UP },
- { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
- { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
- { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
- { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_UP|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_UP|BUTTON_DOWN },
- { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
- { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
- { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
-}; /* button_context_usb_hid_mode_browser */
-
-#ifdef HAVE_USB_HID_MOUSE
-static const struct button_mapping button_context_usb_hid_mode_mouse[] = {
- { ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_SELECT|BUTTON_UP, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_SELECT|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_POWER, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_POWER|BUTTON_UP, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_POWER|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_POWER|BUTTON_DOWN, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_POWER|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_POWER|BUTTON_LEFT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_POWER|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_POWER|BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_POWER|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOLUP, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOLDOWN, BUTTON_NONE },
- { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
-}; /* button_context_usb_hid_mode_mouse */
-#endif
-#endif
-
-/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
-const struct button_mapping* get_context_mapping(int context)
-{
- switch (context)
- {
- case CONTEXT_STD:
- return button_context_standard;
-
- 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
- return button_context_listtree_scroll_with_combo;
- case CONTEXT_CUSTOM|CONTEXT_TREE:
- return button_context_tree;
-
- case CONTEXT_SETTINGS:
- case CONTEXT_SETTINGS_TIME:
- return button_context_settings;
- case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
- case CONTEXT_SETTINGS_COLOURCHOOSER:
- case CONTEXT_SETTINGS_EQ:
- return button_context_settings_right_is_inc;
-
- case CONTEXT_YESNOSCREEN:
- return button_context_yesno;
-#if CONFIG_TUNER
- case CONTEXT_FM:
- return button_context_radio;
-#endif
- case CONTEXT_BOOKMARKSCREEN:
- return button_context_bmark;
- case CONTEXT_QUICKSCREEN:
- return button_context_quickscreen;
- case CONTEXT_PITCHSCREEN:
- return button_context_pitchscreen;
-#ifdef HAVE_RECORDING
- case CONTEXT_RECSCREEN:
- return button_context_recscreen;
-#endif
- case CONTEXT_KEYBOARD:
- return button_context_keyboard;
-#ifdef USB_ENABLE_HID
- case CONTEXT_USB_HID:
- return button_context_usb_hid;
- case CONTEXT_USB_HID_MODE_MULTIMEDIA:
- return button_context_usb_hid_mode_multimedia;
- case CONTEXT_USB_HID_MODE_PRESENTATION:
- return button_context_usb_hid_mode_presentation;
- case CONTEXT_USB_HID_MODE_BROWSER:
- return button_context_usb_hid_mode_browser;
-#ifdef HAVE_USB_HID_MOUSE
- case CONTEXT_USB_HID_MODE_MOUSE:
- return button_context_usb_hid_mode_mouse;
-#endif
-#endif
- default:
- return button_context_standard;
- }
- return button_context_standard;
-}
diff --git a/apps/keymaps/keymap-erosq.c b/apps/keymaps/keymap-erosq.c
index 71c9b39171..59b70d24ca 100644
--- a/apps/keymaps/keymap-erosq.c
+++ b/apps/keymaps/keymap-erosq.c
@@ -39,16 +39,11 @@ static const struct button_mapping button_context_standard[] = {
{ ACTION_STD_NEXT, BUTTON_NEXT, BUTTON_NONE },
{ ACTION_STD_NEXTREPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- { ACTION_STD_CANCEL, BUTTON_BACK|BUTTON_REL, BUTTON_BACK }, // release just because it feels better to use
+ { ACTION_STD_HOTKEY, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_STD_CANCEL, BUTTON_BACK|BUTTON_REL, BUTTON_BACK },
{ ACTION_STD_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
{ ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
- { ACTION_STD_KEYLOCK, BUTTON_POWER, BUTTON_NONE },
-
-/* ACTION_STD_QUICKSCREEN,
- * ACTION_STD_KEYLOCK
- * ACTION_STD_REC
- * ACTION_STD_HOTKEY
- */
+ { ACTION_STD_KEYLOCK, BUTTON_POWER|BUTTON_REL, BUTTON_NONE },
LAST_ITEM_IN_LIST
}; /* button_context_standard */
@@ -67,34 +62,32 @@ static const struct button_mapping button_context_wps[] = {
{ ACTION_WPS_STOPSEEK, BUTTON_PREV|BUTTON_REL, BUTTON_PREV|BUTTON_REPEAT },
{ ACTION_WPS_SKIPNEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
{ ACTION_WPS_SKIPPREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
- { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_WPS_QUICKSCREEN, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_WPS_HOTKEY, BUTTON_SCROLL_BACK, BUTTON_NONE },
+ { ACTION_WPS_HOTKEY, BUTTON_SCROLL_FWD, BUTTON_NONE },
{ ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
{ ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE },
{ ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
/* ACTION_WPS_ID3SCREEN optional */
{ ACTION_WPS_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
-// { ACTION_WPS_QUICKSCREEN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
{ ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, /* this should be the same as ACTION_STD_MENU */
/* ACTION_WPS_VIEW_PLAYLIST
* ACTION_WPS_LIST_BOOKMARKS, optional
* ACTION_WPS_CREATE_BOOKMARK, optional
*/
- { ACTION_STD_KEYLOCK, BUTTON_POWER, BUTTON_NONE },
+ { ACTION_STD_KEYLOCK, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
+ { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
LAST_ITEM_IN_LIST
}; /* button_context_wps */
static const struct button_mapping button_context_settings[] = {
{ ACTION_SETTINGS_INC, BUTTON_SCROLL_FWD, BUTTON_NONE },
-// { ACTION_SETTINGS_INCREPEAT, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_INCBIGSTEP, BUTTON_VOL_UP, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_SCROLL_BACK, BUTTON_NONE },
-// { ACTION_SETTINGS_DECREPEAT, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DECBIGSTEP, BUTTON_VOL_DOWN, BUTTON_NONE },
-/* ACTION_SETTINGS_DECBIGSTEP */
{ ACTION_SETTINGS_RESET, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
-/* ACTION_SETTINGS_SET, Used by touchscreen targets */
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
}; /* button_context_settings */
@@ -117,9 +110,9 @@ static const struct button_mapping button_context_tree[] = {
/*
{ ACTION_TREE_WPS, BUTTON_OPTION|BUTTON_REL, BUTTON_OPTION },
{ ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
- { ACTION_TREE_HOTKEY, BUTTON_HOME|BUTTON_REPEAT, BUTTON_HOME },
*/
- { ACTION_STD_MENU, BUTTON_MENU, BUTTON_MENU },
+ { ACTION_TREE_HOTKEY, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
+ { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
}; /* button_context_tree */
@@ -133,10 +126,10 @@ static const struct button_mapping button_context_yesno[] = {
static const struct button_mapping button_context_quickscreen[] = {
{ ACTION_QS_TOP, BUTTON_PREV|BUTTON_REL, BUTTON_NONE },
{ ACTION_QS_TOP, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_DOWN, BUTTON_SCROLL_FWD|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_SCROLL_BACK|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
+ { ACTION_QS_RIGHT, BUTTON_SCROLL_FWD, BUTTON_NONE },
+ { ACTION_QS_LEFT, BUTTON_SCROLL_BACK, BUTTON_NONE },
+ { ACTION_QS_DOWN, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE },
+ { ACTION_QS_DOWN, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_CANCEL, BUTTON_BACK, BUTTON_NONE },
LAST_ITEM_IN_LIST
@@ -150,12 +143,9 @@ static const struct button_mapping button_context_settings_time[] = {
{ ACTION_STD_CANCEL, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK },
{ ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
{ ACTION_SETTINGS_INC, BUTTON_SCROLL_FWD, BUTTON_NONE },
-// { ACTION_SETTINGS_INCREPEAT, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_SETTINGS_DEC, BUTTON_SCROLL_BACK, BUTTON_NONE },
-// { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
LAST_ITEM_IN_LIST
- //LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
}; /* button_context_settings_time */
static const struct button_mapping button_context_pitchscreen[] = {
@@ -164,9 +154,7 @@ static const struct button_mapping button_context_pitchscreen[] = {
{ ACTION_PS_DEC_SMALL, BUTTON_SCROLL_BACK, BUTTON_NONE },
{ ACTION_PS_DEC_BIG, BUTTON_VOL_DOWN, BUTTON_NONE },
{ ACTION_PS_NUDGE_LEFT, BUTTON_PREV, BUTTON_NONE },
-/* { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE }, */
{ ACTION_PS_NUDGE_RIGHT, BUTTON_NEXT, BUTTON_NONE },
-/* { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE }, */
{ ACTION_PS_TOGGLE_MODE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
{ ACTION_PS_RESET, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
{ ACTION_PS_EXIT, BUTTON_BACK, BUTTON_NONE },
diff --git a/apps/keymaps/keymap-fiiom3k.c b/apps/keymaps/keymap-fiiom3k.c
index e562443227..94d2dbc172 100644
--- a/apps/keymaps/keymap-fiiom3k.c
+++ b/apps/keymaps/keymap-fiiom3k.c
@@ -76,6 +76,16 @@ static const struct button_mapping button_context_wps[] = {
LAST_ITEM_IN_LIST
}; /* button_context_wps */
+static const struct button_mapping button_context_wps_locked[] = {
+ {ACTION_WPS_SKIPNEXT, BUTTON_VOL_UP|BUTTON_REL, BUTTON_PLAY|BUTTON_VOL_UP},
+ {ACTION_WPS_SEEKFWD, BUTTON_PLAY|BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE},
+ {ACTION_WPS_STOPSEEK, BUTTON_PLAY|BUTTON_VOL_UP|BUTTON_REL, BUTTON_PLAY|BUTTON_VOL_UP|BUTTON_REPEAT},
+ {ACTION_WPS_SKIPPREV, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_PLAY|BUTTON_VOL_DOWN},
+ {ACTION_WPS_SEEKBACK, BUTTON_PLAY|BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+ {ACTION_WPS_STOPSEEK, BUTTON_PLAY|BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_PLAY|BUTTON_VOL_DOWN|BUTTON_REPEAT},
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_WPS)
+}; /* button_context_wps_locked */
+
static const struct button_mapping button_context_tree[] = {
{ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY},
{ACTION_TREE_WPS, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK},
@@ -185,10 +195,74 @@ static const struct button_mapping button_context_keyboard[] = {
LAST_ITEM_IN_LIST
}; /* button_context_keyboard */
+static const struct button_mapping button_context_usb_hid[] = {
+ {ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_POWER, BUTTON_NONE},
+ LAST_ITEM_IN_LIST,
+}; /* button_context_usb_hid */
+
+static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
+ {ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP, BUTTON_NONE},
+ {ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE},
+ {ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE},
+ {ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+ {ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_VOL_DOWN|BUTTON_PLAY, BUTTON_NONE},
+ {ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY},
+ {ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY},
+ {ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT, BUTTON_NONE},
+ {ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT, BUTTON_NONE},
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_multimedia */
+
+static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
+ {ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY},
+ {ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY},
+ {ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT},
+ {ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT},
+ {ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT},
+ {ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT},
+ {ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_VOL_UP, BUTTON_NONE},
+ {ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_VOL_DOWN, BUTTON_NONE},
+ {ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_MENU, BUTTON_NONE},
+ {ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_BACK, BUTTON_NONE},
+ {ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT},
+ {ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT},
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_presentation */
+
+static const struct button_mapping button_context_usb_hid_mode_browser[] = {
+ {ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_SCROLL_BACK, BUTTON_NONE},
+ {ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_SCROLL_BACK|BUTTON_REPEAT, BUTTON_NONE},
+ {ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_SCROLL_FWD, BUTTON_NONE},
+ {ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_SCROLL_FWD|BUTTON_REPEAT, BUTTON_NONE},
+ {ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_DOWN, BUTTON_NONE},
+ {ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_UP, BUTTON_NONE},
+ {ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE},
+ {ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE},
+ {ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_VOL_UP, BUTTON_NONE},
+ {ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_VOL_DOWN, BUTTON_NONE},
+ {ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY},
+ {ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT},
+ {ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT},
+ {ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT},
+ {ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT},
+ {ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT},
+ {ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY},
+ LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
+}; /* button_context_usb_hid_mode_browser */
+
const struct button_mapping* get_context_mapping(int context)
{
switch (context)
{
+ case CONTEXT_WPS|CONTEXT_LOCKED:
+ return button_context_wps_locked;
+ default:
+ context &= ~CONTEXT_LOCKED;
+ break;
+ }
+
+ switch (context)
+ {
default:
case CONTEXT_STD:
return button_context_standard;
@@ -215,5 +289,13 @@ const struct button_mapping* get_context_mapping(int context)
return button_context_yesnoscreen;
case CONTEXT_KEYBOARD:
return button_context_keyboard;
+ case CONTEXT_USB_HID:
+ return button_context_usb_hid;
+ case CONTEXT_USB_HID_MODE_MULTIMEDIA:
+ return button_context_usb_hid_mode_multimedia;
+ case CONTEXT_USB_HID_MODE_PRESENTATION:
+ return button_context_usb_hid_mode_presentation;
+ case CONTEXT_USB_HID_MODE_BROWSER:
+ return button_context_usb_hid_mode_browser;
}
}
diff --git a/apps/keymaps/keymap-iaudio67.c b/apps/keymaps/keymap-iaudio67.c
deleted file mode 100644
index 5c62a73dd0..0000000000
--- a/apps/keymaps/keymap-iaudio67.c
+++ /dev/null
@@ -1,330 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (C) 2007 Mark Arigo
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-/* Button Code Definitions for Iaudio[67] target */
-
-#include "config.h"
-#include "action.h"
-#include "button.h"
-#include "settings.h"
-
-/* {Action Code, Button code, Prereq button code } */
-
-/*
- * The format of the list is as follows
- * { Action Code, Button code, Prereq button code }
- * if there's no need to check the previous button's value, use BUTTON_NONE
- * Insert LAST_ITEM_IN_LIST at the end of each mapping
- */
-static const struct button_mapping button_context_standard[] = {
- { ACTION_STD_PREV, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_STD_NEXT, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_STOP|BUTTON_REL, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
-
- { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
- { ACTION_STD_CONTEXT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
-// { ACTION_STD_QUICKSCREEN, BUTTON_REC|BUTTON_PLAY, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_standard */
-
-
-static const struct button_mapping button_context_wps[] = {
-
- { ACTION_WPS_VOLDOWN, BUTTON_VOLDOWN, BUTTON_NONE },
- { ACTION_WPS_VOLDOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_VOLUP, BUTTON_VOLUP, BUTTON_NONE },
- { ACTION_WPS_VOLUP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
- { ACTION_WPS_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
-
- { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
-
- { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
-
- { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
-#ifdef HAVE_HOTKEY
- { ACTION_WPS_HOTKEY, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
-#else
- { ACTION_WPS_VIEW_PLAYLIST, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
-#endif
- { ACTION_WPS_STOP, BUTTON_STOP, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_wps */
-
-static const struct button_mapping button_context_settings[] = {
- { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE },
-// { ACTION_SETTINGS_RESET, BUTTON_PLAY, BUTTON_NONE },
-
- { ACTION_SETTINGS_INC, BUTTON_VOLUP|BUTTON_REL, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT,BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_SETTINGS_DEC, BUTTON_VOLDOWN|BUTTON_REL, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT,BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_STD_PREV, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_STD_NEXT, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_settings */
-
-static const struct button_mapping button_context_list[] = {
-#ifdef HAVE_VOLUME_IN_LIST
- { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_NONE },
-
- { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_NONE },
- { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
-#endif
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
-}; /* button_context_list */
-
-static const struct button_mapping button_context_tree[] = {
- // { ACTION_TREE_WPS, BUTTON_REC|BUTTON_VOLUP, BUTTON_REC },
- // { ACTION_TREE_STOP, BUTTON_REC|BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_REC|BUTTON_VOLUP },
-#ifdef HAVE_HOTKEY
- // { ACTION_TREE_HOTKEY, BUTTON_NONE, BUTTON_NONE },
-#endif
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
-}; /* button_context_tree */
-
-static const struct button_mapping button_context_listtree_scroll_without_combo[] = {
-#if 0
- { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-#endif
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
-}; /* button_context_listtree_scroll_without_combo */
-
-static const struct button_mapping button_context_listtree_scroll_with_combo[] = {
-// { ACTION_TREE_PGLEFT, BUTTON_REC|BUTTON_LEFT, BUTTON_NONE },
-// { ACTION_TREE_ROOT_INIT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_REC|BUTTON_LEFT },
-// { ACTION_TREE_PGLEFT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-// { ACTION_TREE_PGRIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_NONE },
-// { ACTION_TREE_PGRIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
-}; /* button_context_listtree_scroll_with_combo */
-
-static const struct button_mapping button_context_yesno[] = {
-// { ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_settings_yesno */
-
-static const struct button_mapping button_context_quickscreen[] = {
-#if 0
- { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REL, BUTTON_NONE },
-
- { ACTION_QS_TOP, BUTTON_VOLUP|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_TOP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_QS_DOWN, BUTTON_VOLDOWN|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_DOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-#endif
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_quickscreen */
-
-static const struct button_mapping button_context_settings_right_is_inc[] = {
-#if 0
- { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT,BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE },
-#endif
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_settings_right_is_inc */
-
-static const struct button_mapping button_context_pitchscreen[] = {
-#if 0
- { ACTION_PS_INC_SMALL, BUTTON_VOLUP, BUTTON_NONE },
- { ACTION_PS_INC_BIG, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_PS_DEC_SMALL, BUTTON_VOLDOWN, BUTTON_NONE },
- { ACTION_PS_DEC_BIG, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
-
- { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
-
- { ACTION_PS_RESET, BUTTON_PLAY, BUTTON_NONE },
- { ACTION_PS_EXIT, BUTTON_MENU, BUTTON_NONE },
-
- { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
-#endif
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_pitchscreen */
-
-/** Recording Screen **/
-#ifdef HAVE_RECORDING
-static const struct button_mapping button_context_recscreen[] = {
- { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
- { ACTION_REC_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- { ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
-// { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC },
-
- { ACTION_SETTINGS_INC, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_SETTINGS_DEC, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT,BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
-}; /* button_context_recscreen */
-#endif
-
-/** FM Radio Screen **/
-#if CONFIG_TUNER
-static const struct button_mapping button_context_radio[] = {
- { ACTION_FM_MENU, BUTTON_MENU | BUTTON_REL, BUTTON_MENU },
- { ACTION_FM_MODE, BUTTON_MENU | BUTTON_REPEAT, BUTTON_MENU },
- { ACTION_FM_PRESET, BUTTON_STOP, BUTTON_NONE },
- { ACTION_FM_PLAY, BUTTON_PLAY | BUTTON_REL, BUTTON_NONE },
- { ACTION_FM_STOP, BUTTON_PLAY | BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_FM_EXIT, BUTTON_POWER, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
-}; /* button_context_radio */
-#endif
-
-static const struct button_mapping button_context_keyboard[] = {
- { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
- { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
- { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
-// { ACTION_KBD_CURSOR_LEFT, BUTTON_REC|BUTTON_LEFT, BUTTON_NONE },
-// { ACTION_KBD_CURSOR_LEFT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT,BUTTON_NONE },
-// { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_NONE },
-// { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
-
- { ACTION_KBD_UP, BUTTON_VOLUP|BUTTON_REL, BUTTON_NONE },
- { ACTION_KBD_UP, BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_DOWN, BUTTON_VOLDOWN|BUTTON_REL, BUTTON_NONE },
- { ACTION_KBD_DOWN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_NONE },
-
-// { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_VOLDOWN, BUTTON_NONE },
-// { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_VOLDOWN|BUTTON_REPEAT,BUTTON_NONE },
-
-// { ACTION_KBD_PAGE_FLIP, BUTTON_REC|BUTTON_PLAY, BUTTON_REC },
-
- { ACTION_KBD_SELECT, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE },
- { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
- { ACTION_KBD_ABORT, BUTTON_MENU|BUTTON_REL, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_keyboard */
-
-static const struct button_mapping button_context_bmark[] = {
-// { ACTION_BMS_DELETE, BUTTON_REC, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
-}; /* button_context_bmark */
-
-/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
-const struct button_mapping* get_context_mapping(int context)
-{
- switch (context)
- {
- case CONTEXT_STD:
- return button_context_standard;
- 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
- return button_context_listtree_scroll_with_combo;
- case CONTEXT_CUSTOM|CONTEXT_TREE:
- return button_context_tree;
-
- case CONTEXT_SETTINGS:
- case CONTEXT_SETTINGS_TIME:
- return button_context_settings;
- case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
- case CONTEXT_SETTINGS_COLOURCHOOSER:
- case CONTEXT_SETTINGS_EQ:
- return button_context_settings_right_is_inc;
-
- case CONTEXT_YESNOSCREEN:
- return button_context_yesno;
-#if CONFIG_TUNER
- case CONTEXT_FM:
- return button_context_radio;
-#endif
- case CONTEXT_BOOKMARKSCREEN:
- return button_context_bmark;
- case CONTEXT_QUICKSCREEN:
- return button_context_quickscreen;
- case CONTEXT_PITCHSCREEN:
- return button_context_pitchscreen;
-#ifdef HAVE_RECORDING
- case CONTEXT_RECSCREEN:
- return button_context_recscreen;
-#endif
- case CONTEXT_KEYBOARD:
- return button_context_keyboard;
-
- default:
- return button_context_standard;
- }
-
- return button_context_standard;
-}
diff --git a/apps/keymaps/keymap-ifp7xx.c b/apps/keymaps/keymap-ifp7xx.c
deleted file mode 100644
index c89b60e747..0000000000
--- a/apps/keymaps/keymap-ifp7xx.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (C) 2006 Tomasz Malesinski
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-
-/* Button Code Definitions for iriver iFP7xx target */
-
-#include "config.h"
-#include "action.h"
-#include "button.h"
-
-/*
- * The format of the list is as follows
- * { Action Code, Button code, Prereq button code }
- * if there's no need to check the previous button's value, use BUTTON_NONE
- * Insert LAST_ITEM_IN_LIST at the end of each mapping
- */
-static const struct button_mapping button_context_standard[] = {
- { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_PLAY, BUTTON_NONE },
- { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT },
-
- { ACTION_STD_QUICKSCREEN, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
- { ACTION_STD_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
- { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_standard */
-
-static const struct button_mapping button_context_wps[] = {
- { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
- { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
- { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
- { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_PLAY|BUTTON_RIGHT, BUTTON_PLAY },
- { ACTION_WPS_ABSETA_PREVDIR, BUTTON_PLAY|BUTTON_LEFT, BUTTON_PLAY },
- { ACTION_WPS_STOP, BUTTON_EQ, BUTTON_NONE },
- { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
- { ACTION_WPS_QUICKSCREEN, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
- { ACTION_WPS_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
- { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_WPS_ABRESET, BUTTON_PLAY|BUTTON_SELECT, BUTTON_PLAY },
- { ACTION_WPS_HOTKEY, BUTTON_PLAY|BUTTON_MODE, BUTTON_PLAY },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_wps */
-
-static const struct button_mapping button_context_settings[] = {
- { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
-}; /* button_context_settings */
-
-static const struct button_mapping button_context_settings_r_is_inc[] = {
- { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
-}; /* button_context_settingsgraphical */
-
-static const struct button_mapping button_context_yesno[] = {
- { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE },
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
-}; /* button_context_settings_yesno */
-
-static const struct button_mapping button_context_bmark[] = {
- { ACTION_BMS_DELETE, BUTTON_MODE, BUTTON_NONE },
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
-}; /* button_context_settings_bmark */
-
-static const struct button_mapping button_context_quickscreen[] = {
- { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE },
- { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
-}; /* button_context_quickscreen */
-
-static const struct button_mapping button_context_pitchscreen[] = {
- { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
- { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
- { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
- { ACTION_PS_RESET, BUTTON_MODE, BUTTON_NONE },
- { ACTION_PS_EXIT, BUTTON_PLAY, BUTTON_NONE },
- { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
-}; /* button_context_pitchcreen */
-
-static const struct button_mapping button_context_keyboard[] = {
- { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_KBD_DONE, BUTTON_MODE, BUTTON_NONE },
- { ACTION_KBD_ABORT, BUTTON_PLAY, BUTTON_NONE },
- { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
- { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_keyboard */
-
-/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
-const struct button_mapping* get_context_mapping(int context)
-{
- switch (context)
- {
- case CONTEXT_STD:
- return button_context_standard;
- case CONTEXT_WPS:
- return button_context_wps;
- case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
- case CONTEXT_SETTINGS_EQ:
- case CONTEXT_SETTINGS_COLOURCHOOSER:
- case CONTEXT_SETTINGS_TIME:
- return button_context_settings_r_is_inc;
- case CONTEXT_SETTINGS:
- return button_context_settings;
- case CONTEXT_YESNOSCREEN:
- return button_context_yesno;
- case CONTEXT_BOOKMARKSCREEN:
- return button_context_bmark;
- case CONTEXT_QUICKSCREEN:
- return button_context_quickscreen;
- case CONTEXT_PITCHSCREEN:
- return button_context_pitchscreen;
- case CONTEXT_KEYBOARD:
- return button_context_keyboard;
- }
- return button_context_standard;
-}
diff --git a/apps/keymaps/keymap-logikdax.c b/apps/keymaps/keymap-logikdax.c
deleted file mode 100644
index 20c23031ef..0000000000
--- a/apps/keymaps/keymap-logikdax.c
+++ /dev/null
@@ -1,318 +0,0 @@
-/***************************************************************************
- * __________ __ ___.
- * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- * \/ \/ \/ \/ \/
- * $Id$
- *
- * Copyright (C) 2008 Dave Chapman
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- ****************************************************************************/
-/* Button Code Definitions for Sandisk c200 target */
-
-#include "config.h"
-#include "action.h"
-#include "button.h"
-#include "settings.h"
-
-/* {Action Code, Button code, Prereq button code } */
-
-/*
- * The format of the list is as follows
- * { Action Code, Button code, Prereq button code }
- * if there's no need to check the previous button's value, use BUTTON_NONE
- * Insert LAST_ITEM_IN_LIST at the end of each mapping
- */
-static const struct button_mapping button_context_standard[] = {
- { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
-
- { ACTION_STD_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
- { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
-// { ACTION_STD_QUICKSCREEN, BUTTON_REC|BUTTON_SELECT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_standard */
-
-
-static const struct button_mapping button_context_wps[] = {
- { ACTION_WPS_PLAY, BUTTON_POWERPLAY|BUTTON_REL, BUTTON_POWERPLAY },
- { ACTION_WPS_STOP, BUTTON_POWERPLAY|BUTTON_REPEAT, BUTTON_POWERPLAY },
-
- { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
-
- { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
-
- { ACTION_WPS_ABSETB_NEXTDIR,BUTTON_MODE|BUTTON_RIGHT, BUTTON_MODE },
- { ACTION_WPS_ABSETA_PREVDIR,BUTTON_MODE|BUTTON_LEFT, BUTTON_MODE },
- { ACTION_WPS_ABRESET, BUTTON_MODE|BUTTON_UP, BUTTON_MODE },
-
- { ACTION_WPS_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
- { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
-#if 0
- { ACTION_WPS_PITCHSCREEN, BUTTON_SELECT|BUTTON_UP, BUTTON_SELECT },
- { ACTION_WPS_ID3SCREEN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_SELECT },
- { ACTION_WPS_CONTEXT, BUTTON_VOLDOWN|BUTTON_REL, BUTTON_VOLDOWN },
- { ACTION_WPS_QUICKSCREEN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_VOLDOWN },
-#endif
-
- LAST_ITEM_IN_LIST
-}; /* button_context_wps */
-
-static const struct button_mapping button_context_settings[] = {
- { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
- { ACTION_SETTINGS_RESET, BUTTON_SELECT, BUTTON_NONE },
-
- { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
- { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_settings */
-
-static const struct button_mapping button_context_list[] = {
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
-}; /* button_context_list */
-
-static const struct button_mapping button_context_tree[] = {
- // { ACTION_TREE_WPS, BUTTON_REC|BUTTON_VOLUP, BUTTON_REC },
- // { ACTION_TREE_STOP, BUTTON_REC|BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_REC|BUTTON_VOLUP },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
-}; /* button_context_tree */
-
-static const struct button_mapping button_context_listtree_scroll_without_combo[] = {
- { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
- { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
- { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
- { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
-}; /* button_context_listtree_scroll_without_combo */
-
-static const struct button_mapping button_context_listtree_scroll_with_combo[] = {
-// { ACTION_TREE_PGLEFT, BUTTON_REC|BUTTON_LEFT, BUTTON_NONE },
-// { ACTION_TREE_ROOT_INIT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_REC|BUTTON_LEFT },
-// { ACTION_TREE_PGLEFT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-// { ACTION_TREE_PGRIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_NONE },
-// { ACTION_TREE_PGRIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
-}; /* button_context_listtree_scroll_with_combo */
-
-static const struct button_mapping button_context_yesno[] = {
- { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_settings_yesno */
-
-static const struct button_mapping button_context_quickscreen[] = {
- { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_STD_CANCEL, BUTTON_MODE|BUTTON_REL, BUTTON_NONE },
-
- { ACTION_QS_TOP, BUTTON_UP|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
- { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_quickscreen */
-
-static const struct button_mapping button_context_settings_right_is_inc[] = {
- { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT,BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_STD_CANCEL, BUTTON_MODE, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_settings_right_is_inc */
-
-static const struct button_mapping button_context_pitchscreen[] = {
- { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
- { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
-
- { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
-
- { ACTION_PS_RESET, BUTTON_SELECT, BUTTON_NONE },
- { ACTION_PS_EXIT, BUTTON_MODE, BUTTON_NONE },
-
- { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
-}; /* button_context_pitchscreen */
-
-/** Recording Screen **/
-#ifdef HAVE_RECORDING
-static const struct button_mapping button_context_recscreen[] = {
- { ACTION_STD_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
- { ACTION_REC_PAUSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
- { ACTION_STD_CANCEL, BUTTON_MODE|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC },
-
- { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT,BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
-}; /* button_context_recscreen */
-#endif
-
-/** FM Radio Screen **/
-#if CONFIG_TUNER
-static const struct button_mapping button_context_radio[] = {
- { ACTION_NONE, BUTTON_UP, BUTTON_NONE },
- { ACTION_FM_MENU, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_FM_PRESET, BUTTON_SELECT, BUTTON_NONE },
- { ACTION_FM_STOP, BUTTON_POWERPLAY|BUTTON_REPEAT, BUTTON_POWERPLAY },
- { ACTION_FM_MODE, BUTTON_REC, BUTTON_NONE },
- { ACTION_FM_EXIT, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
- { ACTION_FM_PLAY, BUTTON_POWERPLAY|BUTTON_REL, BUTTON_POWERPLAY },
- { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
- { ACTION_SETTINGS_INCREPEAT,BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_SETTINGS_DECREPEAT,BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
-}; /* button_context_radio */
-#endif
-
-static const struct button_mapping button_context_keyboard[] = {
- { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
-
-// { ACTION_KBD_CURSOR_LEFT, BUTTON_REC|BUTTON_LEFT, BUTTON_NONE },
-// { ACTION_KBD_CURSOR_LEFT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT,BUTTON_NONE },
-// { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_NONE },
-// { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
-
- { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
- { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
- { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
- { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
-
-// { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_VOLDOWN, BUTTON_NONE },
-// { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_VOLDOWN|BUTTON_REPEAT,BUTTON_NONE },
-
-// { ACTION_KBD_PAGE_FLIP, BUTTON_REC|BUTTON_SELECT, BUTTON_REC },
-
- { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE },
- { ACTION_KBD_DONE, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
- { ACTION_KBD_ABORT, BUTTON_MODE, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST
-}; /* button_context_keyboard */
-
-static const struct button_mapping button_context_bmark[] = {
-// { ACTION_BMS_DELETE, BUTTON_REC, BUTTON_NONE },
-
- LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
-}; /* button_context_bmark */
-
-/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
-const struct button_mapping* get_context_mapping(int context)
-{
- switch (context)
- {
- case CONTEXT_STD:
- return button_context_standard;
-
- 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
- return button_context_listtree_scroll_with_combo;
- case CONTEXT_CUSTOM|CONTEXT_TREE:
- return button_context_tree;
-
- case CONTEXT_SETTINGS:
- case CONTEXT_SETTINGS_TIME:
- return button_context_settings;
- case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
- case CONTEXT_SETTINGS_COLOURCHOOSER:
- case CONTEXT_SETTINGS_EQ:
- return button_context_settings_right_is_inc;
-
- case CONTEXT_YESNOSCREEN:
- return button_context_yesno;
-#if CONFIG_TUNER
- case CONTEXT_FM:
- return button_context_radio;
-#endif
- case CONTEXT_BOOKMARKSCREEN:
- return button_context_bmark;
- case CONTEXT_QUICKSCREEN:
- return button_context_quickscreen;
- case CONTEXT_PITCHSCREEN:
- return button_context_pitchscreen;
-#ifdef HAVE_RECORDING
- case CONTEXT_RECSCREEN:
- return button_context_recscreen;
-#endif
- case CONTEXT_KEYBOARD:
- return button_context_keyboard;
-
- default:
- return button_context_standard;
- }
- return button_context_standard;
-}
diff --git a/apps/lang/english-us.lang b/apps/lang/english-us.lang
index 8ddf4a82d0..9439236b9c 100644
--- a/apps/lang/english-us.lang
+++ b/apps/lang/english-us.lang
@@ -5992,12 +5992,10 @@
<source>
*: "Battery: %d%% %dh %dm"
ipodmini1g,ipodmini2g,iriverh10: "Batt: %d%% %dh %dm"
- iriverifp7xx: "%d%% %dh %dm"
</source>
<dest>
*: "Battery: %d%% %dh %dm"
ipodmini1g,ipodmini2g,iriverh10: "Batt: %d%% %dh %dm"
- iriverifp7xx: "%d%% %dh %dm"
</dest>
<voice>
*: "Battery level"
@@ -15080,7 +15078,7 @@
<source>
*: "Press LEFT to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
iriverh10,samsungyh*: "Double tap LEFT to cancel."
@@ -15095,7 +15093,7 @@
<dest>
*: "Press LEFT to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
iriverh10,samsungyh*: "Double tap LEFT to cancel."
@@ -15110,7 +15108,7 @@
<voice>
*: "Press LEFT to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
iriverh10,samsungyh*: "Double tap LEFT to cancel."
@@ -15704,3 +15702,17 @@
*: "Always Autolock"
</voice>
</phrase>
+<phrase>
+ id: LANG_PLAYLIST_RELOAD_AFTER_SAVE
+ desc: reload playlist after saving
+ user: core
+ <source>
+ *: "Reload After Saving"
+ </source>
+ <dest>
+ *: "Reload After Saving"
+ </dest>
+ <voice>
+ *: "Reload After Saving"
+ </voice>
+</phrase>
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 9ca4c84430..4cbc6f30f6 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -57,7 +57,6 @@
# H120/H140 iriverh120
# H320/H340 iriverh300
# H10 iriverh10
-# IFP 7XX iriverifp7xx
# iaudio/Cowon
# X5 iaudiox5
# M5 iaudiom5
@@ -6069,12 +6068,10 @@
<source>
*: "Battery: %d%% %dh %dm"
ipodmini1g,ipodmini2g,iriverh10: "Batt: %d%% %dh %dm"
- iriverifp7xx: "%d%% %dh %dm"
</source>
<dest>
*: "Battery: %d%% %dh %dm"
ipodmini1g,ipodmini2g,iriverh10: "Batt: %d%% %dh %dm"
- iriverifp7xx: "%d%% %dh %dm"
</dest>
<voice>
*: "Battery level"
@@ -15239,7 +15236,7 @@
<source>
*: "Press LEFT to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
iriverh10,samsungyh*: "Double tap LEFT to cancel."
@@ -15254,7 +15251,7 @@
<dest>
*: "Press LEFT to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
iriverh10,samsungyh*: "Double tap LEFT to cancel."
@@ -15269,7 +15266,7 @@
<voice>
*: "Press LEFT to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
iriverh10,samsungyh*: "Double tap LEFT to cancel."
@@ -15781,3 +15778,17 @@
*: "Always Autolock"
</voice>
</phrase>
+<phrase>
+ id: LANG_PLAYLIST_RELOAD_AFTER_SAVE
+ desc: reload playlist after saving
+ user: core
+ <source>
+ *: "Reload After Saving"
+ </source>
+ <dest>
+ *: "Reload After Saving"
+ </dest>
+ <voice>
+ *: "Reload After Saving"
+ </voice>
+</phrase>
diff --git a/apps/lang/italiano.lang b/apps/lang/italiano.lang
index dc8cd4be1d..559b53127d 100644
--- a/apps/lang/italiano.lang
+++ b/apps/lang/italiano.lang
@@ -15031,7 +15031,7 @@
<source>
*: "Press LEFT to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
iriverh10,samsungyh*: "Double tap LEFT to cancel."
@@ -15046,7 +15046,7 @@
<dest>
*: "Premere LEFT per annullare."
android,hifietma*,zenvision: "Premere BACK per annullare."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Premere POWER per annullare."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Premere POWER per annullare."
ihifi760,ihifi960: "Premere due volte RETURN per annullare."
ihifi770,ihifi770c,ihifi800: "Premere HOME per annullare."
iriverh10,samsungyh*: "Premere due volte LEFT per annullare."
@@ -15061,7 +15061,7 @@
<voice>
*: "Premere LEFT per annullare."
android,hifietma*,zenvision: "Premere BACK per annullare."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Premere POWER per annullare."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Premere POWER per annullare."
ihifi760,ihifi960: "Premere due volte RETURN per annullare."
ihifi770,ihifi770c,ihifi800: "Premere HOME per annullare."
iriverh10,samsungyh*: "Premere due volte LEFT per annullare."
diff --git a/apps/lang/nederlands.lang b/apps/lang/nederlands.lang
index a6a68ed1e6..3e7abc613d 100644
--- a/apps/lang/nederlands.lang
+++ b/apps/lang/nederlands.lang
@@ -15104,7 +15104,7 @@
<source>
*: "Press LEFT to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
iriverh10,samsungyh*: "Double tap LEFT to cancel."
@@ -15120,7 +15120,7 @@
*: "Druk op LINKS om te annuleren."
android: "Druk op RECHTS om te annuleren."
hifietma*,zenvision: "Druk op BACK om te annuleren."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Druk op POWER om te annuleren."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Druk op POWER om te annuleren."
ihifi760,ihifi960: "Dubbeltik op RETURN om te annuleren."
ihifi770,ihifi770c,ihifi800: "Druk op HOME om te annuleren."
iriverh10,samsungyh*: "Dubbeltik op LINKS om te annuleren."
@@ -15136,7 +15136,7 @@
*: "Druk op LINKS om te annuleren."
android: "Druk op RECHTS om te annuleren."
hifietma*,zenvision: "Druk op BACK om te annuleren."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Druk op POWER om te annuleren."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Druk op POWER om te annuleren."
ihifi760,ihifi960: "Dubbeltik op RETURN om te annuleren."
ihifi770,ihifi770c,ihifi800: "Druk op HOME om te annuleren."
iriverh10,samsungyh*: "Dubbeltik op LINKS om te annuleren."
diff --git a/apps/lang/polski.lang b/apps/lang/polski.lang
index 6832ccdc87..ea426691a7 100644
--- a/apps/lang/polski.lang
+++ b/apps/lang/polski.lang
@@ -6001,12 +6001,10 @@
<source>
*: "Battery: %d%% %dh %dm"
ipodmini1g,ipodmini2g,iriverh10: "Batt: %d%% %dh %dm"
- iriverifp7xx: "%d%% %dh %dm"
</source>
<dest>
*: "Bateria: %d%% %dh %dm"
ipodmini1g,ipodmini2g,iriverh10: "Bateria: %d%% %dh %dm"
- iriverifp7xx: "%d%% %dh %dm"
</dest>
<voice>
*: "Poziom baterii"
@@ -9620,15 +9618,15 @@
user: core
<source>
*: none
- gigabeatfx,sansafuzeplus: "Touchpad Sensitivity"
+ fiiom3k,gigabeatfx,sansafuzeplus: "Touchpad Sensitivity"
</source>
<dest>
*: none
- gigabeatfx,sansafuzeplus: "Czułość panelu dotykowego"
+ fiiom3k,gigabeatfx,sansafuzeplus: "Czułość panelu dotykowego"
</dest>
<voice>
*: none
- gigabeatfx,sansafuzeplus: "Czułość panelu dotykowego"
+ fiiom3k,gigabeatfx,sansafuzeplus: "Czułość panelu dotykowego"
</voice>
</phrase>
<phrase>
@@ -15038,7 +15036,7 @@
<source>
*: "Press LEFT to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
iriverh10,samsungyh*: "Double tap LEFT to cancel."
@@ -15053,7 +15051,7 @@
<dest>
*: "Wciśnij LEFT, aby anulować."
android,hifietma*,zenvision: "Wciśnij BACK, aby anulować."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Wciśnij POWER, aby anulować."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Wciśnij POWER, aby anulować."
ihifi760,ihifi960: "Podwójnie stuknij RETURN, aby anulować."
ihifi770,ihifi770c,ihifi800: "Wciśnij HOME, aby anulować."
iriverh10,samsungyh*: "Podwójnie stuknij LEFT, aby anulować."
@@ -15068,7 +15066,7 @@
<voice>
*: "Wciśnij left, aby anulować."
android,hifietma*,zenvision: "Wciśnij bak, aby anulować."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Wciśnij pałer, aby anulować."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Wciśnij pałer, aby anulować."
ihifi760,ihifi960: "Podwójnie stuknij ritern, aby anulować."
ihifi770,ihifi770c,ihifi800: "Wciśnij hołm, aby anulować."
iriverh10,samsungyh*: "Podwójnie stuknij left, aby anulować."
@@ -15699,3 +15697,31 @@
*: "Zwolnij głośność"
</voice>
</phrase>
+<phrase>
+ id: LANG_ACTION_ALWAYSAUTOLOCK
+ desc: always prime autolock
+ user: core
+ <source>
+ *: "Always Autolock"
+ </source>
+ <dest>
+ *: "Zawsze automatycznie blokuj"
+ </dest>
+ <voice>
+ *: "Zawsze automatycznie blokuj"
+ </voice>
+</phrase>
+<phrase>
+ id: LANG_PLAYLIST_RELOAD_AFTER_SAVE
+ desc: reload playlist after saving
+ user: core
+ <source>
+ *: "Reload After Saving"
+ </source>
+ <dest>
+ *: "Załaduj ponownie po zapisaniu"
+ </dest>
+ <voice>
+ *: "Załaduj ponownie po zapisaniu"
+ </voice>
+</phrase>
diff --git a/apps/lang/russian.lang b/apps/lang/russian.lang
index 6364c71c0b..9d71ad819c 100644
--- a/apps/lang/russian.lang
+++ b/apps/lang/russian.lang
@@ -15161,7 +15161,7 @@
<source>
*: "Press LEFT to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
iriverh10,samsungyh*: "Double tap LEFT to cancel."
@@ -15176,7 +15176,7 @@
<dest>
*: "Нажмите ВЛЕВО для отмены."
android,hifietma*,zenvision: "Нажмите НАЗАД для отмены."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Нажмите ВКЛ. для отмены."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Нажмите ВКЛ. для отмены."
ihifi760,ihifi960: "Дважды нажмите ВОЗВРАТ для отмены."
ihifi770,ihifi770c,ihifi800: "Нажмите ДОМОЙ для отмены."
iriverh10,samsungyh*: "Дважды нажмите ВЛЕВО для отмены."
@@ -15191,7 +15191,7 @@
<voice>
*: "Нажмите кнопку Влево для отмены."
android,hifietma*,zenvision: "Нажмите кнопку Назад для отмены."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Нажмите кнопку включения для отмены."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Нажмите кнопку включения для отмены."
ihifi760,ihifi960: "Дважды нажмите кнопку Назад для отмены."
ihifi770,ihifi770c,ihifi800: "Нажмите кнопку Домой для отмены."
iriverh10,samsungyh*: "Дважды нажмите кнопку Влево для отмены."
diff --git a/apps/lang/slovak.lang b/apps/lang/slovak.lang
index 65015a5990..00f98ecd35 100644
--- a/apps/lang/slovak.lang
+++ b/apps/lang/slovak.lang
@@ -15056,7 +15056,7 @@
<source>
*: "Press LEFT to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
iriverh10,samsungyh*: "Double tap LEFT to cancel."
@@ -15071,7 +15071,7 @@
<dest>
*: "Stlačte LEFT pre zrušenie"
android: "Stlačte späť pre zrušenie"
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Stlačte POWER pre zrušenie"
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Stlačte POWER pre zrušenie"
hifietma*,zenvision: "Stlačte BACK Pre zrušenie"
ihifi760,ihifi960: "Poklepte RETURN pre zrušenie"
ihifi770,ihifi770c,ihifi800: "Stlačte HOME pre zrušenie"
@@ -15087,7 +15087,7 @@
<voice>
*: "Stlačte LEFT pre zrušenie"
android: "Stlačte späť pre zrušenie"
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Stlačte POWER pre zrušenie"
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Stlačte POWER pre zrušenie"
hifietma*,zenvision: "Stlačte BACK Pre zrušenie"
ihifi760,ihifi960: "Poklepte RETURN pre zrušenie"
ihifi770,ihifi770c,ihifi800: "Stlačte HOME pre zrušenie"
diff --git a/apps/lang/srpski.lang b/apps/lang/srpski.lang
index db93124c8f..95063ca0c0 100644
--- a/apps/lang/srpski.lang
+++ b/apps/lang/srpski.lang
@@ -15318,7 +15318,7 @@
<source>
*: "Press LEFT to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
iriverh10,samsungyh*: "Double tap LEFT to cancel."
@@ -15333,7 +15333,7 @@
<dest>
*: "Притисните LEFT за прекид."
android,hifietma*,zenvision: "Притисните BACK за прекид."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Притисните POWER за прекид."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Притисните POWER за прекид."
ihifi760,ihifi960: "Дупли тап RETURN за прекид."
ihifi770,ihifi770c,ihifi800: "Притисните HOME за прекид."
iriverh10,samsungyh*: "Дупли тап LEFT за прекид."
@@ -15348,7 +15348,7 @@
<voice>
*: "Притисните LEFT за прекид."
android,hifietma*,zenvision: "Притисните BACK за прекид."
- cowond2,creativezenxfi2,iaudio7,ibassodx50,ibassodx90,mrobe500,ondavx747: "Притисните POWER за прекид."
+ cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Притисните POWER за прекид."
ihifi760,ihifi960: "Дупли тап RETURN за прекид."
ihifi770,ihifi770c,ihifi800: "Притисните HOME за прекид."
iriverh10,samsungyh*: "Дупли тап LEFT за прекид."
diff --git a/apps/main.c b/apps/main.c
index 3c549a8e63..c7b223faea 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -321,10 +321,6 @@ static void init(void)
global_status.font_id[i] = FONT_SYSFIXED;
font_init();
show_logo();
-#ifndef USB_NONE
- usb_init();
- usb_start_monitoring();
-#endif
button_init();
powermgmt_init();
backlight_init();
@@ -374,6 +370,13 @@ static void init(void)
audio_init();
talk_announce_voice_invalid(); /* notify user w/ voice prompt if voice file invalid */
settings_apply_skins();
+
+/* do USB last so prompt (if enabled) can work correctly if USB was inserted with device off,
+ * also doesn't hurt that it will display the nice pretty backdrop this way too. */
+#ifndef USB_NONE
+ usb_init();
+ usb_start_monitoring();
+#endif
}
#else /* CONFIG_PLATFORM & PLATFORM_HOSTED */
diff --git a/apps/menu.c b/apps/menu.c
index b25aa46a2c..6279ec10a6 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -394,7 +394,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
int new_audio_status;
redraw_lists = false;
keyclick_set_callback(gui_synclist_keyclick_callback, &lists);
- action = get_action(CONTEXT_MAINMENU,
+ action = get_action(CONTEXT_MAINMENU|ALLOW_SOFTLOCK,
list_do_action_timeout(&lists, HZ));
/* query audio status to see if it changed */
diff --git a/apps/menus/playlist_menu.c b/apps/menus/playlist_menu.c
index 3122a4090f..b84abe0b37 100644
--- a/apps/menus/playlist_menu.c
+++ b/apps/menus/playlist_menu.c
@@ -38,9 +38,19 @@
#include "talk.h"
#include "playlist_catalog.h"
#include "splash.h"
+#include "filetree.h"
+/* load a screen to save the playlist passed in (or current playlist if NULL is passed) */
int save_playlist_screen(struct playlist_info* playlist)
{
+
+ char directoryonly[MAX_PATH+3];
+ char *filename;
+
+ int resume_index;
+ uint32_t resume_elapsed;
+ uint32_t resume_offset;
+
char temp[MAX_PATH+1], *dot;
int len;
@@ -71,6 +81,55 @@ int save_playlist_screen(struct playlist_info* playlist)
/* reload in case playlist was saved to cwd */
reload_directory();
+
+ /* only reload newly saved playlist if:
+ * playlist is null AND setting is turned on
+ *
+ * if playlist is null, we should be dealing with the current playlist,
+ * and thus we got here from the wps screen. That means we want to reload
+ * the current playlist so the user can make bookmarks. */
+ if ((global_settings.playlist_reload_after_save == true) &&
+ (playlist == NULL))
+ {
+
+ /* at least one slash exists in temp */
+ if (strrchr(temp, '/') != NULL)
+ {
+ filename = strrchr(temp, '/') + 1;
+
+ if (temp[0] == '/') /* most common situation - first char is a slash */
+ {
+ strcpy(directoryonly, temp);
+ directoryonly[filename - temp] = '\0';
+ } else /* there is a slash, but not at the beginning of temp - prepend one */
+ {
+ directoryonly[0] = '/';
+
+ strcpy(directoryonly+1, temp);
+ directoryonly[filename - temp + 1] = '\0';
+ }
+ } else /* temp doesn't contain any slashes, uncommon? */
+ {
+ directoryonly[0] = '/';
+ directoryonly[1] = '\0';
+ filename = temp;
+ }
+
+ /* can't trust index from id3 (don't know why), get it from playlist */
+ resume_index = playlist_get_current()->index;
+
+ struct mp3entry* id3 = audio_current_track();
+
+ /* record elapsed and offset so they don't change when we load new playlist */
+ resume_elapsed = id3->elapsed;
+ resume_offset = id3->offset;
+
+ ft_play_playlist(temp, directoryonly, filename, true);
+ playlist_start(resume_index, resume_elapsed, resume_offset);
+ }
+ /* cancelled out of name selection */
+ } else {
+ return 1;
}
return 0;
@@ -112,9 +171,10 @@ MAKE_MENU(viewer_settings_menu, ID2P(LANG_PLAYLISTVIEWER_SETTINGS),
MENUITEM_SETTING(warn_on_erase, &global_settings.warnon_erase_dynplaylist, NULL);
MENUITEM_SETTING(show_shuffled_adding_options, &global_settings.show_shuffled_adding_options, NULL);
MENUITEM_SETTING(show_queue_options, &global_settings.show_queue_options, NULL);
+MENUITEM_SETTING(playlist_reload_after_save, &global_settings.playlist_reload_after_save, NULL);
MAKE_MENU(currentplaylist_settings_menu, ID2P(LANG_CURRENT_PLAYLIST),
NULL, Icon_Playlist,
- &warn_on_erase, &show_shuffled_adding_options, &show_queue_options);
+ &warn_on_erase, &show_shuffled_adding_options, &show_queue_options, &playlist_reload_after_save);
MAKE_MENU(playlist_settings, ID2P(LANG_PLAYLISTS), NULL,
Icon_Playlist,
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 4202298fa3..a5e747651a 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -73,6 +73,7 @@ static int selectivesoftlock_callback(int action,
set_selective_softlock_actions(
global_settings.bt_selective_softlock_actions,
global_settings.bt_selective_softlock_actions_mask);
+ action_autosoftlock_init();
break;
}
@@ -400,7 +401,7 @@ MENUITEM_SETTING(governor, &global_settings.governor, NULL);
MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
0, Icon_System_menu,
-#if (BATTERY_CAPACITY_INC > 0) || (BATTERY_TYPES_COUNT > 1)
+#if (BATTERY_CAPACITY_INC > 0) || (BATTERY_TYPES_COUNT > 1) || defined(HAVE_USB_CHARGING_ENABLE)
&battery_menu,
#endif
#if defined(HAVE_DIRCACHE) || defined(HAVE_DISK_STORAGE)
diff --git a/apps/onplay.c b/apps/onplay.c
index d72f592f2e..0942d69d3f 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -456,6 +456,7 @@ static bool shuffle_playlist(void)
}
static bool save_playlist(void)
{
+ /* save_playlist_screen should load the newly saved playlist and resume */
save_playlist_screen(NULL);
return false;
}
diff --git a/apps/plugin.c b/apps/plugin.c
index 32cecc320f..a3970a88a7 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -792,6 +792,7 @@ static const struct plugin_api rockbox_api = {
#ifdef PLUGIN_USE_IRAM
audio_hard_stop,
#endif
+ crc_32r,
/* new stuff at the end, sort into place next time
the API gets incompatible */
diff --git a/apps/plugin.h b/apps/plugin.h
index 394a4dbbfd..64ced00bfa 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -919,6 +919,7 @@ struct plugin_api {
#ifdef PLUGIN_USE_IRAM
void (*audio_hard_stop)(void);
#endif
+ uint32_t (*crc_32r)(const void *src, uint32_t len, uint32_t crc32);
/* new stuff at the end, sort into place next time
the API gets incompatible */
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index f8269f5c3b..2534e3bebe 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -61,13 +61,6 @@
#define BATTERY_ON_TXT "SELECT - start"
#define BATTERY_OFF_TXT "POWER"
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-
-#define BATTERY_ON BUTTON_SELECT
-#define BATTERY_OFF BUTTON_PLAY
-#define BATTERY_ON_TXT "SELECT - start"
-#define BATTERY_OFF_TXT "PLAY"
-
#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
(CONFIG_KEYPAD == SANSA_C200_PAD) || \
(CONFIG_KEYPAD == SANSA_CLIP_PAD) || \
@@ -141,13 +134,6 @@
#define BATTERY_OFF BUTTON_POWER
#define BATTERY_OFF_TXT "POWER"
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-
-#define BATTERY_OFF BUTTON_POWER
-#define BATTERY_OFF_TXT "POWER"
-#define BATTERY_ON BUTTON_PLAY
-#define BATTERY_ON_TXT "PLAY - start"
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define BATTERY_ON BUTTON_PLAY
#define BATTERY_ON_TXT "PLAY - start"
diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c
index 0667c31ef6..4242f5a89f 100644
--- a/apps/plugins/blackjack.c
+++ b/apps/plugins/blackjack.c
@@ -104,22 +104,6 @@ enum {
#define BJACK_RIGHT BUTTON_RIGHT
#define BJACK_LEFT BUTTON_LEFT
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define BJACK_SELECT_NAME "MODE"
-#define BJACK_STAY_NAME "MODE"
-#define BJACK_QUIT_NAME "PLAY"
-#define BJACK_DOUBLE_NAME "SELECT"
-#define BJACK_SELECT BUTTON_MODE
-#define BJACK_QUIT BUTTON_PLAY
-#define BJACK_MAX (BUTTON_EQ|BUTTON_UP)
-#define BJACK_MIN (BUTTON_EQ|BUTTON_DOWN)
-#define BJACK_STAY BUTTON_MODE
-#define BJACK_DOUBLEDOWN BUTTON_SELECT
-#define BJACK_UP BUTTON_UP
-#define BJACK_DOWN BUTTON_DOWN
-#define BJACK_RIGHT BUTTON_RIGHT
-#define BJACK_LEFT BUTTON_LEFT
-
#elif CONFIG_KEYPAD == GIGABEAT_PAD
#define BJACK_SELECT_NAME "SELECT"
#define BJACK_STAY_NAME "VOL-"
@@ -1085,7 +1069,7 @@ static void blackjack_savegame(struct game_context* bj) {
/*****************************************************************************
* blackjack_get_yes_no() gets a yes/no answer from the user
******************************************************************************/
-static unsigned int blackjack_get_yes_no(char message[20]) {
+static unsigned int blackjack_get_yes_no(const char *message) {
int button;
unsigned int w, h, b, choice = 0;
bool breakout = false;
@@ -1146,7 +1130,7 @@ static unsigned int blackjack_get_yes_no(char message[20]) {
/*****************************************************************************
* blackjack_get_amount() gets an amount from the player to be used
******************************************************************************/
-static signed int blackjack_get_amount(const char message[20],
+static signed int blackjack_get_amount(const char *message,
signed int lower_limit,
signed int upper_limit,
signed int start) {
diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c
index 4d1b6fa594..cbaea8aa7e 100644
--- a/apps/plugins/calculator.c
+++ b/apps/plugins/calculator.c
@@ -269,19 +269,6 @@ F3: equal to "="
#define CALCULATOR_QUIT BUTTON_POWER
#define CALCULATOR_CLEAR BUTTON_MENU
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-
-#define CALCULATOR_LEFT BUTTON_LEFT
-#define CALCULATOR_RIGHT BUTTON_RIGHT
-#define CALCULATOR_UP BUTTON_VOLUP
-#define CALCULATOR_DOWN BUTTON_VOLDOWN
-#define CALCULATOR_QUIT BUTTON_POWER
-#define CALCULATOR_INPUT BUTTON_PLAY
-#define CALCULATOR_CALC BUTTON_MENU
-#define CALCULATOR_CLEAR BUTTON_STOP
-
-#define CALCULATOR_RC_QUIT (BUTTON_MENU|BUTTON_PLAY)
-
#elif (CONFIG_KEYPAD == CREATIVEZVM_PAD)
#define CALCULATOR_LEFT BUTTON_LEFT
@@ -733,6 +720,8 @@ static void doMultiple(double* operandOne, int* powerOne,
double operandTwo, int powerTwo);
static void doAdd (double* operandOne, int* powerOne,
double operandTwo, int powerTwo);
+static void doExponent(double* operandOne, int* powerOne,
+ double operandTwo, int powerTwo);
static void printResult(void);
static void formatResult(void);
static void oneOperand(void);
@@ -740,6 +729,75 @@ static void oneOperand(void);
static void drawLines(void);
static void drawButtons(int group);
+double strtod(const char *nptr, char **endptr);
+long long atoll(const char *nptr);
+
+/* -----------------------------------------------------------------------
+Standard library function
+----------------------------------------------------------------------- */
+double strtod(const char *nptr, char **endptr)
+{
+ double out;
+ long mantissa;
+ int length=0, end=0;
+ mantissa=atoll(nptr);
+ while(!end)
+ {
+ switch(*nptr)
+ {
+ case '\0':
+ end=1;
+ break;
+ case ',':
+ case '.':
+ case '\'':
+ end=1;
+ default:
+ nptr++;
+ }
+ }
+ out=atoll(nptr);
+ while( (*nptr == '0')||(*nptr == '1')||(*nptr == '2')||(*nptr == '3')||(*nptr == '4')||
+ (*nptr == '5')||(*nptr == '6')||(*nptr == '7')||(*nptr == '8')||(*nptr == '9') )
+ {
+ nptr++;
+ length++;
+ }
+ for(;length;length--)
+ out /= 10;
+ out += mantissa;
+ if(endptr != NULL)
+ *endptr=(char *) nptr;
+ return out;
+}
+
+// WARNING Unsafe: Use strtoll instead
+long long atoll(const char *nptr)
+{
+ long long result=0;
+ char negative=0;
+ while( (*nptr == ' ') || (*nptr == '\f') || (*nptr == '\n')||
+ (*nptr == '\r') || (*nptr == '\t') || (*nptr == '\v') )
+ nptr++;
+ if(*nptr == '+')
+ nptr++;
+ if(*nptr == '-')
+ {
+ negative++;
+ nptr++;
+ }
+ while (*nptr)
+ {
+ if( (*nptr < '0') || (*nptr > '9') )
+ break;
+ result *=10;
+ result+= (*(nptr++) -'0');
+ }
+ if(negative)
+ result = 0 - result;
+ return result;
+}
+
/* -----------------------------------------------------------------------
Handy functions
----------------------------------------------------------------------- */
@@ -1062,6 +1120,93 @@ static void doMultiple(double* operandOne, int* powerOne,
}
/* -----------------------------------------------------------------------
+exponentiate in scientific number format
+----------------------------------------------------------------------- */
+static void doExponent(double* operandOne, int* powerOne,
+ double operandTwo, int powerTwo)
+{
+ char negative=0;
+ char *lastDigit;
+ char negativeBuffer[25];
+ if (*operandOne == 0)
+ {
+ if (operandTwo == 0)
+ {
+ calStatus=cal_error; // result is undefined
+ }
+ else{
+ *powerOne = 0;
+ *operandOne = 0;
+ }
+ return;
+ }
+ if (operandTwo == 0)
+ {
+ *powerOne = 1;
+ *operandOne = 0.1;
+ return;
+ }
+ if (operandTwo < 0)
+ {
+ negative+=2;
+ operandTwo= ABS(operandTwo);
+ }
+ if (*operandOne < 0)
+ {
+#if MEMORYSIZE < 8
+ (void)negativeBuffer;
+ (void)lastDigit;
+ calStatus=cal_error;
+ return;
+#else
+ if(powerTwo < 0)
+ {
+ calStatus=cal_error; // result is imaginary
+ return;
+ }
+
+ /*Truncate operandTwo to three places past the radix
+ in order to eliminate floating point artifacts
+ (function should set error if truncating a non-integer) */
+ rb->snprintf(negativeBuffer, 25, "%.*f", powerTwo+3, operandTwo);
+ operandTwo = strtod(negativeBuffer, NULL);
+
+ /*Truncate operandTwo to powerTwo digits by way of string
+ in order to confirm operandTwo *10^powerTwo is an integer*/
+ rb->snprintf(negativeBuffer, 25, "%.*f", powerTwo, operandTwo);
+
+ if(strtod(negativeBuffer, &lastDigit) != operandTwo)
+ {
+ calStatus=cal_error; // result is imaginary
+ return;
+ }
+ if(rb->atoi(lastDigit-1) % 2)
+ negative++;
+#endif
+ }
+ (*operandOne) = myLn(ABS(*operandOne)) + (double) (*powerOne) * 2.302585092994046;
+ (*powerOne) = 0;
+ doMultiple(operandOne, powerOne, ABS(operandTwo), powerTwo);
+ while(*powerOne)
+ {
+ if(*powerOne > 0)
+ {
+ (*operandOne) *= 10;
+ (*powerOne) --;
+ }
+ else{
+ (*operandOne) /= 10;
+ (*powerOne) ++;
+ }
+ }
+ (*operandOne) = myExp(*operandOne);
+ if(negative & 2)
+ (*operandOne) = 1/(*operandOne);
+ if(negative & 1)
+ *operandOne = -(*operandOne);
+}
+
+/* -----------------------------------------------------------------------
Handles all one operand calculations
----------------------------------------------------------------------- */
static void oneOperand(void)
@@ -1205,6 +1350,9 @@ static void twoOperands(void)
else
calStatus = cal_error;
break;
+ case '^':
+ doExponent(&operand, &operandPower, result, power);
+ break;
default: /* ' ' */
switchOperands(); /* counter switchOperands() below */
break;
@@ -1697,7 +1845,9 @@ static void basicButtonsProcess(void){
#ifdef CALCULATOR_OPERATORS
case_cycle_operators: /* F2 shortkey entrance */
#endif
- calStatus = cal_normal;
+ if (calStatus == cal_typing ||
+ calStatus == cal_dotted)
+ calStatus = cal_normal;
formatResult();
operand = result;
operandPower = power;
@@ -1753,8 +1903,14 @@ static void sciButtonsProcess(void){
break;
case sci_xy:
- /*Not implemented yet
- Maybe it could use x^y = exp(y*ln(x))*/
+ if(!operInputted) {twoOperands(); operInputted = true;}
+ oper = '^';
+ if (calStatus == cal_typing ||
+ calStatus == cal_dotted)
+ calStatus = cal_normal;
+ formatResult();
+ operand = result;
+ operandPower = power;
break;
case sci_sci:
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c
index 54173fde1c..e7f221a3c9 100644
--- a/apps/plugins/calendar.c
+++ b/apps/plugins/calendar.c
@@ -68,16 +68,6 @@
#define CALENDAR_NEXT_MONTH BUTTON_VOL_DOWN
#define CALENDAR_PREV_MONTH BUTTON_VOL_UP
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define CALENDAR_QUIT BUTTON_PLAY
-#define CALENDAR_SELECT BUTTON_SELECT
-#define CALENDAR_NEXT_WEEK BUTTON_DOWN
-#define CALENDAR_PREV_WEEK BUTTON_UP
-#define CALENDAR_NEXT_DAY BUTTON_RIGHT
-#define CALENDAR_PREV_DAY BUTTON_LEFT
-#define CALENDAR_NEXT_MONTH BUTTON_MODE
-#define CALENDAR_PREV_MONTH BUTTON_EQ
-
#elif CONFIG_KEYPAD == SANSA_E200_PAD
#define CALENDAR_QUIT BUTTON_POWER
#define CALENDAR_SELECT BUTTON_SELECT
diff --git a/apps/plugins/chessbox/chessbox_pgn.h b/apps/plugins/chessbox/chessbox_pgn.h
index 5bfce10ec5..827f045a4b 100644
--- a/apps/plugins/chessbox/chessbox_pgn.h
+++ b/apps/plugins/chessbox/chessbox_pgn.h
@@ -70,20 +70,6 @@
#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define CB_SELECT BUTTON_SELECT
-#define CB_UP BUTTON_UP
-#define CB_DOWN BUTTON_DOWN
-#define CB_LEFT BUTTON_LEFT
-#define CB_RIGHT BUTTON_RIGHT
-#define CB_PLAY BUTTON_PLAY
-#define CB_LEVEL BUTTON_EQ
-#define CB_MENU BUTTON_MODE
-#define CB_SCROLL_UP (BUTTON_UP|BUTTON_REPEAT)
-#define CB_SCROLL_DOWN (BUTTON_DOWN|BUTTON_REPEAT)
-#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
-#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
-
#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
#define CB_SELECT BUTTON_SELECT
#define CB_UP BUTTON_UP
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index 9a30dee984..91b04e713a 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -46,16 +46,6 @@
#define CHC_SETTINGS_OK BUTTON_SELECT
#define CHC_SETTINGS_CANCEL BUTTON_MENU
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define CHC_QUIT BUTTON_PLAY
-#define CHC_STARTSTOP BUTTON_MODE
-#define CHC_RESET BUTTON_EQ
-#define CHC_MENU BUTTON_SELECT
-#define CHC_SETTINGS_INC BUTTON_RIGHT
-#define CHC_SETTINGS_DEC BUTTON_LEFT
-#define CHC_SETTINGS_OK BUTTON_SELECT
-#define CHC_SETTINGS_CANCEL BUTTON_PLAY
-
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
#define CHC_QUIT BUTTON_REC
#define CHC_STARTSTOP BUTTON_PLAY
@@ -157,17 +147,6 @@
#define CHC_SETTINGS_DEC BUTTON_MINUS
#define CHC_SETTINGS_CANCEL BUTTON_POWER
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define CHC_QUIT BUTTON_POWER
-#define CHC_STARTSTOP BUTTON_PLAY
-#define CHC_RESET BUTTON_LEFT
-#define CHC_MENU BUTTON_MENU
-#define CHC_SETTINGS_INC BUTTON_VOLUP
-#define CHC_SETTINGS_DEC BUTTON_VOLDOWN
-#define CHC_SETTINGS_OK BUTTON_PLAY
-#define CHC_SETTINGS_OK2 BUTTON_LEFT
-#define CHC_SETTINGS_CANCEL BUTTON_POWER
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define CHC_QUIT BUTTON_BACK
#define CHC_STARTSTOP BUTTON_PLAY
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c
index ab8f7b5540..70763a1b67 100644
--- a/apps/plugins/chopper.c
+++ b/apps/plugins/chopper.c
@@ -108,12 +108,6 @@ Still To do:
#define QUIT BUTTON_POWER
#define ACTION2 BUTTON_PLUS
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define QUIT BUTTON_POWER
-#define ACTION BUTTON_PLAY
-#define ACTION2 BUTTON_STOP
-#define ACTIONTEXT "PLAY"
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define QUIT BUTTON_BACK
#define ACTION BUTTON_UP
diff --git a/apps/plugins/clix.c b/apps/plugins/clix.c
index f1f21f6312..c127a300f2 100644
--- a/apps/plugins/clix.c
+++ b/apps/plugins/clix.c
@@ -100,14 +100,6 @@
#define CLIX_BUTTON_UP BUTTON_SCROLL_UP
#define CLIX_BUTTON_DOWN BUTTON_SCROLL_DOWN
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define CLIX_BUTTON_QUIT BUTTON_POWER
-#define CLIX_BUTTON_LEFT BUTTON_LEFT
-#define CLIX_BUTTON_RIGHT BUTTON_RIGHT
-#define CLIX_BUTTON_CLICK BUTTON_PLAY
-#define CLIX_BUTTON_UP BUTTON_STOP
-#define CLIX_BUTTON_DOWN BUTTON_PLAY
-
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
#define CLIX_BUTTON_QUIT BUTTON_POWER
#define CLIX_BUTTON_LEFT BUTTON_LEFT
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index 6587fdcb65..857f2415d4 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -62,16 +62,6 @@
#define CUBE_HIGHSPEED_PRE BUTTON_SELECT
#define CUBE_HIGHSPEED (BUTTON_SELECT | BUTTON_REL)
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define CUBE_QUIT BUTTON_PLAY
-#define CUBE_NEXT BUTTON_RIGHT
-#define CUBE_PREV BUTTON_LEFT
-#define CUBE_INC BUTTON_UP
-#define CUBE_DEC BUTTON_DOWN
-#define CUBE_MODE BUTTON_MODE
-#define CUBE_PAUSE BUTTON_SELECT
-#define CUBE_HIGHSPEED BUTTON_EQ
-
#elif (CONFIG_KEYPAD == IAUDIO_X5M5_PAD)
#define CUBE_QUIT BUTTON_POWER
#define CUBE_NEXT BUTTON_RIGHT
@@ -171,16 +161,6 @@
#elif CONFIG_KEYPAD == COWON_D2_PAD
#define CUBE_QUIT BUTTON_POWER
-#elif (CONFIG_KEYPAD == IAUDIO67_PAD)
-#define CUBE_QUIT BUTTON_POWER
-#define CUBE_NEXT BUTTON_RIGHT
-#define CUBE_PREV BUTTON_LEFT
-#define CUBE_INC BUTTON_VOLUP
-#define CUBE_DEC BUTTON_VOLDOWN
-#define CUBE_MODE BUTTON_MENU
-#define CUBE_PAUSE BUTTON_PLAY
-#define CUBE_HIGHSPEED BUTTON_STOP
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define CUBE_QUIT BUTTON_BACK
#define CUBE_NEXT BUTTON_RIGHT
diff --git a/apps/plugins/doom/doomdef.c b/apps/plugins/doom/doomdef.c
index 3facfbb299..6ae4bb6894 100644
--- a/apps/plugins/doom/doomdef.c
+++ b/apps/plugins/doom/doomdef.c
@@ -34,7 +34,7 @@
// Location for any defines turned variables.
#if(LCD_HEIGHT>LCD_WIDTH)
-bool rotate_screen=0;
+int rotate_screen=0;
int SCREENWIDTH;
int SCREENHEIGHT;
#endif
diff --git a/apps/plugins/doom/doomdef.h b/apps/plugins/doom/doomdef.h
index 05346cd443..43114f75ef 100644
--- a/apps/plugins/doom/doomdef.h
+++ b/apps/plugins/doom/doomdef.h
@@ -94,7 +94,7 @@ typedef unsigned Language_t;
// when multiple screen sizes are supported
#if(LCD_HEIGHT>LCD_WIDTH)
-extern bool rotate_screen;
+extern int rotate_screen;
// proff 08/17/98: Changed for high-res
#define MAX_SCREENWIDTH LCD_HEIGHT
#define MAX_SCREENHEIGHT LCD_HEIGHT
diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c
index bb04194acc..2381a7614d 100644
--- a/apps/plugins/doom/i_video.c
+++ b/apps/plugins/doom/i_video.c
@@ -316,16 +316,6 @@ void I_ShutdownGraphics(void)
#define DOOMBUTTON_ENTER BUTTON_MENU
#define DOOMBUTTON_WEAPON BUTTON_DISPLAY
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define DOOMBUTTON_ESC BUTTON_POWER
-#define DOOMBUTTON_UP BUTTON_STOP
-#define DOOMBUTTON_DOWN BUTTON_PLAY
-#define DOOMBUTTON_LEFT BUTTON_LEFT
-#define DOOMBUTTON_RIGHT BUTTON_RIGHT
-#define DOOMBUTTON_SHOOT BUTTON_VOLUP
-#define DOOMBUTTON_OPEN BUTTON_VOLDOWN
-#define DOOMBUTTON_ENTER BUTTON_MENU
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define DOOMBUTTON_UP BUTTON_UP
#define DOOMBUTTON_DOWN BUTTON_DOWN
diff --git a/apps/plugins/doom/m_misc.c b/apps/plugins/doom/m_misc.c
index 586a4a1c2f..0318c9d741 100644
--- a/apps/plugins/doom/m_misc.c
+++ b/apps/plugins/doom/m_misc.c
@@ -308,7 +308,7 @@ default_t defaults[] =
{"screen_height",{&desired_screenheight, NULL},{200, NULL},200,1200,
def_int,ss_none, 0, 0},*/
#if(LCD_HEIGHT>LCD_WIDTH)
- {"rotate_screen",{(void *)&rotate_screen, NULL},{0, NULL},0,1,
+ {"rotate_screen",{&rotate_screen, NULL},{0, NULL},0,1,
def_bool,ss_none, 0, 0}, /* kwk - rotate the screen 90 degrees */
#endif
{"fake_contrast",{&fake_contrast, NULL},{1, NULL},0,1,
diff --git a/apps/plugins/fractals/fractal.h b/apps/plugins/fractals/fractal.h
index 28172aed9f..b64bf942fe 100644
--- a/apps/plugins/fractals/fractal.h
+++ b/apps/plugins/fractals/fractal.h
@@ -155,20 +155,6 @@
#define FRACTAL_PRECISION_DEC BUTTON_REW
#define FRACTAL_RESET (BUTTON_PLAY | BUTTON_REW)
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define FRACTAL_QUIT BUTTON_EQ
-#define FRACTAL_UP BUTTON_UP
-#define FRACTAL_DOWN BUTTON_DOWN
-#define FRACTAL_LEFT BUTTON_LEFT
-#define FRACTAL_RIGHT BUTTON_RIGHT
-#define FRACTAL_ZOOM_IN_PRE BUTTON_SELECT
-#define FRACTAL_ZOOM_IN (BUTTON_SELECT | BUTTON_REL)
-#define FRACTAL_ZOOM_OUT_PRE BUTTON_SELECT
-#define FRACTAL_ZOOM_OUT (BUTTON_SELECT | BUTTON_REPEAT)
-#define FRACTAL_PRECISION_INC (BUTTON_PLAY | BUTTON_RIGHT)
-#define FRACTAL_PRECISION_DEC (BUTTON_PLAY | BUTTON_LEFT)
-#define FRACTAL_RESET BUTTON_MODE
-
#elif CONFIG_KEYPAD == GIGABEAT_S_PAD
#define FRACTAL_QUIT BUTTON_BACK
#define FRACTAL_UP BUTTON_UP
diff --git a/apps/plugins/greyscale.c b/apps/plugins/greyscale.c
index c44b1f77c0..d9cb7436de 100644
--- a/apps/plugins/greyscale.c
+++ b/apps/plugins/greyscale.c
@@ -57,14 +57,6 @@
#define GREYSCALE_RIGHT BUTTON_RIGHT
#define GREYSCALE_OFF BUTTON_MENU
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define GREYSCALE_SHIFT BUTTON_PLAY
-#define GREYSCALE_UP BUTTON_UP
-#define GREYSCALE_DOWN BUTTON_DOWN
-#define GREYSCALE_LEFT BUTTON_LEFT
-#define GREYSCALE_RIGHT BUTTON_RIGHT
-#define GREYSCALE_OFF BUTTON_EQ
-
#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
#define GREYSCALE_SHIFT BUTTON_RC_PLAY /* somewhat dangerous... */
#define GREYSCALE_UP BUTTON_RC_VOL_UP
diff --git a/apps/plugins/imageviewer/imageviewer_button.h b/apps/plugins/imageviewer/imageviewer_button.h
index cfb9a2969b..d588de95ca 100644
--- a/apps/plugins/imageviewer/imageviewer_button.h
+++ b/apps/plugins/imageviewer/imageviewer_button.h
@@ -207,17 +207,6 @@
#elif CONFIG_KEYPAD == COWON_D2_PAD
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define IMGVIEW_ZOOM_IN BUTTON_VOLUP
-#define IMGVIEW_ZOOM_OUT BUTTON_VOLDOWN
-#define IMGVIEW_UP BUTTON_STOP
-#define IMGVIEW_DOWN BUTTON_PLAY
-#define IMGVIEW_LEFT BUTTON_LEFT
-#define IMGVIEW_RIGHT BUTTON_RIGHT
-#define IMGVIEW_NEXT (BUTTON_PLAY|BUTTON_VOLUP)
-#define IMGVIEW_PREVIOUS (BUTTON_PLAY|BUTTON_VOLDOWN)
-#define IMGVIEW_MENU BUTTON_MENU
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define IMGVIEW_ZOOM_IN BUTTON_PLAY
diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c
index 8b0519d9d0..c28ab7e830 100644
--- a/apps/plugins/invadrox.c
+++ b/apps/plugins/invadrox.c
@@ -163,13 +163,6 @@
#define RIGHT BUTTON_PLUS
#define FIRE BUTTON_MENU
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-
-#define QUIT BUTTON_POWER
-#define LEFT BUTTON_LEFT
-#define RIGHT BUTTON_RIGHT
-#define FIRE BUTTON_PLAY
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define QUIT BUTTON_BACK
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index 83a44eea02..7f7965b07d 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -63,16 +63,6 @@
#define HK_SELECT "SELECT"
#define HK_CANCEL "MENU"
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define JEWELS_UP BUTTON_UP
-#define JEWELS_DOWN BUTTON_DOWN
-#define JEWELS_LEFT BUTTON_LEFT
-#define JEWELS_RIGHT BUTTON_RIGHT
-#define JEWELS_SELECT BUTTON_SELECT
-#define JEWELS_CANCEL BUTTON_PLAY
-#define HK_SELECT "SELECT"
-#define HK_CANCEL "PLAY"
-
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
#define JEWELS_UP BUTTON_UP
#define JEWELS_DOWN BUTTON_DOWN
@@ -201,16 +191,6 @@ CONFIG_KEYPAD == SANSA_M200_PAD
#define JEWELS_CANCEL BUTTON_POWER
#define HK_CANCEL "POWER"
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define JEWELS_UP BUTTON_STOP
-#define JEWELS_DOWN BUTTON_PLAY
-#define JEWELS_LEFT BUTTON_LEFT
-#define JEWELS_RIGHT BUTTON_RIGHT
-#define JEWELS_SELECT BUTTON_MENU
-#define JEWELS_CANCEL BUTTON_POWER
-#define HK_SELECT "MENU"
-#define HK_CANCEL "POWER"
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define JEWELS_UP BUTTON_UP
#define JEWELS_DOWN BUTTON_DOWN
diff --git a/apps/plugins/lib/grey_core.c b/apps/plugins/lib/grey_core.c
index e3543aeba2..b025ef8eaa 100644
--- a/apps/plugins/lib/grey_core.c
+++ b/apps/plugins/lib/grey_core.c
@@ -294,7 +294,6 @@ static const unsigned char lcdlinear[256] = {
#define LCD_SCANRATE 73 /* Hz */
#else /* not yet calibrated targets - generic linear mapping */
-/* TODO: calibrate iFP7xx */
static const unsigned char lcdlinear[256] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c
index b1bcd06ee6..028472d9a8 100644
--- a/apps/plugins/lib/pluginlib_actions.c
+++ b/apps/plugins/lib/pluginlib_actions.c
@@ -91,7 +91,6 @@ const struct button_mapping pla_main_ctx[] =
|| (CONFIG_KEYPAD == IRIVER_H300_PAD) \
|| (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \
|| (CONFIG_KEYPAD == GIGABEAT_PAD) \
- || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \
|| (CONFIG_KEYPAD == SANSA_C200_PAD) \
|| (CONFIG_KEYPAD == GIGABEAT_S_PAD) \
|| (CONFIG_KEYPAD == MROBE100_PAD) \
@@ -161,15 +160,6 @@ const struct button_mapping pla_main_ctx[] =
{ PLA_DOWN_REPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
{ PLA_LEFT_REPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
{ PLA_RIGHT_REPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
-#elif (CONFIG_KEYPAD == IAUDIO67_PAD)
- { PLA_UP, BUTTON_STOP, BUTTON_NONE },
- { PLA_DOWN, BUTTON_PLAY, BUTTON_NONE },
- { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE },
- { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
- { PLA_UP_REPEAT, BUTTON_STOP|BUTTON_REPEAT, BUTTON_NONE },
- { PLA_DOWN_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
- { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
- { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
#elif (CONFIG_KEYPAD == PBELL_VIBE500_PAD)
{ PLA_UP, BUTTON_UP, BUTTON_NONE},
{ PLA_DOWN, BUTTON_DOWN, BUTTON_NONE},
@@ -357,12 +347,6 @@ const struct button_mapping pla_main_ctx[] =
{PLA_SELECT, BUTTON_PLAY, BUTTON_NONE},
{PLA_SELECT_REL, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY},
{PLA_SELECT_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
-#elif (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD)
- {PLA_CANCEL, BUTTON_EQ|BUTTON_REL, BUTTON_EQ},
- {PLA_EXIT, BUTTON_EQ|BUTTON_REPEAT, BUTTON_NONE},
- {PLA_SELECT, BUTTON_SELECT, BUTTON_NONE},
- {PLA_SELECT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT},
- {PLA_SELECT_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
#elif (CONFIG_KEYPAD == MROBE500_PAD)
{PLA_CANCEL, BUTTON_POWER|BUTTON_REL, BUTTON_POWER},
{PLA_EXIT, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE},
@@ -394,12 +378,6 @@ const struct button_mapping pla_main_ctx[] =
{PLA_SELECT, BUTTON_PLAY, BUTTON_NONE},
{PLA_SELECT_REL, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY},
{PLA_SELECT_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
-#elif (CONFIG_KEYPAD == IAUDIO67_PAD)
- {PLA_CANCEL, BUTTON_POWER|BUTTON_REL, BUTTON_POWER},
- {PLA_EXIT, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE},
- {PLA_SELECT, BUTTON_PLAY, BUTTON_NONE},
- {PLA_SELECT_REL, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY},
- {PLA_SELECT_REPEAT, BUTTON_PLAY|BUTTON_REPEAT BUTTON_NONE},
#elif (CONFIG_KEYPAD == CREATIVEZVM_PAD)
{PLA_CANCEL, BUTTON_BACK|BUTTON_REL, BUTTON_BACK},
{PLA_EXIT, BUTTON_BACK|BUTTON_REPEAT, BUTTON_NONE},
diff --git a/apps/plugins/lua/include_lua/create_kbd_layout.lua b/apps/plugins/lua/include_lua/create_kbd_layout.lua
new file mode 100644
index 0000000000..7d0792a667
--- /dev/null
+++ b/apps/plugins/lua/include_lua/create_kbd_layout.lua
@@ -0,0 +1,107 @@
+--[[
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2021 William Wilgus
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+]]
+--create keyboard layout
+--BILGUS 4/2021
+-- create_kbd_layout = require("create_kbd_layout")
+-- local layout = create_kbd_layout("abcd")
+
+local function encode_short(n)
+ return string.char(bit.band(0x00FF, n), bit.rshift(bit.band(0xFF00, n), 8))
+end
+
+local function utf8decode(str)
+ local INVALID = 0xfffd
+ local t = {}
+ local function check_char(c)
+ local tail = false
+ local code
+ c = string.byte(c)
+ if (c <= 0x7f) or (c >= 0xc2) then
+ -- Start of new character
+ if (c < 0x80) then -- U-00000000 - U-0000007F, 1 string.byte
+ code = c;
+ elseif (c < 0xe0) then -- U-00000080 - U-000007FF, 2 string.bytes
+ tail = 1;
+ code = bit.band(c, 0x1f)
+ elseif (c < 0xf0) then -- U-00000800 - U-0000FFFF, 3 string.bytes
+ tail = 2;
+ code = bit.band(c, 0x0f)
+ elseif (c < 0xf5) then -- U-00010000 - U-001FFFFF, 4 string.bytes
+ tail = 3;
+ code = bit.band(c, 0x07)
+ else
+ -- Invalid size
+ code = INVALID;
+ end
+
+ while tail and c ~= 0 do
+ tail = tail - 1
+ if bit.band(c, 0xc0) == 0x80 then
+ -- Valid continuation character
+ code = bit.bor(bit.lshift(code, 6),bit.band(c, 0x3f))
+ else
+ -- Invalid continuation char
+ code = INVALID;
+ break;
+ end
+ end
+ else
+ -- Invalid UTF-8 char
+ code = INVALID;
+ end
+ -- currently we don't support chars above U-FFFF
+ t[#t + 1 ] = encode_short((code < 0x10000) and code or INVALID)
+ end
+ str:gsub(".", check_char) -- run check function for every char
+ return table.concat(t)
+end
+
+local function create_keyboard_layout(s_layout)
+ local insert = table.insert
+ lines = {}
+
+ for str in string.gmatch(s_layout, "([^\n]+)") do
+ local len = string.len(str)
+ lines[#lines + 1] =
+ table.concat({encode_short(len), utf8decode(str)})
+ end
+ lines[#lines + 1] = encode_short(0xFEFF)
+
+ return table.concat(lines)
+end
+
+
+--[[
+local name = "Test_KBD_LAYOUT_" .. tostring(1)
+local test = create_keyboard_layout("ABCDEFGHIJKLM\nNOPQRSTUVWXYZ\n0123456789")
+local file = io.open('/' .. name, "w+") -- overwrite, rb ignores the 'b' flag
+file:write(test)-- write the layout to the file now
+file:close()
+
+if not file then
+ rb.splash(rb.HZ, "Error opening /" .. name)
+ return
+end
+rb.kbd_input(name, test)
+]]
+return create_keyboard_layout
diff --git a/apps/plugins/lua/include_lua/menubuttons.lua b/apps/plugins/lua/include_lua/menubuttons.lua
new file mode 100644
index 0000000000..7c19592bbe
--- /dev/null
+++ b/apps/plugins/lua/include_lua/menubuttons.lua
@@ -0,0 +1,59 @@
+--[[
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2021 William Wilgus
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+]]
+-- Bilgus 4/2021
+local oldrb = rb
+local tmploader = require("temploader")
+
+local a_is_loaded = (package.loaded.actions ~= nil)
+local rbold = rb
+
+if not a_is_loaded then
+ --replace the rb table so we can keep the defines out of the namespace
+ rb = {}
+end
+
+--require("actions") -- Contains rb.actions & rb.contexts
+local actions, err = tmploader("actions")
+if err then
+ error(err)
+end
+
+-- Menu Button definitions --
+local button_t = {
+ CANCEL = rb.actions.PLA_CANCEL,
+ DOWN = rb.actions.PLA_DOWN,
+ DOWNR = rb.actions.PLA_DOWN_REPEAT,
+ EXIT = rb.actions.PLA_EXIT,
+ LEFT = rb.actions.PLA_LEFT,
+ LEFTR = rb.actions.PLA_LEFT_REPEAT,
+ RIGHT = rb.actions.PLA_RIGHT,
+ RIGHTR = rb.actions.PLA_RIGHT_REPEAT,
+ SEL = rb.actions.PLA_SELECT,
+ SELREL = rb.actions.PLA_SELECT_REL,
+ SELR = rb.actions.PLA_SELECT_REPEAT,
+ UP = rb.actions.PLA_UP,
+ UPR = rb.actions.PLA_UP_REPEAT,
+}
+
+rb = oldrb
+return button_t
diff --git a/apps/plugins/lua/include_lua/menucoresettings.lua b/apps/plugins/lua/include_lua/menucoresettings.lua
new file mode 100644
index 0000000000..27d5e86ca1
--- /dev/null
+++ b/apps/plugins/lua/include_lua/menucoresettings.lua
@@ -0,0 +1,78 @@
+--[[
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2021 William Wilgus
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+]]
+--menu core settings loaded from rockbox user settings
+--Bilgus 4/2021
+
+local function get_core_settings()
+ local tmploader = require("temploader")
+ -- rbsettings is a large module to have sitting in RAM
+ -- if user already has it in RAM then use that
+ local rbs_is_loaded = (package.loaded.rbsettings ~= nil)
+ local s_is_loaded = (package.loaded.settings ~= nil)
+ local rbold = rb
+
+ if not rbs_is_loaded then
+ --replace the rb table so we can keep the defines out of the namespace
+ rb = { global_settings = rb.global_settings,
+ global_status = rb.global_status}
+ end
+
+ tmploader("rbsettings")
+ tmploader("settings")
+ -- these are exact matches color and talk are wildcard matches
+ local list_settings = "cursor_style|show_icons|statusbar|scrollbar|scrollbar_width|list_separator_height|backdrop_file|"
+ local function filterfn(struct, k)
+ k = k or ""
+ --rbold.splash(100, struct .. " " .. k)
+ return (k:find("color") or k:find("talk") or list_settings:find(k))
+ end
+ local rb_settings = rb.settings.dump('global_settings', "system", nil, nil, filterfn)
+
+ local color_table = {}
+ local talk_table = {}
+ local list_settings_table = {}
+
+ for key, value in pairs(rb_settings) do
+ key = key or ""
+ if (key:find("color")) then
+ color_table[key]=value
+ elseif (key:find("talk")) then
+ talk_table[key]=value
+ else --if (list_settings:find(key)) then
+ list_settings_table[key]=value
+ end
+ end
+
+ if not s_is_loaded then
+ rb.settings = nil
+ end
+
+ rb = rbold
+ rb.core_color_table = color_table
+ rb.core_talk_table = talk_table
+ rb.core_list_settings_table = list_settings_table
+end
+get_core_settings()
+get_core_settings = nil
+package.loaded.menucoresettings = nil
+collectgarbage("collect")
diff --git a/apps/plugins/lua/include_lua/print.lua b/apps/plugins/lua/include_lua/print.lua
index 3b4c389848..6f2010422a 100644
--- a/apps/plugins/lua/include_lua/print.lua
+++ b/apps/plugins/lua/include_lua/print.lua
@@ -343,20 +343,15 @@ local _print = {} do
tld.line_end_color = line_end_color
end
- line_separator = ld.line_separator
-
+ line_separator = ld.line_separator or o.drawsep
+ local indent = line_indent < 0 and 0 or line_indent --rb scroller doesn't like negative offset!
if o.line == 1 and o.header then
- --rb scroller doesn't like negative offset!
- local indent = line_indent < 0 and 0 or line_indent
set_desc(ld, true, 1, false, rb.STYLE_DEFAULT,
indent, o.fg_pattern, o.bg_pattern, o.bg_pattern)
ld.show_cursor = false
elseif s_lines[o.line] then
--/* Display line selector */
local style = show_cursor == true and rb.STYLE_DEFAULT or linestyle
-
- local indent = line_indent < 0 and 0 or line_indent
- --rb scroller doesn't like negative offset!
local ovfl = (o.ovfl == "auto" and w >= o.width and x == 0)
set_desc(ld, ovfl, 0, true, style, indent,
o.bg_pattern, o.sel_pattern, o.sel_pattern)
@@ -377,7 +372,9 @@ local _print = {} do
if ld.selected == true then
rb.set_viewport(o) -- revert drawmode if selected
end
- rb.lcd_drawline(0, line * h, o.width, line * h)
+ if not o.header then
+ rb.lcd_drawline(0, line * h, o.width, line * h)
+ end
rb.lcd_drawline(0, line * h + h, o.width, line * h + h) --only to add the last line
-- but we don't have an idea which line is the last line here so every line is the last line!
end
@@ -457,6 +454,7 @@ local _print = {} do
_print.opt.line = set_line
_print.opt.linedesc = set_linedesc
_print.opt.autoupdate = set_update
+ _print.selected = function() return s_lines end
_print.clear = clear
_print.f = printf
diff --git a/apps/plugins/lua/include_lua/printmenus.lua b/apps/plugins/lua/include_lua/printmenus.lua
index 3e8f870104..938d99a5ed 100644
--- a/apps/plugins/lua/include_lua/printmenus.lua
+++ b/apps/plugins/lua/include_lua/printmenus.lua
@@ -23,74 +23,18 @@
if not rb.lcd_framebuffer then rb.splash(rb.HZ, "No Support!") return nil end
require("printtable")
+require("menucoresettings") --loads user settings from rockbox
local _clr = require("color")
+
local _LCD = rb.lcd_framebuffer()
--[[ -- dpad requires:
-require("actions") -- Contains rb.actions & rb.contexts
+local BUTTON = require("menubuttons")
local _timer = require("timer")
--- Button definitions --
-local CANCEL_BUTTON = rb.actions.PLA_CANCEL
-local DOWN_BUTTON = rb.actions.PLA_DOWN
-local DOWNR_BUTTON = rb.actions.PLA_DOWN_REPEAT
-local EXIT_BUTTON = rb.actions.PLA_EXIT
-local LEFT_BUTTON = rb.actions.PLA_LEFT
-local LEFTR_BUTTON = rb.actions.PLA_LEFT_REPEAT
-local RIGHT_BUTTON = rb.actions.PLA_RIGHT
-local RIGHTR_BUTTON = rb.actions.PLA_RIGHT_REPEAT
-local SEL_BUTTON = rb.actions.PLA_SELECT
-local SELREL_BUTTON = rb.actions.PLA_SELECT_REL
-local SELR_BUTTON = rb.actions.PLA_SELECT_REPEAT
-local UP_BUTTON = rb.actions.PLA_UP
-local UPR_BUTTON = rb.actions.PLA_UP_REPEAT
]]
--------------------------------------------------------------------------------
-local function get_core_settings()
- if rb.core_color_table ~= nil and rb.core_talk_table ~= nil and
- rb.core_list_settings_table ~= nil then return end
-
- local rbs_is_loaded = (package.loaded.rbsettings ~= nil)
- local s_is_loaded = (package.loaded.settings ~= nil)
-
- require("rbsettings")
- require("settings")
- rb.metadata = nil -- remove track metadata settings
-
- local rb_settings = rb.settings.dump('global_settings', "system")
- local color_table = {}
- local talk_table = {}
- local list_settings_table = {}
- local list_settings = "cursor_style|show_icons|statusbar|scrollbar|scrollbar_width|list_separator_height|backdrop_file|"
- for key, value in pairs(rb_settings) do
- key = key or ""
- if (key:find("color")) then
- color_table[key]=value
- elseif (key:find("talk")) then
- talk_table[key]=value
- elseif (list_settings:find(key)) then
- list_settings_table[key]=value
- end
- end
-
- if not s_is_loaded then
- rb.settings = nil
- package.loaded.settings = nil
- end
-
- if not rbs_is_loaded then
- rb.system = nil
- rb.metadata = nil
- package.loaded.rbsettings = nil
- end
-
- rb.core_color_table = color_table
- rb.core_talk_table = talk_table
- rb.core_list_settings_table = list_settings_table
- collectgarbage("collect")
-end
-
--[[ cursor style button routine
-- left / right are x, xi is increment xir is increment when repeat
-- up / down are y, yi is increment yir is increment when repeat
@@ -112,44 +56,44 @@ local function dpad(x, xi, xir, y, yi, yir, timeout, overflow)
while true do
button = rb.get_plugin_action(timeout)
- if button == CANCEL_BUTTON then
+ if button == BUTTON.CANCEL then
cancel = 1
break;
- elseif button == EXIT_BUTTON then
+ elseif button == BUTTON.EXIT then
cancel = 1
break;
- elseif button == SEL_BUTTON then
+ elseif button == BUTTON.SEL then
select = 1
timeout = timeout + 1
- elseif button == SELR_BUTTON then
+ elseif button == BUTTON.SELR then
select = 2
timeout = timeout + 1
- elseif button == SELREL_BUTTON then
+ elseif button == BUTTON.SELREL then
select = -1
timeout = timeout + 1
- elseif button == LEFT_BUTTON then
+ elseif button == BUTTON.LEFT then
x_chg = x_chg - xi
if scroll_is_fixed then
cancel = 1
break;
end
- elseif button == LEFTR_BUTTON then
+ elseif button == BUTTON.LEFTR then
x_chg = x_chg - xir
- elseif button == RIGHT_BUTTON then
+ elseif button == BUTTON.RIGHT then
x_chg = x_chg + xi
if scroll_is_fixed then
select = 1
timeout = timeout + 1
end
- elseif button == RIGHTR_BUTTON then
+ elseif button == BUTTON.RIGHTR then
x_chg = x_chg + xir
- elseif button == UP_BUTTON then
+ elseif button == BUTTON.UP then
y_chg = y_chg + yi
- elseif button == UPR_BUTTON then
+ elseif button == BUTTON.UPR then
y_chg = y_chg + yir
- elseif button == DOWN_BUTTON then
+ elseif button == BUTTON.DOWN then
y_chg = y_chg - yi
- elseif button == DOWNR_BUTTON then
+ elseif button == BUTTON.DOWNR then
y_chg = y_chg - yir
elseif timeout >= 0 then--and rb.button_queue_count() < 1 then
break;
@@ -175,7 +119,6 @@ function print_menu(menu_t, func_t, selected, settings, copy_screen)
if selected then vcur = selected + 1 end
if vcur and vcur <= 1 then vcur = 2 end
- get_core_settings()
local c_table = rb.core_color_table or {}
if not settings then
@@ -239,7 +182,7 @@ function print_menu(menu_t, func_t, selected, settings, copy_screen)
if copy_screen == true then _LCD:copy(screen_img) end
if func_t and func_t[i] then
- if func_t[i](i, menu_t) == true then break end
+ if func_t[i](i, menu_t, func_t) == true then break end
else
break
end
diff --git a/apps/plugins/lua/include_lua/printsubmenu.lua b/apps/plugins/lua/include_lua/printsubmenu.lua
new file mode 100644
index 0000000000..f4b93db98d
--- /dev/null
+++ b/apps/plugins/lua/include_lua/printsubmenu.lua
@@ -0,0 +1,314 @@
+--[[
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2021 William Wilgus
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+]]
+if not rb.lcd_framebuffer then rb.splash(rb.HZ, "No Support!") return nil end
+--GLOBALS
+menu_ctx = {}
+submenu_insert = table.insert
+submenu_remove = table.remove
+
+local last_ctx = false
+local p_settings
+local function empty_fn() end
+
+--[[root menu tables
+expanded menus get inserted / removed
+and context menus replace them but unless you
+want a new root menu they are never overwritten
+func_t functions get 3 variables passed by the menu_system
+func_t[i] =function sample(i, menu_t, func_t]
+this function gets run on user selection
+for every function in func_t:
+'i' is the selected item
+'menu_t' is the current strings table
+'func_t' is the current function table
+
+menu_t[i] will returnm the text of the item user selected and
+func_t[i] will return the function we are currently in
+]]
+
+menu_t = {}
+func_t = {}
+
+require("printmenus")
+
+local BUTTON = require("menubuttons")
+local last_sel = 0
+
+local function display_context_menu() end -- forward declaration
+
+local function dpad(x, xi, xir, y, yi, yir, timeout, overflow, selected)
+ local scroll_is_fixed = overflow ~= "manual"
+ if timeout == nil then timeout = -1 end
+ local cancel, select = 0, 0
+ local x_chg, y_chg = 0, 0
+ local button
+ while true do
+ button = rb.get_plugin_action(timeout)
+
+ if button == BUTTON.CANCEL then
+ cancel = 1
+ break;
+ elseif button == BUTTON.EXIT then
+ cancel = 1
+ break;
+ elseif button == BUTTON.SEL then
+ last_sel = 1
+ timeout = timeout + 1
+ elseif button == BUTTON.SELR then
+ last_sel = 2
+ if display_context_menu(selected or -1) == true then
+ select = 1
+ break;
+ end
+ timeout = timeout + 1
+ elseif button == BUTTON.SELREL then
+ if last_sel == 1 then
+ select = 1
+ end
+ last_sel = 0
+ timeout = timeout + 1
+ elseif button == BUTTON.LEFT then
+ x_chg = x_chg - xi
+ if scroll_is_fixed then
+ cancel = 1
+ break;
+ end
+ elseif button == BUTTON.LEFTR then
+ x_chg = x_chg - xir
+ elseif button == BUTTON.RIGHT then
+ x_chg = x_chg + xi
+ if scroll_is_fixed then
+ select = 1
+ timeout = timeout + 1
+ end
+ elseif button == BUTTON.RIGHTR then
+ x_chg = x_chg + xir
+ elseif button == BUTTON.UP then
+ y_chg = y_chg + yi
+ elseif button == BUTTON.UPR then
+ y_chg = y_chg + yir
+ elseif button == BUTTON.DOWN then
+ y_chg = y_chg - yi
+ elseif button == BUTTON.DOWNR then
+ y_chg = y_chg - yir
+ elseif timeout >= 0 then--and rb.button_queue_count() < 1 then
+ break;
+ end
+
+ if x_chg ~= 0 or y_chg ~= 0 then
+ timeout = timeout + 1
+ end
+ end
+
+ x = x + x_chg
+ y = y + y_chg
+
+ return cancel, select, x_chg, x, y_chg, y, 0xffff
+end -- dpad
+
+local function ctx_loop()
+ local loopfn = ctx_loop
+ ctx_loop = empty_fn() --prevent another execution
+ local mt, ft = get_menu()
+ local i
+ repeat
+ if menu_ctx.update then mt, ft = get_menu(); menu_ctx.update = false end
+ _, i = print_menu(mt, ft, menu_ctx.start, p_settings)
+ until menu_ctx.quit
+
+ ctx_loop = loopfn --restore for another run
+end
+
+--[[ push_ctx() save surrent menu and load another ]]
+local function push_ctx(new_getmenu)
+ last_ctx = last_ctx or {}
+ submenu_insert(last_ctx, menu_ctx)
+ menu_ctx.getmenu = get_menu
+ menu_ctx.settings = p_settings
+ --menu_ctx is a new variable after this point
+ submenu_set_defaults()
+ menu_ctx.update = true
+ if type(new_getmenu) == 'function' then
+ get_menu = new_getmenu
+ end
+end
+
+--[[ pop_ctx() restore last menu ]]
+local function pop_ctx()
+ menu_ctx = submenu_remove(last_ctx)
+ if menu_ctx then
+ get_menu = menu_ctx.getmenu
+ p_settings = menu_ctx.settings
+ if menu_ctx.restorefn then
+ menu_ctx.restorefn(menu_t, func_t)
+ menu_ctx.restorefn = nil
+ end
+ menu_ctx.getmenu = nil
+ menu_ctx.settings = nil
+ menu_ctx.update = true
+ return true
+ end
+end
+
+--[[ display_context_menu_internal() supplies a new get_menu function that returns
+ the context menu 'user_context_fn' supplied by set_menu()
+ this menu is immediately displayed and when finished will
+ automatically restore the last menu
+]]
+local function display_context_menu_internal(sel)
+ if sel <= 0 or not menu_ctx.user_context_fn then return false end
+ local parent = submenu_get_parent() or 0
+ local user_context_fn = menu_ctx.user_context_fn
+
+ local function display_context_menu(i, menu_t, func_t)
+ local function new_getmenu()
+ local mt, ft = user_context_fn(parent, i, menu_t, func_t)
+ ft[0] = pop_ctx --set back fn
+ return mt, ft
+ end
+ push_ctx(new_getmenu)
+ return true
+ end
+
+ --save the current function in closure restore_fn for later
+ local funct = func_t[sel]
+ local function restore_fn(mt, ft)
+ ft[sel] = funct
+ menu_ctx.start = sel - 1
+ end
+
+ menu_ctx.restorefn = restore_fn
+ -- insert into the current fn table so it gets execd by the menu
+ func_t[sel] = display_context_menu
+
+ return true
+end
+
+--[[ submenu_get_parent() gets the parent of the top most level
+ if lv is supplied it instead gets the parent of that level ]]
+function submenu_get_parent(lv)
+ lv = lv or #menu_ctx.collapse_fn or 1
+ collectgarbage("step")
+ local t = menu_ctx.collapse_fn[lv] or {}
+ return t[2] or -1, lv
+end
+
+--[[ submenu_collapse() collapses submenu till level or ROOT is reached ]]
+function submenu_collapse(parent, lv)
+ local lv_out, menu_sz = 0, 0
+ local item_out = -1
+ local items_removed = 0
+ if lv <= #menu_ctx.collapse_fn then
+ repeat
+ local collapse_fn = submenu_remove(menu_ctx.collapse_fn)
+ if collapse_fn then
+ lv_out, item_out, menu_sz = collapse_fn[1](parent, menu_t, func_t)
+ items_removed = items_removed + menu_sz
+ end
+
+ until not collapse_fn or lv >= lv_out
+ end
+ return lv_out, item_out, items_removed
+end
+
+--[[ submenu_create() supply level of submenu > 0, ROOT is lv 0
+ supply menu strings table and function table
+ closure returned run this function to expand the menu
+]]
+function submenu_create(lv, mt, ft)
+ if lv < 1 then error("Level < 1") end
+ if type(mt) ~= 'table' or type(ft) ~= 'table' then
+ error("mt and ft must be tables")
+ end
+
+ -- everything in lua is 1 based menu level is no exception
+ local lv_tab = string.rep ("\t", lv)
+ local function submenu_closure(i, m, f)
+ menu_ctx.lv = lv
+ local lv_out, menusz_out, start_item
+ local item_in, item_out = i, i
+ if lv <= #menu_ctx.collapse_fn then --something else expanded??
+ repeat
+ local collapse_fn = submenu_remove(menu_ctx.collapse_fn)
+ if collapse_fn then
+ lv_out, item_out, menusz_out = collapse_fn[1](i, m, f)
+ -- if the item i is below this menu, it needs to shift too
+ if item_in > item_out then i = i - (menusz_out) end
+ end
+ until not collapse_fn or lv >= lv_out
+ menu_ctx.start = i
+ if item_out == item_in then return end
+ end
+
+ local menu_sz = #mt
+ menu_ctx.start = i
+ start_item = i
+ menu_ctx.update = true
+ for item, _ in ipairs(mt) do
+ i = i + 1
+ submenu_insert(m, i, lv_tab .. mt[item])
+ submenu_insert(f, i, ft[item])
+ end
+
+ local function collapse_closure(i, m, f)
+ --creates a closure around lv, start_item and menu_sz
+ for j = 1, menu_sz, 1 do
+ submenu_remove(m, start_item + 1)
+ submenu_remove(f, start_item + 1)
+ end
+ return lv, start_item, menu_sz
+ end
+
+ submenu_insert(menu_ctx.collapse_fn, lv, {collapse_closure, start_item})
+ return true
+ end
+
+ return submenu_closure
+end
+
+--
+function submenu_set_defaults(settings, ctx)
+ p_settings = settings or {wrap = true, hasheader = true, justify = "left", dpad_fn = dpad}
+ menu_ctx = ctx or {collapse_fn = {}, lv = 0, update = false, start = 1}
+end
+
+--[[ get_menu() returns the ROOT string and fn tables]]
+function get_menu()
+ return menu_t, func_t
+end
+
+--[[ set_menu() set your menu and the menu has now been entered ]]
+function set_menu(mt, ft, user_context_fn, settings)
+
+ submenu_set_defaults(settings)
+ if type(user_context_fn) == 'function' then
+ display_context_menu = display_context_menu_internal
+ menu_ctx.user_context_fn = user_context_fn
+ else
+ display_context_menu = empty_fn
+ menu_ctx.user_context_fn = false
+ end
+ p_settings = settings or p_settings
+ menu_t, func_t = mt, ft
+ ctx_loop()
+end
diff --git a/apps/plugins/lua/include_lua/printtable.lua b/apps/plugins/lua/include_lua/printtable.lua
index c23d801f83..c70fc1343f 100644
--- a/apps/plugins/lua/include_lua/printtable.lua
+++ b/apps/plugins/lua/include_lua/printtable.lua
@@ -22,28 +22,12 @@
]]
if not rb.lcd_framebuffer then rb.splash(rb.HZ, "No Support!") return nil end
-require("actions") -- Contains rb.actions & rb.contexts
-
local _clr = require("color")
local _print = require("print")
local _timer = require("timer")
+local BUTTON = require("menubuttons")
local sb_width = 5
--- Button definitions --
-local CANCEL_BUTTON = rb.actions.PLA_CANCEL
-local DOWN_BUTTON = rb.actions.PLA_DOWN
-local DOWNR_BUTTON = rb.actions.PLA_DOWN_REPEAT
-local EXIT_BUTTON = rb.actions.PLA_EXIT
-local LEFT_BUTTON = rb.actions.PLA_LEFT
-local LEFTR_BUTTON = rb.actions.PLA_LEFT_REPEAT
-local RIGHT_BUTTON = rb.actions.PLA_RIGHT
-local RIGHTR_BUTTON = rb.actions.PLA_RIGHT_REPEAT
-local SEL_BUTTON = rb.actions.PLA_SELECT
-local SELREL_BUTTON = rb.actions.PLA_SELECT_REL
-local SELR_BUTTON = rb.actions.PLA_SELECT_REPEAT
-local UP_BUTTON = rb.actions.PLA_UP
-local UPR_BUTTON = rb.actions.PLA_UP_REPEAT
-
-- clamps value to >= min and <= max
local function clamp(iVal, iMin, iMax)
if iMin > iMax then
@@ -71,7 +55,7 @@ end
-- time since last button press is returned in ticks..
-- make xi, xir, yi, yir negative to flip direction...
]]
-local function dpad(x, xi, xir, y, yi, yir, timeout, overflow)
+local function dpad(x, xi, xir, y, yi, yir, timeout, overflow, selected)
local scroll_is_fixed = overflow ~= "manual"
_timer("dpad") -- start a persistant timer; keeps time between button events
if timeout == nil then timeout = -1 end
@@ -81,44 +65,44 @@ local function dpad(x, xi, xir, y, yi, yir, timeout, overflow)
while true do
button = rb.get_plugin_action(timeout)
- if button == CANCEL_BUTTON then
+ if button == BUTTON.CANCEL then
cancel = 1
break;
- elseif button == EXIT_BUTTON then
+ elseif button == BUTTON.EXIT then
cancel = 1
break;
- elseif button == SEL_BUTTON then
+ elseif button == BUTTON.SEL then
select = 1
timeout = timeout + 1
- elseif button == SELR_BUTTON then
+ elseif button == BUTTON.SELR then
select = 2
timeout = timeout + 1
- elseif button == SELREL_BUTTON then
+ elseif button == BUTTON.SELREL then
select = -1
timeout = timeout + 1
- elseif button == LEFT_BUTTON then
+ elseif button == BUTTON.LEFT then
x_chg = x_chg - xi
if scroll_is_fixed then
cancel = 1
break;
end
- elseif button == LEFTR_BUTTON then
+ elseif button == BUTTON.LEFTR then
x_chg = x_chg - xir
- elseif button == RIGHT_BUTTON then
+ elseif button == BUTTON.RIGHT then
x_chg = x_chg + xi
if scroll_is_fixed then
select = 1
timeout = timeout + 1
end
- elseif button == RIGHTR_BUTTON then
+ elseif button == BUTTON.RIGHTR then
x_chg = x_chg + xir
- elseif button == UP_BUTTON then
+ elseif button == BUTTON.UP then
y_chg = y_chg + yi
- elseif button == UPR_BUTTON then
+ elseif button == BUTTON.UPR then
y_chg = y_chg + yir
- elseif button == DOWN_BUTTON then
+ elseif button == BUTTON.DOWN then
y_chg = y_chg - yi
- elseif button == DOWNR_BUTTON then
+ elseif button == BUTTON.DOWNR then
y_chg = y_chg - yir
elseif timeout >= 0 then--and rb.button_queue_count() < 1 then
break;
@@ -247,7 +231,8 @@ function print_table(t, t_count, settings)
rb.lcd_update()
local quit, select, x_chg, xi, y_chg, yi, timeb =
- dpad_fn(t_p.col, -1, -t_p.col_scrl, t_p.row, -1, -t_p.row_scrl, nil, overflow)
+ dpad_fn(t_p.col, -1, -t_p.col_scrl, t_p.row, -1, -t_p.row_scrl,
+ nil, overflow, (t_p.row + t_p.vcursor - 1))
t_p.vcursor = t_p.vcursor + y_chg
@@ -316,7 +301,7 @@ function print_table(t, t_count, settings)
if t[i] == nil then
rb.splash(1, string.format("ERROR %d is nil", i))
t[i] = "???"
- if rb.get_plugin_action(10) == CANCEL_BUTTON then return 0 end
+ if rb.get_plugin_action(10) == BUTTON.CANCEL then return 0 end
end
if m_sel == true and t[i]:sub(-1) == "\0" then
@@ -351,6 +336,16 @@ function print_table(t, t_count, settings)
table_p = init_position(15, 5)
line, maxline = _print.opt.area(5, 1, rb.LCD_WIDTH - 10 - sb_width, rb.LCD_HEIGHT - 2)
+
+ if (curpos or 0) > maxline then
+ local c = maxline / 2
+ start = (start or 1) + curpos - maxline
+ curpos = maxline
+ while start + maxline <= t_count and curpos > c do
+ curpos = curpos - 1
+ start = start + 1
+ end
+ end
maxline = math.min(maxline, t_count)
-- allow user to start at a position other than the beginning
diff --git a/apps/plugins/lua/include_lua/rbsettings.lua b/apps/plugins/lua/include_lua/rbsettings.lua
index defdb11b77..995e5023c9 100644
--- a/apps/plugins/lua/include_lua/rbsettings.lua
+++ b/apps/plugins/lua/include_lua/rbsettings.lua
@@ -151,12 +151,15 @@ function rb.settings.read(s_settings, s_var, s_groupname)
return data
end
-function rb.settings.dump(s_settings, s_groupname, s_structname, t_output)
+function rb.settings.dump(s_settings, s_groupname, s_structname, t_output, fn_filter)
t_output = t_output or {}
+ fn_filter = fn_filter or function(s,k) return true end
local tgroup = rb[s_groupname]
s_structname = s_structname or s_settings
for k, v in pairs(tgroup[s_structname]) do
- t_output[k] = rb.settings.read(s_settings, v, s_groupname)
+ if fn_filter(s_structname, k) then
+ t_output[k] = rb.settings.read(s_settings, v, s_groupname)
+ end
end
return t_output
end
diff --git a/apps/plugins/lua/include_lua/temploader.lua b/apps/plugins/lua/include_lua/temploader.lua
new file mode 100644
index 0000000000..7fd58aee99
--- /dev/null
+++ b/apps/plugins/lua/include_lua/temploader.lua
@@ -0,0 +1,63 @@
+--[[
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2021 William Wilgus
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+--
+temp_loader allows some (pure) lua requires to be loaded and later garbage collected
+unfortunately the 'required' module needs to be formatted in such a way to
+pass back a reference to a function or call table in order to keep the functions
+within from being garbage collected too early
+
+modules that add things to _G table are unaffected by using this function
+except if later you use require or temp_loader those tables will again
+be reloaded with fresh data since nothing was recorded about the module being loaded
+
+modulename - same as require()
+newinstance == true -- get a new copy (from disk) of the module
+... other args for the module
+
+BE AWARE this bypasses the module loader
+which would allow code reuse so if you aren't careful this memory saving tool
+could spell disaster for free RAM if you load the same code multiple times
+--]]
+
+local function tempload(modulename, newinstance, ...)
+ --http://lua-users.org/wiki/LuaModulesLoader
+ local errmsg = ""
+ -- Is there current a loaded module by this name?
+ if package.loaded[modulename] ~= nil and not newinstance then
+ return require(modulename)
+ end
+ -- Find source
+ local modulepath = string.gsub(modulename, "%.", "/")
+ for path in string.gmatch(package.path, "([^;]+)") do
+ local filename = string.gsub(path, "%?", modulepath)
+ --attempt to open and compile module
+ local file, err = loadfile(filename)
+ if file then
+ -- execute the compiled chunk
+ return file(... or modulename)
+ end
+ errmsg = table.concat({errmsg, "\n\tno file '", filename, "' (temp loader)"})
+ end
+ return nil, errmsg
+end
+
+return tempload
diff --git a/apps/plugins/lua/lauxlib.c b/apps/plugins/lua/lauxlib.c
index acd7e0e636..b8332427f0 100644
--- a/apps/plugins/lua/lauxlib.c
+++ b/apps/plugins/lua/lauxlib.c
@@ -268,7 +268,8 @@ static int latebind_func_index(lua_State *L)
const char *name = lua_tostring(L, -1);
lua_pushstring (L, "__latebind");/* basetable;name;__latebind;*/
- lua_rawget (L, -3);/* basetable;name;__latebind(t);*/
+ if(lua_istable(L, -3))
+ lua_rawget (L, -3);/* basetable;name;__latebind(t);*/
luaL_argcheck(L, lua_istable(L, -3) && lua_istable(L, -1), 1,
"__latebind table expected");
@@ -324,25 +325,31 @@ static int latebind_func_pairs(lua_State *L)
{
/* basetable @ top of stack 1(basetable)-1 */
luaL_argcheck(L, lua_istable(L, 1), 1, "table expected");
- lua_getglobal(L, "pairs"); /* function to be called / returned (btable;pairs) */
- lua_createtable(L, 0, 15); /* btable;pairs;newtable; */
- /* clone base table */
+#if 0
+ lua_getglobal(L, "next"); /* function to be called / returned (btable;next) */
+ lua_createtable(L, 0, 15); /* btable;next;newtable; */
+ lua_pushnil(L); /* nil name retrieves all unbound latebound functions */
lua_pushnil(L); /* first key */
- while(lua_next(L, 1) != 0) {
- /* (btable;pairs;ntable;k;v) */
+#else
+ /* this way is more RAM efficient in testing */
+ if(luaL_dostring(L, "return next, {}, nil, nil")!= 0)
+ lua_error(L);
+#endif
+ /* (btable;next;ntable;nil;nil) */
+ /* clone base table */
+ while(lua_next(L, 1) > 0) {
+ /* (btable;next;ntable;nil;k;v) */
lua_pushvalue(L, -2); /* dupe key Stk = (..;k;v -> ..k;v;k)*/
lua_insert(L, -2); /* Stk = (..k;k;v) */
- lua_rawset(L, 3); /* btable;pairs;ntable;k */
+ lua_rawset(L, -5); /* btable;next;ntable;nil;k */
}
-
- lua_pushnil(L); /*nil name retrieves all unbound late bound functions */
- latebind_func_index(L);/* (btable;pairs;ntable;nil) -> (btable;pairs;ntable) */
-
- /* (btable;pairs;ntable) */
- lua_call(L, 1, 3); /* pairs(ntable) -> (btable;iter;state;value) */
-
- return 3;
+ /* fill the new table with all the latebound functions */
+ /* nil name retrieves all unbound latebound functions */
+ latebind_func_index(L);/* (btable;next;ntable;nil) -> (btable;next;ntable) */
+ lua_pushnil(L); /*nil initial key for next*/
+ /* stack = (btable;next;ntable;nil) */
+ return 3; /*(next,ntable,nil)*/
}
diff --git a/apps/plugins/lua/loadlib.c b/apps/plugins/lua/loadlib.c
index 1e310beed1..732ad707b5 100644
--- a/apps/plugins/lua/loadlib.c
+++ b/apps/plugins/lua/loadlib.c
@@ -130,9 +130,11 @@ static int ll_require (lua_State *L) {
lua_pushliteral(L, ""); /* error message accumulator */
for (i=1; ; i++) {
lua_rawgeti(L, -2, i); /* get a loader */
- if (lua_isnil(L, -1))
+ if (lua_isnil(L, -1)) {
+ lua_setfield(L, 2, name); /* _LOADED[name] = nil */
luaL_error(L, "module " LUA_QS " not found:%s",
name, lua_tostring(L, -2));
+ }
lua_pushstring(L, name);
lua_call(L, 1, 1); /* call it */
if (lua_isfunction(L, -1)) /* did it find module? */
diff --git a/apps/plugins/lua/lparser.c b/apps/plugins/lua/lparser.c
index 8b93237918..23d3972036 100644
--- a/apps/plugins/lua/lparser.c
+++ b/apps/plugins/lua/lparser.c
@@ -603,7 +603,12 @@ static void parlist (LexState *ls) {
} while (!f->is_vararg && testnext(ls, ','));
}
adjustlocalvars(ls, nparams);
+ //f->numparams = cast_byte(fs->nactvar - (f->is_vararg & VARARG_HASARG));
+#if defined(LUA_COMPAT_VARARG)
f->numparams = cast_byte(fs->nactvar - (f->is_vararg & VARARG_HASARG));
+#else
+ f->numparams = cast_byte(fs->nactvar);
+#endif
luaK_reserveregs(fs, fs->nactvar); /* reserve register for parameters */
}
diff --git a/apps/plugins/lua/lua.make b/apps/plugins/lua/lua.make
index 1e74277549..60dfd24cdd 100644
--- a/apps/plugins/lua/lua.make
+++ b/apps/plugins/lua/lua.make
@@ -16,11 +16,14 @@ LUA_OBJ := $(call c2obj, $(LUA_SRC))
OTHER_SRC += $(LUA_SRC)
LUA_INCLUDEDIR := $(LUA_SRCDIR)/include_lua
-LUA_INCLUDELIST := $(addprefix $(LUA_BUILDDIR)/,audio.lua blit.lua color.lua draw.lua draw_floodfill.lua draw_poly.lua \
- draw_num.lua draw_text.lua files.lua image.lua image_save.lua lcd.lua math_ex.lua \
- print.lua timer.lua playlist.lua pcm.lua sound.lua printmenus.lua\
- rbcompat.lua rbsettings.lua poly_points.lua printtable.lua)
-
+LUA_INCLUDELIST := $(addprefix $(LUA_BUILDDIR)/,audio.lua blit.lua color.lua \
+ draw.lua draw_floodfill.lua draw_poly.lua draw_num.lua \
+ draw_text.lua files.lua image.lua image_save.lua lcd.lua \
+ math_ex.lua print.lua timer.lua playlist.lua pcm.lua \
+ sound.lua rbcompat.lua rbsettings.lua poly_points.lua \
+ printtable.lua printmenus.lua printsubmenu.lua \
+ menubuttons.lua menucoresettings.lua create_kbd_layout.lua \
+ temploader.lua)
ifndef APP_TYPE
ROCKS += $(LUA_BUILDDIR)/lua.rock
diff --git a/apps/plugins/lua/rbdefines_helper.pl b/apps/plugins/lua/rbdefines_helper.pl
index eca09187fa..e788855e87 100755
--- a/apps/plugins/lua/rbdefines_helper.pl
+++ b/apps/plugins/lua/rbdefines_helper.pl
@@ -47,7 +47,7 @@ if ($def_type eq "rb_defines") {
'^PLAYLIST_(INSERT|PREPEND|REPLACE)',
'^TOUCHSCREEN_(POINT|BUTTON)$',
'^SYS_CHARGER_(DIS|)CONNECTED$',
- '^SYS_(TIMEOUT|POWEROFF)$',
+ '^SYS_(TIMEOUT|POWEROFF|BATTERY_UPDATE)$',
'^SYS_USB_(DIS|)CONNECTED$',
'^HOME_DIR$',
'^PLUGIN_DIR$',
diff --git a/apps/plugins/lua/rockaux.c b/apps/plugins/lua/rockaux.c
index 25bace3451..929dea798b 100644
--- a/apps/plugins/lua/rockaux.c
+++ b/apps/plugins/lua/rockaux.c
@@ -52,6 +52,8 @@ char *strerror(int errnum)
*/
int splash_scroller(int timeout, const char* str)
{
+ if (!str)
+ str = "[nil]";
int w, ch_w, ch_h;
rb->lcd_getstringsize("W", &ch_w, &ch_h);
@@ -104,7 +106,8 @@ int splash_scroller(int timeout, const char* str)
{
brk = strpbrk_n(ch+1, max_ch, break_chars);
chars_next_break = (brk - ch);
- if (chars_next_break < 2 || w + (ch_w * chars_next_break) > max_w)
+ if (brk &&
+ (chars_next_break < 2 || w + (ch_w * chars_next_break) > max_w))
{
if (!isprint(line[linepos]))
{
@@ -133,28 +136,32 @@ int splash_scroller(int timeout, const char* str)
}
rb->lcd_update();
-
- action = rb->get_action(CONTEXT_STD, timeout);
- switch(action)
+ if (timeout >= TIMEOUT_BLOCK)
{
- case ACTION_STD_OK:
- case ACTION_STD_CANCEL:
- cycles--;
- /* Fall Through */
- case ACTION_NONE:
- cycles--;
- break;
- case ACTION_STD_PREV:
- timeout = TIMEOUT_BLOCK; /* disable timeout */
- if(firstline > 0)
- firstline--;
- break;
- case ACTION_STD_NEXT:
- timeout = TIMEOUT_BLOCK; /* disable timeout */
- if (linesdisp == max_lines)
- firstline++;
- break;
+ action = rb->get_action(CONTEXT_STD, timeout);
+ switch(action)
+ {
+ case ACTION_STD_OK:
+ case ACTION_STD_CANCEL:
+ cycles--;
+ /* Fall Through */
+ case ACTION_NONE:
+ cycles--;
+ break;
+ case ACTION_STD_PREV:
+ timeout = TIMEOUT_BLOCK; /* disable timeout */
+ if(firstline > 0)
+ firstline--;
+ break;
+ case ACTION_STD_NEXT:
+ timeout = TIMEOUT_BLOCK; /* disable timeout */
+ if (linesdisp == max_lines)
+ firstline++;
+ break;
+ }
}
+ else
+ break;
}
return action;
}
@@ -220,7 +227,7 @@ int get_current_path(lua_State *L, int level)
}
}
- lua_pushnil(L);
+ lua_pushnil(L);
return 1;
}
@@ -244,25 +251,32 @@ int filetol(int fd, long *num)
while (rb->read(fd, &chbuf, 1) == 1)
{
- if(!isspace(chbuf) || retn == 1)
+ if(retn || !isspace(chbuf))
{
- if(chbuf == '0') /* strip preceeding zeros */
- {
- *num = 0;
- retn = 1;
- }
- else if(chbuf == '-' && retn != 1)
- neg = true;
- else
+ switch(chbuf)
{
- rb->lseek(fd, -1, SEEK_CUR);
- break;
+ case '-':
+ {
+ if (retn) /* 0 preceeds, this negative sign must be in error */
+ goto get_digits;
+ neg = true;
+ continue;
+ }
+ case '0': /* strip preceeding zeros */
+ {
+ *num = 0;
+ retn = 1;
+ continue;
+ }
+ default:
+ goto get_digits;
}
}
}
while (rb->read(fd, &chbuf, 1) == 1)
{
+get_digits:
if(!isdigit(chbuf))
{
rb->lseek(fd, -1, SEEK_CUR);
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index 81b6f4ce2a..2672d446fc 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -143,10 +143,17 @@ RB_WRAP(touchscreen_mode)
RB_WRAP(kbd_input)
{
+ /*kbd_input(text, layout)*
+ note: layout needs special formatting
+ see includes/create_kbd_layout.lua
+ or lib/kbd_helper.c
+ */
luaL_Buffer b;
luaL_buffinit(L, &b);
const char *input = lua_tostring(L, 1);
+ size_t layout_len;
+ const unsigned char *layout = lua_tolstring(L, 2, &layout_len);
char *buffer = luaL_prepbuffer(&b);
if(input != NULL)
@@ -154,7 +161,14 @@ RB_WRAP(kbd_input)
else
buffer[0] = '\0';
- if(!rb->kbd_input(buffer, LUAL_BUFFERSIZE, NULL))
+ if(layout_len <= 2 ||
+ layout[layout_len - 1] != 0xFE ||
+ layout[layout_len - 2] != 0xFF)
+ {
+ layout = NULL;
+ }
+
+ if(!rb->kbd_input(buffer, LUAL_BUFFERSIZE, (unsigned short *)layout))
{
luaL_addstring(&b, buffer);
luaL_pushresult(&b);
diff --git a/apps/plugins/lua_scripts/print_buttons.lua b/apps/plugins/lua_scripts/print_buttons.lua
new file mode 100644
index 0000000000..1b488ddd64
--- /dev/null
+++ b/apps/plugins/lua_scripts/print_buttons.lua
@@ -0,0 +1,70 @@
+-- bilgus 4/2021
+require "buttons"
+local BUTTON_NONE = 0
+
+local function decode_ord_btn(btn)
+ local btntxt = ""
+ for k, v in pairs(rb.buttons) do
+ if btn > BUTTON_NONE and v ~= BUTTON_NONE and bit.band(btn, v) == v then
+ if #btntxt > 0 then
+ btntxt = btntxt .. " | "
+ end
+ btntxt = btntxt .. k
+ end
+ end
+ if btntxt == "" then return nil end
+ return btntxt
+end
+
+local _, w, h = rb.font_getstringsize("W", rb.FONT_UI)
+local max_lines = rb.LCD_HEIGHT / h - 1
+
+button_text = {}
+for k, v in pairs(rb.buttons) do
+ button_text[v] = k
+end
+
+--Add the system button codes to the button_text table
+for k, v in pairs(rb) do
+ if string.find(k or "", "SYS_", 1, true) and type(v) == "number" then
+ button_text[v] = k
+ end
+end
+
+local s = {[1] = "Buttons Found:"}
+for k, v in pairs(button_text) do
+ table.insert(s, tostring(k) .. " : " .. tostring(v))
+end
+rb.splash_scroller(rb.HZ, table.concat(s, "\n"))
+
+button_text[BUTTON_NONE] = " "
+
+local lastbtn = BUTTON_NONE
+local lastkey = BUTTON_NONE
+local s_t = {"Press same button 3x to exit"}
+local keyrpt = 0
+
+repeat
+
+ local btn
+ if lastbtn == BUTTON_NONE then
+ btn = rb.button_get(true)
+ else
+ btn = rb.button_get_w_tmo(rb.HZ)
+ end
+
+ if btn ~= lastkey then
+ table.insert(s_t, 1, (button_text[btn] or decode_ord_btn(btn) or "unknown " .. tostring (btn)))
+ end
+
+ if btn == lastbtn then keyrpt = keyrpt + 1 end
+ if button_text[btn] then lastbtn = btn end
+ lastkey = btn
+
+ rb.splash_scroller(-2, table.concat(s_t, "\n"))
+
+ if #s_t > max_lines then
+ table.remove(s_t)
+ end
+
+until keyrpt >= 2
diff --git a/apps/plugins/lua_scripts/print_lua_func.lua b/apps/plugins/lua_scripts/print_lua_func.lua
index ef0290bbd8..8519914d5f 100644
--- a/apps/plugins/lua_scripts/print_lua_func.lua
+++ b/apps/plugins/lua_scripts/print_lua_func.lua
@@ -1,23 +1,26 @@
+
--RB LUA show all global variables; BILGUS
-require "actions"
-require "audio"
-require "buttons"
-require "color"
-require "draw"
-require "draw_floodfill"
-require "draw_poly"
-require "draw_text"
-
-require "image"
-require "image_save"
-
-require "lcd"
-require "math_ex"
-require "pcm"
-require "playlist"
-require "print"
---require "settings" --uses a lot of memory
-require "sound"
+if not ... then --if executed directly this is nil
+ require "actions"
+ require "audio"
+ require "buttons"
+ require "color"
+ require "draw"
+ require "draw_floodfill"
+ require "draw_poly"
+ require "draw_text"
+
+ require "image"
+ require "image_save"
+
+ require "lcd"
+ require "math_ex"
+ require "pcm"
+ require "playlist"
+ require "print"
+ --require "settings" --uses a lot of memory
+ require "sound"
+end
collectgarbage("collect")
local sDumpFile = "/rb-lua_functions.txt"
@@ -276,8 +279,9 @@ end
for i=1, #tWriteBuf do tWriteBuf[i] = _NIL end -- reuse table
end
end
-
- tcBase= nil tkSortCbase= nil
+ if ... then
+ tcBase= nil tkSortCbase= nil
+ end
tWriteBuf[#tWriteBuf + 1] = "\r\n"
tWriteBuf[#tWriteBuf + 1] = dtTag("?")
tWriteBuf[#tWriteBuf + 1] = "\r\n\r\n"
@@ -306,5 +310,29 @@ end
filehandle:write(table.concat(tWriteBuf))
for i=1, #tWriteBuf do tWriteBuf[i] = _NIL end -- empty table
filehandle:close()
- rb.splash(rb.HZ * 5, n .. " Items dumped to : " .. sDumpFile)
+ --rb.splash((rb.HZ or 100) * 5, n .. " Items dumped to : " .. sDumpFile)
--rb.splash(500, collectgarbage("count"))
+if not ... then
+ local lu = collectgarbage("collect")
+ local used, allocd, free = rb.mem_stats()
+ local lu = collectgarbage("count")
+ local fmt = function(t, v) return string.format("%s: %d Kb\n", t, v /1024) end
+ local s_t = {}
+ s_t[1] = n
+ s_t[2] = " Items dumped to:\n"
+ s_t[3] = sDumpFile
+ s_t[4] = "\n\nLoaded Modules:\n"
+ n = 0
+ for k, v in pairsByPairs(tcBase, tkSortCbase ) do
+ n = n + 1
+ if n ~= 1 then
+ s_t[#s_t + 1] = ", "
+ end
+ s_t[#s_t + 1] = tostring(k)
+ if n >= 3 then -- split loaded modules to multiple lines
+ n = 0
+ s_t[#s_t + 1] = "\n"
+ end
+ end
+ rb.splash_scroller(5 * (rb.HZ or 100), table.concat(s_t))
+end
diff --git a/apps/plugins/lua_scripts/submenu_demo.lua b/apps/plugins/lua_scripts/submenu_demo.lua
new file mode 100644
index 0000000000..8eac825474
--- /dev/null
+++ b/apps/plugins/lua_scripts/submenu_demo.lua
@@ -0,0 +1,121 @@
+--Bilgus 4/2021 Menu with subitems and context demo
+require("printsubmenu")
+
+local scrpath = rb.current_path()
+
+local function get_ctx_menu(parent, sel, menu_t, func_t)
+ local mt = {"Context menu " .. (menu_t[parent] or "ROOT") ..
+ " : " .. menu_t[sel], "Quit", "Action 1", "Action 2"}
+ local ft = {false, function() menu_ctx.quit = true return true end}
+ return mt, ft
+end
+
+local function ITEM_MENU()
+
+ local function flung(i, menu_t, func_t)
+ local parent = submenu_get_parent() or 0
+ rb.splash(100, "flung " .. (menu_t[parent] or "?"))
+ end
+
+ local function foo(i, menu_t, func_t)
+ local parent = submenu_get_parent() or 0
+ rb.splash(100, "FOO " .. menu_t[parent])
+ end
+
+ local function far(i, menu_t, func_t)
+ local parent = submenu_get_parent() or 0
+ rb.splash(100, "far" .. menu_t[parent])
+ end
+
+ return {"Flung", "FOO", "Far"},
+ {flung, foo, far}
+end
+
+local function USERITEMS()
+ local lv = 2
+ local mt = {"Item_1", "Item_2", "Item_3"}
+ local ft = {}
+
+ local function insert_item(i, name, func) --closure
+ submenu_insert(mt, i, name)
+ submenu_insert(ft, i, func)
+ end
+
+ for i = 1, #mt, 1 do
+ ft[i] = submenu_create(lv, ITEM_MENU())
+ end
+
+ local function add_new(i, menu_t, func_t)
+ local parent, lv = submenu_get_parent(lv - 1)
+ local last = #mt
+ local name = "Item_" .. tostring(last)
+ local func = submenu_create(lv + 1, ITEM_MENU())
+
+ local lv_out, item_out, removed = submenu_collapse(parent, lv + 1)-- collapse others
+ submenu_collapse(parent, lv) -- collapse the parent
+
+ insert_item(last, name, func)
+
+ func_t[parent](parent, menu_t, func_t) -- reopen parent
+ menu_ctx.start = i - removed
+ return true
+ end
+
+ local next = #mt + 1
+ insert_item(next, "Add New", add_new)
+ return mt, ft
+end
+
+local function MAIN_MENU()
+
+ local function go_back(i, m, f)
+ local parent = submenu_get_parent() or 0
+ if parent > 0 then
+ f[parent](parent, m, f)
+ else
+ menu_ctx.quit = true
+ end
+ menu_ctx.start = parent - 1
+ return true
+ end
+
+ local mt = {
+ [1] = "lua Menu Demo",
+ [2] = "Items",
+ [3] = "Back",
+ }
+
+ local ft = {
+ [0] = go_back, --if user cancels do this function
+ [1] = false, -- shouldn't happen title occupies this slot
+ [2] = submenu_create(1, USERITEMS()),
+ [3] = go_back,
+ }
+ return mt, ft, get_ctx_menu
+end
+
+function ShowMain()
+ set_menu(MAIN_MENU())
+end
+
+--ShowMainMenu()
+ShowMain()
+rb.lcd_clear_display()
+rb.lcd_update()
+local lu = collectgarbage("collect")
+local used, allocd, free = rb.mem_stats()
+local lu = collectgarbage("count")
+local fmt = function(t, v) return string.format("%s: %d Kb\n", t, v /1024) end
+
+-- this is how lua recommends to concat strings rather than ..
+local s_t = {}
+s_t[1] = "rockbox:\n"
+s_t[2] = fmt("Used ", used)
+s_t[3] = fmt("Allocd ", allocd)
+s_t[4] = fmt("Free ", free)
+s_t[5] = "\nlua:\n"
+s_t[6] = fmt("Used", lu * 1024)
+s_t[7] = "\n\nNote that the rockbox used count is a high watermark"
+rb.splash_scroller(5 * rb.HZ, table.concat(s_t))
+--require("print_lua_func")
+os.exit(1, "Goodbye")
diff --git a/apps/plugins/midi/midiplay.c b/apps/plugins/midi/midiplay.c
index f07cdd4dcf..a28d1d3862 100644
--- a/apps/plugins/midi/midiplay.c
+++ b/apps/plugins/midi/midiplay.c
@@ -140,14 +140,6 @@
#elif CONFIG_KEYPAD == COWON_D2_PAD
#define MIDI_QUIT BUTTON_POWER
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define MIDI_QUIT BUTTON_POWER
-#define MIDI_FFWD BUTTON_RIGHT
-#define MIDI_REWIND BUTTON_LEFT
-#define MIDI_VOL_UP BUTTON_STOP
-#define MIDI_VOL_DOWN BUTTON_PLAY
-#define MIDI_PLAYPAUSE BUTTON_MENU
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define MIDI_QUIT BUTTON_BACK
#define MIDI_FFWD BUTTON_RIGHT
diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c
index 7c5084529b..db10185c91 100644
--- a/apps/plugins/mp3_encoder.c
+++ b/apps/plugins/mp3_encoder.c
@@ -2443,12 +2443,6 @@ static void get_mp3_filename(const char *wav_name)
#elif CONFIG_KEYPAD == COWON_D2_PAD
#define MP3ENC_DONE BUTTON_POWER
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define MP3ENC_PREV BUTTON_LEFT
-#define MP3ENC_NEXT BUTTON_RIGHT
-#define MP3ENC_DONE BUTTON_POWER
-#define MP3ENC_SELECT BUTTON_PLAY
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define MP3ENC_PREV BUTTON_UP
#define MP3ENC_NEXT BUTTON_DOWN
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c
index d59797eaa7..505f3aa33d 100644
--- a/apps/plugins/mpegplayer/mpeg_settings.c
+++ b/apps/plugins/mpegplayer/mpeg_settings.c
@@ -142,14 +142,6 @@ struct mpeg_settings settings;
#elif CONFIG_KEYPAD == COWON_D2_PAD
#define MPEG_START_TIME_EXIT BUTTON_POWER
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define MPEG_START_TIME_SELECT BUTTON_MENU
-#define MPEG_START_TIME_LEFT BUTTON_LEFT
-#define MPEG_START_TIME_RIGHT BUTTON_RIGHT
-#define MPEG_START_TIME_UP BUTTON_STOP
-#define MPEG_START_TIME_DOWN BUTTON_PLAY
-#define MPEG_START_TIME_EXIT BUTTON_POWER
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define MPEG_START_TIME_SELECT BUTTON_SELECT
#define MPEG_START_TIME_LEFT BUTTON_LEFT
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index 6b18e4fa3a..34eafd5d9c 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -254,15 +254,6 @@ CONFIG_KEYPAD == SANSA_M200_PAD
#define MPEG_VOLDOWN BUTTON_MINUS
#define MPEG_VOLUP BUTTON_PLUS
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define MPEG_MENU BUTTON_MENU
-#define MPEG_STOP BUTTON_STOP
-#define MPEG_PAUSE BUTTON_PLAY
-#define MPEG_VOLDOWN BUTTON_VOLDOWN
-#define MPEG_VOLUP BUTTON_VOLUP
-#define MPEG_RW BUTTON_LEFT
-#define MPEG_FF BUTTON_RIGHT
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define MPEG_MENU BUTTON_MENU
#define MPEG_STOP BUTTON_BACK
diff --git a/apps/plugins/pacbox/pacbox.h b/apps/plugins/pacbox/pacbox.h
index c1a1c6b9e5..a3d42b099c 100644
--- a/apps/plugins/pacbox/pacbox.h
+++ b/apps/plugins/pacbox/pacbox.h
@@ -169,18 +169,6 @@
#define PACMAN_MENU (BUTTON_MENU|BUTTON_REL)
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-
-#define PACMAN_UP BUTTON_STOP
-#define PACMAN_DOWN BUTTON_PLAY
-#define PACMAN_LEFT BUTTON_LEFT
-#define PACMAN_RIGHT BUTTON_RIGHT
-#define PACMAN_1UP BUTTON_VOLDOWN
-#define PACMAN_2UP BUTTON_VOLUP
-#define PACMAN_COIN_PRE BUTTON_MENU
-#define PACMAN_COIN (BUTTON_MENU | BUTTON_PLAY)
-#define PACMAN_MENU BUTTON_POWER
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define PACMAN_UP BUTTON_UP
diff --git a/apps/plugins/pegbox.c b/apps/plugins/pegbox.c
index 498aa36357..f089c38023 100644
--- a/apps/plugins/pegbox.c
+++ b/apps/plugins/pegbox.c
@@ -95,23 +95,6 @@
#define LVL_UP_TEXT "PLAY"
#define LVL_DOWN_TEXT "-"
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define PEGBOX_SELECT BUTTON_MODE
-#define PEGBOX_QUIT BUTTON_PLAY
-#define PEGBOX_RESTART (BUTTON_EQ|BUTTON_MODE)
-#define PEGBOX_LVL_UP (BUTTON_EQ|BUTTON_UP)
-#define PEGBOX_LVL_DOWN (BUTTON_EQ|BUTTON_DOWN)
-#define PEGBOX_UP BUTTON_UP
-#define PEGBOX_DOWN BUTTON_DOWN
-#define PEGBOX_RIGHT BUTTON_RIGHT
-#define PEGBOX_LEFT BUTTON_LEFT
-
-#define SELECT_TEXT "MODE"
-#define QUIT_TEXT "PLAY"
-#define RESTART_TEXT "EQ+MODE"
-#define LVL_UP_TEXT "EQ+UP"
-#define LVL_DOWN_TEXT "EQ+DOWN"
-
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define PEGBOX_SELECT BUTTON_PLAY
#define PEGBOX_QUIT BUTTON_POWER
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 42930f0ff6..9731d92d35 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -103,10 +103,8 @@ const struct button_mapping pf_context_buttons[] =
{PF_SELECT, BUTTON_CENTER, BUTTON_NONE},
{PF_BACK, BUTTON_BOTTOMRIGHT, BUTTON_NONE},
#endif
-#if CONFIG_KEYPAD == SANSA_C100_PAD
- {PF_QUIT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU},
-#elif CONFIG_KEYPAD == CREATIVEZV_PAD || CONFIG_KEYPAD == CREATIVEZVM_PAD || \
- CONFIG_KEYPAD == PHILIPS_HDD1630_PAD || CONFIG_KEYPAD == IAUDIO67_PAD || \
+#if CONFIG_KEYPAD == CREATIVEZV_PAD || CONFIG_KEYPAD == CREATIVEZVM_PAD || \
+ CONFIG_KEYPAD == PHILIPS_HDD1630_PAD || \
CONFIG_KEYPAD == GIGABEAT_PAD || CONFIG_KEYPAD == GIGABEAT_S_PAD || \
CONFIG_KEYPAD == MROBE100_PAD || CONFIG_KEYPAD == MROBE500_PAD || \
CONFIG_KEYPAD == PHILIPS_SA9200_PAD || CONFIG_KEYPAD == SANSA_CLIP_PAD || \
@@ -130,15 +128,11 @@ const struct button_mapping pf_context_buttons[] =
#endif
#elif CONFIG_KEYPAD == SANSA_E200_PAD
{PF_QUIT, BUTTON_POWER, BUTTON_NONE},
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
- {PF_QUIT, BUTTON_EQ, BUTTON_NONE},
#elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
|| (CONFIG_KEYPAD == IPOD_3G_PAD) \
|| (CONFIG_KEYPAD == IPOD_4G_PAD) \
|| (CONFIG_KEYPAD == MPIO_HD300_PAD)
{PF_QUIT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU},
-#elif CONFIG_KEYPAD == LOGIK_DAX_PAD
- {PF_QUIT, BUTTON_POWERPLAY|BUTTON_REPEAT, BUTTON_POWERPLAY},
#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
{PF_QUIT, BUTTON_RC_REC, BUTTON_NONE},
#elif CONFIG_KEYPAD == MEIZU_M6SL_PAD
@@ -154,6 +148,15 @@ const struct button_mapping pf_context_buttons[] =
{PF_CONTEXT, BUTTON_FFWD|BUTTON_REPEAT, BUTTON_FFWD},
{PF_TRACKLIST, BUTTON_FFWD|BUTTON_REL, BUTTON_FFWD},
{PF_WPS, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY},
+#elif CONFIG_KEYPAD == FIIO_M3K_PAD
+ {PF_PREV, BUTTON_LEFT, BUTTON_NONE},
+ {PF_PREV_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
+ {PF_NEXT, BUTTON_RIGHT, BUTTON_NONE},
+ {PF_NEXT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
+ {PF_MENU, BUTTON_POWER|BUTTON_REL, BUTTON_POWER},
+ {PF_QUIT, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER},
+ {PF_CONTEXT, BUTTON_MENU|BUTTON_REL, BUTTON_MENU},
+ {PF_TRACKLIST, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU},
#endif
#if CONFIG_KEYPAD == IAUDIO_M3_PAD
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD|CONTEXT_REMOTE)
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds
index 5931b6b0a5..cc0be3abd5 100644
--- a/apps/plugins/plugin.lds
+++ b/apps/plugins/plugin.lds
@@ -54,7 +54,7 @@ OUTPUT_FORMAT(elf32-littlemips)
#elif CONFIG_CPU==S3C2440
#include "cpu.h"
/* must be 16Kb (0x4000) aligned */
-#define TTB_SIZE (0x4000)
+#define TTB_SIZE (0x4000)
#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
#elif CONFIG_CPU==TCC7801
@@ -77,9 +77,9 @@ OUTPUT_FORMAT(elf32-littlemips)
#include "cpu.h"
#define DRAMSIZE (DRAM_SIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE - FRAME_SIZE - TTB_SIZE)
#elif CONFIG_CPU==X1000
-#include "config.h"
+#include "cpu.h"
#undef STUBOFFSET
-#define STUBOFFSET 0x4000
+#define DRAMSIZE (X1000_DRAM_SIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE)
#endif
/* default to full RAM (minus codecs&plugins) unless specified otherwise */
@@ -127,7 +127,7 @@ OUTPUT_FORMAT(elf32-littlemips)
/* The bit of IRAM that is available is used in the core */
#define IRAMSIZE 0
-#elif defined(CPU_TCC780X) || defined(CPU_TCC77X)
+#elif defined(CPU_TCC780X)
#define DRAMORIG 0x20000000
#if CONFIG_CPU==TCC7801
#define IRAMORIG 0x1000c000
@@ -179,7 +179,7 @@ OUTPUT_FORMAT(elf32-littlemips)
/* The bit of IRAM that is available is used in the core */
#elif CONFIG_CPU == X1000
-#define DRAMORIG (0x80000000 + STUBOFFSET)
+#define DRAMORIG X1000_DRAM_BASE
#define IRAM DRAM
#define IRAMSIZE 0
@@ -272,7 +272,7 @@ SECTIONS
*(.idata)
#endif
} > PLUGIN_RAM
-
+
#if NOCACHE_BASE != 0
.ncdata . + NOCACHE_BASE :
{
@@ -281,7 +281,7 @@ SECTIONS
. = ALIGN(CACHEALIGN_SIZE);
/* EABI currently needs these defined here, otherwise .iram and .bss can
sometimes have an incorrect load address, breaking codecs and plugins. */
- bssaddr = . - NOCACHE_BASE;
+ bssaddr = . - NOCACHE_BASE;
#if defined(IRAMSIZE) && IRAMSIZE != 0
iramcopy = . - NOCACHE_BASE;
#endif
@@ -299,6 +299,7 @@ SECTIONS
{
*(.eh_frame)
#ifdef CPU_MIPS
+ *(.MIPS.abiflags)
*(.rel.dyn)
#endif
}
@@ -314,7 +315,7 @@ SECTIONS
*(COMMON)
. = ALIGN(0x4);
} > PLUGIN_RAM
-
+
#if NOCACHE_BASE != 0
.ncbss . + NOCACHE_BASE (NOLOAD) :
{
@@ -354,7 +355,7 @@ SECTIONS
. = ALIGN(0x4);
iend = .;
} > PLUGIN_IRAM
-
+
loadendaddr = MAX(plugin_end_addr, LOADADDR(.iram) + SIZEOF(.iram));
#else
loadendaddr = plugin_end_addr;
diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c
index b06789af6b..22484d0bc9 100644
--- a/apps/plugins/pong.c
+++ b/apps/plugins/pong.c
@@ -139,14 +139,6 @@
#elif (CONFIG_KEYPAD == COWON_D2_PAD)
#define PONG_QUIT BUTTON_POWER
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define PONG_QUIT BUTTON_POWER
-#define PONG_PAUSE BUTTON_MENU
-#define PONG_LEFT_UP BUTTON_VOLUP
-#define PONG_LEFT_DOWN BUTTON_VOLDOWN
-#define PONG_RIGHT_UP BUTTON_RIGHT
-#define PONG_RIGHT_DOWN BUTTON_LEFT
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define PONG_QUIT BUTTON_BACK
#define PONG_LEFT_UP BUTTON_UP
diff --git a/apps/plugins/reversi/reversi-gui.h b/apps/plugins/reversi/reversi-gui.h
index fd60b23927..7e031e6103 100644
--- a/apps/plugins/reversi/reversi-gui.h
+++ b/apps/plugins/reversi/reversi-gui.h
@@ -136,15 +136,6 @@
#define REVERSI_BUTTON_QUIT BUTTON_POWER
#define REVERSI_BUTTON_MENU BUTTON_MENU
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define REVERSI_BUTTON_QUIT BUTTON_POWER
-#define REVERSI_BUTTON_UP BUTTON_STOP
-#define REVERSI_BUTTON_DOWN BUTTON_PLAY
-#define REVERSI_BUTTON_LEFT BUTTON_LEFT
-#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
-#define REVERSI_BUTTON_MAKE_MOVE BUTTON_VOLUP
-#define REVERSI_BUTTON_MENU BUTTON_MENU
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define REVERSI_BUTTON_QUIT BUTTON_BACK
#define REVERSI_BUTTON_UP BUTTON_UP
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c
index 9c36f8f62f..07a15bfb62 100644
--- a/apps/plugins/rockblox.c
+++ b/apps/plugins/rockblox.c
@@ -152,17 +152,6 @@
#define ROCKBLOX_DROP BUTTON_SELECT
#define ROCKBLOX_RESTART BUTTON_A
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-
-#define ROCKBLOX_OFF BUTTON_PLAY
-#define ROCKBLOX_ROTATE_CCW BUTTON_UP
-#define ROCKBLOX_ROTATE_CW BUTTON_SELECT
-#define ROCKBLOX_DOWN BUTTON_DOWN
-#define ROCKBLOX_LEFT BUTTON_LEFT
-#define ROCKBLOX_RIGHT BUTTON_RIGHT
-#define ROCKBLOX_DROP BUTTON_MODE
-#define ROCKBLOX_RESTART BUTTON_EQ
-
#elif CONFIG_KEYPAD == MROBE500_PAD
#define ROCKBLOX_OFF BUTTON_POWER
@@ -205,17 +194,6 @@
#define ROCKBLOX_OFF BUTTON_POWER
#define ROCKBLOX_RESTART BUTTON_MENU
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-
-#define ROCKBLOX_OFF BUTTON_POWER
-#define ROCKBLOX_ROTATE_CCW BUTTON_VOLDOWN
-#define ROCKBLOX_ROTATE_CW BUTTON_VOLUP
-#define ROCKBLOX_DOWN BUTTON_STOP
-#define ROCKBLOX_LEFT BUTTON_LEFT
-#define ROCKBLOX_RIGHT BUTTON_RIGHT
-#define ROCKBLOX_DROP BUTTON_PLAY
-#define ROCKBLOX_RESTART BUTTON_MENU
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define ROCKBLOX_OFF BUTTON_BACK
#define ROCKBLOX_ROTATE_CCW BUTTON_UP
diff --git a/apps/plugins/rockboy/cpu.c b/apps/plugins/rockboy/cpu.c
index 392dd49b5f..037ea1bc37 100644
--- a/apps/plugins/rockboy/cpu.c
+++ b/apps/plugins/rockboy/cpu.c
@@ -13,7 +13,6 @@
#include "asm.h"
#endif
-
struct cpu cpu IBSS_ATTR;
bool plugbuf;
@@ -764,25 +763,32 @@ next:
__JR:
JR; break;
case 0x20: /* JR NZ */
- if (!(F&FZ)) goto __JR; NOJR; break;
+ if (!(F&FZ)) goto __JR;
+ NOJR; break;
case 0x28: /* JR Z */
- if (F&FZ) goto __JR; NOJR; break;
+ if (F&FZ) goto __JR;
+ NOJR; break;
case 0x30: /* JR NC */
- if (!(F&FC)) goto __JR; NOJR; break;
+ if (!(F&FC)) goto __JR;
+ NOJR; break;
case 0x38: /* JR C */
- if (F&FC) goto __JR; NOJR; break;
-
+ if (F&FC) goto __JR;
+ NOJR; break;
case 0xC3: /* JP */
__JP:
JP; break;
case 0xC2: /* JP NZ */
- if (!(F&FZ)) goto __JP; NOJP; break;
+ if (!(F&FZ)) goto __JP;
+ NOJP; break;
case 0xCA: /* JP Z */
- if (F&FZ) goto __JP; NOJP; break;
+ if (F&FZ) goto __JP;
+ NOJP; break;
case 0xD2: /* JP NC */
- if (!(F&FC)) goto __JP; NOJP; break;
+ if (!(F&FC)) goto __JP;
+ NOJP; break;
case 0xDA: /* JP C */
- if (F&FC) goto __JP; NOJP; break;
+ if (F&FC) goto __JP;
+ NOJP; break;
case 0xE9: /* JP HL */
PC = HL; break;
@@ -790,13 +796,17 @@ next:
__RET:
RET; break;
case 0xC0: /* RET NZ */
- if (!(F&FZ)) goto __RET; NORET; break;
+ if (!(F&FZ)) goto __RET;
+ NORET; break;
case 0xC8: /* RET Z */
- if (F&FZ) goto __RET; NORET; break;
+ if (F&FZ) goto __RET;
+ NORET; break;
case 0xD0: /* RET NC */
- if (!(F&FC)) goto __RET; NORET; break;
+ if (!(F&FC)) goto __RET;
+ NORET; break;
case 0xD8: /* RET C */
- if (F&FC) goto __RET; NORET; break;
+ if (F&FC) goto __RET;
+ NORET; break;
case 0xD9: /* RETI */
IME = IMA = 1; goto __RET;
@@ -804,13 +814,17 @@ next:
__CALL:
CALL; break;
case 0xC4: /* CALL NZ */
- if (!(F&FZ)) goto __CALL; NOCALL; break;
+ if (!(F&FZ)) goto __CALL;
+ NOCALL; break;
case 0xCC: /* CALL Z */
- if (F&FZ) goto __CALL; NOCALL; break;
+ if (F&FZ) goto __CALL;
+ NOCALL; break;
case 0xD4: /* CALL NC */
- if (!(F&FC)) goto __CALL; NOCALL; break;
+ if (!(F&FC)) goto __CALL;
+ NOCALL; break;
case 0xDC: /* CALL C */
- if (F&FC) goto __CALL; NOCALL; break;
+ if (F&FC) goto __CALL;
+ NOCALL; break;
case 0xC7: /* RST 0 */
b = 0x00; goto __RST;
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c
index 6dd010961e..d2c56ff6cc 100644
--- a/apps/plugins/rockboy/rockboy.c
+++ b/apps/plugins/rockboy/rockboy.c
@@ -122,16 +122,6 @@ static void setoptions (void)
options.SELECT = BUTTON_NONE;
options.MENU = (BUTTON_SELECT | BUTTON_REPEAT);
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
- options.UP = BUTTON_UP;
- options.DOWN = BUTTON_DOWN;
-
- options.A = BUTTON_PLAY;
- options.B = BUTTON_EQ;
- options.START = BUTTON_MODE;
- options.SELECT = (BUTTON_SELECT | BUTTON_REL);
- options.MENU = (BUTTON_SELECT | BUTTON_REPEAT);
-
#elif CONFIG_KEYPAD == GIGABEAT_PAD
options.UP = BUTTON_UP;
options.DOWN = BUTTON_DOWN;
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c
index 9d57d7428c..41c671a38c 100644
--- a/apps/plugins/sokoban.c
+++ b/apps/plugins/sokoban.c
@@ -312,20 +312,6 @@
#define SOKOBAN_LEVEL_UP BUTTON_PLUS
#define SOKOBAN_MENU_NAME "[MENU]"
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define SOKOBAN_LEFT BUTTON_LEFT
-#define SOKOBAN_RIGHT BUTTON_RIGHT
-#define SOKOBAN_UP BUTTON_STOP
-#define SOKOBAN_DOWN BUTTON_PLAY
-#define SOKOBAN_MENU BUTTON_MENU
-#define SOKOBAN_UNDO BUTTON_VOLDOWN
-#define SOKOBAN_REDO BUTTON_VOLUP
-#define SOKOBAN_PAUSE (BUTTON_MENU|BUTTON_LEFT)
-#define BUTTON_SAVE (BUTTON_MENU|BUTTON_PLAY)
-#define BUTTON_SAVE_NAME "MENU+PLAY"
-
-#define SOKOBAN_RC_MENU (BUTTON_MENU|BUTTON_STOP)
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define SOKOBAN_LEFT BUTTON_LEFT
#define SOKOBAN_RIGHT BUTTON_RIGHT
diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c
index 5259d0d616..bb96b8a44b 100644
--- a/apps/plugins/stopwatch.c
+++ b/apps/plugins/stopwatch.c
@@ -51,14 +51,6 @@
#define STOPWATCH_SCROLL_UP BUTTON_SCROLL_FWD
#define STOPWATCH_SCROLL_DOWN BUTTON_SCROLL_BACK
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define STOPWATCH_QUIT BUTTON_PLAY
-#define STOPWATCH_START_STOP BUTTON_MODE
-#define STOPWATCH_RESET_TIMER BUTTON_EQ
-#define STOPWATCH_LAP_TIMER BUTTON_SELECT
-#define STOPWATCH_SCROLL_UP BUTTON_UP
-#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
-
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
#define STOPWATCH_QUIT BUTTON_POWER
#define STOPWATCH_START_STOP BUTTON_PLAY
@@ -133,15 +125,6 @@
#elif CONFIG_KEYPAD == COWON_D2_PAD
#define STOPWATCH_QUIT BUTTON_POWER
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define STOPWATCH_QUIT BUTTON_MENU
-#define STOPWATCH_START_STOP BUTTON_PLAY
-#define STOPWATCH_RESET_TIMER BUTTON_STOP
-#define STOPWATCH_LAP_TIMER BUTTON_LEFT
-#define STOPWATCH_SCROLL_UP BUTTON_VOLUP
-#define STOPWATCH_SCROLL_DOWN BUTTON_VOLDOWN
-#define STOPWATCH_RC_QUIT BUTTON_POWER
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define STOPWATCH_QUIT BUTTON_BACK
#define STOPWATCH_START_STOP BUTTON_PLAY
diff --git a/apps/plugins/sudoku/sudoku.h b/apps/plugins/sudoku/sudoku.h
index 6ee3eb33ee..1332a9a80f 100644
--- a/apps/plugins/sudoku/sudoku.h
+++ b/apps/plugins/sudoku/sudoku.h
@@ -181,16 +181,6 @@
#define SUDOKU_BUTTON_QUIT BUTTON_POWER
#define SUDOKU_BUTTON_MENU BUTTON_MENU
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define SUDOKU_BUTTON_QUIT BUTTON_POWER
-#define SUDOKU_BUTTON_UP BUTTON_STOP
-#define SUDOKU_BUTTON_DOWN BUTTON_PLAY
-#define SUDOKU_BUTTON_LEFT BUTTON_LEFT
-#define SUDOKU_BUTTON_RIGHT BUTTON_RIGHT
-#define SUDOKU_BUTTON_TOGGLE BUTTON_VOLUP
-#define SUDOKU_BUTTON_MENU BUTTON_MENU
-#define SUDOKU_BUTTON_POSSIBLE BUTTON_VOLDOWN
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define SUDOKU_BUTTON_QUIT BUTTON_BACK
#define SUDOKU_BUTTON_UP BUTTON_UP
diff --git a/apps/plugins/text_viewer/tv_button.h b/apps/plugins/text_viewer/tv_button.h
index bea8f829ef..d9a57d114f 100644
--- a/apps/plugins/text_viewer/tv_button.h
+++ b/apps/plugins/text_viewer/tv_button.h
@@ -75,17 +75,6 @@
#define TV_AUTOSCROLL BUTTON_PLAY
#define TV_BOOKMARK BUTTON_SELECT
-/* iFP7xx keys */
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define TV_QUIT BUTTON_PLAY
-#define TV_SCROLL_UP BUTTON_UP
-#define TV_SCROLL_DOWN BUTTON_DOWN
-#define TV_SCREEN_LEFT BUTTON_LEFT
-#define TV_SCREEN_RIGHT BUTTON_RIGHT
-#define TV_MENU BUTTON_MODE
-#define TV_AUTOSCROLL BUTTON_SELECT
-#define TV_BOOKMARK (BUTTON_LEFT|BUTTON_SELECT)
-
/* iAudio X5/M5 keys */
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
#define TV_QUIT BUTTON_POWER
@@ -247,18 +236,6 @@
#define TV_SCROLL_DOWN BUTTON_PLUS
#define TV_BOOKMARK (BUTTON_MENU|BUTTON_PLUS)
-/* Cowon iAudio 7 keys */
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define TV_QUIT BUTTON_POWER
-#define TV_SCROLL_UP BUTTON_VOLUP
-#define TV_SCROLL_DOWN BUTTON_VOLDOWN
-#define TV_SCREEN_LEFT BUTTON_LEFT
-#define TV_SCREEN_RIGHT BUTTON_RIGHT
-#define TV_MENU BUTTON_MENU
-#define TV_AUTOSCROLL BUTTON_PLAY
-#define TV_RC_QUIT BUTTON_STOP
-#define TV_BOOKMARK (BUTTON_LEFT|BUTTON_PLAY)
-
/* Creative Zen Vision:M keys */
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define TV_QUIT BUTTON_BACK
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c
index 36aae071cb..cf959ad7f5 100644
--- a/apps/plugins/xobox.c
+++ b/apps/plugins/xobox.c
@@ -146,15 +146,6 @@
#define QUIT BUTTON_POWER
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-
-#define QUIT BUTTON_POWER
-#define LEFT BUTTON_LEFT
-#define RIGHT BUTTON_RIGHT
-#define UP BUTTON_STOP
-#define DOWN BUTTON_PLAY
-#define PAUSE BUTTON_MENU
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define QUIT BUTTON_BACK
diff --git a/apps/plugins/zxbox/keymaps.h b/apps/plugins/zxbox/keymaps.h
index dbebc3b1d9..e9316a301b 100644
--- a/apps/plugins/zxbox/keymaps.h
+++ b/apps/plugins/zxbox/keymaps.h
@@ -47,14 +47,6 @@
#define ZX_SELECT BUTTON_SELECT
#define ZX_MENU BUTTON_PLAY
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-#define ZX_SELECT BUTTON_SELECT
-#define ZX_MENU BUTTON_PLAY
-#define ZX_LEFT BUTTON_LEFT
-#define ZX_RIGHT BUTTON_RIGHT
-#define ZX_UP BUTTON_UP
-#define ZX_DOWN BUTTON_DOWN
-
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
#define ZX_SELECT BUTTON_REW
#define ZX_MENU BUTTON_FF
@@ -110,14 +102,6 @@
#elif CONFIG_KEYPAD == COWON_D2_PAD
#define ZX_MENU (BUTTON_MENU|BUTTON_REL)
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-#define ZX_UP BUTTON_STOP
-#define ZX_DOWN BUTTON_PLAY
-#define ZX_LEFT BUTTON_LEFT
-#define ZX_RIGHT BUTTON_RIGHT
-#define ZX_SELECT BUTTON_VOLUP
-#define ZX_MENU BUTTON_MENU
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define ZX_UP BUTTON_UP
#define ZX_DOWN BUTTON_DOWN
diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c
index dd517e01e7..6e0997c339 100644
--- a/apps/plugins/zxbox/zxbox_keyb.c
+++ b/apps/plugins/zxbox/zxbox_keyb.c
@@ -32,17 +32,6 @@
#define KBD_UP BUTTON_SCROLL_BACK
#define KBD_DOWN BUTTON_SCROLL_FWD
-#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
-
-/* TODO: Check keyboard mappings */
-
-#define KBD_SELECT BUTTON_SELECT
-#define KBD_ABORT BUTTON_PLAY
-#define KBD_LEFT BUTTON_LEFT
-#define KBD_RIGHT BUTTON_RIGHT
-#define KBD_UP BUTTON_UP
-#define KBD_DOWN BUTTON_DOWN
-
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
/* TODO: Check keyboard mappings */
@@ -113,15 +102,6 @@
#define KBD_ABORT BUTTON_POWER
-#elif CONFIG_KEYPAD == IAUDIO67_PAD
-
-#define KBD_SELECT BUTTON_MENU
-#define KBD_ABORT BUTTON_POWER
-#define KBD_LEFT BUTTON_LEFT
-#define KBD_RIGHT BUTTON_RIGHT
-#define KBD_UP BUTTON_STOP
-#define KBD_DOWN BUTTON_PLAY
-
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
#define KBD_SELECT BUTTON_SELECT
@@ -512,27 +492,27 @@ int zx_kbd_input(char* text/*, int buflen*/)
len_utf8 = rb->utf8length(text);
#endif
FOR_NB_SCREENS(l)
+ {
rb->screens[l]->clear_display();
+ }
-
- /* draw page */
- FOR_NB_SCREENS(l)
- {
- rb->screens[l]->setfont(param[l].curfont);
- k = param[l].page*param[l].max_chars*param[l].lines;
- for (i=j=0; j < param[l].lines && k < param[l].nchars; k++) {
- utf8 = rb->utf8encode(param[l].kbd_buf[k], outline);
- *utf8 = 0;
- rb->screens[l]->getstringsize(outline, &w, NULL);
- rb->screens[l]->putsxy(i*param[l].font_w + (param[l].font_w-w)/2, j*param[l].font_h
- + statusbar_size, outline);
- if (++i == param[l].max_chars) {
- i = 0;
- j++;
- }
+ /* draw page */
+ FOR_NB_SCREENS(l)
+ {
+ rb->screens[l]->setfont(param[l].curfont);
+ k = param[l].page*param[l].max_chars*param[l].lines;
+ for (i=j=0; j < param[l].lines && k < param[l].nchars; k++) {
+ utf8 = rb->utf8encode(param[l].kbd_buf[k], outline);
+ *utf8 = 0;
+ rb->screens[l]->getstringsize(outline, &w, NULL);
+ rb->screens[l]->putsxy(i*param[l].font_w + (param[l].font_w-w)/2, j*param[l].font_h
+ + statusbar_size, outline);
+ if (++i == param[l].max_chars) {
+ i = 0;
+ j++;
}
}
-
+ }
/* separator */
FOR_NB_SCREENS(l)
@@ -581,19 +561,20 @@ int zx_kbd_input(char* text/*, int buflen*/)
}
cur_blink = !cur_blink;
-
- /* highlight the key that has focus */
- FOR_NB_SCREENS(l)
- {
- rb->screens[l]->set_drawmode(DRMODE_COMPLEMENT);
- rb->screens[l]->fillrect(param[l].font_w * param[l].x,
- statusbar_size + param[l].font_h * param[l].y,
- param[l].font_w, param[l].font_h);
- rb->screens[l]->set_drawmode(DRMODE_SOLID);
- }
+ /* highlight the key that has focus */
+ FOR_NB_SCREENS(l)
+ {
+ rb->screens[l]->set_drawmode(DRMODE_COMPLEMENT);
+ rb->screens[l]->fillrect(param[l].font_w * param[l].x,
+ statusbar_size + param[l].font_h * param[l].y,
+ param[l].font_w, param[l].font_h);
+ rb->screens[l]->set_drawmode(DRMODE_SOLID);
+ }
FOR_NB_SCREENS(l)
- rb->screens[l]->update();
+ {
+ rb->screens[l]->update();
+ }
button = rb->button_get_w_tmo(HZ/2);
diff --git a/apps/settings.c b/apps/settings.c
index 99cede382b..f89fc581ca 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -1010,6 +1010,7 @@ void settings_apply(bool read_disk)
set_selective_softlock_actions(
global_settings.bt_selective_softlock_actions,
global_settings.bt_selective_softlock_actions_mask);
+ action_autosoftlock_init();
#endif
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
diff --git a/apps/settings.h b/apps/settings.h
index 5d6d4cb717..fedec8e025 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -576,6 +576,7 @@ struct user_settings
bool constrain_next_folder; /* whether next_folder is constrained to
directories within start_directory */
int recursive_dir_insert; /* should directories be inserted recursively */
+ bool playlist_reload_after_save; /* reload and resume playlist after saving */
bool fade_on_stop; /* fade on pause/unpause/stop */
bool playlist_shuffle;
bool warnon_erase_dynplaylist; /* warn when erasing dynamic playlist */
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 4a0bf96864..c13df734e6 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -1277,6 +1277,8 @@ const struct settings_list settings[] = {
CHOICE_SETTING(0, recursive_dir_insert, LANG_RECURSE_DIRECTORY , RECURSE_ON,
"recursive directory insert", off_on_ask, NULL , 3 ,
ID2P(LANG_OFF), ID2P(LANG_ON), ID2P(LANG_ASK)),
+ OFFON_SETTING(0, playlist_reload_after_save, LANG_PLAYLIST_RELOAD_AFTER_SAVE,
+ false, "reload after saving playlist", NULL),
/* bookmarks */
CHOICE_SETTING(0, autocreatebookmark, LANG_BOOKMARK_SETTINGS_AUTOCREATE,
BOOKMARK_NO, "autocreate bookmarks",
diff --git a/apps/tagcache.c b/apps/tagcache.c
index bff1550059..e6a4e8e3c4 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -2239,7 +2239,7 @@ static bool build_numeric_indices(struct tagcache_header *h, int tmpfd)
masterfd_pos = lseek(masterfd, tcmh.tch.entry_count * sizeof(struct index_entry),
SEEK_CUR);
- if (masterfd_pos == filesize(masterfd))
+ if (masterfd_pos < 0)
{
logf("we can't append!");
close(masterfd);
@@ -2988,12 +2988,7 @@ static bool commit(void)
}
if (tch.entry_count == 0)
- {
logf("nothing to commit");
- close(tmpfd);
- remove(TAGCACHE_FILE_TEMP);
- return true;
- }
/* Fully initialize existing headers (if any) before going further. */
tc_stat.ready = check_all_headers();
diff --git a/apps/tree.c b/apps/tree.c
index 9e4aafccfe..88ccff5e37 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -646,7 +646,7 @@ static int dirbrowse(void)
tc.dirlevel = 0; /* shouldnt be needed.. this code needs work! */
keyclick_set_callback(gui_synclist_keyclick_callback, &tree_lists);
- button = get_action(CONTEXT_TREE,
+ button = get_action(CONTEXT_TREE|ALLOW_SOFTLOCK,
list_do_action_timeout(&tree_lists, HZ/2));
oldbutton = button;
gui_synclist_do_button(&tree_lists, &button,LIST_WRAP_UNLESS_HELD);