]> git.sesse.net Git - kdenlive/blob - src/effectslist.h
Fix various effects related crashes (don't store effects in QList, but use QDomDocume...
[kdenlive] / src / effectslist.h
1 /***************************************************************************
2                           effectslist.h  -  description
3                              -------------------
4     begin                : Sat Aug 10 2002
5     copyright            : (C) 2002 by Jason Wood
6     email                : jasonwood@blueyonder.co.uk
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #ifndef EFFECTSLIST_H
19 #define EFFECTSLIST_H
20
21 #include <QDomDocument>
22
23 /**A List for DocClipBase objects. Use this instead of QList<DocClipBase> so as to sort lists correctly.
24  * Also contains the ability to set a "master clip", which can be used by a number of operations where
25  * the need for one clip to act as a reference for what happens to all clips is needed.
26   * @author Jason Wood
27   */
28
29
30 class EffectsList: public QDomDocument
31 {
32 public:
33     EffectsList();
34     ~EffectsList();
35     /** Returns an XML version of this Effect.*/
36     QDomElement getEffectByName(const QString & name) const;
37     QDomElement getEffectByTag(const QString & tag, const QString & id) const;
38     /** if the list contains effect defined by tag + id, returns effect index, otherwise -1 */
39     int hasEffect(const QString & tag, const QString & id) const;
40     QStringList effectIdInfo(const int ix) const;
41     QStringList effectNames();
42     QString getInfo(const QString & tag, const QString & id) const;
43     QString getInfoFromIndex(const int ix) const;
44     void clone(const EffectsList original);
45     void append(QDomElement e);
46     bool isEmpty() const;
47     int count() const;
48     const QDomElement at(int ix) const;
49     void removeAt(int ix);
50     QDomElement item(int ix);
51     void insert(int ix, QDomElement effect);
52     static bool hasKeyFrames(QDomElement effect);
53     static void setParameter(QDomElement effect, const QString &name, const QString &value);
54     static QString parameter(QDomElement effect, const QString &name);
55
56 private:
57     QDomElement m_baseElement;
58
59 };
60
61 #endif