From f85acc5e31d504647781ccd5977d6b0476eea11b Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Fri, 29 Sep 2023 15:46:32 +0200 Subject: [PATCH] chore: Rename members to match new `output_latency_ms` CO name --- src/engine/enginemixer.cpp | 17 +++++++++-------- src/engine/enginemixer.h | 4 ++-- src/preferences/dialog/dlgprefsound.cpp | 6 +++--- src/preferences/dialog/dlgprefsound.h | 4 ++-- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/engine/enginemixer.cpp b/src/engine/enginemixer.cpp index 4a4950da126..e4b7ad92434 100644 --- a/src/engine/enginemixer.cpp +++ b/src/engine/enginemixer.cpp @@ -74,16 +74,17 @@ EngineMixer::EngineMixer( m_pWorkerScheduler->start(QThread::HighPriority); // Main sample rate - m_pMainSampleRate = new ControlObject( + m_pSampleRate = new ControlObject( ConfigKey(kAppGroup, QStringLiteral("samplerate")), true, true); - m_pMainSampleRate->addAlias(ConfigKey(group, QStringLiteral("samplerate"))); - m_pMainSampleRate->set(44100.); + m_pSampleRate->addAlias(ConfigKey(group, QStringLiteral("samplerate"))); + m_pSampleRate->set(44100.); // Latency control - m_pMainLatency = new ControlObject(ConfigKey(kAppGroup, QStringLiteral("output_latency_ms")), + m_pOutputLatencyMs = new ControlObject( + ConfigKey(kAppGroup, QStringLiteral("output_latency_ms")), true, true); // reported latency (sometimes correct) - m_pMainLatency->addAlias(ConfigKey(kLegacyGroup, QStringLiteral("latency"))); + m_pOutputLatencyMs->addAlias(ConfigKey(kLegacyGroup, QStringLiteral("latency"))); m_pAudioLatencyOverloadCount = new ControlObject( ConfigKey(kAppGroup, QStringLiteral("audio_latency_overload_count"))); m_pAudioLatencyOverloadCount->addAlias(ConfigKey( @@ -236,8 +237,8 @@ EngineMixer::~EngineMixer() { delete m_pXFaderMode; delete m_pEngineSync; - delete m_pMainSampleRate; - delete m_pMainLatency; + delete m_pSampleRate; + delete m_pOutputLatencyMs; delete m_pAudioLatencyOverloadCount; delete m_pAudioLatencyUsage; delete m_pAudioLatencyOverload; @@ -418,7 +419,7 @@ void EngineMixer::process(const int iBufferSize) { bool boothEnabled = m_pBoothEnabled->toBool(); bool headphoneEnabled = m_pHeadphoneEnabled->toBool(); - m_sampleRate = mixxx::audio::SampleRate::fromDouble(m_pMainSampleRate->get()); + m_sampleRate = mixxx::audio::SampleRate::fromDouble(m_pSampleRate->get()); // TODO: remove assumption of stereo buffer constexpr unsigned int kChannels = 2; const unsigned int iFrames = iBufferSize / kChannels; diff --git a/src/engine/enginemixer.h b/src/engine/enginemixer.h index 0d1d5581024..23d7c95bced 100644 --- a/src/engine/enginemixer.h +++ b/src/engine/enginemixer.h @@ -303,8 +303,8 @@ class EngineMixer : public QObject, public AudioSource { ControlObject* m_pMainGain; ControlObject* m_pBoothGain; ControlObject* m_pHeadGain; - ControlObject* m_pMainSampleRate; - ControlObject* m_pMainLatency; + ControlObject* m_pSampleRate; + ControlObject* m_pOutputLatencyMs; ControlObject* m_pAudioLatencyOverloadCount; ControlObject* m_pAudioLatencyUsage; ControlObject* m_pAudioLatencyOverload; diff --git a/src/preferences/dialog/dlgprefsound.cpp b/src/preferences/dialog/dlgprefsound.cpp index 32a28be8e13..c32b16379a3 100644 --- a/src/preferences/dialog/dlgprefsound.cpp +++ b/src/preferences/dialog/dlgprefsound.cpp @@ -207,8 +207,8 @@ DlgPrefSound::DlgPrefSound(QWidget* pParent, new ControlProxy(kAppGroup, QStringLiteral("audio_latency_overload_count"), this); m_pAudioLatencyOverloadCount->connectValueChanged(this, &DlgPrefSound::bufferUnderflow); - m_pMainLatency = new ControlProxy(kAppGroup, QStringLiteral("output_latency_ms"), this); - m_pMainLatency->connectValueChanged(this, &DlgPrefSound::mainLatencyChanged); + m_pOutputLatencyMs = new ControlProxy(kAppGroup, QStringLiteral("output_latency_ms"), this); + m_pOutputLatencyMs->connectValueChanged(this, &DlgPrefSound::outputLatencyChanged); // TODO: remove this option by automatically disabling/enabling the main mix // when recording, broadcasting, headphone, and main outputs are enabled/disabled @@ -732,7 +732,7 @@ void DlgPrefSound::bufferUnderflow(double count) { update(); } -void DlgPrefSound::mainLatencyChanged(double latency) { +void DlgPrefSound::outputLatencyChanged(double latency) { currentLatency->setText(QString("%1 ms").arg(latency)); update(); } diff --git a/src/preferences/dialog/dlgprefsound.h b/src/preferences/dialog/dlgprefsound.h index 42a3d46109f..797a596e036 100644 --- a/src/preferences/dialog/dlgprefsound.h +++ b/src/preferences/dialog/dlgprefsound.h @@ -48,7 +48,7 @@ class DlgPrefSound : public DlgPreferencePage, public Ui::DlgPrefSoundDlg { void slotApply() override; // called on ok button void slotResetToDefaults() override; void bufferUnderflow(double count); - void mainLatencyChanged(double latency); + void outputLatencyChanged(double latency); void latencyCompensationSpinboxChanged(double value); void mainDelaySpinboxChanged(double value); void headDelaySpinboxChanged(double value); @@ -86,7 +86,7 @@ class DlgPrefSound : public DlgPreferencePage, public Ui::DlgPrefSoundDlg { UserSettingsPointer m_pSettings; SoundManagerConfig m_config; ControlProxy* m_pAudioLatencyOverloadCount; - ControlProxy* m_pMainLatency; + ControlProxy* m_pOutputLatencyMs; ControlProxy* m_pHeadDelay; ControlProxy* m_pMainDelay; ControlProxy* m_pBoothDelay;