X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftrackview.h;h=f82b661b736132673a10823dfdfcfa73e1f8c1a1;hb=7bd462b3f3af359d9ed156b0d515ea1fcfee9bfb;hp=1e537714e9ba93cc7da4ec39d8876b25c9d15c71;hpb=62f7974e0759e81f0855a15055bd066e4d6c5e2f;p=kdenlive diff --git a/src/trackview.h b/src/trackview.h index 1e537714..f82b661b 100644 --- a/src/trackview.h +++ b/src/trackview.h @@ -17,19 +17,22 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ +/** +* @class TrackView +* @brief Manages the timline +* @author Jean-Baptiste Mardelle +*/ #ifndef TRACKVIEW_H #define TRACKVIEW_H #include -#include -#include #include #include #include #include -#define FRAME_SIZE 90 +#include #include "customtrackscene.h" #include "ui_timeline_ui.h" @@ -39,15 +42,15 @@ class Transition; class CustomTrackView; class KdenliveDoc; class CustomRuler; +class DocClipBase; -class TrackView : public QWidget { +class TrackView : public QWidget, public Ui::TimeLine_UI +{ Q_OBJECT public: - TrackView(KdenliveDoc *doc, QWidget *parent = 0); - - const double zoomFactor() const; - const int mapLocalToValue(int x) const; + explicit TrackView(KdenliveDoc *doc, bool *ok, QWidget *parent = 0); + virtual ~ TrackView(); void setEditMode(const QString & editMode); const QString & editMode() const; QGraphicsScene *projectScene(); @@ -56,49 +59,75 @@ public: int tracksNumber() const; KdenliveDoc *document(); void refresh() ; + void updateProjectFps(); int outPoint() const; int inPoint() const; int fitZoom() const; + + /** @brief Updates (redraws) the ruler. + * + * Used to change from displaying frames to timecode or vice versa. */ + void updateRuler(); + +protected: + virtual void keyPressEvent(QKeyEvent * event); public slots: void slotDeleteClip(const QString &clipId); - void slotChangeZoom(int factor); + void slotChangeZoom(int horizontal, int vertical = -1); void setDuration(int dur); void slotSetZone(QPoint p); private: - Ui::TimeLine_UI *view; CustomRuler *m_ruler; CustomTrackView *m_trackview; + QList m_invalidProducers; double m_scale; int m_projectTracks; QString m_editMode; CustomTrackScene *m_scene; KdenliveDoc *m_doc; - QVBoxLayout *m_tracksLayout; - QVBoxLayout *m_headersLayout; - QScrollArea *m_scrollArea; - QFrame *m_scrollBox; - QVBoxLayout *m_tracksAreaLayout; + int m_verticalZoom; QString m_documentErrors; void parseDocument(QDomDocument doc); - int slotAddProjectTrack(int ix, QDomElement xml); + int slotAddProjectTrack(int ix, QDomElement xml, bool locked); + DocClipBase *getMissingProducer(const QString id) const; + void adjustTrackHeaders(); private slots: void setCursorPos(int pos); void moveCursorPos(int pos); - void slotTransitionItemSelected(Transition*, bool update); + /** @brief Rebuilds the track headers */ void slotRebuildTrackHeaders(); - + /** @brief The tracks count or a track name changed, rebuild and notify */ + void slotReloadTracks(); + void slotChangeTrackLock(int ix, bool lock); + void slotVerticalZoomDown(); + void slotVerticalZoomUp(); + + /** @brief Changes the name of a track. + * @param ix Number of the track + * @param name New name */ + void slotRenameTrack(int ix, QString name); + void slotRepaintTracks(); + + /** @brief Adjusts the margins of the header area. + * + * Avoid a shift between header area and trackview if + * the horizontal scrollbar is visible and the position + * of the vertical scrollbar is maximal */ + void slotUpdateVerticalScroll(int min, int max); signals: void mousePosition(int); void cursorMoved(); - void transitionItemSelected(Transition*, bool); void zoneMoved(int, int); void insertTrack(int); void deleteTrack(int); + void configTrack(int); + void updateTracksInfo(); + void setZoom(int); }; #endif