]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.h
Trying to fix a bug with the clip move undo command. No success.
[kdenlive] / src / customtrackview.h
index 70c89e738a81c28d656aab5f1a79784d6d6a8954..66ee744b8a791d0a67854e7e5a2d6b7145933cee 100644 (file)
@@ -42,6 +42,7 @@ class ClipItem;
 class AbstractClipItem;
 class AbstractGroupItem;
 class Transition;
+class AudioCorrelation;
 
 class CustomTrackView : public QGraphicsView
 {
@@ -60,16 +61,22 @@ public:
     void configTracks(QList <TrackInfo> trackInfos);
     int cursorPos();
     void checkAutoScroll();
-    void moveClip(const ItemInfo start, const ItemInfo end, bool refresh);
-    void moveGroup(QList <ItemInfo> startClip, QList <ItemInfo> startTransition, const GenTime offset, const int trackOffset, bool reverseMove = false);
+    /**
+      Move the clip at \c start to \c end.
+
+      If \c out_actualEnd is not NULL, it will be set to the position the clip really ended up at.
+      For example, attempting to move a clip to t = -1 s will actually move it to t = 0 s.
+      */
+    bool moveClip(const ItemInfo &start, const ItemInfo &end, bool refresh, ItemInfo *out_actualEnd = NULL);
+    void moveGroup(QList <ItemInfo> startClip, QList <ItemInfo> startTransition, const GenTime &offset, const int trackOffset, bool reverseMove = false);
     /** move transition, startPos = (old start, old end), endPos = (new start, new end) */
-    void moveTransition(const ItemInfo start, const ItemInfo end, bool m_refresh);
-    void resizeClip(const ItemInfo start, const ItemInfo end, bool dontWorry = false);
+    void moveTransition(const ItemInfo &start, const ItemInfo &end, bool refresh);
+    void resizeClip(const ItemInfo &start, const ItemInfo &end, bool dontWorry = false);
     void addClip(QDomElement xml, const QString &clipId, ItemInfo info, EffectsList list = EffectsList(), bool overwrite = false, bool push = false, bool refresh = true);
     void deleteClip(ItemInfo info, bool refresh = true);
     void slotDeleteClipMarker(const QString &comment, const QString &id, const GenTime &position);
     void slotDeleteAllClipMarkers(const QString &id);
-    void addMarker(const QString &id, const GenTime &pos, const QString comment);
+    void addMarker(const QString &id, const GenTime &pos, const QString &comment);
     void setScale(double scaleFactor, double verticalScale);
     void deleteClip(const QString &clipId);
     void slotAddEffect(QDomElement effect, GenTime pos, int track);
@@ -88,14 +95,15 @@ public:
     /** @brief Cuts all clips that are selected at the timeline cursor position. */
     void cutSelectedClips();
     void setContextMenu(QMenu *timeline, QMenu *clip, QMenu *transition, QActionGroup *clipTypeGroup, QMenu *markermenu);
-    void checkTrackHeight();
+    bool checkTrackHeight();
+    void updateSceneFrameWidth();
     //QList <TrackInfo> tracksList() const;
     void setTool(PROJECTTOOL tool);
     ClipItem *cutClip(ItemInfo info, GenTime cutTime, bool cut, bool execute = true);
     void slotSeekToPreviousSnap();
     void slotSeekToNextSnap();
     double getSnapPointForPos(double pos);
-    void editKeyFrame(const GenTime pos, const int track, const int index, const QString keyframes);
+    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);
@@ -104,7 +112,6 @@ public:
     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();
@@ -117,7 +124,7 @@ public:
     void slotInsertSpace();
     /** @brief Prepares removing space. */
     void slotRemoveSpace();
-    void insertSpace(QList<ItemInfo> clipsToMove, QList<ItemInfo> transToMove, int track, const GenTime duration, const GenTime offset);
+    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 saveThumbnails();
@@ -133,11 +140,17 @@ public:
     void lockTrack(int ix, bool lock, bool requestUpdate = true);
     void groupClips(bool group = true);
     void doGroupClips(QList <ItemInfo> clipInfos, QList <ItemInfo> transitionInfos, bool group);
-    void loadGroups(const QDomNodeList groups);
+    void loadGroups(const QDomNodeList &groups);
 
     /** @brief Creates SplitAudioCommands for selected clips. */
     void splitAudio();
 
+    /// Define which clip to take as reference for automatic audio alignment
+    void setAudioAlignReference();
+
+    /// Automatically align the currently selected clips to synchronize their audio with the reference's audio
+    void alignAudio();
+
     /** @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
@@ -185,6 +198,8 @@ public:
     * Check whether given track has a clip with audio in it. */
     bool hasAudio(int track) const;
 
+    int getFrameWidth();
+    
 public slots:
     void setCursorPos(int pos, bool seek = true);
     void moveCursorPos(int delta);
@@ -209,7 +224,7 @@ public slots:
      * @param t Position of the marker
      * @param c Comment of the marker */
     void slotAddClipMarker(const QString &id, GenTime t, QString c);
-    bool addGuide(const GenTime pos, const QString &comment);
+    bool addGuide(const GenTime &pos, const QString &comment);
 
     /** @brief Shows a dialog for adding a guide.
      * @param dialog (default = true) false = do not show the dialog but use current position as position and comment */
@@ -218,7 +233,7 @@ public slots:
     void slotEditGuide(int guidePos = -1);
     void slotDeleteGuide(int guidePos = -1);
     void slotDeleteAllGuides();
-    void editGuide(const GenTime oldPos, const GenTime pos, const QString &comment);
+    void editGuide(const GenTime &oldPos, const GenTime &pos, const QString &comment);
     void copyClip();
     void pasteClip();
     void pasteClipEffects();
@@ -231,7 +246,7 @@ public slots:
     void slotDeleteTrack(int ix);
     /** @brief Shows the configure tracks dialog. */
     void slotConfigTracks(int ix);
-    void clipNameChanged(const QString id, const QString name);
+    void clipNameChanged(const QString &id, const QString &name);
     void slotTrackUp();
     void slotTrackDown();
     void slotSelectTrack(int ix);
@@ -259,7 +274,11 @@ public slots:
     /** @brief Add en effect to a track.
     * @param effect The new effect xml
     * @param ix The track index */
-    void slotAddTrackEffect(const QDomElement effect, int ix);
+    void slotAddTrackEffect(const QDomElement &effect, int ix);
+    /** @brief Select all clips in selected track. */
+    void slotSelectClipsInTrack();
+    /** @brief Select all clips in timeline. */
+    void slotSelectAllClips();
 
     /** @brief Update the list of snap points (sticky timeline hotspots).
     * @param selected The currently selected clip if any
@@ -350,6 +369,9 @@ private:
     QWaitCondition m_producerNotReady;
     KStatefulBrush m_activeTrackBrush;
 
+    AudioCorrelation *m_audioCorrelator;
+    ClipItem *m_audioAlignmentReference;
+
     /** stores the state of the control modifier during mouse press.
      * Will then be used to identify whether we resize a group or only one item of it. */
     bool m_controlModifier;
@@ -357,7 +379,7 @@ private:
     /** Get the index of the video track that is just below current track */
     int getPreviousVideoTrack(int track);
     void updatePositionEffects(ClipItem * item, ItemInfo info, bool standalone = true);
-    bool insertDropClips(const QMimeData *data, const QPoint pos);
+    bool insertDropClips(const QMimeData *data, const QPoint &pos);
     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;
@@ -410,7 +432,7 @@ private:
     void razorGroup(AbstractGroupItem *group, GenTime cutPos);
 
     /** @brief Gets the effect parameters that will be passed to Mlt. */
-    EffectsParameterList getEffectArgs(const QDomElement effect);
+    EffectsParameterList getEffectArgs(const QDomElement &effect);
 
     /** @brief Update Tracknames to fit again after track was added/deleted.
      * @param track Number of track which was added/deleted
@@ -449,6 +471,9 @@ private slots:
      *  @param id The clip's Id string.
      *  @param resetThumbs Should we recreate the timeline thumbnails. */
     void slotRefreshThumbs(const QString &id, bool resetThumbs);
+    /** @brief A Filter job producer results. */
+    void slotGotFilterJobResults(const QString &id, int startPos, int track, const QString &filter, stringMap filterParams);
+
 
 signals:
     void cursorMoved(int, int);
@@ -464,8 +489,8 @@ signals:
     void activateDocumentMonitor();
     void trackHeightChanged();
     void tracksChanged();
-    void displayMessage(const QString, MessageType);
-    void showClipFrame(DocClipBase *, QPoint, const int);
+    void displayMessage(const QString &, MessageType);
+    void showClipFrame(DocClipBase *, QPoint, bool, const int);
     void doTrackLock(int, bool);
     void updateClipMarkers(DocClipBase *);
     void updateTrackHeaders();