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>
24 #include <QDomElement>
28 #include "definitions.h"
29 #include "abstractclipitem.h"
32 /**Describes a Transition, with a name, parameters keyframes, etc.
33 *@author Jean-Baptiste Mardelle
38 class Transition : public AbstractClipItem
43 Transition(const ItemInfo info, int transitiontrack, double fps, QDomElement params = QDomElement(), bool automaticTransition = false);
44 virtual ~Transition();
45 virtual void paint(QPainter *painter,
46 const QStyleOptionGraphicsItem *option,
48 virtual int type() const;
49 /** Returns an XML representation of this transition. */
52 /** Return the track number of transition in the playlist*/
53 int transitionEndTrack() const;
54 bool hasClip(const ClipItem * clip) const;
55 bool belongsToClip(const ClipItem * clip) const;
56 bool invertedTransition() const;
57 QString transitionTag() const;
58 QStringList transitionInfo() const;
59 OPERATIONTYPE operationMode(QPointF pos);
60 //const QMap < QString, QString > transitionParameters() const;
61 void setTransitionParameters(const QDomElement params);
62 void setTransitionDirection(bool inv);
63 void setTransitionTrack(int track);
64 //Transition *reparent(ClipItem * clip);
66 /** Transition should be linked to another track */
67 void updateTransitionEndTrack(int newtrack);
68 void setForcedTrack(bool force, int track);
69 bool forcedTrack() const;
70 const ClipItem *referencedClip() const;
72 bool isAutomatic() const;
73 void setAutomatic(bool automatic);
75 int defaultZValue() const;
78 virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
82 bool m_forceTransitionTrack;
84 /** true if the transition was added automatically and should be moved with its clip */
85 bool m_automaticTransition;
86 /** contains the transition parameters */
87 QDomElement m_parameters;
88 /** The clip to which the transition is attached */
89 ClipItem *m_referenceClip;
91 /** The 2nd clip to which the transition is attached */
92 ClipItem *m_secondClip;
93 int m_transitionTrack;
95 /** Return the display name for a transition type */
96 QString getTransitionName(const TRANSITIONTYPE & type);
98 /** Return the transition type for a given name */
99 TRANSITIONTYPE getTransitionForName(const QString & type);
101 #if QT_VERSION >= 0x040600
102 QPropertyAnimation *m_startAnimation;