]> git.sesse.net Git - kdenlive/blob - src/definitions.h
* Guides improvements and fixes
[kdenlive] / src / definitions.h
1 /***************************************************************************
2  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
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.                                   *
8  *                                                                         *
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.                          *
13  *                                                                         *
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  ***************************************************************************/
19
20
21 #ifndef DEFINITIONS_H
22 #define DEFINITIONS_H
23
24 #include <KLocale>
25
26 #include "gentime.h"
27
28 #define FRAME_SIZE 90
29 #define MAXCLIPDURATION 15000
30
31 enum OPERATIONTYPE { NONE = 0, MOVE = 1, RESIZESTART = 2, RESIZEEND = 3, FADEIN = 4, FADEOUT = 5, TRANSITIONSTART = 6, TRANSITIONEND = 7, MOVEGUIDE = 8, KEYFRAME = 9};
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 };
34
35 enum PROJECTTOOL { SELECTTOOL = 0 , RAZORTOOL = 1 };
36
37 enum TRANSITIONTYPE {
38     /** TRANSITIONTYPE: between 0-99: video trans, 100-199: video+audio trans, 200-299: audio trans */
39     LUMA_TRANSITION = 0,
40     COMPOSITE_TRANSITION = 1,
41     PIP_TRANSITION = 2,
42     LUMAFILE_TRANSITION = 3,
43     MIX_TRANSITION = 200
44 };
45
46 enum MessageType {
47     DefaultMessage,
48     OperationCompletedMessage,
49     InformationMessage,
50     ErrorMessage
51 };
52
53 enum TRACKTYPE { AUDIOTRACK = 0, VIDEOTRACK = 1 };
54
55 struct TrackInfo {
56     TRACKTYPE type;
57     bool isMute;
58     bool isBlind;
59 };
60
61 struct ItemInfo {
62     GenTime startPos;
63     GenTime endPos;
64     int track;
65 };
66
67 struct MltVideoProfile {
68     QString path;
69     QString description;
70     int frame_rate_num;
71     int frame_rate_den;
72     int width;
73     int height;
74     bool progressive;
75     int sample_aspect_num;
76     int sample_aspect_den;
77     int display_aspect_num;
78     int display_aspect_den;
79 };
80
81 class CommentedTime {
82 public:
83     CommentedTime(): t(GenTime(0)) {}
84     CommentedTime(const GenTime time, QString comment)
85             : t(time), c(comment) { }
86
87     QString comment()   const          {
88         return (c.isEmpty() ? i18n("Marker") : c);
89     }
90     GenTime time() const          {
91         return t;
92     }
93     void    setComment(QString comm) {
94         c = comm;
95     }
96
97     /* Implementation of > operator; Works identically as with basic types. */
98     bool operator>(CommentedTime op) const {
99         return t > op.time();
100     }
101     /* Implementation of < operator; Works identically as with basic types. */
102     bool operator<(CommentedTime op) const {
103         return t < op.time();
104     }
105     /* Implementation of >= operator; Works identically as with basic types. */
106     bool operator>=(CommentedTime op) const {
107         return t >= op.time();
108     }
109     /* Implementation of <= operator; Works identically as with basic types. */
110     bool operator<=(CommentedTime op) const {
111         return t <= op.time();
112     }
113     /* Implementation of == operator; Works identically as with basic types. */
114     bool operator==(CommentedTime op) const {
115         return t == op.time();
116     }
117     /* Implementation of != operator; Works identically as with basic types. */
118     bool operator!=(CommentedTime op) const {
119         return t != op.time();
120     }
121
122 private:
123     GenTime t;
124     QString c;
125
126
127 };
128 #endif