diff --git a/res/controllers/Traktor-Kontrol-S4-MK3.js b/res/controllers/Traktor-Kontrol-S4-MK3.js index b20056345aa..4d8046b0907 100644 --- a/res/controllers/Traktor-Kontrol-S4-MK3.js +++ b/res/controllers/Traktor-Kontrol-S4-MK3.js @@ -2603,7 +2603,7 @@ class S4Mk3MixerColumn extends ComponentContainer { mixer: this, input: MixerControlsMixAuxOnShift ? function(value) { if (this.mixer.shifted && this.group !== `[Channel${idx}]`) { // FIXME only if group != [ChannelX] - const controlKey = (this.group === `[Microphone${idx}]` || this.group === "[Microphone]") ? "talkover" : "master"; + const controlKey = (this.group === `[Microphone${idx}]` || this.group === "[Microphone]") ? "talkover" : "main_mix"; const isPlaying = engine.getValue(this.group, controlKey); if ((value !== 0) !== isPlaying) { engine.setValue(this.group, controlKey, value !== 0); diff --git a/res/qml/SyncButton.qml b/res/qml/SyncButton.qml index bf428b4ede5..f9044c248fd 100644 --- a/res/qml/SyncButton.qml +++ b/res/qml/SyncButton.qml @@ -64,6 +64,6 @@ Skin.Button { id: leaderControl group: root.group - key: "sync_master" + key: "sync_leader" } } diff --git a/res/schema.xml b/res/schema.xml index 9d47d4eb605..bd0af688c46 100644 --- a/res/schema.xml +++ b/res/schema.xml @@ -457,7 +457,7 @@ reapplying those migrations. This was used in the development of 2.3 to track whether cues were placed manually or automatically. However, this turned out to be unnecessary. - This version is left as a placeholder so users who were using the master + This version is left as a placeholder so users who were using the main branch will have their database updated correctly for the subsequent schema change. diff --git a/res/skins/Deere/auxiliary.xml b/res/skins/Deere/auxiliary.xml index 55041e9f4de..8dea7de9efd 100644 --- a/res/skins/Deere/auxiliary.xml +++ b/res/skins/Deere/auxiliary.xml @@ -108,7 +108,7 @@ me,f Play Play - ,master + ,main_mix diff --git a/res/skins/LateNight/mic_aux/aux_unit.xml b/res/skins/LateNight/mic_aux/aux_unit.xml index 03946f4ebd3..95c8ab9c0bc 100644 --- a/res/skins/LateNight/mic_aux/aux_unit.xml +++ b/res/skins/LateNight/mic_aux/aux_unit.xml @@ -39,7 +39,7 @@ AuxPlay 42f,26f medium - ,master + ,main_mix diff --git a/res/skins/LateNight/mic_aux/aux_unit_unconfigured.xml b/res/skins/LateNight/mic_aux/aux_unit_unconfigured.xml index ae73811892e..6bf72e0d5fe 100644 --- a/res/skins/LateNight/mic_aux/aux_unit_unconfigured.xml +++ b/res/skins/LateNight/mic_aux/aux_unit_unconfigured.xml @@ -36,7 +36,7 @@ skin:../LateNight//buttons/btn_flat_square.svg - ,master + ,main_mix diff --git a/res/skins/Shade/deck_transport.xml b/res/skins/Shade/deck_transport.xml index 03c29621569..00e6a06c49c 100644 --- a/res/skins/Shade/deck_transport.xml +++ b/res/skins/Shade/deck_transport.xml @@ -62,7 +62,7 @@ 5,35 - [Auxiliary],master + [Auxiliary],main_mix LeftButton diff --git a/res/skins/Tango/mic_aux_sampler/aux_unit.xml b/res/skins/Tango/mic_aux_sampler/aux_unit.xml index 97a165506ac..7db7266188e 100644 --- a/res/skins/Tango/mic_aux_sampler/aux_unit.xml +++ b/res/skins/Tango/mic_aux_sampler/aux_unit.xml @@ -38,7 +38,7 @@ Variables: master_enable AuxEnable 20f,29f - ,master + ,main_mix 3f,1min diff --git a/res/skins/Tango/mic_aux_sampler/aux_unit_unconfigured.xml b/res/skins/Tango/mic_aux_sampler/aux_unit_unconfigured.xml index 604fae09d2f..6b61cd58c84 100644 --- a/res/skins/Tango/mic_aux_sampler/aux_unit_unconfigured.xml +++ b/res/skins/Tango/mic_aux_sampler/aux_unit_unconfigured.xml @@ -42,7 +42,7 @@ Variables: MicAuxAdd 20f,20f + - ,master + ,main_mix diff --git a/src/control/controlobjectscript.h b/src/control/controlobjectscript.h index 01525ef71b4..30111cce072 100644 --- a/src/control/controlobjectscript.h +++ b/src/control/controlobjectscript.h @@ -36,7 +36,7 @@ class ControlObjectScript : public ControlProxy { void trigger(double, QObject*); protected slots: - // Receives the value from the master control by a unique queued connection + // Receives the value from the primary control by a unique queued connection // This is specified virtual, to allow gmock to replace it in the test case virtual void slotValueChanged(double v, QObject*); diff --git a/src/control/controlproxy.h b/src/control/controlproxy.h index 69f8bd67860..6ec83d22454 100644 --- a/src/control/controlproxy.h +++ b/src/control/controlproxy.h @@ -159,7 +159,7 @@ class ControlProxy : public QObject { void valueChanged(double); protected slots: - /// Receives the value from the master control by a unique direct connection + /// Receives the value from the primary control by a unique direct connection void slotValueChangedDirect(double v, QObject* pSetter) { if (pSetter != this) { // This is base implementation of this function without scaling @@ -167,7 +167,7 @@ class ControlProxy : public QObject { } } - /// Receives the value from the master control by a unique auto connection + /// Receives the value from the primary control by a unique auto connection void slotValueChangedAuto(double v, QObject* pSetter) { if (pSetter != this) { // This is base implementation of this function without scaling @@ -175,7 +175,7 @@ class ControlProxy : public QObject { } } - /// Receives the value from the master control by a unique Queued connection + /// Receives the value from the primary control by a unique Queued connection void slotValueChangedQueued(double v, QObject* pSetter) { if (pSetter != this) { // This is base implementation of this function without scaling diff --git a/src/engine/channels/engineaux.cpp b/src/engine/channels/engineaux.cpp index db418562a4a..f8d9bd8136f 100644 --- a/src/engine/channels/engineaux.cpp +++ b/src/engine/channels/engineaux.cpp @@ -22,9 +22,9 @@ EngineAux::EngineAux(const ChannelHandleAndGroup& handleGroup, EffectsManager* p ConfigKey(getGroup(), "input_configured")); // by default Aux is disabled on the master and disabled on PFL. User - // can over-ride by setting the "pfl" or "master" controls. + // can over-ride by setting the "pfl" or "main_mix" controls. // Skins can change that during initialisation, if the master control is not provided. - setMaster(false); + setMainMix(false); } EngineAux::~EngineAux() { @@ -46,7 +46,7 @@ EngineChannel::ActiveState EngineAux::updateActiveState() { } void EngineAux::onInputConfigured(const AudioInput& input) { - if (input.getType() != AudioPath::AUXILIARY) { + if (input.getType() != AudioPathType::Auxiliary) { // This is an error! qDebug() << "WARNING: EngineAux connected to AudioInput for a non-auxiliary type!"; return; @@ -56,7 +56,7 @@ void EngineAux::onInputConfigured(const AudioInput& input) { } void EngineAux::onInputUnconfigured(const AudioInput& input) { - if (input.getType() != AudioPath::AUXILIARY) { + if (input.getType() != AudioPathType::Auxiliary) { // This is an error! qDebug() << "WARNING: EngineAux connected to AudioInput for a non-auxiliary type!"; return; diff --git a/src/engine/channels/enginechannel.cpp b/src/engine/channels/enginechannel.cpp index 1b0fc3f46b7..de0b5b3c1cd 100644 --- a/src/engine/channels/enginechannel.cpp +++ b/src/engine/channels/enginechannel.cpp @@ -20,8 +20,10 @@ EngineChannel::EngineChannel(const ChannelHandleAndGroup& handleGroup, m_channelIndex(-1) { m_pPFL = new ControlPushButton(ConfigKey(getGroup(), "pfl")); m_pPFL->setButtonMode(ControlPushButton::TOGGLE); - m_pMaster = new ControlPushButton(ConfigKey(getGroup(), "master")); - m_pMaster->setButtonMode(ControlPushButton::POWERWINDOW); + m_pMainMix = new ControlPushButton(ConfigKey(getGroup(), "main_mix")); + m_pMainMix->setButtonMode(ControlPushButton::POWERWINDOW); + ControlDoublePrivate::insertAlias( + ConfigKey(getGroup(), "master"), ConfigKey(getGroup(), "main_mix")); m_pOrientation = new ControlPushButton(ConfigKey(getGroup(), "orientation")); m_pOrientation->setButtonMode(ControlPushButton::TOGGLE); m_pOrientation->setStates(3); @@ -44,7 +46,7 @@ EngineChannel::EngineChannel(const ChannelHandleAndGroup& handleGroup, } EngineChannel::~EngineChannel() { - delete m_pMaster; + delete m_pMainMix; delete m_pPFL; delete m_pOrientation; delete m_pOrientationLeft; @@ -61,12 +63,12 @@ bool EngineChannel::isPflEnabled() const { return m_pPFL->toBool(); } -void EngineChannel::setMaster(bool enabled) { - m_pMaster->set(enabled ? 1.0 : 0.0); +void EngineChannel::setMainMix(bool enabled) { + m_pMainMix->set(enabled ? 1.0 : 0.0); } -bool EngineChannel::isMasterEnabled() const { - return m_pMaster->toBool(); +bool EngineChannel::isMainMixEnabled() const { + return m_pMainMix->toBool(); } void EngineChannel::setTalkover(bool enabled) { diff --git a/src/engine/channels/enginechannel.h b/src/engine/channels/enginechannel.h index 4f3d03b7bd1..c48bb722a83 100644 --- a/src/engine/channels/enginechannel.h +++ b/src/engine/channels/enginechannel.h @@ -51,8 +51,8 @@ class EngineChannel : public EngineObject { void setPfl(bool enabled); virtual bool isPflEnabled() const; - void setMaster(bool enabled); - virtual bool isMasterEnabled() const; + void setMainMix(bool enabled); + virtual bool isMainMixEnabled() const; void setTalkover(bool enabled); virtual bool isTalkoverEnabled() const; inline bool isTalkoverChannel() { return m_bIsTalkoverChannel; }; @@ -92,7 +92,7 @@ class EngineChannel : public EngineObject { void slotOrientationCenter(double v); private: - ControlPushButton* m_pMaster; + ControlPushButton* m_pMainMix; ControlPushButton* m_pPFL; ControlPushButton* m_pOrientation; ControlPushButton* m_pOrientationLeft; diff --git a/src/engine/channels/enginedeck.cpp b/src/engine/channels/enginedeck.cpp index a04e4eae332..f4d5ba1bb68 100644 --- a/src/engine/channels/enginedeck.cpp +++ b/src/engine/channels/enginedeck.cpp @@ -132,7 +132,7 @@ void EngineDeck::receiveBuffer( } void EngineDeck::onInputConfigured(const AudioInput& input) { - if (input.getType() != AudioPath::VINYLCONTROL) { + if (input.getType() != AudioPathType::VinylControl) { // This is an error! qDebug() << "WARNING: EngineDeck connected to AudioInput for a non-vinylcontrol type!"; return; @@ -142,7 +142,7 @@ void EngineDeck::onInputConfigured(const AudioInput& input) { } void EngineDeck::onInputUnconfigured(const AudioInput& input) { - if (input.getType() != AudioPath::VINYLCONTROL) { + if (input.getType() != AudioPathType::VinylControl) { // This is an error! qDebug() << "WARNING: EngineDeck connected to AudioInput for a non-vinylcontrol type!"; return; diff --git a/src/engine/channels/enginemicrophone.cpp b/src/engine/channels/enginemicrophone.cpp index 98b7f02ce33..339173b03ce 100644 --- a/src/engine/channels/enginemicrophone.cpp +++ b/src/engine/channels/enginemicrophone.cpp @@ -22,7 +22,7 @@ EngineMicrophone::EngineMicrophone(const ChannelHandleAndGroup& handleGroup, ControlDoublePrivate::insertAlias(ConfigKey(getGroup(), "enabled"), ConfigKey(getGroup(), "input_configured")); - setMaster(false); // Use "talkover" button to enable microphones + setMainMix(false); // Use "talkover" button to enable microphones } EngineMicrophone::~EngineMicrophone() { @@ -44,7 +44,7 @@ EngineChannel::ActiveState EngineMicrophone::updateActiveState() { } void EngineMicrophone::onInputConfigured(const AudioInput& input) { - if (input.getType() != AudioPath::MICROPHONE) { + if (input.getType() != AudioPathType::Microphone) { // This is an error! qWarning() << "EngineMicrophone connected to AudioInput for a non-Microphone type!"; return; @@ -54,7 +54,7 @@ void EngineMicrophone::onInputConfigured(const AudioInput& input) { } void EngineMicrophone::onInputUnconfigured(const AudioInput& input) { - if (input.getType() != AudioPath::MICROPHONE) { + if (input.getType() != AudioPathType::Microphone) { // This is an error! qWarning() << "EngineMicrophone connected to AudioInput for a non-Microphone type!"; return; diff --git a/src/engine/enginemaster.cpp b/src/engine/enginemaster.cpp index f92bd34e483..8040bc8fa18 100644 --- a/src/engine/enginemaster.cpp +++ b/src/engine/enginemaster.cpp @@ -36,9 +36,9 @@ EngineMaster::EngineMaster( bool bEnableSidechain) : m_pChannelHandleFactory(pChannelHandleFactory), m_pEngineEffectsManager(pEffectsManager->getEngineEffectsManager()), - m_masterGainOld(0.0), + m_mainGainOld(0.0), m_boothGainOld(0.0), - m_headphoneMasterGainOld(0.0), + m_headphoneMainGainOld(0.0), m_headphoneGainOld(1.0), m_balleftOld(1.0), m_balrightOld(1.0), @@ -66,19 +66,19 @@ EngineMaster::EngineMaster( m_pWorkerScheduler = new EngineWorkerScheduler(this); m_pWorkerScheduler->start(QThread::HighPriority); - // Master sample rate - m_pMasterSampleRate = new ControlObject(ConfigKey(group, "samplerate"), true, true); - m_pMasterSampleRate->set(44100.); + // Main sample rate + m_pMainSampleRate = new ControlObject(ConfigKey(group, "samplerate"), true, true); + m_pMainSampleRate->set(44100.); // Latency control - m_pMasterLatency = new ControlObject(ConfigKey(group, "latency"), + m_pMainLatency = new ControlObject(ConfigKey(group, "latency"), true, true); // reported latency (sometimes correct) m_pAudioLatencyOverloadCount = new ControlObject(ConfigKey(group, "audio_latency_overload_count"), true, true); m_pAudioLatencyUsage = new ControlPotmeter(ConfigKey(group, "audio_latency_usage"), 0.0, 0.25); m_pAudioLatencyOverload = new ControlPotmeter(ConfigKey(group, "audio_latency_overload"), 0.0, 1.0); - // Master sync controller + // Sync controller m_pEngineSync = new EngineSync(pConfig); // The last-used bpm value is saved in the destructor of EngineSync. @@ -92,13 +92,13 @@ EngineMaster::EngineMaster( // Balance m_pBalance = new ControlPotmeter(ConfigKey(group, "balance"), -1., 1.); - // Master gain - m_pMasterGain = new ControlAudioTaperPot(ConfigKey(group, "gain"), -14, 14, 0.5); + // Main gain + m_pMainGain = new ControlAudioTaperPot(ConfigKey(group, "gain"), -14, 14, 0.5); // Booth gain m_pBoothGain = new ControlAudioTaperPot(ConfigKey(group, "booth_gain"), -14, 14, 0.5); - // Legacy: the master "gain" control used to be named "volume" in Mixxx + // Legacy: the main "gain" control used to be named "volume" in Mixxx // 1.11.0 and earlier. See issue #7413. ControlDoublePrivate::insertAlias(ConfigKey(group, "volume"), ConfigKey(group, "gain")); @@ -106,7 +106,7 @@ EngineMaster::EngineMaster( // VU meter: m_pVumeter = new EngineVuMeter(group); - m_pMasterDelay = new EngineDelay(group, ConfigKey(group, "delay")); + m_pMainDelay = new EngineDelay(group, ConfigKey(group, "delay")); m_pHeadDelay = new EngineDelay(group, ConfigKey(group, "headDelay")); m_pBoothDelay = new EngineDelay(group, ConfigKey(group, "boothDelay")); m_pLatencyCompensationDelay = new EngineDelay(group, @@ -126,7 +126,7 @@ EngineMaster::EngineMaster( m_pHeadMix->setDefaultValue(-1.); m_pHeadMix->set(-1.); - // Master / Headphone split-out mode (for devices with only one output). + // Main / Headphone split-out mode (for devices with only one output). m_pHeadSplitEnabled = new ControlPushButton(ConfigKey(group, "headSplit")); m_pHeadSplitEnabled->setButtonMode(ControlPushButton::TOGGLE); m_pHeadSplitEnabled->set(0.0); @@ -135,13 +135,13 @@ EngineMaster::EngineMaster( // Allocate buffers m_pHead = SampleUtil::alloc(MAX_BUFFER_LEN); - m_pMaster = SampleUtil::alloc(MAX_BUFFER_LEN); + m_pMain = SampleUtil::alloc(MAX_BUFFER_LEN); m_pBooth = SampleUtil::alloc(MAX_BUFFER_LEN); m_pTalkover = SampleUtil::alloc(MAX_BUFFER_LEN); m_pTalkoverHeadphones = SampleUtil::alloc(MAX_BUFFER_LEN); m_pSidechainMix = SampleUtil::alloc(MAX_BUFFER_LEN); SampleUtil::clear(m_pHead, MAX_BUFFER_LEN); - SampleUtil::clear(m_pMaster, MAX_BUFFER_LEN); + SampleUtil::clear(m_pMain, MAX_BUFFER_LEN); SampleUtil::clear(m_pBooth, MAX_BUFFER_LEN); SampleUtil::clear(m_pTalkover, MAX_BUFFER_LEN); SampleUtil::clear(m_pTalkoverHeadphones, MAX_BUFFER_LEN); @@ -178,13 +178,17 @@ EngineMaster::EngineMaster( static_cast(EngineBuffer::defaultKeylockEngine()))); // TODO: Make this read only and make EngineMaster decide whether - // processing the master mix is necessary. - m_pMasterEnabled = new ControlObject(ConfigKey(group, "enabled"), - true, false, true); // persist = true + // processing the main mix is necessary. + m_pMainEnabled = new ControlObject(ConfigKey(group, "enabled"), + true, + false, + true); // persist = true m_pBoothEnabled = new ControlObject(ConfigKey(group, "booth_enabled")); m_pBoothEnabled->setReadOnly(); - m_pMasterMonoMixdown = new ControlObject(ConfigKey(group, "mono_mixdown"), - true, false, true); // persist = true + m_pMainMonoMixdown = new ControlObject(ConfigKey(group, "mono_mixdown"), + true, + false, + true); // persist = true m_pMicMonitorMode = new ControlObject(ConfigKey(group, "talkover_mix"), true, false, true); // persist = true m_pHeadphoneEnabled = new ControlObject(ConfigKey(group, "headEnabled")); @@ -200,13 +204,13 @@ EngineMaster::~EngineMaster() { delete m_pBalance; delete m_pHeadMix; delete m_pHeadSplitEnabled; - delete m_pMasterGain; + delete m_pMainGain; delete m_pBoothGain; delete m_pHeadGain; delete m_pTalkoverDucking; delete m_pVumeter; delete m_pEngineSideChain; - delete m_pMasterDelay; + delete m_pMainDelay; delete m_pHeadDelay; delete m_pBoothDelay; delete m_pLatencyCompensationDelay; @@ -218,20 +222,20 @@ EngineMaster::~EngineMaster() { delete m_pXFaderMode; delete m_pEngineSync; - delete m_pMasterSampleRate; - delete m_pMasterLatency; + delete m_pMainSampleRate; + delete m_pMainLatency; delete m_pAudioLatencyOverloadCount; delete m_pAudioLatencyUsage; delete m_pAudioLatencyOverload; - delete m_pMasterEnabled; + delete m_pMainEnabled; delete m_pBoothEnabled; - delete m_pMasterMonoMixdown; + delete m_pMainMonoMixdown; delete m_pMicMonitorMode; delete m_pHeadphoneEnabled; SampleUtil::free(m_pHead); - SampleUtil::free(m_pMaster); + SampleUtil::free(m_pMain); SampleUtil::free(m_pBooth); SampleUtil::free(m_pTalkover); SampleUtil::free(m_pTalkoverHeadphones); @@ -252,8 +256,8 @@ EngineMaster::~EngineMaster() { } } -const CSAMPLE* EngineMaster::getMasterBuffer() const { - return m_pMaster; +const CSAMPLE* EngineMaster::getMainBuffer() const { + return m_pMain; } const CSAMPLE* EngineMaster::getBoothBuffer() const { @@ -281,7 +285,7 @@ void EngineMaster::processChannels(int iBufferSize) { //ScopedTimer timer("EngineMaster::processChannels"); EngineChannel* pLeaderChannel = m_pEngineSync->getLeaderChannel(); - // Reserve the first place for the master channel which + // Reserve the first place for the main channel which // should be processed first m_activeChannels.append(NULL); int activeChannelsStartIndex = 1; // Nothing at 0 yet @@ -306,8 +310,8 @@ void EngineMaster::processChannels(int iBufferSize) { // xFader-Mix m_activeTalkoverChannels.append(pChannelInfo); - // Check if we need to fade out the master channel - GainCache& gainCache = m_channelMasterGainCache[i]; + // Check if we need to fade out the main channel + GainCache& gainCache = m_channelMainGainCache[i]; if (gainCache.m_gain != 0) { gainCache.m_fadeout = true; m_activeBusChannels[pChannel->getOrientation()].append(pChannelInfo); @@ -319,13 +323,13 @@ void EngineMaster::processChannels(int iBufferSize) { gainCache.m_fadeout = true; m_activeTalkoverChannels.append(pChannelInfo); } - if (pChannel->isMasterEnabled() && + if (pChannel->isMainMixEnabled() && !pChannelInfo->m_pMuteControl->toBool()) { // the xFader-Mix m_activeBusChannels[pChannel->getOrientation()].append(pChannelInfo); } else { // Check if we need to fade out the channel - GainCache& gainCache = m_channelMasterGainCache[i]; + GainCache& gainCache = m_channelMainGainCache[i]; if (gainCache.m_gain != 0) { gainCache.m_fadeout = true; m_activeBusChannels[pChannel->getOrientation()].append(pChannelInfo); @@ -348,7 +352,7 @@ void EngineMaster::processChannels(int iBufferSize) { // If necessary, add the channel to the list of buffers to process. if (pChannel == pLeaderChannel) { - // If this is the sync master, it should be processed first. + // If this is the sync leader, it should be processed first. m_activeChannels.replace(0, pChannelInfo); activeChannelsStartIndex = 0; } else { @@ -396,11 +400,11 @@ void EngineMaster::process(const int iBufferSize) { } //Trace t("EngineMaster::process"); - bool masterEnabled = m_pMasterEnabled->toBool(); + bool mainEnabled = m_pMainEnabled->toBool(); bool boothEnabled = m_pBoothEnabled->toBool(); bool headphoneEnabled = m_pHeadphoneEnabled->toBool(); - m_sampleRate = mixxx::audio::SampleRate::fromDouble(m_pMasterSampleRate->get()); + m_sampleRate = mixxx::audio::SampleRate::fromDouble(m_pMainSampleRate->get()); // TODO: remove assumption of stereo buffer constexpr unsigned int kChannels = 2; const unsigned int iFrames = iBufferSize / kChannels; @@ -415,13 +419,13 @@ void EngineMaster::process(const int iBufferSize) { // Compute headphone mix // Head phone left/right mix CSAMPLE pflMixGainInHeadphones = 1; - CSAMPLE masterMixGainInHeadphones = 0; - if (masterEnabled) { + CSAMPLE mainMixGainInHeadphones = 0; + if (mainEnabled) { const auto cf_val = static_cast(m_pHeadMix->get()); pflMixGainInHeadphones = 0.5f * (-cf_val + 1.0f); - masterMixGainInHeadphones = 0.5f * (cf_val + 1.0f); + mainMixGainInHeadphones = 0.5f * (cf_val + 1.0f); // qDebug() << "head val " << cf_val << ", head " << chead_gain - // << ", master " << cmaster_gain; + // << ", main " << mainGain; } // Mix all the PFL enabled channels together. @@ -430,7 +434,7 @@ void EngineMaster::process(const int iBufferSize) { if (headphoneEnabled) { // Process effects and mix PFL channels together for the headphones. // Effects will be reprocessed post-fader for the crossfader buses - // and master mix, so the channel input buffers cannot be modified here. + // and main mix, so the channel input buffers cannot be modified here. ChannelMixer::applyEffectsAndMixChannels( m_headphoneGain, m_activeHeadphoneChannels, @@ -447,7 +451,7 @@ void EngineMaster::process(const int iBufferSize) { // If there is only one channel in the headphone mix, use its features // for effects processing. This allows for previewing how an effect will // sound on a playing deck before turning up the dry/wet knob to make it - // audible on the master mix. Without this, the effect would sound different + // audible on the main mix. Without this, the effect would sound different // in headphones than how it would sound if it was enabled on the deck, // for example with tempo synced effects. if (m_activeHeadphoneChannels.size() == 1) { @@ -516,19 +520,19 @@ void EngineMaster::process(const int iBufferSize) { &crossfaderLeftGain, &crossfaderRightGain); // Make the mix for each crossfader orientation output bus. - // m_masterGain takes care of applying the attenuation from + // m_mainGain takes care of applying the attenuation from // channel volume faders, crossfader, and talkover ducking. // Talkover is mixed in later according to the configured MicMonitorMode - m_masterGain.setGains(crossfaderLeftGain, + m_mainGain.setGains(crossfaderLeftGain, 1.0f, crossfaderRightGain, m_pTalkoverDucking->getGain(iFrames)); for (int o = EngineChannel::LEFT; o <= EngineChannel::RIGHT; o++) { - ChannelMixer::applyEffectsInPlaceAndMixChannels(m_masterGain, + ChannelMixer::applyEffectsInPlaceAndMixChannels(m_mainGain, m_activeBusChannels[o], - &m_channelMasterGainCache, // no [o] because the old gain - // follows an orientation switch + &m_channelMainGainCache, // no [o] because the old gain + // follows an orientation switch m_pOutputBusBuffers[o], m_masterHandle.handle(), iBufferSize, @@ -570,9 +574,9 @@ void EngineMaster::process(const int iBufferSize) { false); } - if (masterEnabled) { - // Mix the crossfader orientation buffers together into the master mix - SampleUtil::copy3WithGain(m_pMaster, + if (mainEnabled) { + // Mix the crossfader orientation buffers together into the main mix + SampleUtil::copy3WithGain(m_pMain, m_pOutputBusBuffers[EngineChannel::LEFT], 1.0, m_pOutputBusBuffers[EngineChannel::CENTER], @@ -584,129 +588,129 @@ void EngineMaster::process(const int iBufferSize) { MicMonitorMode configuredMicMonitorMode = static_cast( static_cast(m_pMicMonitorMode->get())); - // Process master, booth, and record/broadcast buffers according to the + // Process main, booth, and record/broadcast buffers according to the // MicMonitorMode configured in DlgPrefSound // TODO(Be): make SampleUtil ramping functions update the old gain variable - if (configuredMicMonitorMode == MicMonitorMode::MASTER) { - // Process master channel effects - // TODO(Be): Move this after mixing in talkover. To apply master effects - // to both the master and booth in that case will require refactoring + if (configuredMicMonitorMode == MicMonitorMode::Main) { + // Process main channel effects + // TODO(Be): Move this after mixing in talkover. To apply main effects + // to both the main and booth in that case will require refactoring // the effects system to be able to process the same effects on multiple // buffers within the same callback. - applyMasterEffects(iBufferSize); + applyMainEffects(iBufferSize); if (headphoneEnabled) { - processHeadphones(masterMixGainInHeadphones, iBufferSize); + processHeadphones(mainMixGainInHeadphones, iBufferSize); } - // Copy master mix to booth output with booth gain before mixing - // talkover with master mix + // Copy main mix to booth output with booth gain before mixing + // talkover with main mix if (boothEnabled) { CSAMPLE_GAIN boothGain = static_cast(m_pBoothGain->get()); SampleUtil::copyWithRampingGain( m_pBooth, - m_pMaster, + m_pMain, m_boothGainOld, boothGain, iBufferSize); m_boothGainOld = boothGain; } - // Mix talkover into master mix + // Mix talkover into main mix if (m_pNumMicsConfigured->get() > 0) { - SampleUtil::add(m_pMaster, m_pTalkover, iBufferSize); + SampleUtil::add(m_pMain, m_pTalkover, iBufferSize); } - // Apply master gain - CSAMPLE_GAIN master_gain = static_cast(m_pMasterGain->get()); - SampleUtil::applyRampingGain(m_pMaster, m_masterGainOld, master_gain, iBufferSize); - m_masterGainOld = master_gain; + // Apply main gain + CSAMPLE_GAIN mainGain = static_cast(m_pMainGain->get()); + SampleUtil::applyRampingGain(m_pMain, m_mainGainOld, mainGain, iBufferSize); + m_mainGainOld = mainGain; - // Record/broadcast signal is the same as the master output + // Record/broadcast signal is the same as the main output if (sidechainMixRequired()) { - SampleUtil::copy(m_pSidechainMix, m_pMaster, iBufferSize); + SampleUtil::copy(m_pSidechainMix, m_pMain, iBufferSize); } - } else if (configuredMicMonitorMode == MicMonitorMode::MASTER_AND_BOOTH) { - // Process master channel effects + } else if (configuredMicMonitorMode == MicMonitorMode::MainAndBooth) { + // Process main channel effects // TODO(Be): Move this after mixing in talkover. For the MASTER only // MicMonitorMode above, that will require refactoring the effects system // to be able to process the same effects on different buffers // within the same callback. For consistency between the MicMonitorModes, - // process master effects here before mixing in talkover. - applyMasterEffects(iBufferSize); + // process main effects here before mixing in talkover. + applyMainEffects(iBufferSize); if (headphoneEnabled) { - processHeadphones(masterMixGainInHeadphones, iBufferSize); + processHeadphones(mainMixGainInHeadphones, iBufferSize); } - // Mix talkover with master + // Mix talkover with main if (m_pNumMicsConfigured->get() > 0) { - SampleUtil::add(m_pMaster, m_pTalkover, iBufferSize); + SampleUtil::add(m_pMain, m_pTalkover, iBufferSize); } - // Copy master mix (with talkover mixed in) to booth output with booth gain + // Copy main mix (with talkover mixed in) to booth output with booth gain if (boothEnabled) { CSAMPLE_GAIN boothGain = static_cast(m_pBoothGain->get()); SampleUtil::copyWithRampingGain( m_pBooth, - m_pMaster, + m_pMain, m_boothGainOld, boothGain, iBufferSize); m_boothGainOld = boothGain; } - // Apply master gain - CSAMPLE_GAIN master_gain = static_cast(m_pMasterGain->get()); + // Apply main gain + CSAMPLE_GAIN mainGain = static_cast(m_pMainGain->get()); SampleUtil::applyRampingGain( - m_pMaster, - m_masterGainOld, - master_gain, + m_pMain, + m_mainGainOld, + mainGain, iBufferSize); - m_masterGainOld = master_gain; + m_mainGainOld = mainGain; - // Record/broadcast signal is the same as the master output + // Record/broadcast signal is the same as the main output if (sidechainMixRequired()) { - SampleUtil::copy(m_pSidechainMix, m_pMaster, iBufferSize); + SampleUtil::copy(m_pSidechainMix, m_pMain, iBufferSize); } - } else if (configuredMicMonitorMode == MicMonitorMode::DIRECT_MONITOR) { - // Skip mixing talkover with the master and booth outputs + } else if (configuredMicMonitorMode == MicMonitorMode::DirectMonitor) { + // Skip mixing talkover with the main and booth outputs // if using direct monitoring because it is being mixed in hardware // without the latency of sending the signal into Mixxx for processing. // However, include the talkover mix in the record/broadcast signal. - // Copy master mix to booth output with booth gain + // Copy main mix to booth output with booth gain if (boothEnabled) { CSAMPLE_GAIN boothGain = static_cast(m_pBoothGain->get()); SampleUtil::copyWithRampingGain( m_pBooth, - m_pMaster, + m_pMain, m_boothGainOld, boothGain, iBufferSize); m_boothGainOld = boothGain; } - // Process master channel effects + // Process main channel effects // NOTE(Be): This should occur before mixing in talkover for the // record/broadcast signal so the record/broadcast signal is the same - // as what is heard on the master & booth outputs. - applyMasterEffects(iBufferSize); + // as what is heard on the main & booth outputs. + applyMainEffects(iBufferSize); if (headphoneEnabled) { - processHeadphones(masterMixGainInHeadphones, iBufferSize); + processHeadphones(mainMixGainInHeadphones, iBufferSize); } - // Apply master gain - CSAMPLE_GAIN master_gain = static_cast(m_pMasterGain->get()); + // Apply main gain + CSAMPLE_GAIN mainGain = static_cast(m_pMainGain->get()); SampleUtil::applyRampingGain( - m_pMaster, - m_masterGainOld, - master_gain, + m_pMain, + m_mainGainOld, + mainGain, iBufferSize); - m_masterGainOld = master_gain; + m_mainGainOld = mainGain; if (sidechainMixRequired()) { - SampleUtil::copy(m_pSidechainMix, m_pMaster, iBufferSize); + SampleUtil::copy(m_pSidechainMix, m_pMain, iBufferSize); if (m_pNumMicsConfigured->get() > 0) { // The talkover signal Mixxx receives is delayed by the round trip latency. @@ -718,15 +722,15 @@ void EngineMaster::process(const int iBufferSize) { // a full round trip through the signal chain has elapsed since Mixxx // processed the output signal. // Although Mixxx receives the input signal delayed, the user hears it mixed - // in hardware with the master & booth outputs without that + // in hardware with the main & booth outputs without that // latency, so to record/broadcast the same signal that is heard - // on the master & booth outputs, the master mix must be delayed before + // on the main & booth outputs, the main mix must be delayed before // mixing the talkover signal for the record/broadcast mix. // If not using microphone inputs or recording/broadcasting from // a sound card input, skip unnecessary processing here. - // Copy the master mix to a separate buffer before delaying it - // to avoid delaying the master output. + // Copy the main mix to a separate buffer before delaying it + // to avoid delaying the main output. m_pLatencyCompensationDelay->process(m_pSidechainMix, iBufferSize); SampleUtil::add(m_pSidechainMix, m_pTalkover, iBufferSize); } @@ -744,16 +748,16 @@ void EngineMaster::process(const int iBufferSize) { m_pEngineSideChain->writeSamples(m_pSidechainMix, iFrames); } - // Process effects that apply to master hardware output only but not + // Process effects that apply to main hardware output only but not // record/broadcast signal if (m_pEngineEffectsManager) { GroupFeatureState masterFeatures; masterFeatures.has_gain = true; - masterFeatures.gain = m_pMasterGain->get(); + masterFeatures.gain = m_pMainGain->get(); m_pEngineEffectsManager->processPostFaderInPlace( m_masterOutputHandle.handle(), m_masterHandle.handle(), - m_pMaster, + m_pMain, iBufferSize, static_cast(m_sampleRate.value()), masterFeatures); @@ -770,27 +774,31 @@ void EngineMaster::process(const int iBufferSize) { } // Perform balancing on main out - SampleUtil::applyRampingAlternatingGain(m_pMaster, balleft, balright, - m_balleftOld, m_balrightOld, iBufferSize); + SampleUtil::applyRampingAlternatingGain(m_pMain, + balleft, + balright, + m_balleftOld, + m_balrightOld, + iBufferSize); m_balleftOld = balleft; m_balrightOld = balright; // Update VU meter (it does not return anything). Needs to be here so that - // master balance and talkover is reflected in the VU meter. + // main balance and talkover is reflected in the VU meter. if (m_pVumeter != nullptr) { - m_pVumeter->process(m_pMaster, iBufferSize); + m_pVumeter->process(m_pMain, iBufferSize); } } - if (m_pMasterMonoMixdown->toBool()) { - SampleUtil::mixStereoToMono(m_pMaster, iBufferSize); + if (m_pMainMonoMixdown->toBool()) { + SampleUtil::mixStereoToMono(m_pMain, iBufferSize); } - if (masterEnabled) { - m_pMasterDelay->process(m_pMaster, iBufferSize); + if (mainEnabled) { + m_pMainDelay->process(m_pMain, iBufferSize); } else { - SampleUtil::clear(m_pMaster, iBufferSize); + SampleUtil::clear(m_pMain, iBufferSize); } if (headphoneEnabled) { m_pHeadDelay->process(m_pHead, iBufferSize); @@ -804,16 +812,16 @@ void EngineMaster::process(const int iBufferSize) { m_pWorkerScheduler->runWorkers(); } -void EngineMaster::applyMasterEffects(int iBufferSize) { - // Apply master effects +void EngineMaster::applyMainEffects(int bufferSize) { + // Apply main effects if (m_pEngineEffectsManager) { GroupFeatureState masterFeatures; masterFeatures.has_gain = true; - masterFeatures.gain = m_pMasterGain->get(); + masterFeatures.gain = m_pMainGain->get(); m_pEngineEffectsManager->processPostFaderInPlace(m_masterHandle.handle(), m_masterHandle.handle(), - m_pMaster, - iBufferSize, + m_pMain, + bufferSize, static_cast(m_sampleRate.value()), masterFeatures, CSAMPLE_GAIN_ONE, @@ -823,26 +831,26 @@ void EngineMaster::applyMasterEffects(int iBufferSize) { } void EngineMaster::processHeadphones( - const CSAMPLE_GAIN masterMixGainInHeadphones, + const CSAMPLE_GAIN mainMixGainInHeadphones, int iBufferSize) { - // Add master mix to headphones + // Add main mix to headphones SampleUtil::addWithRampingGain( m_pHead, - m_pMaster, - m_headphoneMasterGainOld, - masterMixGainInHeadphones, + m_pMain, + m_headphoneMainGainOld, + mainMixGainInHeadphones, iBufferSize); - m_headphoneMasterGainOld = masterMixGainInHeadphones; + m_headphoneMainGainOld = mainMixGainInHeadphones; // If Head Split is enabled, replace the left channel of the pfl buffer // with a mono mix of the headphone buffer, and the right channel of the pfl - // buffer with a mono mix of the master output buffer. + // buffer with a mono mix of the main output buffer. if (m_pHeadSplitEnabled->toBool()) { // note: NOT VECTORIZED because of in place copy // with all compilers, except clang >= 14. for (SINT i = 0; i + 1 < iBufferSize; i += 2) { m_pHead[i] = (m_pHead[i] + m_pHead[i + 1]) / 2; - m_pHead[i + 1] = (m_pMaster[i] + m_pMaster[i + 1]) / 2; + m_pHead[i + 1] = (m_pMain[i] + m_pMain[i + 1]) / 2; } } @@ -875,7 +883,7 @@ void EngineMaster::addChannel(EngineChannel* pChannel) { constexpr GainCache gainCacheDefault = {0, false}; m_channelHeadphoneGainCache.append(gainCacheDefault); m_channelTalkoverGainCache.append(gainCacheDefault); - m_channelMasterGainCache.append(gainCacheDefault); + m_channelMainGainCache.append(gainCacheDefault); // Pre-allocate scratch buffers to avoid memory allocation in the // callback. QVarLengthArray does nothing if reserve is called with a size @@ -903,9 +911,9 @@ EngineChannel* EngineMaster::getChannel(const QString& group) { return nullptr; } -CSAMPLE_GAIN EngineMaster::getMasterGain(int channelIndex) const { - if (channelIndex >= 0 && channelIndex < m_channelMasterGainCache.size()) { - return m_channelMasterGainCache[channelIndex].m_gain; +CSAMPLE_GAIN EngineMaster::getMainGain(int channelIndex) const { + if (channelIndex >= 0 && channelIndex < m_channelMainGainCache.size()) { + return m_channelMainGainCache[channelIndex].m_gain; } return CSAMPLE_GAIN_ZERO; } @@ -933,22 +941,22 @@ const CSAMPLE* EngineMaster::getChannelBuffer(const QString& group) const { const CSAMPLE* EngineMaster::buffer(const AudioOutput& output) const { switch (output.getType()) { - case AudioOutput::MASTER: - return getMasterBuffer(); + case AudioPathType::Main: + return getMainBuffer(); break; - case AudioOutput::BOOTH: + case AudioPathType::Booth: return getBoothBuffer(); break; - case AudioOutput::HEADPHONES: + case AudioPathType::Headphones: return getHeadphoneBuffer(); break; - case AudioOutput::BUS: + case AudioPathType::Bus: return getOutputBusBuffer(output.getIndex()); break; - case AudioOutput::DECK: + case AudioPathType::Deck: return getDeckBuffer(output.getIndex()); break; - case AudioOutput::RECORD_BROADCAST: + case AudioPathType::RecordBroadcast: return getSidechainBuffer(); break; default: @@ -958,107 +966,107 @@ const CSAMPLE* EngineMaster::buffer(const AudioOutput& output) const { void EngineMaster::onOutputConnected(const AudioOutput& output) { switch (output.getType()) { - case AudioOutput::MASTER: - // overwrite config option if a master output is configured - m_pMasterEnabled->forceSet(1.0); - break; - case AudioOutput::HEADPHONES: - m_pMasterEnabled->forceSet(1.0); - m_pHeadphoneEnabled->forceSet(1.0); - break; - case AudioOutput::BOOTH: - m_pMasterEnabled->forceSet(1.0); - m_pBoothEnabled->forceSet(1.0); - break; - case AudioOutput::BUS: - m_bBusOutputConnected[output.getIndex()] = true; - break; - case AudioOutput::DECK: - // We don't track enabled decks. - break; - case AudioOutput::RECORD_BROADCAST: - // We don't track enabled sidechain. - break; - default: - break; + case AudioPathType::Main: + // overwrite config option if a main output is configured + m_pMainEnabled->forceSet(1.0); + break; + case AudioPathType::Headphones: + m_pMainEnabled->forceSet(1.0); + m_pHeadphoneEnabled->forceSet(1.0); + break; + case AudioPathType::Booth: + m_pMainEnabled->forceSet(1.0); + m_pBoothEnabled->forceSet(1.0); + break; + case AudioPathType::Bus: + m_bBusOutputConnected[output.getIndex()] = true; + break; + case AudioPathType::Deck: + // We don't track enabled decks. + break; + case AudioPathType::RecordBroadcast: + // We don't track enabled sidechain. + break; + default: + break; } } void EngineMaster::onOutputDisconnected(const AudioOutput& output) { switch (output.getType()) { - case AudioOutput::MASTER: - // not used, because we need the master buffer for headphone mix - // and recording/broadcasting as well - break; - case AudioOutput::BOOTH: - m_pBoothEnabled->forceSet(0.0); - break; - case AudioOutput::HEADPHONES: - m_pHeadphoneEnabled->forceSet(0.0); - break; - case AudioOutput::BUS: - m_bBusOutputConnected[output.getIndex()] = false; - break; - case AudioOutput::DECK: - // We don't track enabled decks. - break; - case AudioOutput::RECORD_BROADCAST: - // We don't track enabled sidechain. - break; - default: - break; + case AudioPathType::Main: + // not used, because we need the main buffer for headphone mix + // and recording/broadcasting as well + break; + case AudioPathType::Booth: + m_pBoothEnabled->forceSet(0.0); + break; + case AudioPathType::Headphones: + m_pHeadphoneEnabled->forceSet(0.0); + break; + case AudioPathType::Bus: + m_bBusOutputConnected[output.getIndex()] = false; + break; + case AudioPathType::Deck: + // We don't track enabled decks. + break; + case AudioPathType::RecordBroadcast: + // We don't track enabled sidechain. + break; + default: + break; } } void EngineMaster::onInputConnected(const AudioInput& input) { switch (input.getType()) { - case AudioInput::MICROPHONE: - m_pNumMicsConfigured->set(m_pNumMicsConfigured->get() + 1); - break; - case AudioInput::AUXILIARY: - // We don't track enabled auxiliary inputs. - break; - case AudioInput::VINYLCONTROL: - // We don't track enabled vinyl control inputs. - break; - case AudioInput::RECORD_BROADCAST: - m_bExternalRecordBroadcastInputConnected = true; - break; - default: - break; + case AudioPathType::Microphone: + m_pNumMicsConfigured->set(m_pNumMicsConfigured->get() + 1); + break; + case AudioPathType::Auxiliary: + // We don't track enabled auxiliary inputs. + break; + case AudioPathType::VinylControl: + // We don't track enabled vinyl control inputs. + break; + case AudioPathType::RecordBroadcast: + m_bExternalRecordBroadcastInputConnected = true; + break; + default: + break; } } void EngineMaster::onInputDisconnected(const AudioInput& input) { switch (input.getType()) { - case AudioInput::MICROPHONE: - m_pNumMicsConfigured->set(m_pNumMicsConfigured->get() - 1); - break; - case AudioInput::AUXILIARY: - // We don't track enabled auxiliary inputs. - break; - case AudioInput::VINYLCONTROL: - // We don't track enabled vinyl control inputs. - break; - case AudioInput::RECORD_BROADCAST: - m_bExternalRecordBroadcastInputConnected = false; - break; - default: - break; + case AudioPathType::Microphone: + m_pNumMicsConfigured->set(m_pNumMicsConfigured->get() - 1); + break; + case AudioPathType::Auxiliary: + // We don't track enabled auxiliary inputs. + break; + case AudioPathType::VinylControl: + // We don't track enabled vinyl control inputs. + break; + case AudioPathType::RecordBroadcast: + m_bExternalRecordBroadcastInputConnected = false; + break; + default: + break; } } void EngineMaster::registerNonEngineChannelSoundIO(SoundManager* pSoundManager) { - pSoundManager->registerInput(AudioInput(AudioPath::RECORD_BROADCAST, 0, 2), - m_pEngineSideChain); + pSoundManager->registerInput(AudioInput(AudioPathType::RecordBroadcast, 0, 2), + m_pEngineSideChain); - pSoundManager->registerOutput(AudioOutput(AudioOutput::MASTER, 0, 2), this); - pSoundManager->registerOutput(AudioOutput(AudioOutput::HEADPHONES, 0, 2), this); - pSoundManager->registerOutput(AudioOutput(AudioOutput::BOOTH, 0, 2), this); + pSoundManager->registerOutput(AudioOutput(AudioPathType::Main, 0, 2), this); + pSoundManager->registerOutput(AudioOutput(AudioPathType::Headphones, 0, 2), this); + pSoundManager->registerOutput(AudioOutput(AudioPathType::Booth, 0, 2), this); for (int o = EngineChannel::LEFT; o <= EngineChannel::RIGHT; o++) { - pSoundManager->registerOutput(AudioOutput(AudioOutput::BUS, 0, 2, o), this); + pSoundManager->registerOutput(AudioOutput(AudioPathType::Bus, 0, 2, o), this); } - pSoundManager->registerOutput(AudioOutput(AudioOutput::RECORD_BROADCAST, 0, 2), this); + pSoundManager->registerOutput(AudioOutput(AudioPathType::RecordBroadcast, 0, 2), this); } bool EngineMaster::sidechainMixRequired() const { diff --git a/src/engine/enginemaster.h b/src/engine/enginemaster.h index c9c7098ca5e..4f7c10a6440 100644 --- a/src/engine/enginemaster.h +++ b/src/engine/enginemaster.h @@ -94,7 +94,7 @@ class EngineMaster : public QObject, public AudioSource { } // These are really only exposed for tests to use. - const CSAMPLE* getMasterBuffer() const; + const CSAMPLE* getMainBuffer() const; const CSAMPLE* getBoothBuffer() const; const CSAMPLE* getHeadphoneBuffer() const; const CSAMPLE* getOutputBusBuffer(unsigned int i) const; @@ -106,7 +106,7 @@ class EngineMaster : public QObject, public AudioSource { return m_pEngineSideChain; } - CSAMPLE_GAIN getMasterGain(int channelIndex) const; + CSAMPLE_GAIN getMainGain(int channelIndex) const; struct ChannelInfo { ChannelInfo(int index) @@ -195,10 +195,10 @@ class EngineMaster : public QObject, public AudioSource { // These are out of order with how they are listed in DlgPrefSound for backwards // compatibility with Mixxx 2.0 user settings. In Mixxx 2.0, before the // booth output was added, this was a binary option without - // the MASTER_AND_BOOTH mode. - MASTER = 0, - DIRECT_MONITOR, - MASTER_AND_BOOTH + // the MainAndBooth mode. + Main = 0, + DirectMonitor, + MainAndBooth, }; template @@ -246,11 +246,11 @@ class EngineMaster : public QObject, public AudioSource { protected: // The master buffer is protected so it can be accessed by test subclasses. - CSAMPLE* m_pMaster; + CSAMPLE* m_pMain; // ControlObjects for switching off unnecessary processing // These are protected so tests can set them - ControlObject* m_pMasterEnabled; + ControlObject* m_pMainEnabled; ControlObject* m_pHeadphoneEnabled; ControlObject* m_pBoothEnabled; @@ -263,7 +263,7 @@ class EngineMaster : public QObject, public AudioSource { void processChannels(int iBufferSize); ChannelHandleFactoryPointer m_pChannelHandleFactory; - void applyMasterEffects(int iBufferSize); + void applyMainEffects(int bufferSize); void processHeadphones( const CSAMPLE_GAIN masterMixGainInHeadphones, int iBufferSize); @@ -276,7 +276,7 @@ class EngineMaster : public QObject, public AudioSource { // The previous gain of each channel for each mixing output (master, // headphone, talkover). - QVarLengthArray m_channelMasterGainCache; + QVarLengthArray m_channelMainGainCache; QVarLengthArray m_channelHeadphoneGainCache; QVarLengthArray m_channelTalkoverGainCache; @@ -299,17 +299,17 @@ class EngineMaster : public QObject, public AudioSource { EngineWorkerScheduler* m_pWorkerScheduler; EngineSync* m_pEngineSync; - ControlObject* m_pMasterGain; + ControlObject* m_pMainGain; ControlObject* m_pBoothGain; ControlObject* m_pHeadGain; - ControlObject* m_pMasterSampleRate; - ControlObject* m_pMasterLatency; + ControlObject* m_pMainSampleRate; + ControlObject* m_pMainLatency; ControlObject* m_pAudioLatencyOverloadCount; ControlObject* m_pNumMicsConfigured; ControlPotmeter* m_pAudioLatencyUsage; ControlPotmeter* m_pAudioLatencyOverload; EngineTalkoverDucking* m_pTalkoverDucking; - EngineDelay* m_pMasterDelay; + EngineDelay* m_pMainDelay; EngineDelay* m_pHeadDelay; EngineDelay* m_pBoothDelay; EngineDelay* m_pLatencyCompensationDelay; @@ -329,10 +329,10 @@ class EngineMaster : public QObject, public AudioSource { PflGainCalculator m_headphoneGain; TalkoverGainCalculator m_talkoverGain; - OrientationVolumeGainCalculator m_masterGain; - CSAMPLE_GAIN m_masterGainOld; + OrientationVolumeGainCalculator m_mainGain; + CSAMPLE_GAIN m_mainGainOld; CSAMPLE_GAIN m_boothGainOld; - CSAMPLE_GAIN m_headphoneMasterGainOld; + CSAMPLE_GAIN m_headphoneMainGainOld; CSAMPLE_GAIN m_headphoneGainOld; CSAMPLE_GAIN m_balleftOld; CSAMPLE_GAIN m_balrightOld; @@ -345,7 +345,7 @@ class EngineMaster : public QObject, public AudioSource { const ChannelHandleAndGroup m_busCrossfaderRightHandle; // Mix two Mono channels. This is useful for outdoor gigs - ControlObject* m_pMasterMonoMixdown; + ControlObject* m_pMainMonoMixdown; ControlObject* m_pMicMonitorMode; volatile bool m_bBusOutputConnected[3]; diff --git a/src/engine/sidechain/enginesidechain.cpp b/src/engine/sidechain/enginesidechain.cpp index f6e6803db75..983ac207492 100644 --- a/src/engine/sidechain/enginesidechain.cpp +++ b/src/engine/sidechain/enginesidechain.cpp @@ -66,7 +66,7 @@ void EngineSideChain::addSideChainWorker(SideChainWorker* pWorker) { void EngineSideChain::receiveBuffer(const AudioInput& input, const CSAMPLE* pBuffer, unsigned int iFrames) { - VERIFY_OR_DEBUG_ASSERT(input.getType() == AudioInput::RECORD_BROADCAST) { + VERIFY_OR_DEBUG_ASSERT(input.getType() == AudioPathType::RecordBroadcast) { qDebug() << "WARNING: AudioInput type is not RECORD_BROADCAST. Ignoring incoming buffer."; return; } diff --git a/src/engine/sidechain/shoutconnection.cpp b/src/engine/sidechain/shoutconnection.cpp index a655765c14f..b2d5476f699 100644 --- a/src/engine/sidechain/shoutconnection.cpp +++ b/src/engine/sidechain/shoutconnection.cpp @@ -58,7 +58,7 @@ ShoutConnection::ShoutConnection(BroadcastProfilePtr profile, m_pConfig(pConfig), m_pProfile(profile), m_encoder(nullptr), - m_masterSamplerate("[Master]", "samplerate"), + m_mainSamplerate("[Master]", "samplerate"), m_broadcastEnabled(BROADCAST_PREF_KEY, "enabled"), m_custom_metadata(false), m_firstCall(false), @@ -396,13 +396,13 @@ void ShoutConnection::updateFromPreferences() { qWarning() << "Error: unknown bit rate:" << iBitrate; } - auto masterSamplerate = mixxx::audio::SampleRate::fromDouble(m_masterSamplerate.get()); - VERIFY_OR_DEBUG_ASSERT(masterSamplerate.isValid()) { - qWarning() << "Invalid sample rate!" << masterSamplerate; + auto mainSamplerate = mixxx::audio::SampleRate::fromDouble(m_mainSamplerate.get()); + VERIFY_OR_DEBUG_ASSERT(mainSamplerate.isValid()) { + qWarning() << "Invalid sample rate!" << mainSamplerate; return; } - if (m_format_is_ov && masterSamplerate == 96000) { + if (m_format_is_ov && mainSamplerate == 96000) { errorDialog(tr("Broadcasting at 96 kHz with Ogg Vorbis is not currently " "supported. Please try a different sample rate or switch " "to a different encoding."), @@ -412,7 +412,7 @@ void ShoutConnection::updateFromPreferences() { } #ifdef __OPUS__ - if (m_format_is_opus && masterSamplerate != EncoderOpus::getMasterSamplerate()) { + if (m_format_is_opus && mainSamplerate != EncoderOpus::getMasterSamplerate()) { errorDialog( EncoderOpus::getInvalidSamplerateMessage(), tr("Unsupported sample rate") @@ -463,7 +463,7 @@ void ShoutConnection::updateFromPreferences() { QString userErrorMsg; int ret = -1; if (m_encoder) { - ret = m_encoder->initEncoder(masterSamplerate, &userErrorMsg); + ret = m_encoder->initEncoder(mainSamplerate, &userErrorMsg); } // TODO(XXX): Use mixxx::audio::SampleRate instead of int in initEncoder diff --git a/src/engine/sidechain/shoutconnection.h b/src/engine/sidechain/shoutconnection.h index 512db8d2bec..93aaff6a709 100644 --- a/src/engine/sidechain/shoutconnection.h +++ b/src/engine/sidechain/shoutconnection.h @@ -125,7 +125,7 @@ class ShoutConnection UserSettingsPointer m_pConfig; BroadcastProfilePtr m_pProfile; EncoderPointer m_encoder; - PollingControlProxy m_masterSamplerate; + PollingControlProxy m_mainSamplerate; PollingControlProxy m_broadcastEnabled; // static metadata according to prefereneces bool m_custom_metadata; diff --git a/src/engine/sync/enginesync.cpp b/src/engine/sync/enginesync.cpp index 7049c35499f..8e94ff58cae 100644 --- a/src/engine/sync/enginesync.cpp +++ b/src/engine/sync/enginesync.cpp @@ -304,7 +304,7 @@ Syncable* EngineSync::findBpmMatchTarget(Syncable* requester) { continue; } // Skip non-leader decks, like preview decks. - if (!pOtherSyncable->getChannel()->isMasterEnabled()) { + if (!pOtherSyncable->getChannel()->isMainMixEnabled()) { continue; } if (!pOtherSyncable->getChannel()->isPrimaryDeck()) { @@ -505,7 +505,7 @@ Syncable* EngineSync::pickNonSyncSyncTarget(EngineChannel* pDontPick) const { // Only consider channels that have a track loaded, are in the leader // mix, and are primary decks. - if (pChannel->isActive() && pChannel->isMasterEnabled() && pChannel->isPrimaryDeck()) { + if (pChannel->isActive() && pChannel->isMainMixEnabled() && pChannel->isPrimaryDeck()) { EngineBuffer* pBuffer = pChannel->getEngineBuffer(); if (pBuffer && pBuffer->getBpm().isValid()) { if (pBuffer->getSpeed() != 0.0) { diff --git a/src/engine/sync/synccontrol.cpp b/src/engine/sync/synccontrol.cpp index 95dceb7e1a0..37a1d7224f9 100644 --- a/src/engine/sync/synccontrol.cpp +++ b/src/engine/sync/synccontrol.cpp @@ -575,7 +575,7 @@ void SyncControl::setLocalBpm(mixxx::Bpm localBpm) { void SyncControl::updateAudible() { int channelIndex = m_pChannel->getChannelIndex(); if (channelIndex >= 0) { - CSAMPLE_GAIN gain = getEngineMaster()->getMasterGain(channelIndex); + CSAMPLE_GAIN gain = getEngineMaster()->getMainGain(channelIndex); bool newAudible = gain > CSAMPLE_GAIN_ZERO; if (static_cast(m_audible) != newAudible) { m_audible = newAudible; diff --git a/src/mixer/auxiliary.cpp b/src/mixer/auxiliary.cpp index 583c15a1ace..0ff8a702e7c 100644 --- a/src/mixer/auxiliary.cpp +++ b/src/mixer/auxiliary.cpp @@ -17,25 +17,25 @@ Auxiliary::Auxiliary(PlayerManager* pParent, ChannelHandleAndGroup channelGroup = pEngine->registerChannelGroup(group); EngineAux* pAuxiliary = new EngineAux(channelGroup, pEffectsManager); pEngine->addChannel(pAuxiliary); - AudioInput auxInput = AudioInput(AudioPath::AUXILIARY, 0, 2, index); + AudioInput auxInput = AudioInput(AudioPathType::Auxiliary, 0, 2, index); pSoundManager->registerInput(auxInput, pAuxiliary); m_pInputConfigured = make_parented(group, "input_configured", this); - m_pAuxMasterEnabled = make_parented(group, "master", this); - m_pAuxMasterEnabled->connectValueChanged(this, &Auxiliary::slotAuxMasterEnabled); + m_pAuxMainMixEnabled = make_parented(group, "main_mix", this); + m_pAuxMainMixEnabled->connectValueChanged(this, &Auxiliary::slotAuxMainMixEnabled); } Auxiliary::~Auxiliary() { } -void Auxiliary::slotAuxMasterEnabled(double v) { +void Auxiliary::slotAuxMainMixEnabled(double v) { bool configured = m_pInputConfigured->toBool(); - bool auxMasterEnable = v > 0.0; + bool auxMainMixEnable = v > 0.0; // Warn the user if they try to enable master on a auxiliary with no // configured input. - if (!configured && auxMasterEnable) { - m_pAuxMasterEnabled->set(0.0); + if (!configured && auxMainMixEnable) { + m_pAuxMainMixEnabled->set(0.0); emit noAuxiliaryInputConfigured(); } } diff --git a/src/mixer/auxiliary.h b/src/mixer/auxiliary.h index 401013ebc38..0fc8a1fcfc2 100644 --- a/src/mixer/auxiliary.h +++ b/src/mixer/auxiliary.h @@ -26,9 +26,9 @@ class Auxiliary : public BasePlayer { void noAuxiliaryInputConfigured(); private slots: - void slotAuxMasterEnabled(double v); + void slotAuxMainMixEnabled(double v); private: parented_ptr m_pInputConfigured; - parented_ptr m_pAuxMasterEnabled; + parented_ptr m_pAuxMainMixEnabled; }; diff --git a/src/mixer/basetrackplayer.cpp b/src/mixer/basetrackplayer.cpp index d2b59c1853c..5b3f05558ee 100644 --- a/src/mixer/basetrackplayer.cpp +++ b/src/mixer/basetrackplayer.cpp @@ -44,7 +44,7 @@ BaseTrackPlayerImpl::BaseTrackPlayerImpl( EffectsManager* pEffectsManager, EngineChannel::ChannelOrientation defaultOrientation, const ChannelHandleAndGroup& handleGroup, - bool defaultMaster, + bool defaultMainMix, bool defaultHeadphones, bool primaryDeck) : BaseTrackPlayer(pParent, handleGroup.name()), @@ -72,7 +72,7 @@ BaseTrackPlayerImpl::BaseTrackPlayerImpl( pMixingEngine->addChannel(m_pChannel); // Set the routing option defaults for the master and headphone mixes. - m_pChannel->setMaster(defaultMaster); + m_pChannel->setMainMix(defaultMainMix); m_pChannel->setPfl(defaultHeadphones); // Connect our signals and slots with the EngineBuffer's signals and diff --git a/src/mixer/microphone.cpp b/src/mixer/microphone.cpp index d5a67142872..31814311bac 100644 --- a/src/mixer/microphone.cpp +++ b/src/mixer/microphone.cpp @@ -18,7 +18,7 @@ Microphone::Microphone(PlayerManager* pParent, EngineMicrophone* pMicrophone = new EngineMicrophone(channelGroup, pEffectsManager); pEngine->addChannel(pMicrophone); - AudioInput micInput = AudioInput(AudioPath::MICROPHONE, 0, 2, index); + AudioInput micInput = AudioInput(AudioPathType::Microphone, 0, 2, index); pSoundManager->registerInput(micInput, pMicrophone); m_pInputConfigured = make_parented(group, "input_configured", this); diff --git a/src/mixer/playermanager.cpp b/src/mixer/playermanager.cpp index 49971001499..295f9c61d6c 100644 --- a/src/mixer/playermanager.cpp +++ b/src/mixer/playermanager.cpp @@ -428,12 +428,12 @@ void PlayerManager::addDeckInner() { // Register the deck output with SoundManager. m_pSoundManager->registerOutput( - AudioOutput(AudioOutput::DECK, 0, 2, deckIndex), m_pEngine); + AudioOutput(AudioPathType::Deck, 0, 2, deckIndex), m_pEngine); // Register vinyl input signal with deck for passthrough support. EngineDeck* pEngineDeck = pDeck->getEngineDeck(); m_pSoundManager->registerInput( - AudioInput(AudioInput::VINYLCONTROL, 0, 2, deckIndex), pEngineDeck); + AudioInput(AudioPathType::VinylControl, 0, 2, deckIndex), pEngineDeck); // Setup equalizer and QuickEffect chain for this deck. m_pEffectsManager->addDeck(handleGroup); diff --git a/src/preferences/dialog/dlgprefsound.cpp b/src/preferences/dialog/dlgprefsound.cpp index caa6bd289de..5a6b5b15a44 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, @@ -139,11 +139,11 @@ DlgPrefSound::DlgPrefSound(QWidget* pParent, m_pMicMonitorMode = new ControlProxy("[Master]", "talkover_mix", this); micMonitorModeComboBox->addItem(tr("Main output only"), - QVariant(static_cast(EngineMaster::MicMonitorMode::MASTER))); + QVariant(static_cast(EngineMaster::MicMonitorMode::Main))); micMonitorModeComboBox->addItem(tr("Main and booth outputs"), - QVariant(static_cast(EngineMaster::MicMonitorMode::MASTER_AND_BOOTH))); + QVariant(static_cast(EngineMaster::MicMonitorMode::MainAndBooth))); micMonitorModeComboBox->addItem(tr("Direct monitor (recording and broadcasting only)"), - QVariant(static_cast(EngineMaster::MicMonitorMode::DIRECT_MONITOR))); + QVariant(static_cast(EngineMaster::MicMonitorMode::DirectMonitor))); int modeIndex = micMonitorModeComboBox->findData( static_cast(m_pMicMonitorMode->get())); micMonitorModeComboBox->setCurrentIndex(modeIndex); @@ -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,13 +712,13 @@ 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::MASTER))); + static_cast( + static_cast(EngineMaster::MicMonitorMode::Main))); micMonitorModeComboBox->setCurrentIndex( - micMonitorModeComboBox->findData( - static_cast(EngineMaster::MicMonitorMode::MASTER))); + micMonitorModeComboBox->findData( + static_cast(EngineMaster::MicMonitorMode::Main))); latencyCompensationSpinBox->setValue(latencyCompensationSpinBox->minimum()); @@ -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) { @@ -795,7 +795,7 @@ void DlgPrefSound::checkLatencyCompensation() { if (m_config.hasMicInputs() && !m_config.hasExternalRecordBroadcast()) { micMonitorModeComboBox->setEnabled(true); - if (configuredMicMonitorMode == EngineMaster::MicMonitorMode::DIRECT_MONITOR) { + if (configuredMicMonitorMode == EngineMaster::MicMonitorMode::DirectMonitor) { latencyCompensationSpinBox->setEnabled(true); QString warningIcon( "" 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 diff --git a/src/soundio/sounddevicenetwork.cpp b/src/soundio/sounddevicenetwork.cpp index 17b7d88eff8..b481e5a0ba1 100644 --- a/src/soundio/sounddevicenetwork.cpp +++ b/src/soundio/sounddevicenetwork.cpp @@ -37,7 +37,7 @@ SoundDeviceNetwork::SoundDeviceNetwork( : SoundDevice(config, sm), m_pNetworkStream(pNetworkStream), m_inputDrift(false), - m_masterAudioLatencyUsage("[Master]", "audio_latency_usage"), + m_mainAudioLatencyUsage("[Master]", "audio_latency_usage"), m_framesSinceAudioLatencyUsageUpdate(0), m_denormals(false), m_targetTime(0) { @@ -513,11 +513,11 @@ void SoundDeviceNetwork::updateAudioLatencyUsage(SINT framesPerBuffer) { if (m_framesSinceAudioLatencyUsageUpdate > (m_dSampleRate / CPU_USAGE_UPDATE_RATE)) { double secInAudioCb = m_timeInAudioCallback.toDoubleSeconds(); - m_masterAudioLatencyUsage.set(secInAudioCb / + m_mainAudioLatencyUsage.set(secInAudioCb / (m_framesSinceAudioLatencyUsageUpdate / m_dSampleRate)); m_timeInAudioCallback = mixxx::Duration::empty(); m_framesSinceAudioLatencyUsageUpdate = 0; - //qDebug() << m_pMasterAudioLatencyUsage->get(); + // qDebug() << m_mainAudioLatencyUsage->get(); } qint64 currentTime = m_pNetworkStream->getInputStreamTimeUs(); diff --git a/src/soundio/sounddevicenetwork.h b/src/soundio/sounddevicenetwork.h index c617ef960be..cce73b6425c 100644 --- a/src/soundio/sounddevicenetwork.h +++ b/src/soundio/sounddevicenetwork.h @@ -62,7 +62,7 @@ class SoundDeviceNetwork : public SoundDevice { std::unique_ptr> m_inputFifo; bool m_inputDrift; - PollingControlProxy m_masterAudioLatencyUsage; + PollingControlProxy m_mainAudioLatencyUsage; mixxx::Duration m_timeInAudioCallback; int m_framesSinceAudioLatencyUsageUpdate; std::unique_ptr m_pThread; diff --git a/src/soundio/sounddeviceportaudio.cpp b/src/soundio/sounddeviceportaudio.cpp index b2b1fb297f7..1167764f4e2 100644 --- a/src/soundio/sounddeviceportaudio.cpp +++ b/src/soundio/sounddeviceportaudio.cpp @@ -90,7 +90,7 @@ SoundDevicePortAudio::SoundDevicePortAudio(UserSettingsPointer config, m_outputDrift(false), m_inputDrift(false), m_bSetThreadPriority(false), - m_masterAudioLatencyUsage("[Master]", "audio_latency_usage"), + m_mainAudioLatencyUsage("[Master]", "audio_latency_usage"), m_framesSinceAudioLatencyUsageUpdate(0), m_syncBuffers(2), m_invalidTimeInfoCount(0), @@ -1087,12 +1087,12 @@ void SoundDevicePortAudio::updateAudioLatencyUsage( m_framesSinceAudioLatencyUsageUpdate += framesPerBuffer; if (m_framesSinceAudioLatencyUsageUpdate > (m_dSampleRate / kCpuUsageUpdateRate)) { double secInAudioCb = m_timeInAudioCallback.toDoubleSeconds(); - m_masterAudioLatencyUsage.set( + m_mainAudioLatencyUsage.set( secInAudioCb / (m_framesSinceAudioLatencyUsageUpdate / m_dSampleRate)); m_timeInAudioCallback = mixxx::Duration::fromSeconds(0); m_framesSinceAudioLatencyUsageUpdate = 0; - //qDebug() << m_pMasterAudioLatencyUsage - // << m_pMasterAudioLatencyUsage->get(); + // qDebug() << m_mainAudioLatencyUsage + // << m_mainAudioLatencyUsage->get(); } // measure time in Audio callback at the very last m_timeInAudioCallback += m_clkRefTimer.elapsed(); diff --git a/src/soundio/sounddeviceportaudio.h b/src/soundio/sounddeviceportaudio.h index 5355138d1b0..a2c46152599 100644 --- a/src/soundio/sounddeviceportaudio.h +++ b/src/soundio/sounddeviceportaudio.h @@ -75,7 +75,7 @@ class SoundDevicePortAudio : public SoundDevice { QString m_lastError; // Whether we have set the thread priority to realtime or not. bool m_bSetThreadPriority; - PollingControlProxy m_masterAudioLatencyUsage; + PollingControlProxy m_mainAudioLatencyUsage; mixxx::Duration m_timeInAudioCallback; int m_framesSinceAudioLatencyUsageUpdate; int m_syncBuffers; diff --git a/src/soundio/soundmanager.cpp b/src/soundio/soundmanager.cpp index 1a8f054a608..d2fb6e95bd6 100644 --- a/src/soundio/soundmanager.cpp +++ b/src/soundio/soundmanager.cpp @@ -52,9 +52,9 @@ SoundManager::SoundManager(UserSettingsPointer pConfig, m_pErrorDevice(nullptr), m_underflowHappened(0), m_underflowUpdateCount(0), - m_masterAudioLatencyOverloadCount("[Master]", + m_mainAudioLatencyOverloadCount("[Master]", "audio_latency_overload_count"), - m_masterAudioLatencyOverload("[Master]", "audio_latency_overload") { + m_mainAudioLatencyOverload("[Master]", "audio_latency_overload") { // TODO(xxx) some of these ControlObject are not needed by soundmanager, or are unused here. // It is possible to take them out? m_pControlObjectSoundStatusCO = new ControlObject( @@ -350,7 +350,7 @@ SoundDeviceStatus SoundManager::setupDevices() { // compute the new one then atomically hand off below. SoundDevicePointer pNewMasterClockRef; - m_masterAudioLatencyOverloadCount.set(0); + m_mainAudioLatencyOverloadCount.set(0); // load with all configured devices. // all found devices are removed below @@ -393,7 +393,7 @@ SoundDeviceStatus SoundManager::setupDevices() { // Statically connect the Network Device to the Sidechain if (pDevice->getDeviceId().name == kNetworkDeviceInternalName) { - AudioOutput out(AudioPath::RECORD_BROADCAST, 0, 2, 0); + AudioOutput out(AudioPathType::RecordBroadcast, 0, 2, 0); outputs.append(out); if (m_config.getForceNetworkClock() && !jackApiUsed()) { pNewMasterClockRef = pDevice; @@ -420,11 +420,11 @@ SoundDeviceStatus SoundManager::setupDevices() { } if (!m_config.getForceNetworkClock() || jackApiUsed()) { - if (out.getType() == AudioOutput::MASTER) { + if (out.getType() == AudioPathType::Main) { pNewMasterClockRef = pDevice; - } else if ((out.getType() == AudioOutput::DECK || - out.getType() == AudioOutput::BUS) - && !pNewMasterClockRef) { + } else if ((out.getType() == AudioPathType::Deck || + out.getType() == AudioPathType::Bus) && + !pNewMasterClockRef) { pNewMasterClockRef = pDevice; } } @@ -687,9 +687,9 @@ int SoundManager::getConfiguredDeckCount() const { void SoundManager::processUnderflowHappened(SINT framesPerBuffer) { if (m_underflowUpdateCount == 0) { if (atomicLoadRelaxed(m_underflowHappened)) { - m_masterAudioLatencyOverload.set(1.0); - m_masterAudioLatencyOverloadCount.set( - m_masterAudioLatencyOverloadCount.get() + 1); + m_mainAudioLatencyOverload.set(1.0); + m_mainAudioLatencyOverloadCount.set( + m_mainAudioLatencyOverloadCount.get() + 1); m_underflowUpdateCount = CPU_OVERLOAD_DURATION * m_config.getSampleRate() / framesPerBuffer / 1000; @@ -697,7 +697,7 @@ void SoundManager::processUnderflowHappened(SINT framesPerBuffer) { // but that is OK, because we count only // 1 underflow each 500 ms } else { - m_masterAudioLatencyOverload.set(0.0); + m_mainAudioLatencyOverload.set(0.0); } } else { --m_underflowUpdateCount; diff --git a/src/soundio/soundmanager.h b/src/soundio/soundmanager.h index d06cacd8c3c..62331078e61 100644 --- a/src/soundio/soundmanager.h +++ b/src/soundio/soundmanager.h @@ -149,6 +149,6 @@ class SoundManager : public QObject { QAtomicInt m_underflowHappened; int m_underflowUpdateCount; - PollingControlProxy m_masterAudioLatencyOverloadCount; - PollingControlProxy m_masterAudioLatencyOverload; + PollingControlProxy m_mainAudioLatencyOverloadCount; + PollingControlProxy m_mainAudioLatencyOverload; }; diff --git a/src/soundio/soundmanagerconfig.cpp b/src/soundio/soundmanagerconfig.cpp index 1473e6fd756..13e373ac843 100644 --- a/src/soundio/soundmanagerconfig.cpp +++ b/src/soundio/soundmanagerconfig.cpp @@ -176,7 +176,7 @@ bool SoundManagerConfig::readFromDisk() { continue; } AudioOutput out(AudioOutput::fromXML(outElement)); - if (out.getType() == AudioPath::INVALID) { + if (out.getType() == AudioPathType::Invalid) { continue; } bool dupe(false); @@ -199,7 +199,7 @@ bool SoundManagerConfig::readFromDisk() { continue; } AudioInput in(AudioInput::fromXML(inElement)); - if (in.getType() == AudioPath::INVALID) { + if (in.getType() == AudioPathType::Invalid) { continue; } bool dupe(false); @@ -350,9 +350,9 @@ void SoundManagerConfig::setCorrectDeckCount(int configuredDeckCount) { ++it) { const int index = it.value().getIndex(); const AudioPathType type = it.value().getType(); - if ((type == AudioInput::DECK || - type == AudioInput::VINYLCONTROL || - type == AudioInput::AUXILIARY) && + if ((type == AudioPathType::Deck || + type == AudioPathType::VinylControl || + type == AudioPathType::Auxiliary) && index + 1 > minimum_deck_count) { qDebug() << "Found an input connection above current deck count"; minimum_deck_count = index + 1; @@ -363,7 +363,7 @@ void SoundManagerConfig::setCorrectDeckCount(int configuredDeckCount) { ++it) { const int index = it.value().getIndex(); const AudioPathType type = it.value().getType(); - if (type == AudioOutput::DECK && index + 1 > minimum_deck_count) { + if (type == AudioPathType::Deck && index + 1 > minimum_deck_count) { qDebug() << "Found an output connection above current deck count"; minimum_deck_count = index + 1; } @@ -438,9 +438,9 @@ void SoundManagerConfig::addOutput(const SoundDeviceId &device, const AudioOutpu void SoundManagerConfig::addInput(const SoundDeviceId &device, const AudioInput &in) { m_inputs.insert(device, in); - if (in.getType() == AudioPath::MICROPHONE) { + if (in.getType() == AudioPathType::Microphone) { m_iNumMicInputs++; - } else if (in.getType() == AudioPath::RECORD_BROADCAST) { + } else if (in.getType() == AudioPathType::RecordBroadcast) { m_bExternalRecordBroadcastConnected = true; } } @@ -519,7 +519,7 @@ void SoundManagerConfig::loadDefaults(SoundManager* soundManager, unsigned int f if (pDevice->getNumOutputChannels() < 2) { continue; } - AudioOutput masterOut(AudioPath::MASTER, 0, 2, 0); + AudioOutput masterOut(AudioPathType::Main, 0, 2, 0); addOutput(pDevice->getDeviceId(), masterOut); defaultSampleRate = pDevice->getDefaultSampleRate(); break; diff --git a/src/soundio/soundmanagerutil.cpp b/src/soundio/soundmanagerutil.cpp index c9ef04a04fc..573193f2ae9 100644 --- a/src/soundio/soundmanagerutil.cpp +++ b/src/soundio/soundmanagerutil.cpp @@ -51,9 +51,9 @@ bool ChannelGroup::clashesWith(const ChannelGroup &other) const { * @param channels the number of channels used. */ AudioPath::AudioPath(unsigned char channelBase, unsigned char channels) - : m_channelGroup(channelBase, channels), - m_type(INVALID), - m_index(0) { + : m_channelGroup(channelBase, channels), + m_type(AudioPathType::Invalid), + m_index(0) { } /** @@ -99,33 +99,33 @@ QString AudioPath::getString() const { */ QString AudioPath::getStringFromType(AudioPathType type) { switch (type) { - case INVALID: - // this shouldn't happen but g++ complains if I don't - // handle this -- bkgood - return QStringLiteral("Invalid"); - case MASTER: + case AudioPathType::Main: // This was renamed to "Main" in the GUI, but keep "Master" here to avoid // making users reconfigure the output when upgrading. // https://mixxx.org/news/2020-06-29-black-lives-matter/ return QStringLiteral("Master"); - case BOOTH: - return QStringLiteral("Booth"); - case HEADPHONES: + case AudioPathType::Headphones: return QStringLiteral("Headphones"); - case BUS: + case AudioPathType::Booth: + return QStringLiteral("Booth"); + case AudioPathType::Bus: return QStringLiteral("Bus"); - case DECK: + case AudioPathType::Deck: return QStringLiteral("Deck"); - case RECORD_BROADCAST: - return QStringLiteral("Record/Broadcast"); - case VINYLCONTROL: + case AudioPathType::VinylControl: return QStringLiteral("Vinyl Control"); - case MICROPHONE: + case AudioPathType::Microphone: return QStringLiteral("Microphone"); - case AUXILIARY: + case AudioPathType::Auxiliary: return QStringLiteral("Auxiliary"); + case AudioPathType::RecordBroadcast: + return QStringLiteral("Record/Broadcast"); + case AudioPathType::Invalid: + // this shouldn't happen but g++ complains if I don't + // handle this -- bkgood + return QStringLiteral("Invalid"); } - return QStringLiteral("Unknown path type %1").arg(type); + return QObject::tr("Unknown path type %1").arg(static_cast(type)); } /** @@ -134,17 +134,17 @@ QString AudioPath::getStringFromType(AudioPathType type) { */ QString AudioPath::getTrStringFromType(AudioPathType type, unsigned char index) { switch (type) { - case INVALID: + case AudioPathType::Invalid: // this shouldn't happen but g++ complains if I don't // handle this -- bkgood return QObject::tr("Invalid"); - case MASTER: + case AudioPathType::Main: return QObject::tr("Main"); - case BOOTH: - return QObject::tr("Booth"); - case HEADPHONES: + case AudioPathType::Headphones: return QObject::tr("Headphones"); - case BUS: + case AudioPathType::Booth: + return QObject::tr("Booth"); + case AudioPathType::Bus: switch (index) { case EngineChannel::LEFT: return QObject::tr("Left Bus"); @@ -155,22 +155,22 @@ QString AudioPath::getTrStringFromType(AudioPathType type, unsigned char index) default: return QObject::tr("Invalid Bus"); } - case DECK: + case AudioPathType::Deck: return QString("%1 %2").arg(QObject::tr("Deck"), QString::number(index + 1)); - case RECORD_BROADCAST: - return QObject::tr("Record/Broadcast"); - case VINYLCONTROL: + case AudioPathType::VinylControl: return QString("%1 %2").arg(QObject::tr("Vinyl Control"), QString::number(index + 1)); - case MICROPHONE: + case AudioPathType::Microphone: return QString("%1 %2").arg(QObject::tr("Microphone"), QString::number(index + 1)); - case AUXILIARY: + case AudioPathType::Auxiliary: return QString("%1 %2").arg(QObject::tr("Auxiliary"), QString::number(index + 1)); + case AudioPathType::RecordBroadcast: + return QObject::tr("Record/Broadcast"); } - return QObject::tr("Unknown path type %1").arg(type); + return QObject::tr("Unknown path type %1").arg(static_cast(type)); } /** @@ -179,26 +179,26 @@ QString AudioPath::getTrStringFromType(AudioPathType type, unsigned char index) */ AudioPathType AudioPath::getTypeFromString(QString string) { string = string.toLower(); - if (string == AudioPath::getStringFromType(AudioPath::MASTER).toLower()) { - return AudioPath::MASTER; - } else if (string == AudioPath::getStringFromType(AudioPath::BOOTH).toLower()) { - return AudioPath::BOOTH; - } else if (string == AudioPath::getStringFromType(AudioPath::HEADPHONES).toLower()) { - return AudioPath::HEADPHONES; - } else if (string == AudioPath::getStringFromType(AudioPath::BUS).toLower()) { - return AudioPath::BUS; - } else if (string == AudioPath::getStringFromType(AudioPath::DECK).toLower()) { - return AudioPath::DECK; - } else if (string == AudioPath::getStringFromType(AudioPath::VINYLCONTROL).toLower()) { - return AudioPath::VINYLCONTROL; - } else if (string == AudioPath::getStringFromType(AudioPath::MICROPHONE).toLower()) { - return AudioPath::MICROPHONE; - } else if (string == AudioPath::getStringFromType(AudioPath::AUXILIARY).toLower()) { - return AudioPath::AUXILIARY; - } else if (string == AudioPath::getStringFromType(AudioPath::RECORD_BROADCAST).toLower()) { - return AudioPath::RECORD_BROADCAST; + if (string == AudioPath::getStringFromType(AudioPathType::Main).toLower()) { + return AudioPathType::Main; + } else if (string == AudioPath::getStringFromType(AudioPathType::Booth).toLower()) { + return AudioPathType::Booth; + } else if (string == AudioPath::getStringFromType(AudioPathType::Headphones).toLower()) { + return AudioPathType::Headphones; + } else if (string == AudioPath::getStringFromType(AudioPathType::Bus).toLower()) { + return AudioPathType::Bus; + } else if (string == AudioPath::getStringFromType(AudioPathType::Deck).toLower()) { + return AudioPathType::Deck; + } else if (string == AudioPath::getStringFromType(AudioPathType::VinylControl).toLower()) { + return AudioPathType::VinylControl; + } else if (string == AudioPath::getStringFromType(AudioPathType::Microphone).toLower()) { + return AudioPathType::Microphone; + } else if (string == AudioPath::getStringFromType(AudioPathType::Auxiliary).toLower()) { + return AudioPathType::Auxiliary; + } else if (string == AudioPath::getStringFromType(AudioPathType::RecordBroadcast).toLower()) { + return AudioPathType::RecordBroadcast; } else { - return AudioPath::INVALID; + return AudioPathType::Invalid; } } @@ -208,11 +208,11 @@ AudioPathType AudioPath::getTypeFromString(QString string) { */ bool AudioPath::isIndexed(AudioPathType type) { switch (type) { - case BUS: - case DECK: - case VINYLCONTROL: - case AUXILIARY: - case MICROPHONE: + case AudioPathType::Bus: + case AudioPathType::Deck: + case AudioPathType::VinylControl: + case AudioPathType::Microphone: + case AudioPathType::Auxiliary: return true; default: break; @@ -225,8 +225,8 @@ bool AudioPath::isIndexed(AudioPathType type) { * @note This method is static. */ AudioPathType AudioPath::getTypeFromInt(int typeInt) { - if (typeInt < 0 || typeInt >= AudioPath::INVALID) { - return AudioPath::INVALID; + if (typeInt < 0 || typeInt >= static_cast(AudioPathType::Invalid)) { + return AudioPathType::Invalid; } return static_cast(typeInt); } @@ -234,7 +234,7 @@ AudioPathType AudioPath::getTypeFromInt(int typeInt) { // static unsigned char AudioPath::minChannelsForType(AudioPathType type) { switch (type) { - case AudioPath::VINYLCONTROL: + case AudioPathType::VinylControl: return 2; default: return 1; @@ -302,14 +302,14 @@ AudioOutput AudioOutput::fromXML(const QDomElement &xml) { * @note This method is static. */ QList AudioOutput::getSupportedTypes() { - QList types; - types.append(MASTER); - types.append(BOOTH); - types.append(HEADPHONES); - types.append(BUS); - types.append(DECK); - types.append(RECORD_BROADCAST); - return types; + return QList{ + AudioPathType::Main, + AudioPathType::Booth, + AudioPathType::Headphones, + AudioPathType::Bus, + AudioPathType::Deck, + AudioPathType::RecordBroadcast, + }; } /** @@ -320,7 +320,7 @@ void AudioOutput::setType(AudioPathType type) { if (AudioOutput::getSupportedTypes().contains(type)) { m_type = type; } else { - m_type = AudioPath::INVALID; + m_type = AudioPathType::Invalid; } } @@ -372,7 +372,7 @@ AudioInput AudioInput::fromXML(const QDomElement &xml) { // microphones and stereo for everything else since previously microphone // inputs were the only mono AudioPath. if (channels == 0) { - channels = type == MICROPHONE ? 1 : 2; + channels = type == AudioPathType::Microphone ? 1 : 2; } return AudioInput(type, channel, channels, index); } @@ -382,16 +382,16 @@ AudioInput AudioInput::fromXML(const QDomElement &xml) { * @note This method is static. */ QList AudioInput::getSupportedTypes() { - QList types; + return QList{ #ifdef __VINYLCONTROL__ - // this disables vinyl control for all of the sound devices stuff - // (prefs, etc), minimal ifdefs :) -- bkgood - types.append(VINYLCONTROL); + // this disables vinyl control for all of the sound devices stuff + // (prefs, etc), minimal ifdefs :) -- bkgood + AudioPathType::VinylControl, #endif - types.append(AUXILIARY); - types.append(MICROPHONE); - types.append(RECORD_BROADCAST); - return types; + AudioPathType::Auxiliary, + AudioPathType::Microphone, + AudioPathType::RecordBroadcast, + }; } /** @@ -402,7 +402,7 @@ void AudioInput::setType(AudioPathType type) { if (AudioInput::getSupportedTypes().contains(type)) { m_type = type; } else { - m_type = AudioPath::INVALID; + m_type = AudioPathType::Invalid; } } diff --git a/src/soundio/soundmanagerutil.h b/src/soundio/soundmanagerutil.h index 2b25616bfad..a0fa1ce7566 100644 --- a/src/soundio/soundmanagerutil.h +++ b/src/soundio/soundmanagerutil.h @@ -56,46 +56,46 @@ class AudioPath { /// methods including getStringFromType, isIndexed, getTypeFromInt, /// channelsNeededForType (if necessary), the subclasses' getSupportedTypes /// (if necessary), etc. - enum AudioPathType { - MASTER, - HEADPHONES, - BOOTH, - BUS, - DECK, - VINYLCONTROL, - MICROPHONE, - AUXILIARY, - RECORD_BROADCAST, - INVALID, // if this isn't last bad things will happen -bkgood - }; - AudioPath(unsigned char channelBase, unsigned char channels); - virtual ~AudioPath() = default; - AudioPathType getType() const; - ChannelGroup getChannelGroup() const; - unsigned char getIndex() const; - bool channelsClash(const AudioPath &other) const; - QString getString() const; - static QString getStringFromType(AudioPathType type); - static QString getTrStringFromType(AudioPathType type, unsigned char index); - static AudioPathType getTypeFromString(QString string); - static bool isIndexed(AudioPathType type); - static AudioPathType getTypeFromInt(int typeInt); - - /// Returns the minimum number of channels needed on a sound device for an - /// AudioPathType. - static unsigned char minChannelsForType(AudioPathType type); - - // Returns the maximum number of channels needed on a sound device for an - // AudioPathType. - static unsigned char maxChannelsForType(AudioPathType type); - - uint hashValue() const { + enum class AudioPathType : int { + Main, + Headphones, + Booth, + Bus, + Deck, + VinylControl, + Microphone, + Auxiliary, + RecordBroadcast, + Invalid, // if this isn't last bad things will happen -bkgood + }; + AudioPath(unsigned char channelBase, unsigned char channels); + virtual ~AudioPath() = default; + AudioPathType getType() const; + ChannelGroup getChannelGroup() const; + unsigned char getIndex() const; + bool channelsClash(const AudioPath& other) const; + QString getString() const; + static QString getStringFromType(AudioPathType type); + static QString getTrStringFromType(AudioPathType type, unsigned char index); + static AudioPathType getTypeFromString(QString string); + static bool isIndexed(AudioPathType type); + static AudioPathType getTypeFromInt(int typeInt); + + /// Returns the minimum number of channels needed on a sound device for an + /// AudioPathType. + static unsigned char minChannelsForType(AudioPathType type); + + // Returns the maximum number of channels needed on a sound device for an + // AudioPathType. + static unsigned char maxChannelsForType(AudioPathType type); + + uint hashValue() const { // Exclude m_channelGroup from hash value! // See also: operator==() // TODO: Why?? - return (m_type << 8) | + return (static_cast(m_type) << 8) | m_index; - } + } friend qhash_seed_t qHash( const AudioPath& path, qhash_seed_t seed = 0) { @@ -147,7 +147,7 @@ class AudioOutput : public AudioPath { static AudioOutput fromXML(const QDomElement &xml); static QList getSupportedTypes(); bool isHidden() const { - return m_type == RECORD_BROADCAST; + return m_type == AudioPathType::RecordBroadcast; } protected: @@ -172,8 +172,10 @@ class AudioOutputBuffer : public AudioOutput { /// that is be processed in Mixxx. class AudioInput : public AudioPath { public: - AudioInput(AudioPathType type = INVALID, unsigned char channelBase = 0, - unsigned char channels = 0, unsigned char index = 0); + AudioInput(AudioPathType type = AudioPathType::Invalid, + unsigned char channelBase = 0, + unsigned char channels = 0, + unsigned char index = 0); ~AudioInput() override; QDomElement toXML(QDomElement *element) const; static AudioInput fromXML(const QDomElement &xml); diff --git a/src/test/co_dumps/co_dump_inital.csv b/src/test/co_dumps/co_dump_inital.csv index 582f258679b..2da1357d29a 100644 --- a/src/test/co_dumps/co_dump_inital.csv +++ b/src/test/co_dumps/co_dump_inital.csv @@ -1447,7 +1447,7 @@ [EqualizerRack1_[Channel2]],super1_toggle,0 [Channel2],beatloop_0.125_toggle,0 [EffectRack1_EffectUnit1_Effect4],parameter1_set_default,0 -[Microphone3],master,0 +[Microphone3],main_mix,0 [PreviewDeck1],hotcue_32_position,-1 [Channel2],hotcue_15_gotoandplay,0 [EqualizerRack1_[Master]_Effect1],parameter14_link_type,0 @@ -1462,7 +1462,7 @@ [QuickEffectRack1_[Channel4]],loaded,1 [Auxiliary3],orientation_center,0 [EffectRack1_EffectUnit1_Effect3],parameter1_set_default,0 -[Microphone4],master,0 +[Microphone4],main_mix,0 [Sampler3],eject,0 [Sampler4],hotcue_35_position,-1 [QuickEffectRack1_[Channel2]_Effect1],parameter1_up,0 @@ -1676,7 +1676,7 @@ [EffectRack1_EffectUnit1_Effect4],parameter10_down_small,0 [Auxiliary1],orientation_center,0 [EffectRack1_EffectUnit3_Effect2],parameter9_set_default,0 -[Microphone2],master,0 +[Microphone2],main_mix,0 [Channel3],hotcue_31_set,0 [Channel1],hotcue_36_gotoandstop,0 [EffectRack1_EffectUnit1_Effect3],parameter7_set_zero,0 @@ -2249,7 +2249,7 @@ [Channel1],beatjump_0.5_forward,0 [EqualizerRack1_[Channel1]_Effect1],parameter13_up,0 [EffectRack1_EffectUnit3_Effect4],parameter12_set_minus_one,0 -[Microphone],master,0 +[Microphone],main_mix,0 [QuickEffectRack1_[Channel3]_Effect1],parameter12_down,0 [Auxiliary2],VuMeterL_up,0 [PreviewDeck1],loop_scale,0 @@ -4139,7 +4139,7 @@ [Channel2],scratch_position_enable,0 [EffectRack1_EffectUnit4_Effect2],parameter11_up_small,0 [Sampler1],pitch_set_zero,0 -[PreviewDeck1],master,0 +[PreviewDeck1],main_mix,0 [Auxiliary4],pregain_set_zero,0 [EffectRack1_EffectUnit3_Effect3],button_parameter2_type,0 [EffectRack1_EffectUnit4_Effect3],parameter2_set_minus_one,0 @@ -7263,7 +7263,7 @@ [EffectRack1_EffectUnit1_Effect4],button_parameter1_loaded,0 [EqualizerRack1_[Channel3]_Effect1],parameter14_loaded,0 [Sampler3],hotcue_28_goto,0 -[Auxiliary3],master,1 +[Auxiliary3],main_mix,1 [EffectRack1_EffectUnit3_Effect1],button_parameter1_loaded,0 [EffectRack1_EffectUnit3_Effect3],button_parameter2_loaded,0 [Channel3],hotcue_14_goto,0 @@ -7284,7 +7284,7 @@ [EffectRack1_EffectUnit1_Effect3],button_parameter1_loaded,0 [Channel3],hotcue_19_activate_preview,0 [Sampler4],hotcue_28_goto,0 -[Auxiliary4],master,1 +[Auxiliary4],main_mix,1 [Channel4],hotcue_14_goto,0 [EffectRack1_EffectUnit4_Effect1],button_parameter16_type,0 [Channel1],hotcue_9_activate,0 @@ -7369,7 +7369,7 @@ [Channel2],hotcue_23_gotoandstop,0 [Channel1],hotcue_25_enabled,0 [Microphone],orientation_center,0 -[Auxiliary1],master,1 +[Auxiliary1],main_mix,1 [Sampler4],hotcue_28_clear,0 [EffectRack1_EffectUnit1_Effect1],parameter15_down_small,0 [Sampler2],loop_halve,0 @@ -7387,7 +7387,7 @@ [Channel2],hotcue_3_activate,0 [Channel3],hotcue_23_gotoandstop,0 [EqualizerRack1_[Master]_Effect1],parameter13_minus_toggle,0 -[Auxiliary2],master,1 +[Auxiliary2],main_mix,1 [Sampler3],hotcue_18_clear,0 [EffectRack1_EffectUnit1_Effect2],parameter15_down_small,0 [EffectRack1_EffectUnit4_Effect1],parameter14_down_small,0 @@ -8510,7 +8510,7 @@ [Sampler3],loop_move_64_forward,0 [Sampler3],hotcue_24_position,-1 [EffectRack1_EffectUnit4_Effect1],parameter11_loaded,0 -[Channel1],master,1 +[Channel1],main_mix,1 [Channel1],loop_move_0.0625_forward,0 [Sampler2],hotcue_3_clear,0 [Channel2],hotcue_24_clear,0 @@ -8528,7 +8528,7 @@ [PreviewDeck1],hotcue_2_goto,0 [Channel3],beatlooproll_1_activate,0 [EqualizerRack1_[Channel4]_Effect1],parameter13_toggle,0 -[Channel2],master,1 +[Channel2],main_mix,1 [Sampler1],hotcue_11_activate_preview,0 [ReplayGain],ReplayGainBoost_down,0 [Channel2],loop_move_0.0625_forward,0 @@ -8550,7 +8550,7 @@ [Channel3],hotcue_23_enabled,0 [Channel4],beatlooproll_1_activate,0 [Sampler4],hotcue_28_position,-1 -[Channel3],master,1 +[Channel3],main_mix,1 [Sampler2],hotcue_12_position,-1 [Sampler2],hotcue_11_activate_preview,0 [Sampler3],hotcue_30_enabled,0 @@ -8574,7 +8574,7 @@ [EffectRack1_EffectUnit3_Effect3],parameter6_link_type,0 [EqualizerRack1_[Channel4]_Effect1],parameter16_toggle,0 [Sampler3],hotcue_28_position,-1 -[Channel4],master,1 +[Channel4],main_mix,1 [Sampler1],hotcue_12_position,-1 [Sampler2],loop_start_position,-1 [Sampler1],beat_distance,0 @@ -12628,7 +12628,7 @@ [QuickEffectRack1_[Channel4]_Effect1],parameter12_minus_toggle,0 [Channel2],hotcue_2_goto,0 [EqualizerRack1_[Channel3]_Effect1],parameter6_link_type,0 -[Sampler3],master,1 +[Sampler3],main_mix,1 [Channel2],beatloop_2_activate,0 [Channel4],hotcue_5_clear,0 [EffectRack1_EffectUnit4_Effect2],button_parameter10_loaded,0 @@ -12639,7 +12639,7 @@ [EffectRack1_EffectUnit2_Effect1],button_parameter16_loaded,0 [Master],crossfader_down_small,0 [EqualizerRack1_[Channel2]_Effect1],parameter8_minus_toggle,0 -[Sampler4],master,1 +[Sampler4],main_mix,1 [Channel2],hotcue_20_enabled,0 [PreviewDeck1],hotcue_21_set,0 [PreviewDeck1],hotcue_30_enabled,0 @@ -12704,7 +12704,7 @@ [PreviewDeck1],cue_mode,0 [EqualizerRack1_[Channel4]_Effect1],parameter5_minus_toggle,0 [PreviewDeck1],hotcue_4_position,-1 -[Sampler1],master,1 +[Sampler1],main_mix,1 [Channel2],hotcue_31_activate_preview,0 [Sampler4],VuMeter_down,0 [Channel2],hotcue_5_clear,0 @@ -12720,7 +12720,7 @@ [Sampler3],playposition_set_one,0 [QuickEffectRack1_[Channel1]_Effect1],parameter15_up,0 [EqualizerRack1_[Channel3]_Effect1],parameter6_set_one,0 -[Sampler2],master,1 +[Sampler2],main_mix,1 [Auxiliary3],VuMeterR_toggle,0 [Sampler3],VuMeter_down,0 [EqualizerRack1_[Channel2]_Effect1],parameter2_set_default,0 diff --git a/src/test/enginebuffertest.cpp b/src/test/enginebuffertest.cpp index 1c006dd7b56..62c802604c9 100644 --- a/src/test/enginebuffertest.cpp +++ b/src/test/enginebuffertest.cpp @@ -225,15 +225,18 @@ TEST_F(EngineBufferE2ETest, BasicProcessingTest) { ControlObject::set(ConfigKey(m_sGroup1, "rate"), 0.05); ControlObject::set(ConfigKey(m_sGroup1, "play"), 1.0); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "BasicProcessingTestPlay"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "BasicProcessingTestPlay"); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "BasicProcessingTestPlaying"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "BasicProcessingTestPlaying"); ControlObject::set(ConfigKey(m_sGroup1, "play"), 0.0); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "BasicProcessingTestPause"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "BasicProcessingTestPause"); } TEST_F(EngineBufferE2ETest, ScratchTest) { @@ -246,8 +249,9 @@ TEST_F(EngineBufferE2ETest, ScratchTest) { ProcessBuffer(); ControlObject::set(ConfigKey(m_sGroup1, "scratch2"), -1.1); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "ScratchTestMaster"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "ScratchTestMaster"); } TEST_F(EngineBufferE2ETest, ScratchTestStart) { @@ -260,8 +264,9 @@ TEST_F(EngineBufferE2ETest, ScratchTestStart) { ProcessBuffer(); ControlObject::set(ConfigKey(m_sGroup1, "scratch2"), 0.5); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "ScratchTestStart"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "ScratchTestStart"); } TEST_F(EngineBufferE2ETest, ReverseTest) { @@ -271,8 +276,9 @@ TEST_F(EngineBufferE2ETest, ReverseTest) { ProcessBuffer(); ControlObject::set(ConfigKey(m_sGroup1, "reverse"), 1.0); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "ReverseTest"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "ReverseTest"); } // DISABLED: This test is too dependent on the sound touch library version. @@ -286,19 +292,22 @@ TEST_F(EngineBufferE2ETest, DISABLED_SoundTouchToggleTest) { // Test transition from vinyl to keylock ControlObject::set(ConfigKey(m_sGroup1, "keylock"), 1.0); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "SoundTouchTest"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "SoundTouchTest"); // Test transition from keylock to vinyl due to slow speed. ControlObject::set(ConfigKey(m_sGroup1, "play"), 0.0); ControlObject::set(ConfigKey(m_sGroup1, "rateSearch"), 0.0072); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "SoundTouchTestSlow"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "SoundTouchTestSlow"); // Test transition back to keylock due to regular speed. ControlObject::set(ConfigKey(m_sGroup1, "rateSearch"), 1.0); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "SoundTouchTestRegular"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "SoundTouchTestRegular"); } // DISABLED: This test is too dependent on the rubber band library version. @@ -312,19 +321,22 @@ TEST_F(EngineBufferE2ETest, DISABLED_RubberbandToggleTest) { // Test transition from vinyl to keylock ControlObject::set(ConfigKey(m_sGroup1, "keylock"), 1.0); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "RubberbandTest"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "RubberbandTest"); // Test transition from keylock to vinyl due to slow speed. ControlObject::set(ConfigKey(m_sGroup1, "play"), 0.0); ControlObject::set(ConfigKey(m_sGroup1, "rateSearch"), 0.0072); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "RubberbandTestSlow"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "RubberbandTestSlow"); // Test transition back to keylock due to regular speed. ControlObject::set(ConfigKey(m_sGroup1, "rateSearch"), 1.0); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "RubberbandTestRegular"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "RubberbandTestRegular"); } // DISABLED: This test is too dependent on the sound touch library version. @@ -345,8 +357,9 @@ TEST_F(EngineBufferE2ETest, DISABLED_KeylockReverseTest) { ProcessBuffer(); ControlObject::set(ConfigKey(m_sGroup1, "reverse"), 1.0); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "KeylockReverseTest"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "KeylockReverseTest"); } TEST_F(EngineBufferE2ETest, SeekTest) { @@ -357,8 +370,9 @@ TEST_F(EngineBufferE2ETest, SeekTest) { m_pChannel1->getEngineBuffer()->queueNewPlaypos( mixxx::audio::FramePos(500), EngineBuffer::SEEK_EXACT); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "SeekTest"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "SeekTest"); } TEST_F(EngineBufferE2ETest, SoundTouchReverseTest) { @@ -396,8 +410,9 @@ TEST_F(EngineBufferE2ETest, CueGotoAndStopTest) { ProcessBuffer(); ControlObject::set(ConfigKey(m_sGroup1, "cue_gotoandstop"), 1.0); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "CueGotoAndStopTest"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "CueGotoAndStopTest"); } TEST_F(EngineBufferE2ETest, CueGotoAndPlayTest) { @@ -410,8 +425,9 @@ TEST_F(EngineBufferE2ETest, CueGotoAndPlayTest) { ProcessBuffer(); ControlObject::set(ConfigKey(m_sGroup1, "cue_gotoandplay"), 1.0); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "CueGotoAndPlayTest"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "CueGotoAndPlayTest"); } TEST_F(EngineBufferE2ETest, CueStartPlayTest) { @@ -421,8 +437,9 @@ TEST_F(EngineBufferE2ETest, CueStartPlayTest) { ProcessBuffer(); ControlObject::set(ConfigKey(m_sGroup1, "start_play"), 1.0); ProcessBuffer(); - assertBufferMatchesReference(m_pEngineMaster->masterBuffer(), - kProcessBufferSize, "StartPlayTest"); + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + kProcessBufferSize, + "StartPlayTest"); } TEST_F(EngineBufferE2ETest, CueGotoAndPlayDenon) { diff --git a/src/test/enginemastertest.cpp b/src/test/enginemastertest.cpp index 1bf05991f35..c6af11ec624 100644 --- a/src/test/enginemastertest.cpp +++ b/src/test/enginemastertest.cpp @@ -32,7 +32,7 @@ class EngineChannelMock : public EngineChannel { MOCK_METHOD0(updateActiveState, ActiveState()); MOCK_METHOD0(isActive, bool()); - MOCK_CONST_METHOD0(isMasterEnabled, bool()); + MOCK_CONST_METHOD0(isMainMixEnabled, bool()); MOCK_CONST_METHOD0(isPflEnabled, bool()); MOCK_METHOD2(process, void(CSAMPLE* pInOut, const int iBufferSize)); MOCK_CONST_METHOD1(collectFeatures, void(GroupFeatureState* pGroupFeatures)); @@ -41,9 +41,10 @@ class EngineChannelMock : public EngineChannel { class EngineMasterTest : public BaseSignalPathTest { protected: - void assertMasterBufferMatchesGolden(const QString& testName) { - assertBufferMatchesReference(m_pEngineMaster->getMasterBuffer(), MAX_BUFFER_LEN, - QString("%1-master").arg(testName)); + void assertMainBufferMatchesGolden(const QString& testName) { + assertBufferMatchesReference(m_pEngineMaster->getMainBuffer(), + MAX_BUFFER_LEN, + QString("%1-main").arg(testName)); }; void assertHeadphoneBufferMatchesGolden(const QString& testName) { @@ -64,14 +65,14 @@ TEST_F(EngineMasterTest, SingleChannelOutputWorks) { // We assume it uses MAX_BUFFER_LEN. This should probably be fixed. SampleUtil::fill(pChannelBuffer, 0.1f, MAX_BUFFER_LEN); - // Instruct the mock to claim it is active, master and not PFL. + // Instruct the mock to claim it is active, main and not PFL. EXPECT_CALL(*pChannel, updateActiveState()) .Times(1) .WillOnce(Return(EngineChannel::ActiveState::Active)); EXPECT_CALL(*pChannel, isActive()) .Times(1) .WillOnce(Return(true)); - EXPECT_CALL(*pChannel, isMasterEnabled()) + EXPECT_CALL(*pChannel, isMainMixEnabled()) .Times(1) .WillOnce(Return(true)); EXPECT_CALL(*pChannel, isPflEnabled()) @@ -89,8 +90,8 @@ TEST_F(EngineMasterTest, SingleChannelOutputWorks) { m_pEngineMaster->process(MAX_BUFFER_LEN); - // Check that the master output contains the channel data. - assertMasterBufferMatchesGolden(testName); + // Check that the main output contains the channel data. + assertMainBufferMatchesGolden(testName); // Check that the headphone output does not contain the channel data. assertHeadphoneBufferMatchesGolden(testName); @@ -108,14 +109,14 @@ TEST_F(EngineMasterTest, SingleChannelPFLOutputWorks) { // We assume it uses MAX_BUFFER_LEN. This should probably be fixed. SampleUtil::fill(pChannelBuffer, 0.1f, MAX_BUFFER_LEN); - // Instruct the mock to claim it is active, not master and PFL + // Instruct the mock to claim it is active, not main and PFL EXPECT_CALL(*pChannel, updateActiveState()) .Times(1) .WillOnce(Return(EngineChannel::ActiveState::Active)); EXPECT_CALL(*pChannel, isActive()) .Times(1) .WillOnce(Return(true)); - EXPECT_CALL(*pChannel, isMasterEnabled()) + EXPECT_CALL(*pChannel, isMainMixEnabled()) .Times(1) .WillOnce(Return(false)); EXPECT_CALL(*pChannel, isPflEnabled()) @@ -133,8 +134,8 @@ TEST_F(EngineMasterTest, SingleChannelPFLOutputWorks) { m_pEngineMaster->process(MAX_BUFFER_LEN); - // Check that the master output is empty. - assertMasterBufferMatchesGolden(testName); + // Check that the main output is empty. + assertMainBufferMatchesGolden(testName); // Check that the headphone output contains the channel data. assertHeadphoneBufferMatchesGolden(testName); @@ -158,14 +159,14 @@ TEST_F(EngineMasterTest, TwoChannelOutputWorks) { SampleUtil::fill(pChannel1Buffer, 0.1f, MAX_BUFFER_LEN); SampleUtil::fill(pChannel2Buffer, 0.2f, MAX_BUFFER_LEN); - // Instruct channel 1 to claim it is active, master and not PFL. + // Instruct channel 1 to claim it is active, main and not PFL. EXPECT_CALL(*pChannel1, updateActiveState()) .Times(1) .WillOnce(Return(EngineChannel::ActiveState::Active)); EXPECT_CALL(*pChannel1, isActive()) .Times(1) .WillOnce(Return(true)); - EXPECT_CALL(*pChannel1, isMasterEnabled()) + EXPECT_CALL(*pChannel1, isMainMixEnabled()) .Times(1) .WillOnce(Return(true)); EXPECT_CALL(*pChannel1, isPflEnabled()) @@ -176,14 +177,14 @@ TEST_F(EngineMasterTest, TwoChannelOutputWorks) { EXPECT_CALL(*pChannel1, postProcess(160000)) .Times(1); - // Instruct channel 2 to claim it is active, master and not PFL. + // Instruct channel 2 to claim it is active, main and not PFL. EXPECT_CALL(*pChannel2, updateActiveState()) .Times(1) .WillOnce(Return(EngineChannel::ActiveState::Active)); EXPECT_CALL(*pChannel2, isActive()) .Times(1) .WillOnce(Return(true)); - EXPECT_CALL(*pChannel2, isMasterEnabled()) + EXPECT_CALL(*pChannel2, isMainMixEnabled()) .Times(1) .WillOnce(Return(true)); EXPECT_CALL(*pChannel2, isPflEnabled()) @@ -204,8 +205,8 @@ TEST_F(EngineMasterTest, TwoChannelOutputWorks) { m_pEngineMaster->process(MAX_BUFFER_LEN); - // Check that the master output contains the sum of the channel data. - assertMasterBufferMatchesGolden(testName); + // Check that the main output contains the sum of the channel data. + assertMainBufferMatchesGolden(testName); // Check that the headphone output does not contain any channel data. assertHeadphoneBufferMatchesGolden(testName); @@ -229,14 +230,14 @@ TEST_F(EngineMasterTest, TwoChannelPFLOutputWorks) { SampleUtil::fill(pChannel1Buffer, 0.1f, MAX_BUFFER_LEN); SampleUtil::fill(pChannel2Buffer, 0.2f, MAX_BUFFER_LEN); - // Instruct channel 1 to claim it is active, master and PFL. + // Instruct channel 1 to claim it is active, main and PFL. EXPECT_CALL(*pChannel1, updateActiveState()) .Times(1) .WillOnce(Return(EngineChannel::ActiveState::Active)); EXPECT_CALL(*pChannel1, isActive()) .Times(2) .WillRepeatedly(Return(true)); - EXPECT_CALL(*pChannel1, isMasterEnabled()) + EXPECT_CALL(*pChannel1, isMainMixEnabled()) .Times(1) .WillOnce(Return(true)); EXPECT_CALL(*pChannel1, isPflEnabled()) @@ -247,14 +248,14 @@ TEST_F(EngineMasterTest, TwoChannelPFLOutputWorks) { EXPECT_CALL(*pChannel1, postProcess(160000)) .Times(1); - // Instruct channel 2 to claim it is active, master and PFL. + // Instruct channel 2 to claim it is active, main and PFL. EXPECT_CALL(*pChannel2, updateActiveState()) .Times(1) .WillOnce(Return(EngineChannel::ActiveState::Active)); EXPECT_CALL(*pChannel2, isActive()) .Times(2) .WillRepeatedly(Return(true)); - EXPECT_CALL(*pChannel2, isMasterEnabled()) + EXPECT_CALL(*pChannel2, isMainMixEnabled()) .Times(1) .WillOnce(Return(true)); EXPECT_CALL(*pChannel2, isPflEnabled()) @@ -275,8 +276,8 @@ TEST_F(EngineMasterTest, TwoChannelPFLOutputWorks) { m_pEngineMaster->process(MAX_BUFFER_LEN); - // Check that the master output contains the sum of the channel data. - assertMasterBufferMatchesGolden(testName); + // Check that the main output contains the sum of the channel data. + assertMainBufferMatchesGolden(testName); // Check that the headphone output does not contain any channel data. assertHeadphoneBufferMatchesGolden(testName); @@ -305,14 +306,14 @@ TEST_F(EngineMasterTest, ThreeChannelOutputWorks) { SampleUtil::fill(pChannel2Buffer, 0.2f, MAX_BUFFER_LEN); SampleUtil::fill(pChannel3Buffer, 0.3f, MAX_BUFFER_LEN); - // Instruct channel 1 to claim it is active, master and not PFL. + // Instruct channel 1 to claim it is active, main and not PFL. EXPECT_CALL(*pChannel1, updateActiveState()) .Times(1) .WillOnce(Return(EngineChannel::ActiveState::Active)); EXPECT_CALL(*pChannel1, isActive()) .Times(1) .WillOnce(Return(true)); - EXPECT_CALL(*pChannel1, isMasterEnabled()) + EXPECT_CALL(*pChannel1, isMainMixEnabled()) .Times(1) .WillOnce(Return(true)); EXPECT_CALL(*pChannel1, isPflEnabled()) @@ -323,14 +324,14 @@ TEST_F(EngineMasterTest, ThreeChannelOutputWorks) { EXPECT_CALL(*pChannel1, postProcess(160000)) .Times(1); - // Instruct channel 2 to claim it is active, master and not PFL. + // Instruct channel 2 to claim it is active, main and not PFL. EXPECT_CALL(*pChannel2, updateActiveState()) .Times(1) .WillOnce(Return(EngineChannel::ActiveState::Active)); EXPECT_CALL(*pChannel2, isActive()) .Times(1) .WillOnce(Return(true)); - EXPECT_CALL(*pChannel2, isMasterEnabled()) + EXPECT_CALL(*pChannel2, isMainMixEnabled()) .Times(1) .WillOnce(Return(true)); EXPECT_CALL(*pChannel2, isPflEnabled()) @@ -341,14 +342,14 @@ TEST_F(EngineMasterTest, ThreeChannelOutputWorks) { EXPECT_CALL(*pChannel2, postProcess(160000)) .Times(1); - // Instruct channel 3 to claim it is active, master and not PFL. + // Instruct channel 3 to claim it is active, main and not PFL. EXPECT_CALL(*pChannel3, updateActiveState()) .Times(1) .WillOnce(Return(EngineChannel::ActiveState::Active)); EXPECT_CALL(*pChannel3, isActive()) .Times(1) .WillOnce(Return(true)); - EXPECT_CALL(*pChannel3, isMasterEnabled()) + EXPECT_CALL(*pChannel3, isMainMixEnabled()) .Times(1) .WillOnce(Return(true)); EXPECT_CALL(*pChannel3, isPflEnabled()) @@ -372,8 +373,8 @@ TEST_F(EngineMasterTest, ThreeChannelOutputWorks) { m_pEngineMaster->process(MAX_BUFFER_LEN); - // Check that the master output contains the sum of the channel data. - assertMasterBufferMatchesGolden(testName); + // Check that the main output contains the sum of the channel data. + assertMainBufferMatchesGolden(testName); // Check that the headphone output does not contain any channel data. assertHeadphoneBufferMatchesGolden(testName); @@ -402,14 +403,14 @@ TEST_F(EngineMasterTest, ThreeChannelPFLOutputWorks) { SampleUtil::fill(pChannel2Buffer, 0.2f, MAX_BUFFER_LEN); SampleUtil::fill(pChannel3Buffer, 0.3f, MAX_BUFFER_LEN); - // Instruct channel 1 to claim it is active, master and not PFL. + // Instruct channel 1 to claim it is active, main and not PFL. EXPECT_CALL(*pChannel1, updateActiveState()) .Times(1) .WillOnce(Return(EngineChannel::ActiveState::Active)); EXPECT_CALL(*pChannel1, isActive()) .Times(2) .WillRepeatedly(Return(true)); - EXPECT_CALL(*pChannel1, isMasterEnabled()) + EXPECT_CALL(*pChannel1, isMainMixEnabled()) .Times(1) .WillOnce(Return(true)); EXPECT_CALL(*pChannel1, isPflEnabled()) @@ -420,14 +421,14 @@ TEST_F(EngineMasterTest, ThreeChannelPFLOutputWorks) { EXPECT_CALL(*pChannel1, postProcess(160000)) .Times(1); - // Instruct channel 2 to claim it is active, master and not PFL. + // Instruct channel 2 to claim it is active, main and not PFL. EXPECT_CALL(*pChannel2, updateActiveState()) .Times(1) .WillOnce(Return(EngineChannel::ActiveState::Active)); EXPECT_CALL(*pChannel2, isActive()) .Times(2) .WillRepeatedly(Return(true)); - EXPECT_CALL(*pChannel2, isMasterEnabled()) + EXPECT_CALL(*pChannel2, isMainMixEnabled()) .Times(1) .WillOnce(Return(true)); EXPECT_CALL(*pChannel2, isPflEnabled()) @@ -438,14 +439,14 @@ TEST_F(EngineMasterTest, ThreeChannelPFLOutputWorks) { EXPECT_CALL(*pChannel2, postProcess(160000)) .Times(1); - // Instruct channel 3 to claim it is active, master and not PFL. + // Instruct channel 3 to claim it is active, main and not PFL. EXPECT_CALL(*pChannel3, updateActiveState()) .Times(1) .WillOnce(Return(EngineChannel::ActiveState::Active)); EXPECT_CALL(*pChannel3, isActive()) .Times(2) .WillRepeatedly(Return(true)); - EXPECT_CALL(*pChannel3, isMasterEnabled()) + EXPECT_CALL(*pChannel3, isMainMixEnabled()) .Times(1) .WillOnce(Return(true)); EXPECT_CALL(*pChannel3, isPflEnabled()) @@ -469,8 +470,8 @@ TEST_F(EngineMasterTest, ThreeChannelPFLOutputWorks) { m_pEngineMaster->process(MAX_BUFFER_LEN); - // Check that the master output contains the sum of the channel data. - assertMasterBufferMatchesGolden(testName); + // Check that the main output contains the sum of the channel data. + assertMainBufferMatchesGolden(testName); // Check that the headphone output does not contain any channel data. assertHeadphoneBufferMatchesGolden(testName); diff --git a/src/test/enginemicrophonetest.cpp b/src/test/enginemicrophonetest.cpp index ccdedefb31b..56f91ae463e 100644 --- a/src/test/enginemicrophonetest.cpp +++ b/src/test/enginemicrophonetest.cpp @@ -84,7 +84,7 @@ TEST_F(EngineMicrophoneTest, TestInputMatchesOutput) { FillBuffer(input, 0.1f, inputLength); ClearBuffer(output, outputLength); - AudioInput micInput = AudioInput(AudioPath::MICROPHONE, 0, 1, 0); + AudioInput micInput = AudioInput(AudioPathType::Microphone, 0, 1, 0); m_pTalkover->set(1.0); m_pMicrophone->receiveBuffer(micInput, input, inputLength); @@ -96,7 +96,7 @@ TEST_F(EngineMicrophoneTest, TestInputMatchesOutput) { TEST_F(EngineMicrophoneTest, TestRepeatedInputMatchesOutput) { ClearBuffer(output, outputLength); - AudioInput micInput = AudioInput(AudioPath::MICROPHONE, 0, 1, 0); + AudioInput micInput = AudioInput(AudioPathType::Microphone, 0, 1, 0); m_pTalkover->set(1.0); for (int i = 0; i < 10; i++) { diff --git a/src/test/metaknob_link_test.cpp b/src/test/metaknob_link_test.cpp index d7805e1f1ca..0e589624e8f 100644 --- a/src/test/metaknob_link_test.cpp +++ b/src/test/metaknob_link_test.cpp @@ -16,11 +16,11 @@ class MetaLinkTest : public BaseEffectTest { protected: MetaLinkTest() - : m_master(m_factory.getOrCreateHandle("[Master]"), "[Master]"), + : m_main(m_factory.getOrCreateHandle("[Master]"), "[Master]"), m_headphone(m_factory.getOrCreateHandle("[Headphone]"), "[Headphone]") { mixxx::Time::setTestMode(true); mixxx::Time::setTestElapsedTime(mixxx::Duration::fromNanos(0)); - m_pEffectsManager->registerInputChannel(m_master); + m_pEffectsManager->registerInputChannel(m_main); m_pEffectsManager->registerInputChannel(m_headphone); registerTestBackend(); @@ -70,7 +70,7 @@ class MetaLinkTest : public BaseEffectTest { } ChannelHandleFactory m_factory; - ChannelHandleAndGroup m_master; + ChannelHandleAndGroup m_main; ChannelHandleAndGroup m_headphone; EffectSlotPointer m_pEffectSlot; diff --git a/src/test/reference_buffers/SingleChannelOutputWorks-master b/src/test/reference_buffers/SingleChannelOutputWorks-main similarity index 100% rename from src/test/reference_buffers/SingleChannelOutputWorks-master rename to src/test/reference_buffers/SingleChannelOutputWorks-main diff --git a/src/test/reference_buffers/SingleChannelPFLOutputWorks-master b/src/test/reference_buffers/SingleChannelPFLOutputWorks-main similarity index 100% rename from src/test/reference_buffers/SingleChannelPFLOutputWorks-master rename to src/test/reference_buffers/SingleChannelPFLOutputWorks-main diff --git a/src/test/reference_buffers/ThreeChannelOutputWorks-master b/src/test/reference_buffers/ThreeChannelOutputWorks-main similarity index 100% rename from src/test/reference_buffers/ThreeChannelOutputWorks-master rename to src/test/reference_buffers/ThreeChannelOutputWorks-main diff --git a/src/test/reference_buffers/ThreeChannelPFLOutputWorks-master b/src/test/reference_buffers/ThreeChannelPFLOutputWorks-main similarity index 100% rename from src/test/reference_buffers/ThreeChannelPFLOutputWorks-master rename to src/test/reference_buffers/ThreeChannelPFLOutputWorks-main diff --git a/src/test/reference_buffers/TwoChannelOutputWorks-master b/src/test/reference_buffers/TwoChannelOutputWorks-main similarity index 100% rename from src/test/reference_buffers/TwoChannelOutputWorks-master rename to src/test/reference_buffers/TwoChannelOutputWorks-main diff --git a/src/test/reference_buffers/TwoChannelPFLOutputWorks-master b/src/test/reference_buffers/TwoChannelPFLOutputWorks-main similarity index 100% rename from src/test/reference_buffers/TwoChannelPFLOutputWorks-master rename to src/test/reference_buffers/TwoChannelPFLOutputWorks-main diff --git a/src/test/signalpathtest.h b/src/test/signalpathtest.h index f74aa09697e..3e66d992929 100644 --- a/src/test/signalpathtest.h +++ b/src/test/signalpathtest.h @@ -46,8 +46,6 @@ using ::testing::_; EXPECT_FRAMEPOS_EQ(position, controlPos); \ } -// Subclass of EngineMaster that provides access to the master buffer object -// for comparison. class TestEngineMaster : public EngineMaster { public: TestEngineMaster(UserSettingsPointer _config, @@ -60,14 +58,10 @@ class TestEngineMaster : public EngineMaster { pEffectsManager, pChannelHandleFactory, bEnableSidechain) { - m_pMasterEnabled->forceSet(1); + m_pMainEnabled->forceSet(1); m_pHeadphoneEnabled->forceSet(1); m_pBoothEnabled->forceSet(1); } - - CSAMPLE* masterBuffer() { - return m_pMaster; - } }; class BaseSignalPathTest : public MixxxTest, SoundSourceProviderRegistration { @@ -148,7 +142,7 @@ class BaseSignalPathTest : public MixxxTest, SoundSourceProviderRegistration { } void addDeck(EngineDeck* pDeck) { - ControlObject::set(ConfigKey(pDeck->getGroup(), "master"), 1.0); + ControlObject::set(ConfigKey(pDeck->getGroup(), "main_mix"), 1.0); ControlObject::set(ConfigKey(pDeck->getGroup(), "rate_dir"), kDefaultRateDir); ControlObject::set(ConfigKey(pDeck->getGroup(), "rateRange"), kDefaultRateRange); m_pNumDecks->set(m_pNumDecks->get() + 1); diff --git a/src/vinylcontrol/vinylcontrolmanager.cpp b/src/vinylcontrol/vinylcontrolmanager.cpp index d2faaeb3429..06c7b6deb9b 100644 --- a/src/vinylcontrol/vinylcontrolmanager.cpp +++ b/src/vinylcontrol/vinylcontrolmanager.cpp @@ -30,7 +30,7 @@ VinylControlManager::VinylControlManager(QObject* pParent, // VinylControlProcessor. for (int i = 0; i < kMaximumVinylControlInputs; ++i) { pSoundManager->registerInput( - AudioInput(AudioInput::VINYLCONTROL, 0, 2, i), m_pProcessor); + AudioInput(AudioPathType::VinylControl, 0, 2, i), m_pProcessor); } } diff --git a/src/vinylcontrol/vinylcontrolprocessor.cpp b/src/vinylcontrol/vinylcontrolprocessor.cpp index 8da151938b2..ae77d500b46 100644 --- a/src/vinylcontrol/vinylcontrolprocessor.cpp +++ b/src/vinylcontrol/vinylcontrolprocessor.cpp @@ -153,7 +153,7 @@ void VinylControlProcessor::reloadConfig() { } void VinylControlProcessor::onInputConfigured(const AudioInput& input) { - if (input.getType() != AudioInput::VINYLCONTROL) { + if (input.getType() != AudioPathType::VinylControl) { qDebug() << "WARNING: AudioInput type is not VINYLCONTROL. Ignoring."; return; } @@ -177,7 +177,7 @@ void VinylControlProcessor::onInputConfigured(const AudioInput& input) { } void VinylControlProcessor::onInputUnconfigured(const AudioInput& input) { - if (input.getType() != AudioInput::VINYLCONTROL) { + if (input.getType() != AudioPathType::VinylControl) { qDebug() << "WARNING: AudioInput type is not VINYLCONTROL. Ignoring."; return; } @@ -206,7 +206,7 @@ void VinylControlProcessor::receiveBuffer(const AudioInput& input, const CSAMPLE* pBuffer, unsigned int nFrames) { ScopedTimer t("VinylControlProcessor::receiveBuffer"); - if (input.getType() != AudioInput::VINYLCONTROL) { + if (input.getType() != AudioPathType::VinylControl) { qDebug() << "WARNING: AudioInput type is not VINYLCONTROL. Ignoring incoming buffer."; return; }