X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftrackview.h;h=6b19deb3a821137054e38b76273846b14a317e8c;hb=1a2992bda90d670e0ef1ee79f34491e54bd248aa;hp=410ecef0a208854b47b73a69744b23444a2e8562;hpb=187158b0450f465536c15cc31499bcc277d2a451;p=kdenlive diff --git a/src/trackview.h b/src/trackview.h index 410ecef0..6b19deb3 100644 --- a/src/trackview.h +++ b/src/trackview.h @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + ***************************************************************************/ + + #ifndef TRACKVIEW_H #define TRACKVIEW_H @@ -5,46 +25,56 @@ #include #include #include +#include +#include +#include #define FRAME_SIZE 90 #include "ui_timeline_ui.h" -#include "customruler.h" -#include "kdenlivedoc.h" -#include "documenttrack.h" -#include "trackpanelfunctionfactory.h" -#include "trackpanelfunction.h" - -class TrackView : public QWidget -{ - Q_OBJECT - - public: - TrackView(KdenliveDoc *doc, QWidget *parent=0); - - /** This event occurs when the mouse has been moved. */ - void mouseMoveEvent(QMouseEvent * event); + +class ClipItem; +class Transition; +class CustomTrackView; +class KdenliveDoc; +class CustomRuler; + +class TrackView : public QWidget { + Q_OBJECT + +public: + TrackView(KdenliveDoc *doc, QWidget *parent = 0); const double zoomFactor() const; - DocumentTrack *panelAt(int y); const int mapLocalToValue(int x) const; void setEditMode(const QString & editMode); const QString & editMode() const; - - public slots: + QGraphicsScene *projectScene(); + CustomTrackView *projectView(); + int duration() const; + int tracksNumber() const; KdenliveDoc *document(); + void refresh() ; + int outPoint() const; + int inPoint() const; + int currentZoom() const; + int fitZoom() const; - private: + +public slots: + void slotDeleteClip(int clipId); + void slotChangeZoom(int factor); + void setDuration(int dur); + +private: Ui::TimeLine_UI *view; CustomRuler *m_ruler; + CustomTrackView *m_trackview; double m_scale; - QList documentTracks; - int m_projectDuration; - TrackPanelFunctionFactory m_factory; - DocumentTrack *m_panelUnderMouse; - /** The currently applied function. This lasts from mousePressed until mouseRelease. */ - TrackPanelFunction *m_function; + int m_projectTracks; QString m_editMode; + QGraphicsScene *m_scene; + uint m_currentZoom; KdenliveDoc *m_doc; QVBoxLayout *m_tracksLayout; @@ -53,13 +83,21 @@ class TrackView : public QWidget QFrame *m_scrollBox; QVBoxLayout *m_tracksAreaLayout; void parseDocument(QDomDocument doc); - int slotAddAudioTrack(int ix, QDomElement xml); - int slotAddVideoTrack(int ix, QDomElement xml); - void registerFunction(const QString & name, TrackPanelFunction * function); - TrackPanelFunction *getApplicableFunction(DocumentTrack * panel, const QString & editMode, QMouseEvent * event); + int slotAddProjectTrack(int ix, QDomElement xml, bool videotrack); - private slots: - void slotChangeZoom(int factor); +private slots: + void setCursorPos(int pos); + void moveCursorPos(int pos); + void slotClipItemSelected(ClipItem*); + void slotTransitionItemSelected(Transition*); + void slotRebuildTrackHeaders(); + + +signals: + void mousePosition(int); + void cursorMoved(); + void clipItemSelected(ClipItem*); + void transitionItemSelected(Transition*); }; #endif