aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist_state.c
diff options
context:
space:
mode:
authorTim Phipps <mpd@phipps-hutton.freeserve.co.uk>2010-03-21 18:21:47 +0100
committerMax Kellermann <max@duempel.org>2010-03-21 18:21:47 +0100
commite7a515c8b11c643332406d60a13ab1fe06d2b226 (patch)
treeaa7179b453b6fe7b163d1b4b807157359cb436cf /src/playlist_state.c
parente9b75d462c4d0ffee3b3b26582800ec4f657a333 (diff)
downloadmpd-e7a515c8b11c643332406d60a13ab1fe06d2b226.tar.gz
mpd-e7a515c8b11c643332406d60a13ab1fe06d2b226.tar.xz
mpd-e7a515c8b11c643332406d60a13ab1fe06d2b226.zip
Add support for MixRamp tags
Adds mixrampdb and mixrampdelay commands. Reads MIXRAP_START and MIXRAMP_END tags from FLAC files and overlaps instead of crossfading.
Diffstat (limited to '')
-rw-r--r--src/playlist_state.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/playlist_state.c b/src/playlist_state.c
index 93e64ccba..9f057332d 100644
--- a/src/playlist_state.c
+++ b/src/playlist_state.c
@@ -40,6 +40,8 @@
#define PLAYLIST_STATE_FILE_CURRENT "current: "
#define PLAYLIST_STATE_FILE_TIME "time: "
#define PLAYLIST_STATE_FILE_CROSSFADE "crossfade: "
+#define PLAYLIST_STATE_FILE_MIXRAMPDB "mixrampdb: "
+#define PLAYLIST_STATE_FILE_MIXRAMPDELAY "mixrampdelay: "
#define PLAYLIST_STATE_FILE_PLAYLIST_BEGIN "playlist_begin"
#define PLAYLIST_STATE_FILE_PLAYLIST_END "playlist_end"
@@ -90,6 +92,10 @@ playlist_state_save(FILE *fp, const struct playlist *playlist)
playlist->queue.consume);
fprintf(fp, "%s%i\n", PLAYLIST_STATE_FILE_CROSSFADE,
(int)(pc_get_cross_fade()));
+ fprintf(fp, "%s%f\n", PLAYLIST_STATE_FILE_MIXRAMPDB,
+ pc_get_mixramp_db());
+ fprintf(fp, "%s%f\n", PLAYLIST_STATE_FILE_MIXRAMPDELAY,
+ pc_get_mixramp_delay());
fprintf(fp, "%s\n", PLAYLIST_STATE_FILE_PLAYLIST_BEGIN);
queue_save(fp, &playlist->queue);
fprintf(fp, "%s\n", PLAYLIST_STATE_FILE_PLAYLIST_END);
@@ -168,6 +174,10 @@ playlist_state_restore(const char *line, FILE *fp, struct playlist *playlist)
playlist_set_consume(playlist, false);
} else if (g_str_has_prefix(buffer, PLAYLIST_STATE_FILE_CROSSFADE)) {
pc_set_cross_fade(atoi(buffer + strlen(PLAYLIST_STATE_FILE_CROSSFADE)));
+ } else if (g_str_has_prefix(buffer, PLAYLIST_STATE_FILE_MIXRAMPDB)) {
+ pc_set_mixramp_db(atof(buffer + strlen(PLAYLIST_STATE_FILE_MIXRAMPDB)));
+ } else if (g_str_has_prefix(buffer, PLAYLIST_STATE_FILE_MIXRAMPDELAY)) {
+ pc_set_mixramp_delay(atof(buffer + strlen(PLAYLIST_STATE_FILE_MIXRAMPDELAY)));
} else if (g_str_has_prefix(buffer, PLAYLIST_STATE_FILE_RANDOM)) {
random_mode =
strcmp(buffer + strlen(PLAYLIST_STATE_FILE_RANDOM),