{decoder,player}/Control: add ReplayGain{Config,Mode} attributes
Don't use the global variables in class DecoderBridge; instead, forward these values to the decoder thread via PlayerControl and DecoderControl.
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#include "thread/Thread.hxx"
|
||||
#include "CrossFade.hxx"
|
||||
#include "Chrono.hxx"
|
||||
#include "ReplayGainConfig.hxx"
|
||||
#include "ReplayGainMode.hxx"
|
||||
|
||||
#include <exception>
|
||||
|
||||
@@ -167,6 +169,9 @@ struct PlayerControl {
|
||||
|
||||
CrossFadeSettings cross_fade;
|
||||
|
||||
ReplayGainConfig replay_gain_config;
|
||||
ReplayGainMode replay_gain_mode = ReplayGainMode::OFF;
|
||||
|
||||
double total_play_time;
|
||||
|
||||
/**
|
||||
@@ -463,6 +468,13 @@ public:
|
||||
return cross_fade.mixramp_delay;
|
||||
}
|
||||
|
||||
void LockSetReplayGain(const ReplayGainConfig &_config,
|
||||
ReplayGainMode _mode) {
|
||||
const ScopeLock protect(mutex);
|
||||
replay_gain_config = _config;
|
||||
replay_gain_mode = _mode;
|
||||
}
|
||||
|
||||
double GetTotalPlayTime() const {
|
||||
return total_play_time;
|
||||
}
|
||||
|
Reference in New Issue
Block a user