1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
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. *
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. *
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 ***************************************************************************/
24 #include <QScrollArea>
25 #include <QVBoxLayout>
28 #include <QGraphicsScene>
29 #include <QGraphicsLineItem>
33 #include "ui_timeline_ui.h"
34 #include "customruler.h"
35 #include "kdenlivedoc.h"
36 #include "customtrackview.h"
40 class TrackView : public QWidget {
44 TrackView(KdenliveDoc *doc, QWidget *parent = 0);
46 const double zoomFactor() const;
47 const int mapLocalToValue(int x) const;
48 void setEditMode(const QString & editMode);
49 const QString & editMode() const;
50 QGraphicsScene *projectScene();
51 CustomTrackView *projectView();
53 int tracksNumber() const;
54 KdenliveDoc *document();
58 int currentZoom() const;
62 void slotDeleteClip(int clipId);
63 void slotChangeZoom(int factor);
64 void setDuration(int dur);
67 Ui::TimeLine_UI *view;
69 CustomTrackView *m_trackview;
73 QGraphicsScene *m_scene;
77 QVBoxLayout *m_tracksLayout;
78 QVBoxLayout *m_headersLayout;
79 QScrollArea *m_scrollArea;
81 QVBoxLayout *m_tracksAreaLayout;
82 void parseDocument(QDomDocument doc);
83 int slotAddAudioTrack(int ix, QDomElement xml);
84 int slotAddVideoTrack(int ix, QDomElement xml);
87 void setCursorPos(int pos);
88 void moveCursorPos(int pos);
89 void slotClipItemSelected(ClipItem*);
90 void slotTransitionItemSelected(Transition*);
93 void mousePosition(int);
95 void clipItemSelected(ClipItem*);
96 void transitionItemSelected(Transition*);