X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Feffectslist.h;h=2ef55f0f4bdaf82263e2c3f57a5b3eb59b82fda6;hb=c3302003093710ee247ad84c0fe2ef3c579d417f;hp=0d170b35431a87f6b3f9766da88d83aa14cbf4df;hpb=9a4d506b7e074ab59498db733c843b3bd9943e37;p=kdenlive diff --git a/src/effectslist.h b/src/effectslist.h index 0d170b35..2ef55f0f 100644 --- a/src/effectslist.h +++ b/src/effectslist.h @@ -32,10 +32,14 @@ #include +namespace Kdenlive { + enum EFFECTTYPE { simpleEffect, groupEffect }; +} + class EffectsList: public QDomDocument { public: - EffectsList(); + EffectsList(bool indexRequired = false); ~EffectsList(); /** @brief Returns the XML element of an effect. @@ -60,19 +64,19 @@ public: QString getInfoFromIndex(const int ix) const; QString getEffectInfo(const QDomElement effect) const; void clone(const EffectsList &original); - void append(QDomElement e); + QDomElement append(QDomElement e); bool isEmpty() const; int count() const; const QDomElement at(int ix) const; void removeAt(int ix); - QDomElement item(int ix); - void insert(int ix, QDomElement effect); - void replace(int ix, QDomElement effect); - static bool hasKeyFrames(QDomElement effect); - static bool hasSimpleKeyFrames(QDomElement effect); - static bool hasGeometryKeyFrames(QDomElement effect); + QDomElement itemFromIndex(int ix) const; + QDomElement insert(QDomElement effect); + void updateEffect(const QDomElement &effect); + static bool hasKeyFrames(const QDomElement &effect); + static bool hasSimpleKeyFrames(const QDomElement &effect); + static bool hasGeometryKeyFrames(const QDomElement &effect); static void setParameter(QDomElement effect, const QString &name, const QString &value); - static QString parameter(QDomElement effect, const QString &name); + static QString parameter(const QDomElement &effect, const QString &name); /** @brief Change the value of a 'property' element from the effect node. */ static void setProperty(QDomElement effect, const QString &name, const QString &value); /** @brief Rename a 'property' element from the effect node. */ @@ -84,9 +88,19 @@ public: /** @brief Remove all 'meta.*' properties from a producer, used when replacing proxy producers in xml for rendering. */ static void removeMetaProperties(QDomElement producer); void clearList(); + /** @brief Get am effect with effect index equal to ix. */ + QDomElement effectFromIndex(const QDomNodeList &effects, int ix); + /** @brief Update all effects indexes to make sure they are 1, 2, 3, ... */ + void updateIndexes(QDomNodeList effects, int startIndex); + /** @brief Enable / disable a list of effects */ + void enableEffects(const QList &indexes, bool disable); private: QDomElement m_baseElement; + bool m_useIndex; + + /** @brief Init effect default parameter values. */ + void initEffect(const QDomElement &effect) const; };