-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added EffectChainPreset class - Added EffectPreset class - Added EffectsManager::loadEffectChainPresets
- Loading branch information
Showing
8 changed files
with
167 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include "effects/effectchainpreset.h" | ||
|
||
#include "effects/effectxmlelements.h" | ||
#include "effects/effectchainslot.h" | ||
#include "util/xml.h" | ||
|
||
EffectChainPreset::EffectChainPreset() { | ||
} | ||
|
||
EffectChainPreset::EffectChainPreset(const QDomElement& element) { | ||
if (!element.hasChildNodes()) { | ||
return; | ||
} | ||
|
||
m_id = XmlParse::selectNodeQString(element, EffectXml::ChainId); | ||
m_name = XmlParse::selectNodeQString(element, EffectXml::ChainName); | ||
m_description = XmlParse::selectNodeQString(element, EffectXml::ChainDescription); | ||
|
||
QString mixModeStr = XmlParse::selectNodeQString(element, EffectXml::ChainMixMode); | ||
m_mixMode = EffectChainSlot::mixModeFromString(mixModeStr); | ||
|
||
m_dSuper = XmlParse::selectNodeDouble(element, EffectXml::ChainSuperParameter); | ||
|
||
QDomElement effectsElement = XmlParse::selectElement(element, EffectXml::EffectsRoot); | ||
QDomNodeList effectList = effectsElement.childNodes(); | ||
|
||
for (int i = 0; i < effectList.count(); ++i) { | ||
QDomNode effectNode = effectList.at(i); | ||
if (effectNode.isElement()) { | ||
QDomElement effectElement = effectNode.toElement(); | ||
EffectPresetPointer pPreset(new EffectPreset(effectElement)); | ||
m_effectPresets.append(pPreset); | ||
} | ||
} | ||
} | ||
|
||
EffectChainPreset::~EffectChainPreset() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef EFFECTCHAINPRESET_H | ||
#define EFFECTCHAINPRESET_H | ||
|
||
#include <QDomElement> | ||
|
||
#include "effects/defs.h" | ||
#include "effects/effectpreset.h" | ||
|
||
|
||
class EffectChainPreset { | ||
public: | ||
EffectChainPreset(); | ||
EffectChainPreset(const QDomElement& element); | ||
~EffectChainPreset(); | ||
|
||
QString name() const { | ||
return m_name; | ||
} | ||
|
||
private: | ||
QString m_id; | ||
QString m_name; | ||
QString m_description; | ||
double m_dSuper; | ||
EffectChainMixMode m_mixMode; | ||
QList <EffectPresetPointer> m_effectPresets; | ||
}; | ||
|
||
#endif /* EFFECTCHAINPRESET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "effects/effectpreset.h" | ||
|
||
#include "effects/effectxmlelements.h" | ||
#include "util/xml.h" | ||
|
||
EffectPreset::EffectPreset() { | ||
} | ||
|
||
EffectPreset::EffectPreset(const QDomElement& element) { | ||
if (!element.hasChildNodes()) { | ||
return; | ||
} | ||
|
||
m_id = XmlParse::selectNodeQString(element, EffectXml::EffectId); | ||
m_version = XmlParse::selectNodeQString(element, EffectXml::EffectVersion); | ||
m_dMetaParameter = XmlParse::selectNodeDouble(element, EffectXml::EffectMetaParameter); | ||
|
||
QDomElement parametersElement = XmlParse::selectElement(element, EffectXml::ParametersRoot); | ||
QDomNodeList parametersList = parametersElement.childNodes(); | ||
|
||
for (int i = 0; i < parametersList.count(); ++i) { | ||
QDomNode parameterNode = parametersList.at(i); | ||
if (parameterNode.isElement()) { | ||
QDomElement parameterElement = parameterNode.toElement(); | ||
// EffectParameterPresetPointer pPreset(new EffectParameterPreset(parameterElement)); | ||
// m_effectParameterPresets.append(pPreset); | ||
} | ||
} | ||
} | ||
|
||
EffectPreset::~EffectPreset() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef EFFECTPRESET_H | ||
#define EFFECTPRESET_H | ||
|
||
#include <QDomElement> | ||
|
||
#include "effects/defs.h" | ||
|
||
|
||
class EffectPreset { | ||
public: | ||
EffectPreset(); | ||
EffectPreset(const QDomElement& element); | ||
~EffectPreset(); | ||
|
||
private: | ||
QString m_id; | ||
QString m_version; | ||
double m_dMetaParameter; | ||
|
||
// QList <EffectParameterPresetPointer> m_effectParameterPresets; | ||
}; | ||
|
||
#endif /* EFFECTPRESET_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters