]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.h
Use same codebase caring for updating keyframes, attached transitions, ... when resiz...
[kdenlive] / src / customtrackview.h
index 2c704280e6f06f06b31c754723a4cedb5f1520f9..70c90f39982bb154e8e084c01811e879bf2f620c 100644 (file)
@@ -53,7 +53,6 @@ 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();
@@ -107,6 +106,7 @@ public:
     void setDocumentModified();
     void setInPoint();
     void setOutPoint();
+
     /** @brief Prepares inserting space.
     *
     * Shows a dialog to configure length and track. */
@@ -116,11 +116,11 @@ public:
     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
@@ -130,7 +130,14 @@ public:
     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();
@@ -143,15 +150,30 @@ public:
     int selectedTrack() const;
     QStringList selectedClips() const;
     QList<ClipItem *> selectedClipItems() const;
-    void selectClip(bool add, bool group = false);
+
+    /** @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;
+    /** update the timeline objects when palette changes */
+    void updatePalette();
 
 public slots:
     void setCursorPos(int pos, bool seek = true);
@@ -161,6 +183,7 @@ public slots:
     void slotChangeEffectState(ClipItem *clip, int effectPos, bool disable);
     void slotChangeEffectPosition(ClipItem *clip, int currentPos, int newPos);
     void slotUpdateClipEffect(ClipItem *clip, QDomElement oldeffect, QDomElement effect, int ix);
+    void slotUpdateClipRegion(ClipItem *clip, int ix, QString region);
     void slotRefreshEffects(ClipItem *clip);
     void setDuration(int duration);
     void slotAddTransition(ClipItem* clip, ItemInfo transitionInfo, int endTrack, QDomElement transition = QDomElement());
@@ -184,8 +207,10 @@ public slots:
     void slotUpdateAllThumbs();
     void slotCheckPositionScrolling();
     void slotInsertTrack(int ix);
+
+    /** @brief Shows a dialog for selecting a track to delete.
+    * @param ix Number of the track, which should be pre-selected in the dialog */
     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);
@@ -281,6 +306,8 @@ private:
     bool canBeMoved(QList<AbstractClipItem *> items, GenTime offset, int trackOffset) const;
     ClipItem *getClipUnderCursor() const;
     AbstractClipItem *getMainActiveClip() const;
+    /** @brief Rebuilds @param group to fit changes to it's childen. */
+    void rebuildGroup(AbstractGroupItem *group);
     void resetSelectionGroup(bool selectItems = true);
     void groupSelectedItems(bool force = false, bool createNewGroup = false);
     /** Get available space for clip move (min and max free positions) */
@@ -297,6 +324,28 @@ private:
     void adjustTimelineTransitions(EDITMODE mode, Transition *item, QUndoCommand *command);
     /** Adjust keyframes when pasted to another clip */
     void adjustKeyfames(GenTime oldstart, GenTime newstart, GenTime duration, QDomElement xml);
+    
+    /** @brief Removes the tip and stops the animation timer. */
+    void removeTipAnimation();
+    /** @brief Creates a new tip animation.
+    * @param clip clip to display the tip on
+    * @param mode operation mode for which the tip should be displayed
+    * @param size size of the tip */
+    void setTipAnimation(AbstractClipItem *clip, OPERATIONTYPE mode, const double size);
+
+    /** @brief Takes care of updating effects and attached transitions during a resize from start.
+    * @param item Item to resize
+    * @param oldInfo The item's info before resizement (set to item->info() is @param check true)
+    * @param pos New startPos
+    * @param check (optional, default = false) Whether to check for collisions */
+    void prepareResizeClipStart(AbstractClipItem *item, ItemInfo oldInfo, int pos, bool check = false);
+
+    /** @brief Takes care of updating effects and attached transitions during a resize from end.
+    * @param item Item to resize
+    * @param oldInfo The item's info before resizement (set to item->info() is @param check true)
+    * @param pos New endPos
+    * @param check (optional, default = false) Whether to check for collisions */
+    void prepareResizeClipEnd(AbstractClipItem *item, ItemInfo oldInfo, int pos, bool check = false);
 
 private slots:
     void slotRefreshGuides();