-
-
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 |
---|---|---|
|
@@ -11,9 +11,10 @@ enum class EffectEnableState { | |
Enabling | ||
}; | ||
|
||
enum class EffectType { | ||
enum class BackendType { | ||
BuiltIn, | ||
LV2 | ||
LV2, | ||
Unknown | ||
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. Do we need this 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. I added 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. When would an EffectManifest ever not have a backend? 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. EffectManifest would always have a backend currently. But because the backendName is not set in its constructor but through 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. Oh, I thought of a use case for this Unknown value. When we parse an XML file specifying an effect chain preset and use the |
||
}; | ||
|
||
enum class SignalProcessingStage { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,11 +59,15 @@ class EffectManifest final { | |
} | ||
} | ||
|
||
const BackendType& backendType() const { | ||
return m_backendType; | ||
} | ||
const QString& backendName() const { | ||
return m_backendName; | ||
} | ||
void setBackendName(const QString& name) { | ||
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 this |
||
m_backendName = name; | ||
m_backendType = backendTypeFromString(name); | ||
m_backendName = backendTypeToString(m_backendType); | ||
} | ||
|
||
const QString& author() const { | ||
|
@@ -133,6 +137,28 @@ class EffectManifest final { | |
m_metaknobDefault = metaknobDefault; | ||
} | ||
|
||
static QString backendTypeToString(BackendType type) { | ||
switch (type) { | ||
case BackendType::BuiltIn: | ||
//: Used for effects that are built into Mixxx | ||
return QObject::tr("Built-in"); | ||
case BackendType::LV2: | ||
return QObject::tr("LV2"); | ||
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. Replace |
||
default: | ||
//: Used for effects from unknown sources | ||
return QObject::tr("Unknown"); | ||
} | ||
} | ||
static BackendType backendTypeFromString(const QString& name) { | ||
if (name == "Built-in") { | ||
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. This will fail when parsing a string that came from the |
||
return BackendType::BuiltIn; | ||
} else if (name == "LV2") { | ||
return BackendType::LV2; | ||
} else { | ||
return BackendType::Unknown; | ||
} | ||
} | ||
|
||
private: | ||
QString debugString() const { | ||
return QString("EffectManifest(%1)").arg(m_id); | ||
|
@@ -141,8 +167,8 @@ class EffectManifest final { | |
QString m_id; | ||
QString m_name; | ||
QString m_shortName; | ||
BackendType m_backendType; | ||
QString m_backendName; | ||
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 m_backendName |
||
// QString m_backendName; | ||
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 this |
||
QString m_author; | ||
QString m_version; | ||
QString m_description; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ DlgPrefEffects::DlgPrefEffects(QWidget* pParent, | |
EffectManifestPointer pManifest = profile->pManifest; | ||
|
||
// Blacklisted Non-builtin effects by default | ||
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 elaborate on this comment to explain why we are choosing to do this. Replace the comment with: |
||
bool defaultValue = QString::localeAwareCompare(pManifest->backendName(), tr("Built-in")) == 0; | ||
bool defaultValue = (pManifest->backendType() == BackendType::BuiltIn); | ||
bool visible = m_pConfig->getValue<bool>(ConfigKey("[Visible Effects]", | ||
pManifest->id()), defaultValue); | ||
profile->bIsVisible = visible; | ||
|
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.
It's not immediately clear what "BackendType" means without context. I think "EffectType" is a better name. If you don't like that, then how about "EffectBackendType"?
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.
Yes, EffectBackendType seems to be better than EffectType to me. I think EffectType should denote Phaser, compressor, etc...
I have changed it to EffectBackendType
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.
Good point. "EffectBackendType" works well.