1 /***************************************************************************
2 initeffects.h - description
5 copyright : (C) 2006 by Jean-Baptiste Mardelle
7 ***************************************************************************/
9 /***************************************************************************
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. *
16 ***************************************************************************/
22 #include <QDomDocument>
24 #include <mlt++/Mlt.h>
27 /**Init the MLT effects
28 *@author Jean-Baptiste Mardelle
33 class initEffectsThumbnailer : public QThread
37 initEffectsThumbnailer();
38 void prepareThumbnailsCall(const QStringList&);
49 /** @brief Fills the effects and transitions lists.
50 * @ref fillTransitionsList
51 * @ref parseEffectFile
52 * @return pointer to the MLT repository
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);
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
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,
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());
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);
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);
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);
121 initEffects(); // disable the constructor
122 static initEffectsThumbnailer thumbnailer;