player/Control: make ReplayGainConfig const
This commit is contained in:
parent
e443513996
commit
cd4bb444ff
@ -33,7 +33,8 @@ Partition::Partition(Instance &_instance,
|
|||||||
global_events(instance.event_loop, BIND_THIS_METHOD(OnGlobalEvent)),
|
global_events(instance.event_loop, BIND_THIS_METHOD(OnGlobalEvent)),
|
||||||
playlist(max_length, *this),
|
playlist(max_length, *this),
|
||||||
outputs(*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::TRACK
|
||||||
: ReplayGainMode::ALBUM;
|
: ReplayGainMode::ALBUM;
|
||||||
|
|
||||||
pc.LockSetReplayGain(replay_gain_config, mode);
|
pc.LockSetReplayGainMode(mode);
|
||||||
|
|
||||||
outputs.SetReplayGainMode(mode);
|
outputs.SetReplayGainMode(mode);
|
||||||
}
|
}
|
||||||
|
@ -29,10 +29,12 @@
|
|||||||
PlayerControl::PlayerControl(PlayerListener &_listener,
|
PlayerControl::PlayerControl(PlayerListener &_listener,
|
||||||
MultipleOutputs &_outputs,
|
MultipleOutputs &_outputs,
|
||||||
unsigned _buffer_chunks,
|
unsigned _buffer_chunks,
|
||||||
unsigned _buffered_before_play)
|
unsigned _buffered_before_play,
|
||||||
|
const ReplayGainConfig &_replay_gain_config)
|
||||||
:listener(_listener), outputs(_outputs),
|
:listener(_listener), outputs(_outputs),
|
||||||
buffer_chunks(_buffer_chunks),
|
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;
|
CrossFadeSettings cross_fade;
|
||||||
|
|
||||||
ReplayGainConfig replay_gain_config;
|
const ReplayGainConfig replay_gain_config;
|
||||||
ReplayGainMode replay_gain_mode = ReplayGainMode::OFF;
|
ReplayGainMode replay_gain_mode = ReplayGainMode::OFF;
|
||||||
|
|
||||||
double total_play_time = 0;
|
double total_play_time = 0;
|
||||||
@ -186,7 +186,8 @@ struct PlayerControl {
|
|||||||
PlayerControl(PlayerListener &_listener,
|
PlayerControl(PlayerListener &_listener,
|
||||||
MultipleOutputs &_outputs,
|
MultipleOutputs &_outputs,
|
||||||
unsigned buffer_chunks,
|
unsigned buffer_chunks,
|
||||||
unsigned buffered_before_play);
|
unsigned buffered_before_play,
|
||||||
|
const ReplayGainConfig &_replay_gain_config);
|
||||||
~PlayerControl();
|
~PlayerControl();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -468,10 +469,8 @@ public:
|
|||||||
return cross_fade.mixramp_delay;
|
return cross_fade.mixramp_delay;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LockSetReplayGain(const ReplayGainConfig &_config,
|
void LockSetReplayGainMode(ReplayGainMode _mode) {
|
||||||
ReplayGainMode _mode) {
|
|
||||||
const ScopeLock protect(mutex);
|
const ScopeLock protect(mutex);
|
||||||
replay_gain_config = _config;
|
|
||||||
replay_gain_mode = _mode;
|
replay_gain_mode = _mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,10 +53,12 @@ filter_plugin_by_name(gcc_unused const char *name)
|
|||||||
PlayerControl::PlayerControl(PlayerListener &_listener,
|
PlayerControl::PlayerControl(PlayerListener &_listener,
|
||||||
MultipleOutputs &_outputs,
|
MultipleOutputs &_outputs,
|
||||||
unsigned _buffer_chunks,
|
unsigned _buffer_chunks,
|
||||||
unsigned _buffered_before_play)
|
unsigned _buffered_before_play,
|
||||||
|
const ReplayGainConfig &_replay_gain_config)
|
||||||
:listener(_listener), outputs(_outputs),
|
:listener(_listener), outputs(_outputs),
|
||||||
buffer_chunks(_buffer_chunks),
|
buffer_chunks(_buffer_chunks),
|
||||||
buffered_before_play(_buffered_before_play) {}
|
buffered_before_play(_buffered_before_play),
|
||||||
|
replay_gain_config(_replay_gain_config) {}
|
||||||
PlayerControl::~PlayerControl() {}
|
PlayerControl::~PlayerControl() {}
|
||||||
|
|
||||||
static AudioOutput *
|
static AudioOutput *
|
||||||
@ -70,7 +72,8 @@ load_audio_output(EventLoop &event_loop, const char *name)
|
|||||||
|
|
||||||
static struct PlayerControl dummy_player_control(*(PlayerListener *)nullptr,
|
static struct PlayerControl dummy_player_control(*(PlayerListener *)nullptr,
|
||||||
*(MultipleOutputs *)nullptr,
|
*(MultipleOutputs *)nullptr,
|
||||||
32, 4);
|
32, 4,
|
||||||
|
ReplayGainConfig());
|
||||||
|
|
||||||
return audio_output_new(event_loop, ReplayGainConfig(), *param,
|
return audio_output_new(event_loop, ReplayGainConfig(), *param,
|
||||||
*(MixerListener *)nullptr,
|
*(MixerListener *)nullptr,
|
||||||
|
Loading…
Reference in New Issue
Block a user