1 /***************************************************************************
2 transition.h - description
4 begin : Tue Jan 24 2006
5 copyright : (C) 2006 by Jean-Baptiste Mardelle
7 ***************************************************************************/
9 /***************************************************************************
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. *
16 ***************************************************************************/
22 #include <QGraphicsRectItem>
28 #include "definitions.h"
31 /**Describes a Transition, with a name, parameters keyframes, etc.
32 *@author Jean-Baptiste Mardelle
40 Transition(ClipItem * clipa, const TRANSITIONTYPE & type, const GenTime &startTime, const GenTime &endTime, bool inverted = false);
41 Transition(ClipItem * clip, QDomElement transitionElement, GenTime offset = GenTime());
44 /** Returns an XML representation of this transition. */
47 GenTime transitionStartTime() const;
48 GenTime transitionEndTime() const;
49 /** Return the track number of transition in the playlist*/
50 int transitionStartTrack() const;
51 int transitionEndTrack() const;
53 bool hasClip(const ClipItem * clip) const;
54 bool belongsToClip(const ClipItem * clip) const;
55 void resizeTransitionEnd(GenTime time);
56 void resizeTransitionStart(GenTime time);
57 void moveTransition(GenTime time);
58 bool invertTransition() const;
59 TRANSITIONTYPE transitionType() const;
60 QString transitionTag() const;
61 QString transitionName() const;
62 void setTransitionType(TRANSITIONTYPE newType);
63 const QMap < QString, QString > transitionParameters() const;
64 void setTransitionParameters(const QMap < QString, QString > parameters);
65 void setTransitionDirection(bool inv);
66 int transitionTrack() const;
67 void setTransitionTrack(int track);
68 QPixmap transitionPixmap() const;
69 Transition *reparent(ClipItem * clip);
71 GenTime transitionDuration() const;
72 const ClipItem *referencedClip() const;
76 GenTime m_transitionStart;
77 GenTime m_transitionDuration;
78 QMap < QString, QString > m_transitionParameters;
80 /** The name of the transition used by mlt (composite, luma,...)*/
81 TRANSITIONTYPE m_transitionType;
83 /** The name of the transition to be displayed to user */
84 QString m_transitionName;
86 /** Should the transition be reversed */
87 bool m_invertTransition;
91 /** The track to which the transition is attached*/
94 /** The clip to which the transition is attached */
95 ClipItem *m_referenceClip;
97 /** The 2nd clip to which the transition is attached */
98 ClipItem *m_secondClip;
99 int m_transitionTrack;
101 /** Return the display name for a transition type */
102 QString getTransitionName(const TRANSITIONTYPE & type);
104 /** Return the transition type for a given name */
105 TRANSITIONTYPE getTransitionForName(const QString & type);