]> git.sesse.net Git - kdenlive/blob - src/customtrackscene.h
Introducing timeline edit mode, starting with overwrite mode (allows to move a clip...
[kdenlive] / src / customtrackscene.h
1 /***************************************************************************
2  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20
21 #ifndef CUSTOMTRACKSCENE_H
22 #define CUSTOMTRACKSCENE_H
23
24 #include <QList>
25 #include <QGraphicsScene>
26 #include <QPixmap>
27
28 #include "gentime.h"
29
30 class KdenliveDoc;
31 class MltVideoProfile;
32
33 /** This class holds all scene properties that need to be used by clip items */
34
35 enum EDITMODE { NORMALEDIT = 0 , OVERWRITEEDIT = 1 , INSERTEDIT = 2 };
36
37 class CustomTrackScene : public QGraphicsScene
38 {
39     Q_OBJECT
40
41 public:
42     explicit CustomTrackScene(KdenliveDoc *doc, QObject *parent = 0);
43     virtual ~ CustomTrackScene();
44     void setSnapList(QList <GenTime> snaps);
45     GenTime previousSnapPoint(GenTime pos) const;
46     GenTime nextSnapPoint(GenTime pos) const;
47     double getSnapPointForPos(double pos, bool doSnap = true);
48     void setScale(double scale, double vscale);
49     QPointF scale() const;
50     int tracksCount() const;
51     MltVideoProfile profile() const;
52     void setEditMode(EDITMODE mode);
53     EDITMODE editMode() const;
54
55 private:
56     KdenliveDoc *m_document;
57     QList <GenTime> m_snapPoints;
58     QPointF m_scale;
59     EDITMODE m_editMode;
60 };
61
62 #endif
63