]> git.sesse.net Git - kdenlive/blob - src/initeffects.h
Fix label
[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(const 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,
81                                           const QString &name,
82                                           const QString &tag,
83                                           const QString &type,
84                                           const QString &def = QString(),
85                                           const QString &min = QString(),
86                                           const QString &max = QString(),
87                                           const QString &list = QString(),
88                                           const QString &listdisplaynames = QString(),
89                                           const QString &factor = QString(),
90                                           const QString &namedesc = QString(),
91                                           const QString &format = QString(),
92                                           const QString &opacity = QString());
93
94     /** @brief Parses a file to record information about one or more effects.
95      * @param customEffectList list of custom effect
96      * @param audioEffectList list of audio effects
97      * @param videoEffectList list of video effects
98      * @param name file name
99      * @param filtersList list of filters in the MLT repository
100      * @param producersList list of producers in the MLT repository
101      * @param repository MLT repository */
102     static void parseEffectFile(EffectsList *customEffectList,
103                                 EffectsList *audioEffectList,
104                                 EffectsList *videoEffectList,
105                                 const QString &name, QStringList filtersList,
106                                 QStringList producersList,
107                                 Mlt::Repository *repository);
108
109     /** @brief Reloads information about custom effects. */
110     static void parseCustomEffectsFile();
111
112 private:
113     initEffects(); // disable the constructor
114     static initEffectsThumbnailer thumbnailer;
115 };
116
117
118 #endif