Index: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (Revision 20305) +++ apps/lang/english.lang (Arbeitskopie) @@ -12418,3 +12418,17 @@ speaker: "Enable Speaker" + + id: LANG_ENABLE_TRACKLOCK + desc: in Settings -> Playback Settings + user: core + + *: "Enable Tracklock" + + + *: "Enable Tracklock" + + + *: "Enable Tracklock" + + Index: apps/gui/gwps.c =================================================================== --- apps/gui/gwps.c (Revision 20306) +++ apps/gui/gwps.c (Arbeitskopie) @@ -78,7 +78,10 @@ if (!wps_state.id3 || (wps_state.id3->elapsed < skip_thresh*1000)) { audio_prev(); } - else { + else + { + if (global_settings.tracklock) + return; if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type) { curr_cuesheet_skip(-1, wps_state.id3->elapsed); @@ -103,6 +106,8 @@ static void next_track(void) { + if (global_settings.tracklock) + return; /* take care of if we're playing a cuesheet */ if (cuesheet_is_enabled() && wps_state.id3->cuesheet_type) { @@ -121,14 +126,22 @@ { unsigned step = ((unsigned)global_settings.skip_length*1000); unsigned long *elapsed = &(wps_state.id3->elapsed); + bool tracklock = global_settings.tracklock; if (direction == 1 && wps_state.id3->length - *elapsed < step+1000) { #if CONFIG_CODEC == SWCODEC if(global_settings.beep) pcmbuf_beep(1000, 150, 1500*global_settings.beep); #endif + if (!tracklock) + next_track(); return; } else if ((direction == -1 && *elapsed < step)) { + if (!tracklock) + { + prev_track(3); + return; + } *elapsed = 0; } else { *elapsed += step * direction; @@ -177,7 +190,7 @@ int i; long last_left = 0, last_right = 0; int wpsbars, oldbars; - + wps_state_init(); #ifdef HAVE_LCD_CHARCELLS @@ -412,8 +425,7 @@ } break; /* fast forward - OR next dir if this is straight after ACTION_WPS_SKIPNEXT - OR if skip length set, next track if straight after SKIPPREV. */ + OR next dir if this is straight after ACTION_WPS_SKIPNEXT */ case ACTION_WPS_SEEKFWD: if (global_settings.party_mode) break; @@ -429,18 +441,12 @@ audio_next_dir(); } } - else if (global_settings.skip_length > 0 - && current_tick -last_left < HZ) { - next_track(); - update_track = true; - } - else ffwd_rew(ACTION_WPS_SEEKFWD); + else + ffwd_rew(ACTION_WPS_SEEKFWD); last_right = last_left = 0; break; /* fast rewind - OR prev dir if this is straight after ACTION_WPS_SKIPPREV, - OR if skip length set, beg of track or prev track if this is - straight after SKIPPREV */ + OR prev dir if this is straight after ACTION_WPS_SKIPPREV,*/ case ACTION_WPS_SEEKBACK: if (global_settings.party_mode) break; @@ -462,13 +468,8 @@ audio_prev_dir(); } } - else if (global_settings.skip_length > 0 - && current_tick -last_right < HZ) - { - prev_track(3+global_settings.skip_length); - update_track = true; - } - else ffwd_rew(ACTION_WPS_SEEKBACK); + else + ffwd_rew(ACTION_WPS_SEEKBACK); last_left = last_right = 0; break; Index: apps/settings.h =================================================================== --- apps/settings.h (Revision 20305) +++ apps/settings.h (Arbeitskopie) @@ -725,6 +725,7 @@ #ifdef HAVE_SPEAKER bool speaker_enabled; #endif + bool tracklock; /* If values are just added to the end, no need to bump plugin API version. */ Index: apps/menus/playback_menu.c =================================================================== --- apps/menus/playback_menu.c (Revision 20305) +++ apps/menus/playback_menu.c (Arbeitskopie) @@ -176,6 +176,7 @@ #endif MENUITEM_SETTING(skip_length, &global_settings.skip_length, NULL); +MENUITEM_SETTING(tracklock, &global_settings.tracklock, NULL); MAKE_MENU(playback_settings,ID2P(LANG_PLAYBACK),0, Icon_Playback_menu, @@ -197,7 +198,7 @@ #ifdef HAVE_HEADPHONE_DETECTION ,&unplug_menu #endif - ,&skip_length + ,&skip_length, &tracklock, ); static int playback_callback(int action,const struct menu_item_ex *this_item) Index: apps/settings_list.c =================================================================== --- apps/settings_list.c (Revision 20305) +++ apps/settings_list.c (Arbeitskopie) @@ -1462,6 +1462,7 @@ OFFON_SETTING(0, speaker_enabled, LANG_ENABLE_SPEAKER, false, "speaker", audiohw_enable_speaker), #endif + OFFON_SETTING(0, tracklock, LANG_ENABLE_TRACKLOCK, false, "tracklock", NULL), }; const int nb_settings = sizeof(settings)/sizeof(*settings);