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();
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, 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());
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);
107 /** @brief Reloads information about custom effects. */
108 static void parseCustomEffectsFile();
111 initEffects(); // disable the constructor
112 static initEffectsThumbnailer thumbnailer;