]> 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 79b8758affda75e28d049a463308c5530f0f36e6..89ecc1684c9d6af266d022899e6c204a33928c13 100644 (file)
@@ -28,6 +28,8 @@
 #include <QTimeLine>
 #include <QMenu>
 #include <QUndoStack>
+#include <QMutex>
+#include <QWaitCondition>
 
 #include "kdenlivedoc.h"
 #include "docclipbase.h"
@@ -125,9 +127,10 @@ public:
     /** @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);
@@ -175,15 +178,20 @@ public:
     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);
@@ -239,6 +247,11 @@ public slots:
     * @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 );
@@ -317,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);
@@ -343,7 +359,7 @@ 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.
@@ -373,6 +389,9 @@ private:
     * @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();
@@ -401,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