]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.h
Load & save markers (audacity compatible):
[kdenlive] / src / customtrackview.h
index 66ee744b8a791d0a67854e7e5a2d6b7145933cee..1f322854a481ad9acea0e726faea4152b31571bf 100644 (file)
@@ -79,12 +79,15 @@ public:
     void addMarker(const QString &id, const GenTime &pos, const QString &comment);
     void setScale(double scaleFactor, double verticalScale);
     void deleteClip(const QString &clipId);
+    /** @brief Add effect to current clip */
     void slotAddEffect(QDomElement effect, GenTime pos, int track);
     void slotAddGroupEffect(QDomElement effect, AbstractGroupItem *group);
     void addEffect(int track, GenTime pos, QDomElement effect);
     void deleteEffect(int track, GenTime pos, QDomElement effect);
-    void updateEffect(int track, GenTime pos, QDomElement insertedEffect, int ix, bool triggeredByUser = true);
-    void moveEffect(int track, GenTime pos, int oldPos, int newPos);
+    void updateEffect(int track, GenTime pos, QDomElement insertedEffect, bool refreshEffectStack = false);
+    /** @brief Enable / disable a list of effects */
+    void updateEffectState(int track, GenTime pos, QList <int> effectIndexes, bool disable, bool updateEffectStack);
+    void moveEffect(int track, GenTime pos, QList <int> oldPos, QList <int> newPos);
     void addTransition(ItemInfo transitionInfo, int endTrack, QDomElement params, bool refresh);
     void deleteTransition(ItemInfo transitionInfo, int endTrack, QDomElement params, bool refresh);
     void updateTransition(int track, GenTime pos,  QDomElement oldTransition, QDomElement transition, bool updateTransitionWidget);
@@ -187,7 +190,7 @@ public:
     *
     * Inserts at the position of timeline cursor and selected track. */
     void insertClipCut(DocClipBase *clip, int in, int out);
-    void clearSelection();
+    void clearSelection(bool emitInfo = true);
     void editItemDuration();
     void buildGuidesMenu(QMenu *goMenu) const;
     /** update the timeline objects when palette changes */
@@ -199,15 +202,20 @@ public:
     bool hasAudio(int track) const;
 
     int getFrameWidth();
+    /** @brief Returns last requested seeking pos (or SEEK_INACTIVE if no seek). */
+    int seekPosition() const;
     
 public slots:
-    void setCursorPos(int pos, bool seek = true);
+    /** @brief Send seek request to MLT. */
+    void seekCursorPos(int pos);
+    /** @brief Move timeline cursor to new position. */
+    void setCursorPos(int pos);
     void moveCursorPos(int delta);
     void updateCursorPos();
     void slotDeleteEffect(ClipItem *clip, int track, QDomElement effect, bool affectGroup = true);
-    void slotChangeEffectState(ClipItem *clip, int track, int effectPos, bool disable);
-    void slotChangeEffectPosition(ClipItem *clip, int track, int currentPos, int newPos);
-    void slotUpdateClipEffect(ClipItem *clip, int track, QDomElement oldeffect, QDomElement effect, int ix);
+    void slotChangeEffectState(ClipItem *clip, int track, QList <int> effectIndexes, bool disable);
+    void slotChangeEffectPosition(ClipItem *clip, int track, QList <int> currentPos, int newPos);
+    void slotUpdateClipEffect(ClipItem *clip, int track, QDomElement oldeffect, QDomElement effect, int ix, bool refreshEffectStack = true);
     void slotUpdateClipRegion(ClipItem *clip, int ix, QString region);
     void slotRefreshEffects(ClipItem *clip);
     void setDuration(int duration);
@@ -223,7 +231,9 @@ public slots:
      * @param id Id of the marker's clip
      * @param t Position of the marker
      * @param c Comment of the marker */
-    void slotAddClipMarker(const QString &id, GenTime t, QString c);
+    void slotAddClipMarker(const QString &id, GenTime t, QString c, QUndoCommand *groupCommand = 0);
+    void slotLoadClipMarkers(const QString &id);
+    void slotSaveClipMarkers(const QString &id);
     bool addGuide(const GenTime &pos, const QString &comment);
 
     /** @brief Shows a dialog for adding a guide.
@@ -285,6 +295,8 @@ public slots:
     * @param offsetList The list of points that should also snap (for example when movin a clip, start and end points should snap
     * @param skipSelectedItems if true, the selected item start and end points will not be added to snap list */
     void updateSnapPoints(AbstractClipItem *selected, QList <GenTime> offsetList = QList <GenTime> (), bool skipSelectedItems = false);
+    
+    void slotAddEffect(ClipItem *clip, QDomElement effect);
 
 protected:
     virtual void drawBackground(QPainter * painter, const QRectF & rect);
@@ -328,6 +340,7 @@ private:
     ClipItem *getClipItemAt(GenTime pos, int track);
     ClipItem *getClipItemAtEnd(GenTime pos, int track);
     ClipItem *getClipItemAtStart(GenTime pos, int track);
+    Transition *getTransitionItem(TransitionInfo info);
     Transition *getTransitionItemAt(int pos, int track);
     Transition *getTransitionItemAt(GenTime pos, int track);
     Transition *getTransitionItemAtEnd(GenTime pos, int track);
@@ -455,6 +468,12 @@ private:
      * @param fromStart false = resize from end
      * @param command Used as a parent for EditEffectCommand */
     void adjustEffects(ClipItem *item, ItemInfo oldInfo, QUndoCommand *command);
+    
+    /** @brief Prepare an add clip command for an effect */
+    void processEffect(ClipItem *item, QDomElement effect, int offset, QUndoCommand *effectCommand);
+    
+    /** @brief Get effect parameters ready for MLT*/
+    void adjustEffectParameters(EffectsParameterList &parameters, QDomNodeList params, const QString &prefix = QString());
 
 private slots:
     void slotRefreshGuides();
@@ -482,9 +501,8 @@ signals:
     void mousePosition(int);
     /** @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 clipItemSelected(ClipItem *clip, bool raise = true);
     void transitionItemSelected(Transition*, int track = 0, QPoint p = QPoint(), bool update = false);
     void activateDocumentMonitor();
     void trackHeightChanged();
@@ -501,6 +519,8 @@ signals:
     void showTrackEffects(int, TrackInfo);
     /** @brief Update the track effect button that shows if a track has effects or not.*/
     void updateTrackEffectState(int);
+    /** @brief Cursor position changed, repaint ruler.*/
+    void updateRuler();
 };
 
 #endif