summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2006-12-19 01:26:37 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2006-12-19 01:26:37 +0000
commit3bceded79373a43ee75487a5bd037723c92e089b (patch)
tree4c75cadc06d82818321318bc4b59aa385892b475 /apps
parent89990b0ca851b88988531137127a3bbeea7aa717 (diff)
downloadrockbox-3bceded79373a43ee75487a5bd037723c92e089b.tar.gz
rockbox-3bceded79373a43ee75487a5bd037723c92e089b.zip
Accept FS#5344 by Mike Schmitt. Add a "shuffle and track skip" option to
crossfade. Bumps config versino, so SAVE SETTINGS before updating. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11811 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-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
5 files changed, 44 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 @@
10372 *: "Properties" 10372 *: "Properties"
10373 </voice> 10373 </voice>
10374</phrase> 10374</phrase>
10375<phrase>
10376 id: LANG_SHUFFLE_TRACKSKIP
10377 desc: in settings_menu
10378 user:
10379 <source>
10380 *: "Shuffle and Track Skip"
10381 </source>
10382 <dest>
10383 *: "Shuffle and Track Skip"
10384 </dest>
10385 <voice>
10386 *: "Shuffle and Track Skip"
10387 </voice>
10388</phrase>
10389<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)
1819 } 1819 }
1820 /* Automatic track change w/crossfade, if not in "Track Skip Only" mode. */ 1820 /* Automatic track change w/crossfade, if not in "Track Skip Only" mode. */
1821 else if (pcmbuf_is_crossfade_enabled() && !pcmbuf_is_crossfade_active() 1821 else if (pcmbuf_is_crossfade_enabled() && !pcmbuf_is_crossfade_active()
1822 && global_settings.crossfade != 2) 1822 && global_settings.crossfade != CROSSFADE_ENABLE_TRACKSKIP )
1823 { 1823 {
1824 pcmbuf_crossfade_init(false); 1824 if ( global_settings.crossfade
1825 codec_track_changed(); 1825 == CROSSFADE_ENABLE_SHUFFLE_AND_TRACKSKIP )
1826 {
1827 if (global_settings.playlist_shuffle) /* shuffle mode is on, so crossfade: */
1828 {
1829 pcmbuf_crossfade_init(false);
1830 codec_track_changed();
1831 }
1832 else /* shuffle mode is off, so do a gapless track change */
1833 {
1834 pcmbuf_set_position_callback(codec_pcmbuf_position_callback); /* Gapless playback */
1835 pcmbuf_set_event_handler(codec_pcmbuf_track_changed_callback); /* copied from below */
1836 }
1837 }
1838 else /* normal crossfade: */
1839 {
1840 pcmbuf_crossfade_init(false);
1841 codec_track_changed();
1842 }
1826 } 1843 }
1827 /* Gapless playback. */ 1844 /* Gapless playback. */
1828 else 1845 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;
100#include "eq_menu.h" 100#include "eq_menu.h"
101#endif 101#endif
102 102
103#define CONFIG_BLOCK_VERSION 57 103#define CONFIG_BLOCK_VERSION 58
104#define CONFIG_BLOCK_SIZE 512 104#define CONFIG_BLOCK_SIZE 512
105#define RTC_BLOCK_SIZE 44 105#define RTC_BLOCK_SIZE 44
106 106
@@ -581,7 +581,7 @@ static const struct bit_entry hd_bits[] =
581 {1, S_O(replaygain_noclip), false, "replaygain noclip", off_on }, 581 {1, S_O(replaygain_noclip), false, "replaygain noclip", off_on },
582 {8 | SIGNED, S_O(replaygain_preamp), 0, "replaygain preamp", NULL }, 582 {8 | SIGNED, S_O(replaygain_preamp), 0, "replaygain preamp", NULL },
583 {2, S_O(beep), 0, "beep", "off,weak,moderate,strong" }, 583 {2, S_O(beep), 0, "beep", "off,weak,moderate,strong" },
584 {2, S_O(crossfade), 0, "crossfade", "off,shuffle,track skip,always"}, 584 {3, S_O(crossfade), 0, "crossfade", "off,shuffle,track skip,shuffle and track skip,always"},
585 {3, S_O(crossfade_fade_in_delay), 0, "crossfade fade in delay", NULL}, 585 {3, S_O(crossfade_fade_in_delay), 0, "crossfade fade in delay", NULL},
586 {3, S_O(crossfade_fade_out_delay), 0, "crossfade fade out delay", NULL}, 586 {3, S_O(crossfade_fade_out_delay), 0, "crossfade fade out delay", NULL},
587 {4, S_O(crossfade_fade_in_duration), 0, "crossfade fade in duration", NULL}, 587 {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 @@
87#define TRIG_DURATION_COUNT 13 87#define TRIG_DURATION_COUNT 13
88extern const char * const trig_durations[TRIG_DURATION_COUNT]; 88extern const char * const trig_durations[TRIG_DURATION_COUNT];
89 89
90#define CROSSFADE_ENABLE_SHUFFLE 1 90#define CROSSFADE_ENABLE_SHUFFLE 1
91#define CROSSFADE_ENABLE_ALWAYS 2 91#define CROSSFADE_ENABLE_TRACKSKIP 2
92#define CROSSFADE_ENABLE_SHUFFLE_AND_TRACKSKIP 3
93#define CROSSFADE_ENABLE_ALWAYS 4
92 94
93#define FOLDER_ADVANCE_OFF 0 95#define FOLDER_ADVANCE_OFF 0
94#define FOLDER_ADVANCE_NEXT 1 96#define FOLDER_ADVANCE_NEXT 1
@@ -144,7 +146,7 @@ struct user_settings
144 bool superbass; /* true/false */ 146 bool superbass; /* true/false */
145 147
146#if CONFIG_CODEC == SWCODEC 148#if CONFIG_CODEC == SWCODEC
147 int crossfade; /* Enable crossfade (0=off,1=shuffle,2=always) */ 149 int crossfade; /* Enable crossfade (0=off,1=shuffle,2=trackskip,3=shuff&trackskip,4=always) */
148 int crossfade_fade_in_delay; /* Fade in delay (0-15s) */ 150 int crossfade_fade_in_delay; /* Fade in delay (0-15s) */
149 int crossfade_fade_out_delay; /* Fade out delay (0-15s) */ 151 int crossfade_fade_out_delay; /* Fade out delay (0-15s) */
150 int crossfade_fade_in_duration; /* Fade in duration (0-15s) */ 152 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)
1514 { STR(LANG_OFF) }, 1514 { STR(LANG_OFF) },
1515 { STR(LANG_SHUFFLE) }, 1515 { STR(LANG_SHUFFLE) },
1516 { STR(LANG_TRACKSKIP) }, 1516 { STR(LANG_TRACKSKIP) },
1517 { STR(LANG_SHUFFLE_TRACKSKIP) },
1517 { STR(LANG_ALWAYS) }, 1518 { STR(LANG_ALWAYS) },
1518 }; 1519 };
1519 1520
1520 bool ret; 1521 bool ret;
1521 1522
1522 ret=set_option( str(LANG_CROSSFADE_ENABLE), 1523 ret=set_option( str(LANG_CROSSFADE_ENABLE),
1523 &global_settings.crossfade, INT, names, 4, NULL); 1524 &global_settings.crossfade, INT, names, 5, NULL);
1524 audio_set_crossfade(global_settings.crossfade); 1525 audio_set_crossfade(global_settings.crossfade);
1525 return ret; 1526 return ret;
1526} 1527}