diff options
author | Max Kellermann <max@duempel.org> | 2013-08-03 21:00:50 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-03 21:37:56 +0200 |
commit | d1e7b4e38136f9342aad76c685a13adf0e69f869 (patch) | |
tree | 49643b937ddfe735511b566a71398da5a945d7aa /src/CrossFade.cxx | |
parent | 67f591a9ce60651da41afc499bd9a22e25314e35 (diff) | |
download | mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.gz mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.tar.xz mpd-d1e7b4e38136f9342aad76c685a13adf0e69f869.zip |
audio_format: convert to C++
Diffstat (limited to 'src/CrossFade.cxx')
-rw-r--r-- | src/CrossFade.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/CrossFade.cxx b/src/CrossFade.cxx index 253038b26..4f5ff32ca 100644 --- a/src/CrossFade.cxx +++ b/src/CrossFade.cxx @@ -20,7 +20,7 @@ #include "config.h" #include "CrossFade.hxx" #include "MusicChunk.hxx" -#include "audio_format.h" +#include "AudioFormat.hxx" #include "Tag.hxx" #include <cmath> @@ -97,8 +97,8 @@ unsigned cross_fade_calc(float duration, float total_time, float mixramp_db, float mixramp_delay, float replay_gain_db, float replay_gain_prev_db, char *mixramp_start, char *mixramp_prev_end, - const struct audio_format *af, - const struct audio_format *old_format, + const AudioFormat af, + const AudioFormat old_format, unsigned max_chunks) { unsigned int chunks = 0; @@ -107,13 +107,13 @@ unsigned cross_fade_calc(float duration, float total_time, if (duration < 0 || duration >= total_time || /* we can't crossfade when the audio formats are different */ - !audio_format_equals(af, old_format)) + af != old_format) return 0; assert(duration >= 0); - assert(audio_format_valid(af)); + assert(af.IsValid()); - chunks_f = (float)audio_format_time_to_size(af) / (float)CHUNK_SIZE; + chunks_f = (float)af.GetTimeToSize() / (float)CHUNK_SIZE; if (std::isnan(mixramp_delay) || !mixramp_start || !mixramp_prev_end) { chunks = (chunks_f * duration + 0.5); |