void EffectChainSlot::loadEffectChain(EffectChainPointer pEffectChain) { //qDebug() << debugString() << "loadEffectChain" << (pEffectChain ? pEffectChain->id() : "(null)"); clear(); if (pEffectChain) { m_pEffectChain = pEffectChain; m_pEffectChain->addToEngine(m_pEffectRack->getEngineEffectRack(), m_iChainSlotNumber); m_pEffectChain->updateEngineState(); connect(m_pEffectChain.data(), SIGNAL(effectChanged(unsigned int)), this, SLOT(slotChainEffectChanged(unsigned int))); connect(m_pEffectChain.data(), SIGNAL(nameChanged(const QString&)), this, SLOT(slotChainNameChanged(const QString&))); connect(m_pEffectChain.data(), SIGNAL(enabledChanged(bool)), this, SLOT(slotChainEnabledChanged(bool))); connect(m_pEffectChain.data(), SIGNAL(mixChanged(double)), this, SLOT(slotChainMixChanged(double))); connect(m_pEffectChain.data(), SIGNAL(insertionTypeChanged(EffectChain::InsertionType)), this, SLOT(slotChainInsertionTypeChanged(EffectChain::InsertionType))); connect(m_pEffectChain.data(), SIGNAL(channelStatusChanged(const QString&, bool)), this, SLOT(slotChainChannelStatusChanged(const QString&, bool))); m_pControlChainLoaded->forceSet(true); m_pControlChainInsertionType->set(m_pEffectChain->insertionType()); // Mix and enabled channels are persistent properties of the chain slot, // not of the chain. Propagate the current settings to the chain. m_pEffectChain->setMix(m_pControlChainMix->get()); m_pEffectChain->setEnabled(m_pControlChainEnabled->get() > 0.0); foreach (ChannelInfo* pChannelInfo, m_channelInfoByName) { if (pChannelInfo->pEnabled->toBool()) { m_pEffectChain->enableForChannel(pChannelInfo->handle_group); } else { m_pEffectChain->disableForChannel(pChannelInfo->handle_group); } } // Don't emit because we will below. for (int i = 0; i < m_slots.size(); ++i) { slotChainEffectChanged(i, false); } } emit(effectChainLoaded(pEffectChain)); emit(updated()); }
void EffectChain::setInsertionType(InsertionType insertionType) { m_insertionType = insertionType; sendParameterUpdate(); emit(insertionTypeChanged(insertionType)); }