Index: rockbox-devel/apps/action.h =================================================================== --- rockbox-devel.orig/apps/action.h +++ rockbox-devel/apps/action.h @@ -99,6 +99,7 @@ enum { ACTION_WPS_BROWSE, ACTION_WPS_PLAY, ACTION_WPS_SEEKBACK, + ACTION_WPS_TRACKLOCK, ACTION_WPS_SEEKFWD, ACTION_WPS_STOPSEEK, ACTION_WPS_SKIPNEXT, Index: rockbox-devel/apps/gui/gwps-common.c =================================================================== --- rockbox-devel.orig/apps/gui/gwps-common.c +++ rockbox-devel/apps/gui/gwps-common.c @@ -2317,6 +2317,30 @@ bool update_onvol_change(struct gui_wps return false; } +void play_hop(int direction) +{ + if(!wps_state.id3 || !wps_state.id3->length) + return; +#define HOP_MS 5000 + if((direction == -1 && wps_state.id3->elapsed < HOP_MS) + || (direction == 1 + && wps_state.id3->length - wps_state.id3->elapsed < HOP_MS/2)) + return; + if((audio_status() & AUDIO_STATUS_PLAY) && !wps_state.paused) { +#if (CONFIG_CODEC == SWCODEC) + audio_pre_ff_rewind(); +#else + audio_pause(); +#endif + } + wps_state.id3->elapsed += HOP_MS *direction; + audio_ff_rewind(wps_state.id3->elapsed); +#if (CONFIG_CODEC != SWCODEC) + if (!wps_state.paused) + audio_resume(); +#endif +} + bool ffwd_rew(int button) { static const int ff_rew_steps[] = { Index: rockbox-devel/apps/gui/gwps-common.h =================================================================== --- rockbox-devel.orig/apps/gui/gwps-common.h +++ rockbox-devel/apps/gui/gwps-common.h @@ -32,6 +32,7 @@ bool gui_wps_display(void); void setvol(void); bool update_onvol_change(struct gui_wps * gwps); bool update(struct gui_wps *gwps); +void play_hop(int direction); bool ffwd_rew(int button); bool wps_data_preload_tags(struct wps_data *data, char *buf, const char *bmpdir, size_t bmpdirlen); Index: rockbox-devel/apps/gui/gwps.c =================================================================== --- rockbox-devel.orig/apps/gui/gwps.c +++ rockbox-devel/apps/gui/gwps.c @@ -57,6 +57,8 @@ #ifdef HAVE_LCD_COLOR #include "backdrop.h" #endif +#include "pcmbuf.h" +#include "talk.h" #define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" #define RWPS_DEFAULTCFG WPS_DIR "/rockbox_default.rwps" @@ -90,6 +92,7 @@ long gui_wps_show(void) bool update_track = false; int i; long last_left = 0, last_right = 0; + bool tracklock = global_settings.tracklock; action_signalscreenchange(); @@ -315,10 +318,20 @@ long gui_wps_show(void) last_left = 0; break; + case ACTION_WPS_TRACKLOCK: + tracklock = !tracklock; + cond_talk_ids(LANG_TRACKLOCK, + tracklock ? LANG_ON : LANG_OFF); + break; + /* prev / restart */ case ACTION_WPS_SKIPPREV: if (global_settings.party_mode) break; + if(tracklock) { + play_hop(-1); + break; + } last_left = current_tick; update_track = true; @@ -364,6 +377,10 @@ long gui_wps_show(void) case ACTION_WPS_SKIPNEXT: if (global_settings.party_mode) break; + if(tracklock) { + play_hop(1); + break; + } last_right = current_tick; update_track = true; Index: rockbox-devel/apps/keymaps/keymap-x5.c =================================================================== --- rockbox-devel.orig/apps/keymaps/keymap-x5.c +++ rockbox-devel/apps/keymaps/keymap-x5.c @@ -292,6 +292,7 @@ const struct button_mapping button_conte { 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_TRACKLOCK, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE }, { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, Index: rockbox-devel/apps/lang/english.lang =================================================================== --- rockbox-devel.orig/apps/lang/english.lang +++ rockbox-devel/apps/lang/english.lang @@ -10024,3 +10024,17 @@ *: "OK" + + id: LANG_TRACKLOCK + desc: playback settings menu + user: + + *: "Track lock" + + + *: "Track lock" + + + *: "Track lock" + + Index: rockbox-devel/apps/settings.c =================================================================== --- rockbox-devel.orig/apps/settings.c +++ rockbox-devel/apps/settings.c @@ -664,6 +664,7 @@ static const struct bit_entry hd_bits[] #ifdef CONFIG_TUNER {2, S_O(fm_region), 0, "fm_region", "eu,us,jp,kr" }, #endif + {1, S_O(tracklock), false, "track lock", off_on }, /* If values are just added to the end, no need to bump the version. */ /* new stuff to be added at the end */ Index: rockbox-devel/apps/settings.h =================================================================== --- rockbox-devel.orig/apps/settings.h +++ rockbox-devel/apps/settings.h @@ -258,6 +258,7 @@ struct user_settings int timeformat; /* time format: 0=24 hour clock, 1=12 hour clock */ bool playlist_shuffle; bool play_selected; /* Plays selected file even in shuffle mode */ + bool tracklock; /* Default tracklock setting on entering wps */ int ff_rewind_min_step; /* FF/Rewind minimum step size */ int ff_rewind_accel; /* FF/Rewind acceleration (in seconds per doubling) */ int disk_spindown; /* time until disk spindown, in seconds (0=off) */ Index: rockbox-devel/apps/settings_menu.c =================================================================== --- rockbox-devel.orig/apps/settings_menu.c +++ rockbox-devel/apps/settings_menu.c @@ -741,6 +741,11 @@ static bool play_selected(void) return set_bool( str(LANG_PLAY_SELECTED), &global_settings.play_selected ); } +static bool tracklock(void) +{ + return set_bool( str(LANG_TRACKLOCK), &global_settings.tracklock ); +} + static bool dir_filter(void) { static const struct opt_items names[] = { @@ -1731,6 +1736,7 @@ static bool playback_settings_menu(void) { ID2P(LANG_SHUFFLE), shuffle }, { ID2P(LANG_REPEAT), repeat_mode }, { ID2P(LANG_PLAY_SELECTED), play_selected }, + { ID2P(LANG_TRACKLOCK), tracklock }, { ID2P(LANG_RESUME), resume }, { ID2P(LANG_WIND_MENU), ff_rewind_settings_menu }, { ID2P(LANG_MP3BUFFER_MARGIN), buffer_margin },