aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_control.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/player_control.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/player_control.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/player_control.c b/src/player_control.c
index d8aed14ba..30a530a6a 100644
--- a/src/player_control.c
+++ b/src/player_control.c
@@ -30,6 +30,7 @@
#include <assert.h>
#include <stdio.h>
+#include <math.h>
struct player_control pc;
@@ -45,6 +46,8 @@ void pc_init(unsigned buffer_chunks, unsigned int buffered_before_play)
pc.error = PLAYER_ERROR_NOERROR;
pc.state = PLAYER_STATE_STOP;
pc.cross_fade_seconds = 0;
+ pc.mixramp_db = 0;
+ pc.mixramp_delay_seconds = nanf("");
}
void pc_deinit(void)
@@ -305,6 +308,34 @@ pc_set_cross_fade(float cross_fade_seconds)
idle_add(IDLE_OPTIONS);
}
+float
+pc_get_mixramp_db(void)
+{
+ return pc.mixramp_db;
+}
+
+void
+pc_set_mixramp_db(float mixramp_db)
+{
+ pc.mixramp_db = mixramp_db;
+
+ idle_add(IDLE_OPTIONS);
+}
+
+float
+pc_get_mixramp_delay(void)
+{
+ return pc.mixramp_delay_seconds;
+}
+
+void
+pc_set_mixramp_delay(float mixramp_delay_seconds)
+{
+ pc.mixramp_delay_seconds = mixramp_delay_seconds;
+
+ idle_add(IDLE_OPTIONS);
+}
+
double
pc_get_total_play_time(void)
{