Skip to content

Commit

Permalink
refactor(dlgprefsound): Replace term master with main
Browse files Browse the repository at this point in the history
  • Loading branch information
Holzhaus committed Sep 8, 2023
1 parent 4cbc6d8 commit ad3bd7b
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 64 deletions.
90 changes: 45 additions & 45 deletions src/preferences/dialog/dlgprefsound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,24 @@ 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());

connect(latencyCompensationSpinBox,
QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this,
&DlgPrefSound::latencyCompensationSpinboxChanged);
connect(masterDelaySpinBox,
connect(mainDelaySpinBox,
QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this,
&DlgPrefSound::masterDelaySpinboxChanged);
&DlgPrefSound::mainDelaySpinboxChanged);
connect(headDelaySpinBox,
QOverload<double>::of(&QDoubleSpinBox::valueChanged),
this,
Expand Down Expand Up @@ -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<int>::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<int>::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);
Expand Down Expand Up @@ -700,19 +700,19 @@ void DlgPrefSound::slotResetToDefaults() {
}
m_pKeylockEngine->set(static_cast<double>(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);

boothDelaySpinBox->setValue(0.0);
m_pBoothDelay->set(0.0);

// Enable talkover master output
// Enable talkover main output
m_pMicMonitorMode->set(
static_cast<double>(
static_cast<int>(EngineMaster::MicMonitorMode::Main)));
Expand All @@ -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();
}
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
22 changes: 11 additions & 11 deletions src/preferences/dialog/dlgprefsound.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -85,15 +85,15 @@ class DlgPrefSound : public DlgPreferencePage, public Ui::DlgPrefSoundDlg {
std::shared_ptr<SoundManager> 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<SoundDevicePointer> m_inputDevices;
QList<SoundDevicePointer> m_outputDevices;
Expand Down
16 changes: 8 additions & 8 deletions src/preferences/dialog/dlgprefsounddlg.ui
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@
</widget>
</item>
<item row="6" column="1">
<widget class="QComboBox" name="masterMixComboBox"/>
<widget class="QComboBox" name="mainMixComboBox"/>
</item>
<item row="7" column="1">
<widget class="QComboBox" name="masterOutputModeComboBox"/>
<widget class="QComboBox" name="mainOutputModeComboBox"/>
</item>
<item row="7" column="0">
<widget class="QLabel" name="masterMonoLabel">
<widget class="QLabel" name="mainMonoLabel">
<property name="text">
<string>Main Output Mode</string>
</property>
Expand Down Expand Up @@ -146,14 +146,14 @@
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="masterDelayLabel">
<widget class="QLabel" name="mainDelayLabel">
<property name="text">
<string>Main Output Delay</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QDoubleSpinBox" name="masterDelaySpinBox">
<widget class="QDoubleSpinBox" name="mainDelaySpinBox">
<property name="suffix">
<string extracomment="milliseconds"> ms</string>
</property>
Expand Down Expand Up @@ -429,11 +429,11 @@
<tabstop>deviceSyncComboBox</tabstop>
<tabstop>engineClockComboBox</tabstop>
<tabstop>keylockComboBox</tabstop>
<tabstop>masterMixComboBox</tabstop>
<tabstop>masterOutputModeComboBox</tabstop>
<tabstop>mainMixComboBox</tabstop>
<tabstop>mainOutputModeComboBox</tabstop>
<tabstop>micMonitorModeComboBox</tabstop>
<tabstop>latencyCompensationSpinBox</tabstop>
<tabstop>masterDelaySpinBox</tabstop>
<tabstop>mainDelaySpinBox</tabstop>
<tabstop>headDelaySpinBox</tabstop>
<tabstop>boothDelaySpinBox</tabstop>
<tabstop>queryButton</tabstop>
Expand Down

0 comments on commit ad3bd7b

Please sign in to comment.