definitions.h 7.17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/***************************************************************************
 *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
 ***************************************************************************/


21 22 23
#ifndef DEFINITIONS_H
#define DEFINITIONS_H

24
#include "gentime.h"
Vincent Pinon's avatar
Vincent Pinon committed
25
#include "effectslist/effectslist.h"
26

27
#include <QDebug>
28

29
#include <QTreeWidgetItem>
Vincent Pinon's avatar
Vincent Pinon committed
30
#include <QString>
31

32
const int MAXCLIPDURATION = 15000;
33

34
namespace Kdenlive {
35 36 37 38 39 40 41 42 43 44

enum MonitorId {
    NoMonitor,
    ClipMonitor,
    ProjectMonitor,
    RecordMonitor,
    StopMotionMonitor,
    DvdMonitor
};

45
const int DefaultThumbHeight = 100;
46 47 48 49 50 51 52
/*
const QString clipMonitor("clipMonitor");
const QString recordMonitor("recordMonitor");
const QString projectMonitor("projectMonitor");
const QString stopmotionMonitor("stopmotionMonitor");
*/

53 54
}

55 56


57 58
enum OperationType {
    None = 0,
59
    WaitingForConfirm,
60 61 62 63 64 65 66 67 68 69 70 71 72
    MoveOperation,
    ResizeStart,
    ResizeEnd,
    FadeIn,
    FadeOut,
    TransitionStart,
    TransitionEnd,
    MoveGuide,
    KeyFrame,
    Seek,
    Spacer,
    RubberSelection,
    ScrollTimeline,
73 74
    ZoomTimeline,
    ContextMenu
75 76
};

77 78 79 80 81 82 83 84 85 86
namespace PlaylistState {

    enum ClipState {
	Original = 0,
	VideoOnly = 1,
	AudioOnly = 2
    };

};

87 88 89 90 91 92 93 94 95 96
enum ClipType {
    Unknown = 0,
    Audio = 1,
    Video = 2,
    AV = 3,
    Color = 4,
    Image = 5,
    Text = 6,
    SlideShow = 7,
    Virtual = 8,
97
    Playlist = 9,
98 99
    WebVfx = 10,
    TextTemplate = 11,
100
};
101

102 103 104 105 106
enum ProjectItemType {
    ProjectClipType = QTreeWidgetItem::UserType,
    ProjectFoldeType,
    ProjectSubclipType
};
107

108 109 110 111 112 113
enum GraphicsRectItem {
    AVWidget = 70000,
    LabelWidget,
    TransitionWidget,
    GroupWidget
};
114

115 116 117 118 119
enum ProjectTool {
    SelectTool = 0,
    RazorTool = 1,
    SpacerTool = 2
};
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
120

121 122 123 124 125 126 127
enum MonitorSceneType {
    MonitorSceneNone = 0,
    MonitorSceneGeometry,
    MonitorSceneCorners,
    MonitorSceneRoto
};

128
enum TransitionType {
129
    /** TRANSITIONTYPE: between 0-99: video trans, 100-199: video+audio trans, 200-299: audio trans */
130 131 132 133 134
    LumaTransition = 0,
    CompositeTransition = 1,
    PipTransition = 2,
    LumaFileTransition = 3,
    MixTransition = 200
135 136
};

137 138
enum MessageType {
    DefaultMessage,
139
    ProcessingJobMessage,
140 141
    OperationCompletedMessage,
    InformationMessage,
142 143
    ErrorMessage,
    MltError
144 145
};

146 147 148 149
enum TrackType {
    AudioTrack = 0,
    VideoTrack = 1
};
150

151 152 153 154 155 156 157 158
enum ClipJobStatus {
    NoJob = 0,
    JobWaiting = -1,
    JobWorking = -2,
    JobDone = -3,
    JobCrashed = -4,
    JobAborted = -5
};
159

160
class TrackInfo {
161

162
public:
163
    TrackType type;
164
    QString trackName;
165 166
    bool isMute;
    bool isBlind;
167
    bool isLocked;
168
    bool composite;
169
    int duration;
170
    EffectsList effectsList;
171
    TrackInfo() :
172
        type(VideoTrack),
173 174 175
        isMute(0),
        isBlind(0),
        isLocked(0),
176
        composite(0),
177
        duration(0),
178
        effectsList(true) {}
179 180 181 182 183 184
};


struct ProfileInfo {
        QSize profileSize;
        double profileFps;
185 186
};

187 188 189 190 191 192 193 194 195 196 197 198
struct requestClipInfo {
    QDomElement xml;
    QString clipId;
    int imageHeight;
    bool replaceProducer;

    bool operator==(const requestClipInfo &a)
    {
        return clipId == a.clipId;
    }
};

199
typedef QMap<QString, QString> stringMap;
200
typedef QMap <int, QMap <int, QByteArray> > audioByteArray;
Vincent Pinon's avatar
Vincent Pinon committed
201
typedef QVector<qint16> audioShortVector;
202

203 204
class ItemInfo {
public:
205
    /** startPos is the position where the clip starts on the track */
206
    GenTime startPos;
207
    /** endPos is the duration where the clip ends on the track */
208
    GenTime endPos;
209
    /** cropStart is the position where the sub-clip starts, relative to the clip's 0 position */
210
    GenTime cropStart;
211
    /** cropDuration is the duration of the clip */
212
    GenTime cropDuration;
213
    /** Track number */
214
    int track;
Laurent Montel's avatar
Laurent Montel committed
215
    ItemInfo() : track(0) {}
216 217
};

218 219
class TransitionInfo {
public:
220
    /** startPos is the position where the clip starts on the track */
221 222 223 224 225 226 227 228 229
    GenTime startPos;
    /** endPos is the duration where the clip ends on the track */
    GenTime endPos;
    /** the track on which the transition is (b_track)*/
    int b_track;
    /** the track on which the transition is applied (a_track)*/
    int a_track;
    /** Does the user request for a special a_track */
    bool forceTrack;
230 231 232
    TransitionInfo() :
        b_track(0),
        a_track(0),
Laurent Montel's avatar
Laurent Montel committed
233
        forceTrack(0) {}
234 235
};

236 237
class MltVideoProfile {
public:
238 239 240 241 242 243 244 245 246 247 248
    QString path;
    QString description;
    int frame_rate_num;
    int frame_rate_den;
    int width;
    int height;
    bool progressive;
    int sample_aspect_num;
    int sample_aspect_den;
    int display_aspect_num;
    int display_aspect_den;
249
    int colorspace;
250 251 252
    MltVideoProfile();
    bool operator==(const MltVideoProfile& point) const;
    bool operator!=(const MltVideoProfile &other) const;
253 254
};

255

256

257 258
class CommentedTime
{
259
public:
260 261
    CommentedTime();
    CommentedTime(const GenTime &time, const QString& comment, int markerType = 0);
262
    CommentedTime(const QString& hash, const GenTime &time);
263

264
    QString comment() const;
265
    GenTime time() const;
266 267
    /** @brief Returns a string containing infos needed to store marker info. string equals marker type + ":" + marker comment */
    QString hash() const;
268 269 270 271
    void    setComment(const QString &comm);
    void setMarkerType(int t);
    int markerType() const;
    static QColor markerColor(int type);
272 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;
279
    /* Implementation of <= operator; Works identically as with basic types. */
280
    bool operator<=(CommentedTime op) const;
281
    /* Implementation of == operator; Works identically as with basic types. */
282
    bool operator==(CommentedTime op) const;
283
    /* Implementation of != operator; Works identically as with basic types. */
284
    bool operator!=(CommentedTime op) const;
285

286 287 288
private:
    GenTime t;
    QString c;
289
    int type;
290
};
291

292 293
QDebug operator << (QDebug qd, const ItemInfo &info);

294
#endif