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>
26 #include <QLinearGradient>
29 #include "definitions.h"
30 #include "abstractclipitem.h"
33 /**Describes a Transition, with a name, parameters keyframes, etc.
34 *@author Jean-Baptiste Mardelle
39 class Transition : public AbstractClipItem {
43 Transition(const ItemInfo info, int transitiontrack, double fps, QDomElement params = QDomElement());
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 transitionName() const;
58 QString transitionTag() 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 QPixmap transitionPixmap() const;
65 //Transition *reparent(ClipItem * clip);
67 /** Transition should be linked to another track */
68 void updateTransitionEndTrack(int newtrack);
69 const ClipItem *referencedClip() const;
73 virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
77 QLinearGradient m_gradient;
79 /** contains the transition parameters */
80 QDomElement m_parameters;
81 /** The clip to which the transition is attached */
82 ClipItem *m_referenceClip;
84 /** The 2nd clip to which the transition is attached */
85 ClipItem *m_secondClip;
86 int m_transitionTrack;
88 /** Return the display name for a transition type */
89 QString getTransitionName(const TRANSITIONTYPE & type);
91 /** Return the transition type for a given name */
92 TRANSITIONTYPE getTransitionForName(const QString & type);