]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.h
Do not duplicate effect stack after split audio but move audio effects only.
[kdenlive] / src / customtrackview.h
index 11e65110a256e0a2dd4d897812af5e9493ec7d37..f968adf0bd53497b451683ad449c4925eed0b479 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef CUSTOMTRACKVIEW_H
 #define CUSTOMTRACKVIEW_H
 
-#include <KPixmapCache>
+#include <kdeversion.h>
 #include <KColorScheme>
 
 #include <QGraphicsView>
@@ -43,7 +43,6 @@ class AbstractClipItem;
 class AbstractGroupItem;
 class Transition;
 
-
 class CustomTrackView : public QGraphicsView
 {
     Q_OBJECT
@@ -144,7 +143,7 @@ public:
     * @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 doSplitAudio(const GenTime &pos, int track, EffectsList effects, bool split);
     void setVideoOnly();
     void setAudioOnly();
     void setAudioAndVideo();
@@ -156,6 +155,8 @@ public:
     int selectedTrack() const;
     QStringList selectedClips() const;
     QList<ClipItem *> selectedClipItems() const;
+    /** @brief Checks wheter an item can be inserted (make sure it does not overlap another item) */
+    bool canBePastedTo(ItemInfo info, int type) const;
 
     /** @brief Selects a clip.
     * @param add Whether to select or deselect
@@ -177,7 +178,6 @@ public:
     void clearSelection();
     void editItemDuration();
     void buildGuidesMenu(QMenu *goMenu) const;
-    KPixmapCache* pixmapCache;
     /** update the timeline objects when palette changes */
     void updatePalette();
     /** @brief Returns true if a track has audio data on it.
@@ -282,6 +282,7 @@ protected:
     virtual Qt::DropActions supportedDropActions() const;
 
 private:
+    int m_ct;
     int m_tracksHeight;
     int m_projectDuration;
     int m_cursorPos;
@@ -356,9 +357,8 @@ private:
 
     /** Get the index of the video track that is just below current track */
     int getPreviousVideoTrack(int track);
-    void updatePositionEffects(ClipItem * item, ItemInfo info);
+    void updatePositionEffects(ClipItem * item, ItemInfo info, bool standalone = true);
     bool insertDropClips(const QMimeData *data, const QPoint pos);
-    bool canBePastedTo(ItemInfo info, int type) const;
     bool canBePastedTo(QList <ItemInfo> infoList, int type) const;
     bool canBePasted(QList<AbstractClipItem *> items, GenTime offset, int trackOffset) const;
     bool canBeMoved(QList<AbstractClipItem *> items, GenTime offset, int trackOffset) const;
@@ -413,11 +413,6 @@ private:
     /** @brief Gets the effect parameters that will be passed to Mlt. */
     EffectsParameterList getEffectArgs(const QDomElement effect);
 
-    /** @brief Updates @param item's pan and zoom effect after resize or cut.
-     * @param item clip whose pan and zoom effect should be updated
-     * @param cutPos (optional) if clip was cut, cut position relative to the original's clip position */
-    void updatePanZoom(ClipItem *item, GenTime cutPos = GenTime());
-
     /** @brief Update Tracknames to fit again after track was added/deleted.
      * @param track Number of track which was added/deleted
      * @param added true = track added, false = track deleted
@@ -433,6 +428,13 @@ private:
      * In addition to update the duration in TrackInfo it updates effects with keyframes on the track. */
     void updateTrackDuration(int track, QUndoCommand *command);
 
+    /** @brief Adjusts effects after a clip resize.
+     * @param item The item that was resized
+     * @param oldInfo pre resize info
+     * @param fromStart false = resize from end
+     * @param command Used as a parent for EditEffectCommand */
+    void adjustEffects(ClipItem *item, ItemInfo oldInfo, QUndoCommand *command);
+
 private slots:
     void slotRefreshGuides();
     void slotEnableRefresh();
@@ -444,13 +446,21 @@ private slots:
     void slotGoToMarker(QAction *action);
     void slotResetMenuPosition();
     void slotDoResetMenuPosition();
+    /** @brief Re-create the clip thumbnails.
+     *  @param id The clip's Id string.
+     *  @param resetThumbs Should we recreate the timeline thumbnails. */
+    void slotRefreshThumbs(const QString &id, bool resetThumbs);
 
 signals:
     void cursorMoved(int, int);
     void zoomIn();
     void zoomOut();
     void mousePosition(int);
-    void clipItemSelected(ClipItem*, int ix = -1);
+    /** @brief A clip was selected in timeline, update the effect stack
+     *  @param clip The clip
+     *  @param ix The index of currently selected effect
+     *  @param raise If true, the effect stack widget will be raised (come to front). */
+    void clipItemSelected(ClipItem *clip, int ix = -1, bool raise = true);
     void transitionItemSelected(Transition*, int track = 0, QPoint p = QPoint(), bool update = false);
     void activateDocumentMonitor();
     void trackHeightChanged();