X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcustomtrackview.h;h=afa0b44912c8de691c94dcca7a81cc23347da628;hb=0ad3e5e4cf6722cd53ed63e51608b2da2640b240;hp=7d7a55e2811038a22b4acfb5cef8b91187ef4243;hpb=58ca041a8b3c7a88d4d1df6ad03c1299ca74956c;p=kdenlive diff --git a/src/customtrackview.h b/src/customtrackview.h index 7d7a55e2..afa0b449 100644 --- a/src/customtrackview.h +++ b/src/customtrackview.h @@ -22,6 +22,7 @@ #define CUSTOMTRACKVIEW_H #include +#include #include #include @@ -42,6 +43,7 @@ class AbstractClipItem; class AbstractGroupItem; class Transition; + class CustomTrackView : public QGraphicsView { Q_OBJECT @@ -127,9 +129,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 clipInfos, QList transitionInfos, bool group); void loadGroups(const QDomNodeList groups); @@ -201,9 +204,17 @@ public slots: void slotSwitchTrackVideo(int ix); void slotSwitchTrackLock(int ix); void slotUpdateClip(const QString &clipId, bool reload = true); + + /** @brief Creates a AddClipCommand to add, edit or delete a marker. + * @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); bool addGuide(const GenTime pos, const QString &comment); - void slotAddGuide(); + + /** @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 */ + void slotAddGuide(bool dialog = true); void slotEditGuide(CommentedTime guide); void slotEditGuide(int guidePos = -1); void slotDeleteGuide(int guidePos = -1); @@ -251,6 +262,12 @@ public slots: * @param ix The track index */ void slotAddTrackEffect(const QDomElement effect, int ix); + /** @brief Update the list of snap points (sticky timeline hotspots). + * @param selected The currently selected clip if any + * @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 offsetList = QList (), bool skipSelectedItems = false); + protected: virtual void drawBackground(QPainter * painter, const QRectF & rect); //virtual void drawForeground ( QPainter * painter, const QRectF & rect ); @@ -287,7 +304,7 @@ private: QPoint m_clickEvent; QList m_searchPoints; QList m_guides; - void updateSnapPoints(AbstractClipItem *selected, QList offsetList = QList (), bool skipSelectedItems = false); + ClipItem *getClipItemAt(int pos, int track); ClipItem *getClipItemAt(GenTime pos, int track); ClipItem *getClipItemAtEnd(GenTime pos, int track); @@ -331,6 +348,11 @@ private: QMutex m_mutex; QWaitCondition m_producerNotReady; + KStatefulBrush m_activeTrackBrush; + + /** 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; /** Get the index of the video track that is just below current track */ int getPreviousVideoTrack(int track); @@ -391,6 +413,19 @@ 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 + * + * The default track name consists of type + number. If we add/delete a track the number has to be adjusted + * if the name is still the default one. */ + void updateTrackNames(int track, bool added); + private slots: void slotRefreshGuides(); void slotEnableRefresh(); @@ -422,7 +457,9 @@ signals: /** @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, EffectsList); + void showTrackEffects(int, TrackInfo); + /** @brief Update the track effect button that shows if a track has effects or not.*/ + void updateTrackEffectState(int); }; #endif