summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/lang/english.lang15
-rw-r--r--apps/playback.c23
-rw-r--r--apps/settings.c4
-rw-r--r--apps/settings.h8
-rw-r--r--apps/settings_menu.c3
-rw-r--r--docs/CREDITS1
6 files changed, 45 insertions, 9 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index c52962bf29..bca55f116c 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -10372,3 +10372,18 @@
*: "Properties"
</voice>
</phrase>
+<phrase>
+ id: LANG_SHUFFLE_TRACKSKIP
+ desc: in settings_menu
+ user:
+ <source>
+ *: "Shuffle and Track Skip"
+ </source>
+ <dest>
+ *: "Shuffle and Track Skip"
+ </dest>
+ <voice>
+ *: "Shuffle and Track Skip"
+ </voice>
+</phrase>
+<phrase>
diff --git a/apps/playback.c b/apps/playback.c
index f2e029ba30..53dbe07823 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1819,10 +1819,27 @@ static void codec_track_skip_done(bool was_manual)
}
/* Automatic track change w/crossfade, if not in "Track Skip Only" mode. */
else if (pcmbuf_is_crossfade_enabled() && !pcmbuf_is_crossfade_active()
- && global_settings.crossfade != 2)
+ && global_settings.crossfade != CROSSFADE_ENABLE_TRACKSKIP )
{
- pcmbuf_crossfade_init(false);
- codec_track_changed();
+ if ( global_settings.crossfade
+ == CROSSFADE_ENABLE_SHUFFLE_AND_TRACKSKIP )
+ {
+ if (global_settings.playlist_shuffle) /* shuffle mode is on, so crossfade: */
+ {
+ pcmbuf_crossfade_init(false);
+ codec_track_changed();
+ }
+ else /* shuffle mode is off, so do a gapless track change */
+ {
+ pcmbuf_set_position_callback(codec_pcmbuf_position_callback); /* Gapless playback */
+ pcmbuf_set_event_handler(codec_pcmbuf_track_changed_callback); /* copied from below */
+ }
+ }
+ else /* normal crossfade: */
+ {
+ pcmbuf_crossfade_init(false);
+ codec_track_changed();
+ }
}
/* Gapless playback. */
else
diff --git a/apps/settings.c b/apps/settings.c
index 454ba183ee..d4359fda79 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -100,7 +100,7 @@ const char rec_base_directory[] = REC_BASE_DIR;
#include "eq_menu.h"
#endif
-#define CONFIG_BLOCK_VERSION 57
+#define CONFIG_BLOCK_VERSION 58
#define CONFIG_BLOCK_SIZE 512
#define RTC_BLOCK_SIZE 44
@@ -581,7 +581,7 @@ static const struct bit_entry hd_bits[] =
{1, S_O(replaygain_noclip), false, "replaygain noclip", off_on },
{8 | SIGNED, S_O(replaygain_preamp), 0, "replaygain preamp", NULL },
{2, S_O(beep), 0, "beep", "off,weak,moderate,strong" },
- {2, S_O(crossfade), 0, "crossfade", "off,shuffle,track skip,always"},
+ {3, S_O(crossfade), 0, "crossfade", "off,shuffle,track skip,shuffle and track skip,always"},
{3, S_O(crossfade_fade_in_delay), 0, "crossfade fade in delay", NULL},
{3, S_O(crossfade_fade_out_delay), 0, "crossfade fade out delay", NULL},
{4, S_O(crossfade_fade_in_duration), 0, "crossfade fade in duration", NULL},
diff --git a/apps/settings.h b/apps/settings.h
index cb57c1ac77..b5c673faa0 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -87,8 +87,10 @@
#define TRIG_DURATION_COUNT 13
extern const char * const trig_durations[TRIG_DURATION_COUNT];
-#define CROSSFADE_ENABLE_SHUFFLE 1
-#define CROSSFADE_ENABLE_ALWAYS 2
+#define CROSSFADE_ENABLE_SHUFFLE 1
+#define CROSSFADE_ENABLE_TRACKSKIP 2
+#define CROSSFADE_ENABLE_SHUFFLE_AND_TRACKSKIP 3
+#define CROSSFADE_ENABLE_ALWAYS 4
#define FOLDER_ADVANCE_OFF 0
#define FOLDER_ADVANCE_NEXT 1
@@ -144,7 +146,7 @@ struct user_settings
bool superbass; /* true/false */
#if CONFIG_CODEC == SWCODEC
- int crossfade; /* Enable crossfade (0=off,1=shuffle,2=always) */
+ int crossfade; /* Enable crossfade (0=off,1=shuffle,2=trackskip,3=shuff&trackskip,4=always) */
int crossfade_fade_in_delay; /* Fade in delay (0-15s) */
int crossfade_fade_out_delay; /* Fade out delay (0-15s) */
int crossfade_fade_in_duration; /* Fade in duration (0-15s) */
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 892d9d2b2c..e49a9ec2c9 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -1514,13 +1514,14 @@ static bool crossfade(void)
{ STR(LANG_OFF) },
{ STR(LANG_SHUFFLE) },
{ STR(LANG_TRACKSKIP) },
+ { STR(LANG_SHUFFLE_TRACKSKIP) },
{ STR(LANG_ALWAYS) },
};
bool ret;
ret=set_option( str(LANG_CROSSFADE_ENABLE),
- &global_settings.crossfade, INT, names, 4, NULL);
+ &global_settings.crossfade, INT, names, 5, NULL);
audio_set_crossfade(global_settings.crossfade);
return ret;
}
diff --git a/docs/CREDITS b/docs/CREDITS
index d2f30058a4..67770a9e82 100644
--- a/docs/CREDITS
+++ b/docs/CREDITS
@@ -255,3 +255,4 @@ Stephane Doyon
Robert Carboneau
Ye Wei
Bryan Childs
+Mike Schmitt