1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
25 #include "effectslist.h"
27 #include <KLocalizedString>
30 #include <QTreeWidgetItem>
31 #include <QtCore/QString>
33 const int MAXCLIPDURATION = 15000;
46 const int DefaultThumbHeight = 100;
48 const QString clipMonitor("clipMonitor");
49 const QString recordMonitor("recordMonitor");
50 const QString projectMonitor("projectMonitor");
51 const QString stopmotionMonitor("stopmotionMonitor");
86 enum ProjectItemType {
87 ProjectClipType = QTreeWidgetItem::UserType,
92 enum GraphicsRectItem {
105 enum TransitionType {
106 /** TRANSITIONTYPE: between 0-99: video trans, 100-199: video+audio trans, 200-299: audio trans */
108 CompositeTransition = 1,
110 LumaFileTransition = 3,
116 OperationCompletedMessage,
144 EffectsList effectsList;
154 typedef QMap<QString, QString> stringMap;
155 typedef QMap <int, QMap <int, QByteArray> > audioByteArray;
159 /** startPos is the position where the clip starts on the track */
161 /** endPos is the duration where the clip ends on the track */
163 /** cropStart is the position where the sub-clip starts, relative to the clip's 0 position */
165 /** cropDuration is the duration of the clip */
166 GenTime cropDuration;
168 ItemInfo() : track(0) {}
171 class TransitionInfo {
173 /** startPos is the position where the clip starts on the track */
175 /** endPos is the duration where the clip ends on the track */
177 /** the track on which the transition is (b_track)*/
179 /** the track on which the transition is applied (a_track)*/
181 /** Does the user request for a special a_track */
189 class MltVideoProfile {
198 int sample_aspect_num;
199 int sample_aspect_den;
200 int display_aspect_num;
201 int display_aspect_den;
204 bool operator==(const MltVideoProfile& point) const;
205 bool operator!=(const MltVideoProfile &other) const;
210 * @brief A class holding some meta info for effects widgets, like state (collapsed or not, ...)
211 * @author Jean-Baptiste Mardelle
219 bool groupIsCollapsed;
222 QString toString() const;
223 void fromString(QString value);
226 class EffectParameter
229 EffectParameter(const QString &name, const QString &value);
230 QString name() const;
231 QString value() const;
232 void setValue(const QString &value);
239 /** Use our own list for effect parameters so that they are not sorted in any ways, because
240 some effects like sox need a precise order
242 class EffectsParameterList: public QList < EffectParameter >
245 EffectsParameterList();
246 bool hasParam(const QString &name) const;
247 void setParamValue(const QString &name, const QString &value);
249 QString paramValue(const QString &name, const QString &defaultValue = QString()) const;
250 void addParam(const QString &name, const QString &value);
251 void removeParam(const QString &name);
258 CommentedTime(const GenTime &time, const QString& comment, int markerType = 0);
260 QString comment() const;
261 GenTime time() const;
262 void setComment(const QString &comm);
263 void setMarkerType(int t);
264 int markerType() const;
265 static QColor markerColor(int type);
267 /* Implementation of > operator; Works identically as with basic types. */
268 bool operator>(CommentedTime op) const;
269 /* Implementation of < operator; Works identically as with basic types. */
270 bool operator<(CommentedTime op) const;
271 /* Implementation of >= operator; Works identically as with basic types. */
272 bool operator>=(CommentedTime op) const;
273 /* Implementation of <= operator; Works identically as with basic types. */
274 bool operator<=(CommentedTime op) const;
275 /* Implementation of == operator; Works identically as with basic types. */
276 bool operator==(CommentedTime op) const;
277 /* Implementation of != operator; Works identically as with basic types. */
278 bool operator!=(CommentedTime op) const;
286 QDebug operator << (QDebug qd, const ItemInfo &info);