]> git.sesse.net Git - kdenlive/blob - src/initeffects.h
ac5dceac3cbf7d5588390f6b8b4cccb40c4697b9
[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 Mlt::Repository *parseEffectFiles();
58     static void refreshLumas();
59     static QDomDocument createDescriptionFromMlt(Mlt::Repository* repository, const QString& type, const QString& name);
60
61     /** @brief Fills the transitions list.
62      * @param repository MLT repository
63      * @param transitions list to save the transitions data in
64      * @param names list of transitions names
65      *
66      * It creates an element for each transition, asking to MLT for information
67      * when possible, using default parameters otherwise. It also adds some
68      * "virtual" transition, and removes those not implemented. */
69     static void fillTransitionsList(Mlt::Repository *repository,
70                                     EffectsList *transitions,
71                                     QStringList names);
72
73     /** @brief Creates an element describing a transition parameter.
74      * @param doc document containing the transition element
75      * @param name parameter name
76      * @param tag parameter tag
77      * @param type parameter type (string, double, bool, etc.)
78      * @return element with the parameter information */
79     static QDomElement quickParameterFill(QDomDocument & doc, QString name,
80                                           QString tag, QString type,
81                                           QString def = QString(),
82                                           QString min = QString(),
83                                           QString max = QString(),
84                                           QString list = QString(),
85                                           QString listdisplaynames = QString(),
86                                           QString factor = QString(),
87                                           QString namedesc = QString(),
88                                           QString format = QString(),
89                                           QString opacity = QString());
90
91     /** @brief Parses a file to record information about one or more effects.
92      * @param customEffectList list of custom effect
93      * @param audioEffectList list of audio effects
94      * @param videoEffectList list of video effects
95      * @param name file name
96      * @param filtersList list of filters in the MLT repository
97      * @param producersList list of producers in the MLT repository */
98     static void parseEffectFile(EffectsList *customEffectList,
99                                 EffectsList *audioEffectList,
100                                 EffectsList *videoEffectList,
101                                 QString name, QStringList filtersList,
102                                 QStringList producersList);
103
104     /** @brief Reloads information about custom effects. */
105     static void parseCustomEffectsFile();
106     static const char* ladspaEffectString(int ladspaId, QStringList params);
107     static void ladspaEffectFile(const QString & fname, int ladspaId, QStringList params);
108
109     static const char* ladspaPitchEffectString(QStringList params);
110     static const char* ladspaReverbEffectString(QStringList params);
111     static const char* ladspaRoomReverbEffectString(QStringList params);
112     static const char* ladspaEqualizerEffectString(QStringList params);
113     static const char* ladspaDeclipEffectString(QStringList);
114     static const char* ladspaVinylEffectString(QStringList params);
115     static const char* ladspaLimiterEffectString(QStringList params);
116     static const char* ladspaPitchShifterEffectString(QStringList params);
117     static const char* ladspaPhaserEffectString(QStringList params);
118     static const char* ladspaRateScalerEffectString(QStringList params);
119
120 private:
121     initEffects(); // disable the constructor
122     static initEffectsThumbnailer thumbnailer;
123 };
124
125
126 #endif