]> git.sesse.net Git - kdenlive/blob - src/transition.h
removed wrong functions from transition.{cpp,h}
[kdenlive] / src / transition.h
1 /***************************************************************************
2                           transition.h  -  description
3                              -------------------
4     begin                : Tue Jan 24 2006
5     copyright            : (C) 2006 by Jean-Baptiste Mardelle
6     email                : jb@ader.ch
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
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.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #ifndef TRANSITION_H
19 #define TRANSITION_H
20
21 #include <QString>
22 #include <QGraphicsRectItem>
23 #include <QPixmap>
24 #include <qdom.h>
25 #include <QMap>
26
27 #include "gentime.h"
28 #include "definitions.h"
29 #include "abstractclipitem.h"
30
31 /**Describes a Transition, with a name, parameters keyframes, etc.
32   *@author Jean-Baptiste Mardelle
33   */
34
35 class ClipItem;
36
37 class Transition : public AbstractClipItem {
38     Q_OBJECT
39 public:
40
41     Transition(const QRectF&, ClipItem * clipa, const TRANSITIONTYPE & type, const GenTime &startTime, const GenTime &endTime, double fps, bool inverted = false);
42     Transition(const QRectF&, ClipItem * clip, QDomElement transitionElement, double fps, GenTime offset = GenTime());
43     virtual ~Transition();
44     virtual void paint(QPainter *painter,
45                        const QStyleOptionGraphicsItem *option,
46                        QWidget *widget);
47     virtual int type() const;
48     /** Returns an XML representation of this transition. */
49     QDomElement toXML();
50
51     GenTime transitionStartTime() const;
52     GenTime transitionEndTime() const;
53     /** Return the track number of transition in the playlist*/
54     int transitionStartTrack() const;
55     int transitionEndTrack() const;
56     Transition *clone();
57     bool hasClip(const ClipItem * clip) const;
58     bool belongsToClip(const ClipItem * clip) const;
59     void resizeTransitionEnd(GenTime time);
60     void resizeTransitionStart(GenTime time);
61     void moveTransition(GenTime time);
62     bool invertTransition() const;
63     TRANSITIONTYPE transitionType() const;
64     OPERATIONTYPE operationMode(QPointF pos, double scale);
65     QString transitionTag() const;
66     QString transitionName() const;
67     void setTransitionType(TRANSITIONTYPE newType);
68     const QMap < QString, QString > transitionParameters() const;
69     void setTransitionParameters(const QMap < QString, QString > parameters);
70     void setTransitionDirection(bool inv);
71     int transitionTrack() const;
72     void setTransitionTrack(int track);
73     QPixmap transitionPixmap() const;
74     Transition *reparent(ClipItem * clip);
75     bool isValid() const;
76     GenTime transitionDuration() const;
77     const ClipItem *referencedClip() const;
78
79 private:
80
81     GenTime m_transitionStart;
82     GenTime m_transitionDuration;
83     QMap < QString, QString > m_transitionParameters;
84
85     /** The name of the transition used by mlt (composite, luma,...)*/
86     TRANSITIONTYPE m_transitionType;
87
88     /** The name of the transition to be displayed to user */
89     QString m_transitionName;
90
91     /** Should the transition be reversed */
92     bool m_invertTransition;
93
94     bool m_singleClip;
95
96     /** The track to which the transition is attached*/
97     int m_track;
98
99     /** The clip to which the transition is attached */
100     ClipItem *m_referenceClip;
101
102     /** The 2nd clip to which the transition is attached */
103     ClipItem *m_secondClip;
104     int m_transitionTrack;
105
106     /** Return the display name for a transition type */
107     QString getTransitionName(const TRANSITIONTYPE & type);
108
109     /** Return the transition type for a given name */
110     TRANSITIONTYPE getTransitionForName(const QString & type);
111 };
112
113 #endif