]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.h
Do not show split audio command in undo history if there is nothing to split
[kdenlive] / src / customtrackview.h
index a023f93a434aad41fa8ef09afb5a7fb29bd32112..504a8874d41d5e2e5afff024f1a4934ed21f2aca 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef CUSTOMTRACKVIEW_H
 #define CUSTOMTRACKVIEW_H
 
+#include <KPixmapCache>
+
 #include <QGraphicsView>
 #include <QGraphicsItemAnimation>
 #include <QTimeLine>
@@ -51,7 +53,8 @@ public:
     virtual void mouseDoubleClickEvent(QMouseEvent *event);
     void addTrack(TrackInfo type, int ix = -1);
     void removeTrack(int ix);
-    void changeTrack(int ix, TrackInfo type);
+    /** @brief Makes the document use new track infos (name, type, ...). */
+    void configTracks(QList <TrackInfo> trackInfos);
     int cursorPos();
     void checkAutoScroll();
     void moveClip(const ItemInfo start, const ItemInfo end, bool refresh);
@@ -90,31 +93,51 @@ public:
     double getSnapPointForPos(double pos);
     void editKeyFrame(const GenTime pos, const int track, const int index, const QString keyframes);
     bool findString(const QString &text);
+    void selectFound(QString track, QString pos);
     bool findNextString(const QString &text);
     void initSearchStrings();
     void clearSearchStrings();
+    QList<ItemInfo> findId(const QString &clipId);
     void clipStart();
     void clipEnd();
     void changeClipSpeed();
     void doChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, const double speed, const double oldspeed, int strobe, const QString &id);
+    /** @brief Sets the document as modified. */
     void setDocumentModified();
     void setInPoint();
     void setOutPoint();
+
+    /** @brief Prepares inserting space.
+    *
+    * Shows a dialog to configure length and track. */
     void slotInsertSpace();
+    /** @brief Prepares removing space. */
     void slotRemoveSpace();
     void insertSpace(QList<ItemInfo> clipsToMove, QList<ItemInfo> transToMove, int track, const GenTime duration, const GenTime offset);
     ClipItem *getActiveClipUnderCursor(bool allowOutsideCursor = false) const;
     void deleteTimelineTrack(int ix, TrackInfo trackinfo);
-    void changeTimelineTrack(int ix, TrackInfo trackinfo);
     void saveThumbnails();
     void autoTransition();
     QStringList getLadspaParams(QDomElement effect) const;
     void initCursorPos(int pos);
+
+    /** @brief Locks or unlocks a track.
+    * @param ix number of track
+    * @param lock whether to lock or unlock
+    *
+    * Makes sure no clip on track to lock is selected. */
     void lockTrack(int ix, bool lock);
     void groupClips(bool group = true);
     void doGroupClips(QList <ItemInfo> clipInfos, QList <ItemInfo> transitionInfos, bool group);
     void loadGroups(const QDomNodeList groups);
+
+    /** @brief Creates SplitAudioCommands for selected clips. */
     void splitAudio();
+
+    /** @brief Seperates the audio of a clip to a audio track.
+    * @param pos Position of the clip to split 
+    * @param track Track of the clip
+    * @param split Split or unsplit */
     void doSplitAudio(const GenTime &pos, int track, bool split);
     void setVideoOnly();
     void setAudioOnly();
@@ -125,13 +148,30 @@ public:
     void updateProjectFps();
     double fps() const;
     int selectedTrack() const;
-    void selectClip(bool add, bool group = false);
+    QStringList selectedClips() const;
+    QList<ClipItem *> selectedClipItems() const;
+
+    /** @brief Selects a clip.
+    * @param add Whether to select or deselect
+    * @param group (optional) Whether to add the clip to a group
+    * @param track (optional) The track of the clip (has to be combined with @param pos)
+    * @param pos (optional) The position of the clip (has to be combined with @param track) */
+    void selectClip(bool add, bool group = false, int track = -1, int pos = -1);
     void selectTransition(bool add, bool group = false);
     QStringList extractTransitionsLumas();
     void setEditMode(EDITMODE mode);
+
+    /** @brief Inserts @param clip.
+    * @param clip The clip to insert
+    * @param in The inpoint of the clip (crop from start)
+    * @param out The outpoint of the clip (crop from end)
+    *
+    * Inserts at the position of timeline cursor and selected track. */
     void insertClipCut(DocClipBase *clip, int in, int out);
     void clearSelection();
     void editItemDuration();
+    void buildGuidesMenu(QMenu *goMenu) const;
+    KPixmapCache* pixmapCache;
 
 public slots:
     void setCursorPos(int pos, bool seek = true);
@@ -165,7 +205,8 @@ public slots:
     void slotCheckPositionScrolling();
     void slotInsertTrack(int ix);
     void slotDeleteTrack(int ix);
-    void slotChangeTrack(int ix);
+    /** @brief Shows the configure tracks dialog. */
+    void slotConfigTracks(int ix);
     void clipNameChanged(const QString id, const QString name);
     void slotTrackUp();
     void slotTrackDown();
@@ -285,6 +326,8 @@ private slots:
     void slotFetchNextThumbs();
     void checkTrackSequence(int track);
     void slotGoToMarker(QAction *action);
+    void slotResetMenuPosition();
+    void slotDoResetMenuPosition();
 
 signals:
     void cursorMoved(int, int);