diff options
author | Daniel Schürmann <daschuer@mixxx.org> | 2017-04-24 21:31:42 +0200 |
---|---|---|
committer | Daniel Schürmann <daschuer@mixxx.org> | 2017-04-24 21:40:51 +0200 |
commit | a85ba37409f8f1f015cfe89b70e9ff4d369c2dd8 (patch) | |
tree | 2ea5eb3399353aabf01349fbc1547f6ae0d25581 /src/preferences/dialog/dlgprefeq.cpp | |
parent | a72d063ea5c9d418bdf828cb79c47b91cbe51bdd (diff) |
Pass EffectMainfest via shared pointer instead of copying it.
This should be a performance and memory improvemnet.
It gurantees that all effects share the same manifest and
allows to tweak the manifest from the preferences if an effect
is already instantiated.
Diffstat (limited to 'src/preferences/dialog/dlgprefeq.cpp')
-rw-r--r-- | src/preferences/dialog/dlgprefeq.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/preferences/dialog/dlgprefeq.cpp b/src/preferences/dialog/dlgprefeq.cpp index cc8621061c..0fab6c2da8 100644 --- a/src/preferences/dialog/dlgprefeq.cpp +++ b/src/preferences/dialog/dlgprefeq.cpp @@ -174,16 +174,16 @@ void DlgPrefEQ::slotNumDecksChanged(double numDecks) { slotSingleEqChecked(CheckBoxSingleEqEffect->isChecked()); } -static bool isMixingEQ(const EffectManifest& pManifest) { - return pManifest.isMixingEQ(); +static bool isMixingEQ(EffectManifest* pManifest) { + return pManifest->isMixingEQ(); } -static bool isMasterEQ(const EffectManifest& pManifest) { - return pManifest.isMasterEQ(); +static bool isMasterEQ(EffectManifest* pManifest) { + return pManifest->isMasterEQ(); } -static bool hasSuperKnobLinking(const EffectManifest& pManifest) { - for (const auto& pParameterManifest : pManifest.parameters()) { +static bool hasSuperKnobLinking(EffectManifest* pManifest) { + for (const auto& pParameterManifest : pManifest->parameters()) { if (pParameterManifest.defaultLinkType() != EffectManifestParameter::LinkType::NONE) { return true; @@ -204,9 +204,9 @@ void DlgPrefEQ::slotPopulateDeckEffectSelectors() { filterEQ = nullptr; // take all } - const QList<EffectManifest> availableEQEffects = + const QList<EffectManifestPointer> availableEQEffects = m_pEffectsManager->getAvailableEffectManifestsFiltered(filterEQ); - const QList<EffectManifest> availableQuickEffects = + const QList<EffectManifestPointer> availableQuickEffects = m_pEffectsManager->getAvailableEffectManifestsFiltered(hasSuperKnobLinking); for (QComboBox* box : m_deckEqEffectSelectors) { @@ -219,9 +219,9 @@ void DlgPrefEQ::slotPopulateDeckEffectSelectors() { int i; for (i = 0; i < availableEQEffects.size(); ++i) { - const EffectManifest& manifest = availableEQEffects.at(i); - box->addItem(manifest.name(), QVariant(manifest.id())); - if (selectedEffectId == manifest.id()) { + EffectManifestPointer pManifest = availableEQEffects.at(i); + box->addItem(pManifest->name(), QVariant(pManifest->id())); + if (selectedEffectId == pManifest->id()) { currentIndex = i; } } @@ -249,9 +249,9 @@ void DlgPrefEQ::slotPopulateDeckEffectSelectors() { int i; for (i = 0; i < availableQuickEffects.size(); ++i) { - const EffectManifest& manifest = availableQuickEffects.at(i); - box->addItem(manifest.name(), QVariant(manifest.id())); - if (selectedEffectId == manifest.id()) { + EffectManifestPointer pManifest = availableQuickEffects.at(i); + box->addItem(pManifest->name(), QVariant(pManifest->id())); + if (selectedEffectId == pManifest->id()) { currentIndex = i; } } @@ -453,7 +453,7 @@ void DlgPrefEQ::applySelections() { EffectPointer effectpointer = chainslot->getEffectSlot(0)->getEffect(); if (effectpointer && - effectpointer->getManifest().id() == effectId) { + effectpointer->getManifest()->id() == effectId) { need_load = false; } } @@ -633,11 +633,11 @@ void DlgPrefEQ::setUpMasterEQ() { QString configuredEffect = m_pConfig->getValue(ConfigKey(kConfigKey, "EffectForGroup_[Master]"), kDefaultMasterEqId); - const QList<EffectManifest> availableMasterEQEffects = + const QList<EffectManifestPointer> availableMasterEQEffects = m_pEffectsManager->getAvailableEffectManifestsFiltered(isMasterEQ); - for (const auto& manifest : availableMasterEQEffects) { - comboBoxMasterEq->addItem(manifest.name(), QVariant(manifest.id())); + for (const auto& pManifest : availableMasterEQEffects) { + comboBoxMasterEq->addItem(pManifest->name(), QVariant(pManifest->id())); } //: Displayed when no effect is selected comboBoxMasterEq->addItem(tr("None"), QVariant()); |