diff options
author | RJ Ryan <rryan@mixxx.org> | 2013-12-17 01:45:00 -0500 |
---|---|---|
committer | RJ Ryan <rryan@mixxx.org> | 2013-12-17 01:45:23 -0500 |
commit | 4f40522fa1e3a90235a0fb78923af044cac6687c (patch) | |
tree | 3a4dd8e01af307890e5b80476a268e7101e9086d /src/effects/effectchain.h | |
parent | 104372643b571d2e1e35d0ba97efe20f8f2a8b29 (diff) |
Add quick and dirty EffectChain / Effect / EffectParameter XML serialization/de-serialization support.
Diffstat (limited to 'src/effects/effectchain.h')
-rw-r--r-- | src/effects/effectchain.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/effects/effectchain.h b/src/effects/effectchain.h index 4eb9171ab8..8e4458d162 100644 --- a/src/effects/effectchain.h +++ b/src/effects/effectchain.h @@ -4,6 +4,7 @@ #include <QObject> #include <QMap> #include <QList> +#include <QDomDocument> #include "util.h" #include "effects/effect.h" @@ -49,9 +50,31 @@ class EffectChain : public QObject { void setMix(const double& dMix); enum InsertionType { - INSERT = 0, - SEND = 1 + UNKNOWN_INSERTION_TYPE = 0, + INSERT = 1, + SEND = 2 }; + static QString insertionTypeToString(InsertionType type) { + switch (type) { + case INSERT: + return "INSERT"; + case SEND: + return "SEND"; + default: + return "UNKNOWN"; + } + } + static InsertionType insertionTypeFromString(const QString& typeStr) { + if (typeStr == "INSERT") { + return INSERT; + } else if (typeStr == "SEND") { + return SEND; + } else { + return UNKNOWN_INSERTION_TYPE; + } + } + + InsertionType insertionType() const; void setInsertionType(InsertionType type); @@ -63,6 +86,10 @@ class EffectChain : public QObject { EngineEffectChain* getEngineEffectChain(); + QDomElement toXML(QDomDocument* doc) const; + static EffectChainPointer fromXML(EffectsManager* pEffectsManager, + const QDomElement& element); + signals: // Signal that indicates that an effect has been added or removed. void effectAdded(); |