]> git.sesse.net Git - kdenlive/blob - src/trackview.h
some more ui work, fit zoom to project
[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 <QVBoxLayout>
26 #include <KRuler>
27 #include <QGroupBox>
28 #include <QGraphicsScene>
29 #include <QGraphicsLineItem>
30
31 #define FRAME_SIZE 90
32
33 #include "ui_timeline_ui.h"
34 #include "customruler.h"
35 #include "kdenlivedoc.h"
36 #include "customtrackview.h"
37 class ClipItem;
38
39 class TrackView : public QWidget {
40     Q_OBJECT
41
42 public:
43     TrackView(KdenliveDoc *doc, QWidget *parent = 0);
44
45     const double zoomFactor() const;
46     const int mapLocalToValue(int x) const;
47     void setEditMode(const QString & editMode);
48     const QString & editMode() const;
49     QGraphicsScene *projectScene();
50     CustomTrackView *projectView();
51     int duration() const;
52     int tracksNumber() const;
53     KdenliveDoc *document();
54     void refresh() ;
55     int outPoint() const;
56     int inPoint() const;
57     int currentZoom() const;
58     int fitZoom() const;
59
60 public slots:
61     void slotDeleteClip(int clipId);
62     void slotChangeZoom(int factor);
63     void setDuration(int dur);
64
65 private:
66     Ui::TimeLine_UI *view;
67     CustomRuler *m_ruler;
68     CustomTrackView *m_trackview;
69     double m_scale;
70     int m_projectTracks;
71     QString m_editMode;
72     QGraphicsScene *m_scene;
73     uint m_currentZoom;
74
75     KdenliveDoc *m_doc;
76     QVBoxLayout *m_tracksLayout;
77     QVBoxLayout *m_headersLayout;
78     QScrollArea *m_scrollArea;
79     QFrame *m_scrollBox;
80     QVBoxLayout *m_tracksAreaLayout;
81     void parseDocument(QDomDocument doc);
82     int slotAddAudioTrack(int ix, QDomElement xml);
83     int slotAddVideoTrack(int ix, QDomElement xml);
84
85 private slots:
86     void setCursorPos(int pos);
87     void moveCursorPos(int pos);
88     void slotClipItemSelected(ClipItem*);
89
90 signals:
91     void mousePosition(int);
92     void cursorMoved();
93     void clipItemSelected(ClipItem*);
94 };
95
96 #endif