summaryrefslogtreecommitdiffstats
path: root/src/effects/effectchainslot.cpp
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2020-09-09 14:03:46 +0200
committerBe <be@mixxx.org>2020-09-20 15:52:05 -0500
commit8503850dfd116f172be8b1e2e9a1cafc2cef18bc (patch)
treed27232be5da978ea89c22223a55764964e03436a /src/effects/effectchainslot.cpp
parent15f4907ec1f6ba81040e3b2fa8d4890cda8c4eb1 (diff)
effects/effectchainslot: Add COs to retrieve number of chain presets
Diffstat (limited to 'src/effects/effectchainslot.cpp')
-rw-r--r--src/effects/effectchainslot.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/effects/effectchainslot.cpp b/src/effects/effectchainslot.cpp
index 58ea8d6974..15f4b12c72 100644
--- a/src/effects/effectchainslot.cpp
+++ b/src/effects/effectchainslot.cpp
@@ -40,6 +40,15 @@ EffectChainSlot::EffectChainSlot(const QString& group,
ConfigKey(m_group, "num_effectslots"));
m_pControlNumEffectSlots->setReadOnly();
+ m_pControlNumPresetsAvailable = std::make_unique<ControlObject>(
+ ConfigKey(m_group, "num_presetsavailable"));
+ m_pControlNumPresetsAvailable->set(m_pChainPresetManager->numPresets());
+ m_pControlNumPresetsAvailable->setReadOnly();
+ connect(m_pChainPresetManager.get(),
+ &EffectChainPresetManager::effectChainPresetListUpdated,
+ this,
+ &EffectChainSlot::slotPresetListUpdated);
+
m_pControlChainLoaded =
std::make_unique<ControlObject>(ConfigKey(m_group, "loaded"));
m_pControlChainLoaded->setReadOnly();
@@ -263,6 +272,13 @@ EffectSlotPointer EffectChainSlot::addEffectSlot(const QString& group) {
return pEffectSlot;
}
+int EffectChainSlot::numPresets() const {
+ VERIFY_OR_DEBUG_ASSERT(m_pChainPresetManager) {
+ return 0;
+ }
+ return m_pChainPresetManager->numPresets();
+}
+
void EffectChainSlot::registerInputChannel(const ChannelHandleAndGroup& handleGroup,
const double initialValue) {
VERIFY_OR_DEBUG_ASSERT(!m_channelEnableButtons.contains(handleGroup)) {
@@ -344,6 +360,10 @@ void EffectChainSlot::slotChannelStatusChanged(
}
}
+void EffectChainSlot::slotPresetListUpdated() {
+ m_pControlNumPresetsAvailable->forceSet(numPresets());
+}
+
void EffectChainSlot::enableForInputChannel(const ChannelHandleAndGroup& handleGroup) {
if (m_enabledInputChannels.contains(handleGroup)) {
return;