-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Effect Blacklisting #1674
Effect Blacklisting #1674
Changes from 1 commit
6d61872
9caa1f7
02cf7dd
566db03
036f0e2
92acfe0
94ff53a
260bfcd
72b1f91
eb992a3
8caa6ab
0aa3cf8
cd39efb
4e3468c
b4efad1
e250f10
5bbe893
ff90165
b87b2bb
99bb100
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
#include <QMetaType> | ||
#include <QtAlgorithms> | ||
|
||
#include <algorithm> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove the include from effectsmanager.h too |
||
|
||
#include "engine/effects/engineeffectsmanager.h" | ||
#include "effects/effectchainmanager.h" | ||
#include "effects/effectsbackend.h" | ||
|
@@ -69,10 +71,7 @@ EffectsManager::~EffectsManager() { | |
bool alphabetizeEffectManifests(EffectManifestPointer pManifest1, | ||
EffectManifestPointer pManifest2) { | ||
int dNameComp = QString::localeAwareCompare(pManifest1->displayName(), pManifest2->displayName()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do |
||
int bNameComp = QString::localeAwareCompare( | ||
EffectManifest::backendTypeToTranslatedString(pManifest1->backendType()), | ||
EffectManifest::backendTypeToTranslatedString(pManifest2->backendType())); | ||
// Add an exception for "Built-in" backends, to keep the Built-in effects in the beginning | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a comment here: "Sort built-in effects first before external plugins" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's also add a comment in defs.h where the EffectBackendType enum is declared explaining that the order that the values are declared in the enum class determines how they are sorted in the WEffectSelector and DlgPrefEffects. |
||
int bNameComp = static_cast<int>(pManifest1->backendType()) - static_cast<int>(pManifest2->backendType()); | ||
return (bNameComp ? (bNameComp < 0) : (dNameComp < 0)); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,14 @@ DlgPrefEffects::DlgPrefEffects(QWidget* pParent, | |
setupUi(this); | ||
|
||
m_availableEffectsModel.resetFromEffectManager(pEffectsManager); | ||
for (auto profile : m_availableEffectsModel.profiles()) { | ||
for (auto& profile : m_availableEffectsModel.profiles()) { | ||
EffectManifestPointer pManifest = profile->pManifest; | ||
|
||
// Users are likely to have lots of external plugins installed and | ||
// many of them are useless for DJing. To avoid cluttering the list | ||
// shown in WEffectSelector, blacklist external plugins by default. | ||
bool defaultValue = (pManifest->backendType() == EffectBackendType::BuiltIn); | ||
bool visible = m_pConfig->getValue<bool>(ConfigKey("[Visible Effects]", | ||
bool visible = m_pConfig->getValue<bool>(ConfigKey("[Visible " + pManifest->backendName() + " Effects]", | ||
pManifest->id()), defaultValue); | ||
profile->bIsVisible = visible; | ||
m_pEffectsManager->setEffectVisibility(pManifest, visible); | ||
|
@@ -62,7 +62,8 @@ void DlgPrefEffects::slotApply() { | |
for (EffectProfilePtr profile : m_availableEffectsModel.profiles()) { | ||
EffectManifestPointer pManifest = profile->pManifest; | ||
m_pEffectsManager->setEffectVisibility(pManifest, profile->bIsVisible); | ||
m_pConfig->set(ConfigKey("[Visible Effects]", pManifest->id()), ConfigValue(profile->bIsVisible)); | ||
m_pConfig->set(ConfigKey("[Visible " + pManifest->backendName() + " Effects]", pManifest->id()), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a comment here explaining why we put the backendName in the ConfigKey group. |
||
ConfigValue(profile->bIsVisible)); | ||
} | ||
} | ||
|
||
|
@@ -90,5 +91,5 @@ void DlgPrefEffects::availableEffectsListItemSelected(const QModelIndex& selecte | |
effectAuthor->setText(pManifest->author()); | ||
effectDescription->setText(pManifest->description()); | ||
effectVersion->setText(pManifest->version()); | ||
effectType->setText(EffectManifest::backendTypeToTranslatedString(pManifest->backendType())); | ||
effectType->setText(pManifest->translatedBackendName()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment: "Use this when showing the string in the GUI"