]> git.sesse.net Git - kdenlive/blob - src/trackview.h
Zoom through vertical move in timeline ruler:
[kdenlive] / src / trackview.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 TRACKVIEW_H
22 #define TRACKVIEW_H
23
24 #include <QScrollArea>
25 #include <KRuler>
26 #include <QGroupBox>
27 #include <QGraphicsScene>
28 #include <QGraphicsLineItem>
29 #include <QDomElement>
30
31
32 #include "customtrackscene.h"
33 #include "ui_timeline_ui.h"
34
35 class ClipItem;
36 class Transition;
37 class CustomTrackView;
38 class KdenliveDoc;
39 class CustomRuler;
40 class DocClipBase;
41
42 class TrackView : public QWidget, public Ui::TimeLine_UI
43 {
44     Q_OBJECT
45
46 public:
47     explicit TrackView(KdenliveDoc *doc, bool *ok, QWidget *parent = 0);
48     virtual ~ TrackView();
49     void setEditMode(const QString & editMode);
50     const QString & editMode() const;
51     QGraphicsScene *projectScene();
52     CustomTrackView *projectView();
53     int duration() const;
54     int tracksNumber() const;
55     KdenliveDoc *document();
56     void refresh() ;
57     void updateProjectFps();
58     int outPoint() const;
59     int inPoint() const;
60     int fitZoom() const;
61
62 public slots:
63     void slotDeleteClip(const QString &clipId);
64     void slotChangeZoom(int horizontal, int vertical = -1);
65     void setDuration(int dur);
66     void slotSetZone(QPoint p);
67
68 private:
69     CustomRuler *m_ruler;
70     CustomTrackView *m_trackview;
71     QList <QString> m_invalidProducers;
72     double m_scale;
73     int m_projectTracks;
74     QString m_editMode;
75     CustomTrackScene *m_scene;
76
77     KdenliveDoc *m_doc;
78     int m_verticalZoom;
79     QString m_documentErrors;
80     void parseDocument(QDomDocument doc);
81     int slotAddProjectTrack(int ix, QDomElement xml, bool locked);
82     DocClipBase *getMissingProducer(const QString id) const;
83     void adjustTrackHeaders();
84
85 private slots:
86     void setCursorPos(int pos);
87     void moveCursorPos(int pos);
88     void slotRebuildTrackHeaders();
89     void slotChangeTrackLock(int ix, bool lock);
90     void slotVerticalZoomDown();
91     void slotVerticalZoomUp();
92     void slotRenameTrack(int ix);
93
94 signals:
95     void mousePosition(int);
96     void cursorMoved();
97     void zoneMoved(int, int);
98     void insertTrack(int);
99     void deleteTrack(int);
100     void changeTrack(int);
101     void renameTrack(int);
102     void setZoom(int);
103 };
104
105 #endif