player/Control: make ReplayGainConfig const
This commit is contained in:
@@ -33,7 +33,8 @@ Partition::Partition(Instance &_instance,
|
||||
global_events(instance.event_loop, BIND_THIS_METHOD(OnGlobalEvent)),
|
||||
playlist(max_length, *this),
|
||||
outputs(*this),
|
||||
pc(*this, outputs, buffer_chunks, buffered_before_play)
|
||||
pc(*this, outputs, buffer_chunks, buffered_before_play,
|
||||
replay_gain_config)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -51,7 +52,7 @@ Partition::UpdateEffectiveReplayGainMode(ReplayGainMode mode)
|
||||
? ReplayGainMode::TRACK
|
||||
: ReplayGainMode::ALBUM;
|
||||
|
||||
pc.LockSetReplayGain(replay_gain_config, mode);
|
||||
pc.LockSetReplayGainMode(mode);
|
||||
|
||||
outputs.SetReplayGainMode(mode);
|
||||
}
|
||||
|
@@ -29,10 +29,12 @@
|
||||
PlayerControl::PlayerControl(PlayerListener &_listener,
|
||||
MultipleOutputs &_outputs,
|
||||
unsigned _buffer_chunks,
|
||||
unsigned _buffered_before_play)
|
||||
unsigned _buffered_before_play,
|
||||
const ReplayGainConfig &_replay_gain_config)
|
||||
:listener(_listener), outputs(_outputs),
|
||||
buffer_chunks(_buffer_chunks),
|
||||
buffered_before_play(_buffered_before_play)
|
||||
buffered_before_play(_buffered_before_play),
|
||||
replay_gain_config(_replay_gain_config)
|
||||
{
|
||||
}
|
||||
|
||||
|
@@ -169,7 +169,7 @@ struct PlayerControl {
|
||||
|
||||
CrossFadeSettings cross_fade;
|
||||
|
||||
ReplayGainConfig replay_gain_config;
|
||||
const ReplayGainConfig replay_gain_config;
|
||||
ReplayGainMode replay_gain_mode = ReplayGainMode::OFF;
|
||||
|
||||
double total_play_time = 0;
|
||||
@@ -186,7 +186,8 @@ struct PlayerControl {
|
||||
PlayerControl(PlayerListener &_listener,
|
||||
MultipleOutputs &_outputs,
|
||||
unsigned buffer_chunks,
|
||||
unsigned buffered_before_play);
|
||||
unsigned buffered_before_play,
|
||||
const ReplayGainConfig &_replay_gain_config);
|
||||
~PlayerControl();
|
||||
|
||||
/**
|
||||
@@ -468,10 +469,8 @@ public:
|
||||
return cross_fade.mixramp_delay;
|
||||
}
|
||||
|
||||
void LockSetReplayGain(const ReplayGainConfig &_config,
|
||||
ReplayGainMode _mode) {
|
||||
void LockSetReplayGainMode(ReplayGainMode _mode) {
|
||||
const ScopeLock protect(mutex);
|
||||
replay_gain_config = _config;
|
||||
replay_gain_mode = _mode;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user