diff options
author | Daniel Schürmann <daschuer@mixxx.org> | 2018-05-01 23:44:38 +0200 |
---|---|---|
committer | Daniel Schürmann <daschuer@mixxx.org> | 2018-05-01 23:44:38 +0200 |
commit | 2e543cd8e6069c47002ee9b28ae35cfe4e39cd59 (patch) | |
tree | 058e2df591f5a193de4d43dd41ecdbacc55af312 /src/effects/effectchainmanager.cpp | |
parent | cf70247a1e344534f9ff258a1eca8295ddf567f7 (diff) | |
parent | 947694bc2ab3f65ac7452e09128dbbb7c60cdb1b (diff) |
Merge remote-tracking branch 'upstream/master' into lv2_support2
Conflicts:
.travis.yml
src/effects/effect.cpp
src/effects/effect.h
src/effects/effectchainmanager.h
src/effects/effectinstantiator.h
src/effects/effectmanifest.h
src/effects/effectrack.cpp
src/effects/native/autopaneffect.cpp
src/effects/native/balanceeffect.cpp
src/effects/native/biquadfullkilleqeffect.h
src/effects/native/bitcrushereffect.cpp
src/effects/native/echoeffect.cpp
src/effects/native/echoeffect.h
src/effects/native/filtereffect.cpp
src/effects/native/flangereffect.cpp
src/effects/native/loudnesscontoureffect.cpp
src/effects/native/phasereffect.cpp
src/effects/native/reverbeffect.cpp
src/effects/native/threebandbiquadeqeffect.h
src/engine/effects/engineeffect.cpp
src/engine/effects/engineeffect.h
src/mixxx.cpp
src/preferences/dialog/dlgpreferences.cpp
src/preferences/dialog/dlgpreferences.h
src/test/metaknob_link_test.cpp
src/test/nativeeffects_test.cpp
Diffstat (limited to 'src/effects/effectchainmanager.cpp')
-rw-r--r-- | src/effects/effectchainmanager.cpp | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/src/effects/effectchainmanager.cpp b/src/effects/effectchainmanager.cpp index 79c8fe92ae..595f5e010f 100644 --- a/src/effects/effectchainmanager.cpp +++ b/src/effects/effectchainmanager.cpp @@ -18,19 +18,24 @@ EffectChainManager::~EffectChainManager() { //qDebug() << debugString() << "destroyed"; } -void EffectChainManager::registerChannel(const ChannelHandleAndGroup& handle_group) { - if (m_registeredChannels.contains(handle_group)) { - qWarning() << debugString() << "WARNING: Channel already registered:" - << handle_group.name(); +void EffectChainManager::registerInputChannel(const ChannelHandleAndGroup& handle_group) { + VERIFY_OR_DEBUG_ASSERT(!m_registeredInputChannels.contains(handle_group)) { return; } - m_registeredChannels.insert(handle_group); + m_registeredInputChannels.insert(handle_group); - foreach (StandardEffectRackPointer pRack, m_standardEffectRacks) { - pRack->registerChannel(handle_group); + for (auto& pRack : m_standardEffectRacks) { + pRack->registerInputChannel(handle_group); } } +void EffectChainManager::registerOutputChannel(const ChannelHandleAndGroup& handle_group) { + VERIFY_OR_DEBUG_ASSERT(!m_registeredOutputChannels.contains(handle_group)) { + return; + } + m_registeredOutputChannels.insert(handle_group); +} + StandardEffectRackPointer EffectChainManager::addStandardEffectRack() { StandardEffectRackPointer pRack(new StandardEffectRack( m_pEffectsManager, this, m_standardEffectRacks.size())); @@ -76,6 +81,18 @@ QuickEffectRackPointer EffectChainManager::getQuickEffectRack(int i) { return m_quickEffectRacks[i]; } +OutputEffectRackPointer EffectChainManager::addOutputsEffectRack() { + OutputEffectRackPointer pRack(new OutputEffectRack( + m_pEffectsManager, this)); + m_pOutputEffectRack = pRack; + m_effectRacksByGroup.insert(pRack->getGroup(), pRack); + return m_pOutputEffectRack; +} + +OutputEffectRackPointer EffectChainManager::getMasterEffectRack() { + return m_pOutputEffectRack; +} + EffectRackPointer EffectChainManager::getEffectRack(const QString& group) { return m_effectRacksByGroup.value(group); } @@ -176,8 +193,7 @@ bool EffectChainManager::saveEffectChains() { return true; } -void EffectChainManager::loadEffectChains( - StandardEffectRack* pRack) { +void EffectChainManager::loadEffectChains() { QDir settingsPath(m_pConfig->getSettingsPath()); QFile file(settingsPath.absoluteFilePath("effects.xml")); QDomDocument doc; @@ -201,12 +217,19 @@ void EffectChainManager::loadEffectChains( EffectChainPointer pChain = EffectChain::createFromXml( m_pEffectsManager, chainElement); if (pChain) { // null = ejected chains. - EffectChainSlotPointer pChainSlot = pRack->getEffectChainSlot(i); + EffectChainSlotPointer pChainSlot = getStandardEffectRack(0)->getEffectChainSlot(i); if (pChainSlot) { - pChainSlot->loadEffectChain(pChain); + pChainSlot->loadEffectChainToSlot(pChain); pChainSlot->loadChainSlotFromXml(chainElement); + pChain->addToEngine(getStandardEffectRack(0)->getEngineEffectRack(), i); + pChain->updateEngineState(); + pChainSlot->updateRoutingSwitches(); } } } } } + +bool EffectChainManager::isAdoptMetaknobValueEnabled() const { + return m_pConfig->getValue(ConfigKey("[Effects]", "AdoptMetaknobValue"), true); +} |