]> git.sesse.net Git - kdenlive/blob - src/initeffects.h
Use const'ref
[kdenlive] / src / initeffects.h
1 /***************************************************************************
2                           initeffects.h  -  description
3                              -------------------
4     begin                :  Jul 2006
5     copyright            : (C) 2006 by Jean-Baptiste Mardelle
6     email                : jb@ader.ch
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 InitEffects_H
19 #define InitEffects_H
20
21 #include <klocale.h>
22 #include <QDomDocument>
23 #include <QThread>
24 #include <mlt++/Mlt.h>
25
26
27 /**Init the MLT effects
28   *@author Jean-Baptiste Mardelle
29   */
30
31 class EffectsList;
32
33 class initEffectsThumbnailer : public QThread
34 {
35     Q_OBJECT
36 public:
37     initEffectsThumbnailer();
38     void prepareThumbnailsCall(const QStringList&);
39     void run();
40 private :
41     QStringList m_list;
42
43 };
44
45 class initEffects
46 {
47 public:
48
49     /** @brief Fills the effects and transitions lists.
50      * @ref fillTransitionsList
51      * @ref parseEffectFile
52      * @return pointer to the MLT repository
53      *
54      * It checks for all available effects and transitions, removes blacklisted
55      * ones, calls fillTransitionsList() and parseEffectFile() to fill the lists
56      * (with sorted, unique items) and then fills the global lists. */
57     static void parseEffectFiles(const QString &locale = QString());
58     static void refreshLumas();
59     static QDomDocument createDescriptionFromMlt(Mlt::Repository* repository, const QString& type, const QString& name);
60     static QDomDocument getUsedCustomEffects(QMap <QString, QString> effectids);
61
62     /** @brief Fills the transitions list.
63      * @param repository MLT repository
64      * @param transitions list to save the transitions data in
65      * @param names list of transitions names
66      *
67      * It creates an element for each transition, asking to MLT for information
68      * when possible, using default parameters otherwise. It also adds some
69      * "virtual" transition, and removes those not implemented. */
70     static void fillTransitionsList(Mlt::Repository *repository,
71                                     EffectsList *transitions,
72                                     QStringList names);
73
74     /** @brief Creates an element describing a transition parameter.
75      * @param doc document containing the transition element
76      * @param name parameter name
77      * @param tag parameter tag
78      * @param type parameter type (string, double, bool, etc.)
79      * @return element with the parameter information */
80     static QDomElement quickParameterFill(QDomDocument & doc, QString name,
81                                           QString tag, QString type,
82                                           QString def = QString(),
83                                           QString min = QString(),
84                                           QString max = QString(),
85                                           QString list = QString(),
86                                           QString listdisplaynames = QString(),
87                                           QString factor = QString(),
88                                           QString namedesc = QString(),
89                                           QString format = QString(),
90                                           QString opacity = QString());
91
92     /** @brief Parses a file to record information about one or more effects.
93      * @param customEffectList list of custom effect
94      * @param audioEffectList list of audio effects
95      * @param videoEffectList list of video effects
96      * @param name file name
97      * @param filtersList list of filters in the MLT repository
98      * @param producersList list of producers in the MLT repository
99      * @param repository MLT repository */
100     static void parseEffectFile(EffectsList *customEffectList,
101                                 EffectsList *audioEffectList,
102                                 EffectsList *videoEffectList,
103                                 QString name, QStringList filtersList,
104                                 QStringList producersList,
105                                 Mlt::Repository *repository);
106
107     /** @brief Reloads information about custom effects. */
108     static void parseCustomEffectsFile();
109
110 private:
111     initEffects(); // disable the constructor
112     static initEffectsThumbnailer thumbnailer;
113 };
114
115
116 #endif