summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbe_ <be.0@gmx.com>2017-12-16 08:21:45 -0600
committerbe_ <be.0@gmx.com>2017-12-16 08:25:20 -0600
commitcc69596fe40c9b7868774fd7af0224dc4160f579 (patch)
treeac8dfc91ee45cd96526d8eb988a09ebd06dd18cf
parentf8dc023001efd5a0a34b42905059e70dcc8e3132 (diff)
miscellaneous code cleanup
-rw-r--r--src/effects/effectchain.cpp14
-rw-r--r--src/effects/effectchain.h2
-rw-r--r--src/effects/effectchainslot.cpp5
-rw-r--r--src/effects/effectprocessor.h10
4 files changed, 17 insertions, 14 deletions
diff --git a/src/effects/effectchain.cpp b/src/effects/effectchain.cpp
index 41a36e4955..6eaee1528b 100644
--- a/src/effects/effectchain.cpp
+++ b/src/effects/effectchain.cpp
@@ -49,7 +49,7 @@ void EffectChain::addToEngine(EngineEffectRack* pRack, int iIndex) {
// Add the effect to the engine.
EffectPointer pEffect = m_effects[i];
if (pEffect) {
- pEffect->addToEngine(m_pEngineEffectChain, i, m_enabledChannels);
+ pEffect->addToEngine(m_pEngineEffectChain, i, m_enabledInputChannels);
}
}
}
@@ -157,9 +157,9 @@ void EffectChain::setEnabled(bool enabled) {
void EffectChain::enableForInputChannel(const ChannelHandleAndGroup& handle_group) {
// TODO(Be): remove m_enabledChannels from this class and move this logic
// to EffectChainSlot
- bool bWasAlreadyEnabled = m_enabledChannels.contains(handle_group);
+ bool bWasAlreadyEnabled = m_enabledInputChannels.contains(handle_group);
if (!bWasAlreadyEnabled) {
- m_enabledChannels.insert(handle_group);
+ m_enabledInputChannels.insert(handle_group);
}
// The allocation of EffectStates below may be expensive, so avoid it if
@@ -200,11 +200,11 @@ void EffectChain::enableForInputChannel(const ChannelHandleAndGroup& handle_grou
}
bool EffectChain::enabledForChannel(const ChannelHandleAndGroup& handle_group) const {
- return m_enabledChannels.contains(handle_group);
+ return m_enabledInputChannels.contains(handle_group);
}
void EffectChain::disableForInputChannel(const ChannelHandleAndGroup& handle_group) {
- if (m_enabledChannels.remove(handle_group)) {
+ if (m_enabledInputChannels.remove(handle_group)) {
if (!m_bAddedToEngine) {
return;
}
@@ -253,7 +253,7 @@ void EffectChain::addEffect(EffectPointer pEffect) {
m_effects.append(pEffect);
if (m_bAddedToEngine) {
- pEffect->addToEngine(m_pEngineEffectChain, m_effects.size() - 1, m_enabledChannels);
+ pEffect->addToEngine(m_pEngineEffectChain, m_effects.size() - 1, m_enabledInputChannels);
}
emit(effectChanged(m_effects.size() - 1));
}
@@ -278,7 +278,7 @@ void EffectChain::replaceEffect(unsigned int effectSlotNumber,
m_effects.replace(effectSlotNumber, pEffect);
if (!pEffect.isNull()) {
if (m_bAddedToEngine) {
- pEffect->addToEngine(m_pEngineEffectChain, effectSlotNumber, m_enabledChannels);
+ pEffect->addToEngine(m_pEngineEffectChain, effectSlotNumber, m_enabledInputChannels);
}
}
diff --git a/src/effects/effectchain.h b/src/effects/effectchain.h
index f874552b62..e9004652df 100644
--- a/src/effects/effectchain.h
+++ b/src/effects/effectchain.h
@@ -124,7 +124,7 @@ class EffectChain : public QObject {
InsertionType m_insertionType;
double m_dMix;
- QSet<ChannelHandleAndGroup> m_enabledChannels;
+ QSet<ChannelHandleAndGroup> m_enabledInputChannels;
QList<EffectPointer> m_effects;
EngineEffectChain* m_pEngineEffectChain;
bool m_bAddedToEngine;
diff --git a/src/effects/effectchainslot.cpp b/src/effects/effectchainslot.cpp
index 45e7ad5290..bc61905df5 100644
--- a/src/effects/effectchainslot.cpp
+++ b/src/effects/effectchainslot.cpp
@@ -306,10 +306,7 @@ EffectSlotPointer EffectChainSlot::addEffectSlot(const QString& group) {
}
void EffectChainSlot::registerInputChannel(const ChannelHandleAndGroup& handle_group) {
- if (m_channelInfoByName.contains(handle_group.name())) {
- qWarning() << debugString()
- << "WARNING: registerChannel already has channel registered:"
- << handle_group.name();
+ VERIFY_OR_DEBUG_ASSERT(!m_channelInfoByName.contains(handle_group.name())) {
return;
}
diff --git a/src/effects/effectprocessor.h b/src/effects/effectprocessor.h
index 5090435038..d0add56eb8 100644
--- a/src/effects/effectprocessor.h
+++ b/src/effects/effectprocessor.h
@@ -212,9 +212,15 @@ class EffectProcessorImpl : public EffectProcessor {
// Called from main thread for garbage collection after an input channel is disabled
void deleteStatesForInputChannel(const ChannelHandle& inputChannel) final {
- //qDebug() << "EffectProcessorImpl::deleteStatesForInputChannel" << this << inputChannel;
+ if (kEffectDebugOutput) {
+ qDebug() << "EffectProcessorImpl::deleteStatesForInputChannel"
+ << this << inputChannel;
+ }
for (EffectSpecificState* pState : m_channelStateMatrix.at(inputChannel)) {
- //qDebug() << "EffectProcessorImpl::deleteStatesForInputChannel" << this << "deleting state" << pState;
+ if (kEffectDebugOutput) {
+ qDebug() << "EffectProcessorImpl::deleteStatesForInputChannel"
+ << this << "deleting state" << pState;
+ }
delete pState;
}
m_channelStateMatrix[inputChannel].clear();