]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.h
Fix hang on exit somewhere strange inside Qt on OS X.
[kdenlive] / src / customtrackview.h
index 519376c75ea1f1d9c8b1a1064fa0f67e46370b12..89ecc1684c9d6af266d022899e6c204a33928c13 100644 (file)
@@ -28,6 +28,8 @@
 #include <QTimeLine>
 #include <QMenu>
 #include <QUndoStack>
+#include <QMutex>
+#include <QWaitCondition>
 
 #include "kdenlivedoc.h"
 #include "docclipbase.h"
@@ -82,6 +84,7 @@ public:
     void activateMonitor();
     int duration() const;
     void deleteSelectedClips();
+    /** @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();
@@ -106,6 +109,7 @@ public:
     void setDocumentModified();
     void setInPoint();
     void setOutPoint();
+
     /** @brief Prepares inserting space.
     *
     * Shows a dialog to configure length and track. */
@@ -119,16 +123,25 @@ public:
     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
+    * @param requestUpdate (default = true) Whether to request an update of the icon in the track header
     *
     * Makes sure no clip on track to lock is selected. */
-    void lockTrack(int ix, bool lock);
+    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);
+
+    /** @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();
@@ -141,6 +154,7 @@ public:
     int selectedTrack() const;
     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
@@ -150,20 +164,35 @@ public:
     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();
+    /** @brief Returns true if a track has audio data on it.
+    * @param track The track number
+    *
+    * Check whether given track has a clip with audio in it. */
+    bool hasAudio(int track) const;
 
 public slots:
     void setCursorPos(int pos, bool seek = true);
     void moveCursorPos(int delta);
     void updateCursorPos();
-    void slotDeleteEffect(ClipItem *clip, QDomElement effect, bool affectGroup = true);
-    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 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 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());
@@ -187,6 +216,9 @@ 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);
     /** @brief Shows the configure tracks dialog. */
     void slotConfigTracks(int ix);
@@ -196,12 +228,37 @@ public slots:
     void slotSelectTrack(int ix);
     void insertZoneOverwrite(QStringList data, int in);
 
+    /** @brief Rebuilds a group to fit again after children changed.
+    * @param childTrack the track of one of the groups children
+    * @param childPos The position of the same child */
+    void rebuildGroup(int childTrack, GenTime childPos);
+    /** @brief Rebuilds a group to fit again after children changed.
+    * @param group The group to rebuild */
+    void rebuildGroup(AbstractGroupItem *group);
+
+    /** @brief Cuts a group into two parts.
+    * @param clips1 Clips before the cut
+    * @param transitions1 Transitions before the cut
+    * @param clipsCut Clips that need to be cut
+    * @param transitionsCut Transitions that need to be cut
+    * @param clips2 Clips behind the cut
+    * @param transitions2 Transitions behind the cut
+    * @param cutPos Absolute position of the cut
+    * @param cut true = cut, false = "uncut" */
+    void slotRazorGroup(QList <ItemInfo> clips1, QList <ItemInfo> transitions1, QList <ItemInfo> clipsCut, QList <ItemInfo> transitionsCut, QList <ItemInfo> clips2, QList <ItemInfo> transitions2, GenTime cutPos, bool cut);
+
+    /** @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);
+
 protected:
     virtual void drawBackground(QPainter * painter, const QRectF & rect);
     //virtual void drawForeground ( QPainter * painter, const QRectF & rect );
     virtual void dragEnterEvent(QDragEnterEvent * event);
     virtual void dragMoveEvent(QDragMoveEvent * event);
     virtual void dragLeaveEvent(QDragLeaveEvent * event);
+    /** @brief Something has been dropped onto the timeline */
     virtual void dropEvent(QDropEvent * event);
     virtual void wheelEvent(QWheelEvent * e);
     virtual void keyPressEvent(QKeyEvent * event);
@@ -273,6 +330,9 @@ private:
     int m_selectedTrack;
     int m_spacerOffset;
 
+    QMutex m_mutex;
+    QWaitCondition m_producerNotReady;
+
     /** Get the index of the video track that is just below current track */
     int getPreviousVideoTrack(int track);
     void updatePositionEffects(ClipItem * item, ItemInfo info);
@@ -300,6 +360,38 @@ private:
     /** 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
+    * @param command (optional) Will be used as parent command (for undo history) */
+    void prepareResizeClipStart(AbstractClipItem *item, ItemInfo oldInfo, int pos, bool check = false, QUndoCommand *command = NULL);
+
+    /** @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
+    * @param command (optional) Will be used as parent command (for undo history) */
+    void prepareResizeClipEnd(AbstractClipItem *item, ItemInfo oldInfo, int pos, bool check = false, QUndoCommand *command = NULL);
+
+    /** @brief Collects information about the group's children to pass it on to RazorGroupCommand.
+    * @param group The group to cut
+    * @param cutPos The absolute position of the cut */
+    void razorGroup(AbstractGroupItem *group, GenTime cutPos);
+
+    /** @brief Gets the effect parameters that will be passed to Mlt. */
+    EffectsParameterList getEffectArgs(const QDomElement effect);
+
 private slots:
     void slotRefreshGuides();
     void slotEnableRefresh();
@@ -328,6 +420,12 @@ signals:
     void updateClipMarkers(DocClipBase *);
     void updateTrackHeaders();
     void playMonitor();
+    /** @brief Monitor document changes (for example the presence of audio data in timeline for export widget.*/
+    void documentModified();
+    void forceClipProcessing(const QString &);
+    void showTrackEffects(int, TrackInfo);
+    /** @brief Update the track effect button that shows if a track has effects or not.*/
+    void updateTrackEffectState(int);
 };
 
 #endif