From ad3bd7b7c15d3dcf74a02471349b0472bc9af6dd Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Fri, 8 Sep 2023 16:45:51 +0200 Subject: [PATCH] refactor(dlgprefsound): Replace term `master` with `main` --- src/preferences/dialog/dlgprefsound.cpp | 90 +++++++++++------------ src/preferences/dialog/dlgprefsound.h | 22 +++--- src/preferences/dialog/dlgprefsounddlg.ui | 16 ++-- 3 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/preferences/dialog/dlgprefsound.cpp b/src/preferences/dialog/dlgprefsound.cpp index 1905e278711..0b7e1895f7f 100644 --- a/src/preferences/dialog/dlgprefsound.cpp +++ b/src/preferences/dialog/dlgprefsound.cpp @@ -110,13 +110,13 @@ DlgPrefSound::DlgPrefSound(QWidget* pParent, } m_pLatencyCompensation = new ControlProxy("[Master]", "microphoneLatencyCompensation", this); - m_pMasterDelay = new ControlProxy("[Master]", "delay", this); + m_pMainDelay = new ControlProxy("[Master]", "delay", this); m_pHeadDelay = new ControlProxy("[Master]", "headDelay", this); m_pBoothDelay = new ControlProxy("[Master]", "boothDelay", this); latencyCompensationSpinBox->setValue(m_pLatencyCompensation->get()); latencyCompensationWarningLabel->setWordWrap(true); - masterDelaySpinBox->setValue(m_pMasterDelay->get()); + mainDelaySpinBox->setValue(m_pMainDelay->get()); headDelaySpinBox->setValue(m_pHeadDelay->get()); boothDelaySpinBox->setValue(m_pBoothDelay->get()); @@ -124,10 +124,10 @@ DlgPrefSound::DlgPrefSound(QWidget* pParent, QOverload::of(&QDoubleSpinBox::valueChanged), this, &DlgPrefSound::latencyCompensationSpinboxChanged); - connect(masterDelaySpinBox, + connect(mainDelaySpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, - &DlgPrefSound::masterDelaySpinboxChanged); + &DlgPrefSound::mainDelaySpinboxChanged); connect(headDelaySpinBox, QOverload::of(&QDoubleSpinBox::valueChanged), this, @@ -201,34 +201,34 @@ DlgPrefSound::DlgPrefSound(QWidget* pParent, loadSettings(); }); - m_pMasterAudioLatencyOverloadCount = + m_pMainAudioLatencyOverloadCount = new ControlProxy("[Master]", "audio_latency_overload_count", this); - m_pMasterAudioLatencyOverloadCount->connectValueChanged(this, &DlgPrefSound::bufferUnderflow); - - m_pMasterLatency = new ControlProxy("[Master]", "latency", this); - m_pMasterLatency->connectValueChanged(this, &DlgPrefSound::masterLatencyChanged); - - // TODO: remove this option by automatically disabling/enabling the master mix - // when recording, broadcasting, headphone, and master outputs are enabled/disabled - m_pMasterEnabled = new ControlProxy("[Master]", "enabled", this); - masterMixComboBox->addItem(tr("Disabled")); - masterMixComboBox->addItem(tr("Enabled")); - masterMixComboBox->setCurrentIndex(m_pMasterEnabled->toBool() ? 1 : 0); - connect(masterMixComboBox, + m_pMainAudioLatencyOverloadCount->connectValueChanged(this, &DlgPrefSound::bufferUnderflow); + + m_pMainLatency = new ControlProxy("[Master]", "latency", this); + m_pMainLatency->connectValueChanged(this, &DlgPrefSound::mainLatencyChanged); + + // TODO: remove this option by automatically disabling/enabling the main mix + // when recording, broadcasting, headphone, and main outputs are enabled/disabled + m_pMainEnabled = new ControlProxy("[Master]", "enabled", this); + mainMixComboBox->addItem(tr("Disabled")); + mainMixComboBox->addItem(tr("Enabled")); + mainMixComboBox->setCurrentIndex(m_pMainEnabled->toBool() ? 1 : 0); + connect(mainMixComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, - &DlgPrefSound::masterMixChanged); - m_pMasterEnabled->connectValueChanged(this, &DlgPrefSound::masterEnabledChanged); - - m_pMasterMonoMixdown = new ControlProxy("[Master]", "mono_mixdown", this); - masterOutputModeComboBox->addItem(tr("Stereo")); - masterOutputModeComboBox->addItem(tr("Mono")); - masterOutputModeComboBox->setCurrentIndex(m_pMasterMonoMixdown->toBool() ? 1 : 0); - connect(masterOutputModeComboBox, + &DlgPrefSound::mainMixChanged); + m_pMainEnabled->connectValueChanged(this, &DlgPrefSound::mainEnabledChanged); + + m_pMainMonoMixdown = new ControlProxy("[Master]", "mono_mixdown", this); + mainOutputModeComboBox->addItem(tr("Stereo")); + mainOutputModeComboBox->addItem(tr("Mono")); + mainOutputModeComboBox->setCurrentIndex(m_pMainMonoMixdown->toBool() ? 1 : 0); + connect(mainOutputModeComboBox, QOverload::of(&QComboBox::currentIndexChanged), this, - &DlgPrefSound::masterOutputModeComboBoxChanged); - m_pMasterMonoMixdown->connectValueChanged(this, &DlgPrefSound::masterMonoMixdownChanged); + &DlgPrefSound::mainOutputModeComboBoxChanged); + m_pMainMonoMixdown->connectValueChanged(this, &DlgPrefSound::mainMonoMixdownChanged); m_pKeylockEngine = new ControlProxy("[Master]", "keylock_engine", this); @@ -700,11 +700,11 @@ void DlgPrefSound::slotResetToDefaults() { } m_pKeylockEngine->set(static_cast(keylockEngine)); - masterMixComboBox->setCurrentIndex(1); - m_pMasterEnabled->set(1.0); + mainMixComboBox->setCurrentIndex(1); + m_pMainEnabled->set(1.0); - masterDelaySpinBox->setValue(0.0); - m_pMasterDelay->set(0.0); + mainDelaySpinBox->setValue(0.0); + m_pMainDelay->set(0.0); headDelaySpinBox->setValue(0.0); m_pHeadDelay->set(0.0); @@ -712,7 +712,7 @@ void DlgPrefSound::slotResetToDefaults() { boothDelaySpinBox->setValue(0.0); m_pBoothDelay->set(0.0); - // Enable talkover master output + // Enable talkover main output m_pMicMonitorMode->set( static_cast( static_cast(EngineMaster::MicMonitorMode::Main))); @@ -730,7 +730,7 @@ void DlgPrefSound::bufferUnderflow(double count) { update(); } -void DlgPrefSound::masterLatencyChanged(double latency) { +void DlgPrefSound::mainLatencyChanged(double latency) { currentLatency->setText(QString("%1 ms").arg(latency)); update(); } @@ -740,8 +740,8 @@ void DlgPrefSound::latencyCompensationSpinboxChanged(double value) { checkLatencyCompensation(); } -void DlgPrefSound::masterDelaySpinboxChanged(double value) { - m_pMasterDelay->set(value); +void DlgPrefSound::mainDelaySpinboxChanged(double value) { + m_pMainDelay->set(value); } void DlgPrefSound::headDelaySpinboxChanged(double value) { @@ -752,22 +752,22 @@ void DlgPrefSound::boothDelaySpinboxChanged(double value) { m_pBoothDelay->set(value); } -void DlgPrefSound::masterMixChanged(int value) { - m_pMasterEnabled->set(value); +void DlgPrefSound::mainMixChanged(int value) { + m_pMainEnabled->set(value); } -void DlgPrefSound::masterEnabledChanged(double value) { - const bool masterEnabled = (value != 0); - masterMixComboBox->setCurrentIndex(masterEnabled ? 1 : 0); +void DlgPrefSound::mainEnabledChanged(double value) { + const bool mainEnabled = (value != 0); + mainMixComboBox->setCurrentIndex(mainEnabled ? 1 : 0); } -void DlgPrefSound::masterOutputModeComboBoxChanged(int value) { - m_pMasterMonoMixdown->set((double)value); +void DlgPrefSound::mainOutputModeComboBoxChanged(int value) { + m_pMainMonoMixdown->set((double)value); } -void DlgPrefSound::masterMonoMixdownChanged(double value) { - const bool masterMonoMixdownEnabled = (value != 0); - masterOutputModeComboBox->setCurrentIndex(masterMonoMixdownEnabled ? 1 : 0); +void DlgPrefSound::mainMonoMixdownChanged(double value) { + const bool mainMonoMixdownEnabled = (value != 0); + mainOutputModeComboBox->setCurrentIndex(mainMonoMixdownEnabled ? 1 : 0); } void DlgPrefSound::micMonitorModeComboBoxChanged(int value) { diff --git a/src/preferences/dialog/dlgprefsound.h b/src/preferences/dialog/dlgprefsound.h index b4299297bd4..62a20b1d952 100644 --- a/src/preferences/dialog/dlgprefsound.h +++ b/src/preferences/dialog/dlgprefsound.h @@ -48,15 +48,15 @@ class DlgPrefSound : public DlgPreferencePage, public Ui::DlgPrefSoundDlg { void slotApply() override; // called on ok button void slotResetToDefaults() override; void bufferUnderflow(double count); - void masterLatencyChanged(double latency); + void mainLatencyChanged(double latency); void latencyCompensationSpinboxChanged(double value); - void masterDelaySpinboxChanged(double value); + void mainDelaySpinboxChanged(double value); void headDelaySpinboxChanged(double value); void boothDelaySpinboxChanged(double value); - void masterMixChanged(int value); - void masterEnabledChanged(double value); - void masterOutputModeComboBoxChanged(int value); - void masterMonoMixdownChanged(double value); + void mainMixChanged(int value); + void mainEnabledChanged(double value); + void mainOutputModeComboBoxChanged(int value); + void mainMonoMixdownChanged(double value); void micMonitorModeComboBoxChanged(int value); private slots: @@ -85,15 +85,15 @@ class DlgPrefSound : public DlgPreferencePage, public Ui::DlgPrefSoundDlg { std::shared_ptr m_pSoundManager; UserSettingsPointer m_pSettings; SoundManagerConfig m_config; - ControlProxy* m_pMasterAudioLatencyOverloadCount; - ControlProxy* m_pMasterLatency; + ControlProxy* m_pMainAudioLatencyOverloadCount; + ControlProxy* m_pMainLatency; ControlProxy* m_pHeadDelay; - ControlProxy* m_pMasterDelay; + ControlProxy* m_pMainDelay; ControlProxy* m_pBoothDelay; ControlProxy* m_pLatencyCompensation; ControlProxy* m_pKeylockEngine; - ControlProxy* m_pMasterEnabled; - ControlProxy* m_pMasterMonoMixdown; + ControlProxy* m_pMainEnabled; + ControlProxy* m_pMainMonoMixdown; ControlProxy* m_pMicMonitorMode; QList m_inputDevices; QList m_outputDevices; diff --git a/src/preferences/dialog/dlgprefsounddlg.ui b/src/preferences/dialog/dlgprefsounddlg.ui index e756a72a249..be55c792a0d 100644 --- a/src/preferences/dialog/dlgprefsounddlg.ui +++ b/src/preferences/dialog/dlgprefsounddlg.ui @@ -100,13 +100,13 @@ - + - + - + Main Output Mode @@ -146,14 +146,14 @@ - + Main Output Delay - + ms @@ -429,11 +429,11 @@ deviceSyncComboBox engineClockComboBox keylockComboBox - masterMixComboBox - masterOutputModeComboBox + mainMixComboBox + mainOutputModeComboBox micMonitorModeComboBox latencyCompensationSpinBox - masterDelaySpinBox + mainDelaySpinBox headDelaySpinBox boothDelaySpinBox queryButton