]> git.sesse.net Git - kdenlive/blob - src/transition.h
several transition move fixes
[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 <QDomElement>
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 ItemInfo info, int transitiontrack, double scale, double fps, QDomElement params = QDomElement());
42     virtual ~Transition();
43     virtual void paint(QPainter *painter,
44                        const QStyleOptionGraphicsItem *option,
45                        QWidget *widget);
46     virtual int type() const;
47     /** Returns an XML representation of this transition. */
48     QDomElement toXML();
49
50     /** Return the track number of transition in the playlist*/
51     int transitionEndTrack() const;
52     Transition *clone();
53     bool hasClip(const ClipItem * clip) const;
54     bool belongsToClip(const ClipItem * clip) const;
55     bool invertedTransition() const;
56     QString transitionName() const;
57     QString transitionTag() const;
58     OPERATIONTYPE operationMode(QPointF pos, double scale);
59     //const QMap < QString, QString > transitionParameters() const;
60     void setTransitionParameters(const QDomElement params);
61     void setTransitionDirection(bool inv);
62     void setTransitionTrack(int track);
63     QPixmap transitionPixmap() const;
64     //Transition *reparent(ClipItem * clip);
65     bool isValid() const;
66     /** Transition should be linked to another track */
67     void updateTransitionEndTrack(int newtrack);
68
69     const ClipItem *referencedClip() const;
70
71 private:
72     bool m_singleClip;
73     QString m_name;
74     /** contains the transition parameters */
75     QDomElement m_parameters;
76     /** The clip to which the transition is attached */
77     ClipItem *m_referenceClip;
78
79     /** The 2nd clip to which the transition is attached */
80     ClipItem *m_secondClip;
81     int m_transitionTrack;
82
83     /** Return the display name for a transition type */
84     QString getTransitionName(const TRANSITIONTYPE & type);
85
86     /** Return the transition type for a given name */
87     TRANSITIONTYPE getTransitionForName(const QString & type);
88 };
89
90 #endif