X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftrackview.h;h=1a5b55b94e1e8e6d28bdc1cbafd3091e10fb1416;hb=c2031b18ba7680d505db3fa978cd4c2812df840c;hp=0668496ef6ba912b16b9289f7d57a0c4f0890ec9;hpb=e04bece5ff0797c3b06fcf8ff6a9c37762a1ec94;p=kdenlive diff --git a/src/trackview.h b/src/trackview.h index 0668496e..1a5b55b9 100644 --- a/src/trackview.h +++ b/src/trackview.h @@ -17,21 +17,27 @@ * 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 +#include #include "customtrackscene.h" +#include "effectslist.h" #include "ui_timeline_ui.h" +#include "definitions.h" class ClipItem; class Transition; @@ -40,12 +46,12 @@ class KdenliveDoc; class CustomRuler; class DocClipBase; -class TrackView : public QWidget +class TrackView : public QWidget, public Ui::TimeLine_UI { Q_OBJECT public: - explicit TrackView(KdenliveDoc *doc, QWidget *parent = 0); + explicit TrackView(KdenliveDoc *doc, bool *ok, QWidget *parent = 0); virtual ~ TrackView(); void setEditMode(const QString & editMode); const QString & editMode() const; @@ -55,18 +61,32 @@ 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(); + + /** @brief Parse tracks to see if project has audio in it. + * + * Parses all tracks to check if there is audio data. */ + bool checkProjectAudio() const; + +protected: + virtual void keyPressEvent(QKeyEvent * event); + public slots: void slotDeleteClip(const QString &clipId); void slotChangeZoom(int horizontal, int vertical = -1); void setDuration(int dur); - void slotSetZone(QPoint p); - + void slotSetZone(QPoint p, bool updateDocumentProperties = true); + /** @brief Save a snapshot image of current timeline view */ + void slotSaveTimelinePreview(const QString path); private: - Ui::TimeLine_UI m_view; CustomRuler *m_ruler; CustomTrackView *m_trackview; QList m_invalidProducers; @@ -77,28 +97,50 @@ private: KdenliveDoc *m_doc; int m_verticalZoom; - QVBoxLayout *m_headersLayout; QString m_documentErrors; void parseDocument(QDomDocument doc); int slotAddProjectTrack(int ix, QDomElement xml, bool locked); DocClipBase *getMissingProducer(const QString id) const; void adjustTrackHeaders(); + void slotAddProjectEffects(QDomNodeList effects, QDomElement parentNode, ClipItem *clip, int trackIndex); private slots: void setCursorPos(int pos); void moveCursorPos(int pos); + /** @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); + void slotShowTrackEffects(int); + /** @brief Update the track label showing applied effects.*/ + void slotUpdateTrackEffectState(int); + signals: void mousePosition(int); void cursorMoved(); void zoneMoved(int, int); void insertTrack(int); void deleteTrack(int); - void changeTrack(int); + void configTrack(int); + void updateTracksInfo(); + void setZoom(int); + void showTrackEffects(int, TrackInfo); }; #endif