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 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);
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
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,
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,
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());
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 QString name, QStringList filtersList,
106 QStringList producersList,
107 Mlt::Repository *repository);
109 /** @brief Reloads information about custom effects. */
110 static void parseCustomEffectsFile();
113 initEffects(); // disable the constructor
114 static initEffectsThumbnailer thumbnailer;