X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcustomtrackview.h;h=9312566c6469034bd0dbfc2132aa75c57817da21;hb=621ccf919b20718f7f78ca426f410ff040934c0a;hp=2287ea739533ffcfb64f08f55a6fd6c5a4f6b485;hpb=90e0ecffea8748dbb97479dafb5e50af3a71e471;p=kdenlive diff --git a/src/customtrackview.h b/src/customtrackview.h index 2287ea73..9312566c 100644 --- a/src/customtrackview.h +++ b/src/customtrackview.h @@ -21,7 +21,7 @@ #ifndef CUSTOMTRACKVIEW_H #define CUSTOMTRACKVIEW_H -#include +#include #include #include @@ -43,7 +43,6 @@ class AbstractClipItem; class AbstractGroupItem; class Transition; - class CustomTrackView : public QGraphicsView { Q_OBJECT @@ -156,6 +155,8 @@ public: int selectedTrack() const; QStringList selectedClips() const; QList selectedClipItems() const; + /** @brief Checks wheter an item can be inserted (make sure it does not overlap another item) */ + bool canBePastedTo(ItemInfo info, int type) const; /** @brief Selects a clip. * @param add Whether to select or deselect @@ -177,7 +178,6 @@ public: 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. @@ -204,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); @@ -348,9 +356,8 @@ private: /** Get the index of the video track that is just below current track */ int getPreviousVideoTrack(int track); - void updatePositionEffects(ClipItem * item, ItemInfo info); + void updatePositionEffects(ClipItem * item, ItemInfo info, bool standalone = true); bool insertDropClips(const QMimeData *data, const QPoint pos); - bool canBePastedTo(ItemInfo info, int type) const; bool canBePastedTo(QList infoList, int type) const; bool canBePasted(QList items, GenTime offset, int trackOffset) const; bool canBeMoved(QList items, GenTime offset, int trackOffset) const; @@ -418,6 +425,20 @@ private: * if the name is still the default one. */ void updateTrackNames(int track, bool added); + /** @brief Updates the duration stored in a track's TrackInfo. + * @param track Number of track as used in ItemInfo (not the numbering used in KdenliveDoc) (negative for all tracks) + * @param command If effects need to be updated the commands to do this will be attached to this undo command + * + * In addition to update the duration in TrackInfo it updates effects with keyframes on the track. */ + void updateTrackDuration(int track, QUndoCommand *command); + + /** @brief Adjusts effects after a clip resize. + * @param item The item that was resized + * @param oldInfo pre resize info + * @param fromStart false = resize from end + * @param command Used as a parent for EditEffectCommand */ + void adjustEffects(ClipItem *item, ItemInfo oldInfo, QUndoCommand *command); + private slots: void slotRefreshGuides(); void slotEnableRefresh(); @@ -429,13 +450,21 @@ private slots: void slotGoToMarker(QAction *action); void slotResetMenuPosition(); void slotDoResetMenuPosition(); + /** @brief Re-create the clip thumbnails. + * @param id The clip's Id string. + * @param resetThumbs Should we recreate the timeline thumbnails. */ + void slotRefreshThumbs(const QString &id, bool resetThumbs); signals: void cursorMoved(int, int); void zoomIn(); void zoomOut(); void mousePosition(int); - void clipItemSelected(ClipItem*, int ix = -1); + /** @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 transitionItemSelected(Transition*, int track = 0, QPoint p = QPoint(), bool update = false); void activateDocumentMonitor(); void trackHeightChanged();