]> git.sesse.net Git - kdenlive/blobdiff - src/effectslist.h
Const'ref
[kdenlive] / src / effectslist.h
index d2c10dcb191f3f04be1894eeec77f9e9283d75ff..2ef55f0f4bdaf82263e2c3f57a5b3eb59b82fda6 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
-                          docclipbaseiterator.h  -  description
+                          effectslist.h  -  description
                              -------------------
     begin                : Sat Aug 10 2002
     copyright            : (C) 2002 by Jason Wood
  *                                                                         *
  ***************************************************************************/
 
+/**
+ * @class EffectsList
+ * @brief List for effects objects.
+ * @author Jason Wood
+ *
+ * This is a list of DocClipBase objects, to be used instead of
+ * QList<DocClipBase> to enable sorting lists correctly. It also contains the
+ * ability to set a "master clip", which can be used by a number of operations
+ * where there is the need of one clip to act as a reference for what happens to
+ * all clips.
+ */
+
 #ifndef EFFECTSLIST_H
 #define EFFECTSLIST_H
 
-#include <QList>
+#include <QDomDocument>
+
+namespace Kdenlive {
+  enum EFFECTTYPE { simpleEffect, groupEffect };
+}
+
+class EffectsList: public QDomDocument
+{
+public:
+    EffectsList(bool indexRequired = false);
+    ~EffectsList();
+
+    /** @brief Returns the XML element of an effect.
+     * @param name name of the effect to be returned */
+    QDomElement getEffectByName(const QString & name) const;
+    QDomElement getEffectByTag(const QString & tag, const QString & id) const;
+
+    /** @brief Checks the existance of an effect.
+     * @param tag effect tag
+     * @param id effect id
+     * @return effect index if the effect exists, -1 otherwise */
+    int hasEffect(const QString & tag, const QString & id) const;
 
-/**An List for DocClipBase objects. Use this instead of QList<DocClipBase> so as to sort lists correctly.
-       * Also contains the ability to set a "master clip", which can be used by a number of operations where
-       * the need for one clip to act as a reference for what happens to all clips is needed.
-  * @author Jason Wood
-  */
+    /** @brief Lists the core properties of an effect.
+     * @param ix effect index
+     * @return list of name, tag and id of an effect */
+    QStringList effectIdInfo(const int ix) const;
 
-#include <QDomElement>
+    /** @brief Lists effects names. */
+    QStringList effectNames();
+    QString getInfo(const QString & tag, const QString & id) const;
+    QString getInfoFromIndex(const int ix) const;
+    QString getEffectInfo(const QDomElement effect) const;
+    void clone(const EffectsList &original);
+    QDomElement append(QDomElement e);
+    bool isEmpty() const;
+    int count() const;
+    const QDomElement at(int ix) const;
+    void removeAt(int ix);
+    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(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. */
+    static void renameProperty(QDomElement effect, const QString &oldName, const QString &newName);
+    /** @brief Get the value of a 'property' element from the effect node. */
+    static QString property(QDomElement effect, const QString &name);
+    /** @brief Delete a 'property' element from the effect node. */
+    static void removeProperty(QDomElement effect, const QString &name);
+    /** @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<int> &indexes, bool disable);
 
-class EffectsList:public QList < QDomElement > {
-  public:
-    EffectsList();
-   ~EffectsList();
-       /** Returns an XML version of this Effect.*/
-  QDomElement getEffectByName(const QString & name);
-  QStringList effectNames();
-  QString getInfo(QString effectName);
+private:
+    QDomElement m_baseElement;
+    bool m_useIndex;
+    
+    /** @brief Init effect default parameter values. */
+    void initEffect(const QDomElement &effect) const;
 
 };