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 ***************************************************************************/
28 const int FRAME_SIZE = 90;
29 const int MAXCLIPDURATION = 15000;
31 enum OPERATIONTYPE { NONE = 0, MOVE = 1, RESIZESTART = 2, RESIZEEND = 3, FADEIN = 4, FADEOUT = 5, TRANSITIONSTART = 6, TRANSITIONEND = 7, MOVEGUIDE = 8, KEYFRAME = 9, SEEK = 10, SPACER = 11, RUBBERSELECTION = 12};
32 enum CLIPTYPE { UNKNOWN = 0, AUDIO = 1, VIDEO = 2, AV = 3, COLOR = 4, IMAGE = 5, TEXT = 6, SLIDESHOW = 7, VIRTUAL = 8, PLAYLIST = 9, FOLDER = 10};
33 enum GRAPHICSRECTITEM { AVWIDGET = 70000 , LABELWIDGET , TRANSITIONWIDGET , GROUPWIDGET};
35 enum PROJECTTOOL { SELECTTOOL = 0 , RAZORTOOL = 1 , SPACERTOOL = 2 };
38 /** TRANSITIONTYPE: between 0-99: video trans, 100-199: video+audio trans, 200-299: audio trans */
40 COMPOSITE_TRANSITION = 1,
42 LUMAFILE_TRANSITION = 3,
48 OperationCompletedMessage,
53 enum TRACKTYPE { AUDIOTRACK = 0, VIDEOTRACK = 1 };
69 struct MltVideoProfile {
77 int sample_aspect_num;
78 int sample_aspect_den;
79 int display_aspect_num;
80 int display_aspect_den;
84 class EffectParameter {
86 EffectParameter(const QString name, const QString value): m_name(name), m_value(value) {}
87 QString name() const {
90 QString value() const {
93 void setValue(const QString value) {
102 /** Use our own list for effect parameters so that they are not sorted in any ways, because
103 some effects like sox need a precise order
105 class EffectsParameterList: public QList < EffectParameter > {
107 EffectsParameterList(): QList < EffectParameter >() {}
108 bool hasParam(const QString name) const {
109 for (int i = 0; i < size(); i++)
110 if (at(i).name() == name) return true;
113 QString paramValue(const QString name, QString defaultValue = QString()) const {
114 for (int i = 0; i < size(); i++) {
115 if (at(i).name() == name) return at(i).value();
119 void addParam(const QString &name, const QString &value) {
120 if (name.isEmpty()) return;
121 append(EffectParameter(name, value));
123 void removeParam(const QString name) {
124 for (int i = 0; i < size(); i++)
125 if (at(i).name() == name) {
132 class CommentedTime {
134 CommentedTime(): t(GenTime(0)) {}
135 CommentedTime(const GenTime time, QString comment)
136 : t(time), c(comment) { }
138 QString comment() const {
139 return (c.isEmpty() ? i18n("Marker") : c);
141 GenTime time() const {
144 void setComment(QString comm) {
148 /* Implementation of > operator; Works identically as with basic types. */
149 bool operator>(CommentedTime op) const {
150 return t > op.time();
152 /* Implementation of < operator; Works identically as with basic types. */
153 bool operator<(CommentedTime op) const {
154 return t < op.time();
156 /* Implementation of >= operator; Works identically as with basic types. */
157 bool operator>=(CommentedTime op) const {
158 return t >= op.time();
160 /* Implementation of <= operator; Works identically as with basic types. */
161 bool operator<=(CommentedTime op) const {
162 return t <= op.time();
164 /* Implementation of == operator; Works identically as with basic types. */
165 bool operator==(CommentedTime op) const {
166 return t == op.time();
168 /* Implementation of != operator; Works identically as with basic types. */
169 bool operator!=(CommentedTime op) const {
170 return t != op.time();