player/CrossFade: add method IsMixRampEnabled()
This commit is contained in:
parent
dda521a150
commit
2518612b1b
@ -118,7 +118,7 @@ CrossFadeSettings::Calculate(SignedSongTime current_total_time,
|
||||
const auto chunk_duration =
|
||||
af.SizeToTime<FloatDuration>(sizeof(MusicChunk::data));
|
||||
|
||||
if (mixramp_delay <= FloatDuration::zero() ||
|
||||
if (!IsMixRampEnabled() ||
|
||||
!mixramp_start || !mixramp_prev_end) {
|
||||
chunks = lround(duration / chunk_duration);
|
||||
} else {
|
||||
|
@ -48,6 +48,10 @@ struct CrossFadeSettings {
|
||||
return duration.count() > 0;
|
||||
}
|
||||
|
||||
constexpr bool IsMixRampEnabled() const noexcept {
|
||||
return mixramp_delay > FloatDuration::zero();
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate how many music pipe chunks should be used for crossfading.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user