From 03747ba93e29d76e664dcc493a21f320117d62d8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 29 Oct 2013 00:14:27 +0100 Subject: PlayerControl: move attributes to struct CrossFadeSettings --- src/PlayerThread.cxx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src/PlayerThread.cxx') diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx index 7273a3300..79efe7a9d 100644 --- a/src/PlayerThread.cxx +++ b/src/PlayerThread.cxx @@ -779,7 +779,7 @@ Player::PlayNextChunk() other_chunk->tag); other_chunk->tag = nullptr; - if (std::isnan(pc.mixramp_delay_seconds)) { + if (std::isnan(pc.cross_fade.mixramp_delay)) { chunk->mix_ratio = ((float)cross_fade_position) / cross_fade_chunks; } else { @@ -999,17 +999,15 @@ Player::Run() calculate how many chunks will be required for it */ cross_fade_chunks = - cross_fade_calc(pc.cross_fade_seconds, dc.total_time, - pc.mixramp_db, - pc.mixramp_delay_seconds, - dc.replay_gain_db, - dc.replay_gain_prev_db, - dc.GetMixRampStart(), - dc.GetMixRampPreviousEnd(), - dc.out_audio_format, - play_audio_format, - buffer.GetSize() - - pc.buffered_before_play); + pc.cross_fade.Calculate(dc.total_time, + dc.replay_gain_db, + dc.replay_gain_prev_db, + dc.GetMixRampStart(), + dc.GetMixRampPreviousEnd(), + dc.out_audio_format, + play_audio_format, + buffer.GetSize() - + pc.buffered_before_play); if (cross_fade_chunks > 0) { xfade_state = CrossFadeState::ENABLED; cross_fading = false; -- cgit v1.2.3