X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcustomtrackview.h;h=d8d8ad4eecbf4ca65859bbb1909ea39da82091cf;hb=79115f0c91d8239e074baedc070d392297f3fc4b;hp=f27f9710d489ee7a850bf5f1e3d6bcdbd30c49e8;hpb=cdf2b2a097309ddfa428cc6b0650b907fbfe3dde;p=kdenlive diff --git a/src/customtrackview.h b/src/customtrackview.h index f27f9710..d8d8ad4e 100644 --- a/src/customtrackview.h +++ b/src/customtrackview.h @@ -55,11 +55,11 @@ public: virtual void mouseReleaseEvent(QMouseEvent * event); virtual void mouseMoveEvent(QMouseEvent * event); virtual void mouseDoubleClickEvent(QMouseEvent *event); - void addTrack(TrackInfo type, int ix = -1); + void addTrack(const TrackInfo &type, int ix = -1); void removeTrack(int ix); /** @brief Makes the document use new track infos (name, type, ...). */ - void configTracks(QList trackInfos); - int cursorPos(); + void configTracks(const QList &trackInfos); + int cursorPos() const; void checkAutoScroll(); /** Move the clip at \c start to \c end. @@ -68,7 +68,7 @@ public: 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 startClip, QList startTransition, const GenTime &offset, const int trackOffset, bool reverseMove = false); + void moveGroup(QList startClip, QList 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 refresh); void resizeClip(const ItemInfo &start, const ItemInfo &end, bool dontWorry = false); @@ -76,23 +76,24 @@ public: 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 CommentedTime marker); + void addMarker(const QString &id, const CommentedTime &marker); void addData(const QString &id, const QString &key, const QString &data); void setScale(double scaleFactor, double verticalScale); void deleteClip(const QString &clipId); + /** @brief An effect was dropped on @param clip */ + void slotDropEffect(ClipItem *clip, QDomElement effect, GenTime pos, int track); /** @brief Add effect to current clip */ - void slotAddEffect(QDomElement effect, GenTime pos, int track); + void slotAddEffect(QDomElement effect, const GenTime &pos, int track); void slotAddGroupEffect(QDomElement effect, AbstractGroupItem *group, AbstractClipItem *dropTarget = NULL); void addEffect(int track, GenTime pos, QDomElement effect); - void deleteEffect(int track, GenTime pos, QDomElement effect); + void deleteEffect(int track, const GenTime &pos, const QDomElement &effect); void updateEffect(int track, GenTime pos, QDomElement insertedEffect, bool refreshEffectStack = false); /** @brief Enable / disable a list of effects */ void updateEffectState(int track, GenTime pos, QList effectIndexes, bool disable, bool updateEffectStack); - void moveEffect(int track, GenTime pos, QList oldPos, QList newPos); - void addTransition(ItemInfo transitionInfo, int endTrack, QDomElement params, bool refresh); - void deleteTransition(ItemInfo transitionInfo, int endTrack, QDomElement params, bool refresh); - void updateTransition(int track, GenTime pos, QDomElement oldTransition, QDomElement transition, bool updateTransitionWidget); - void moveTransition(GenTime oldpos, GenTime newpos); + void moveEffect(int track, const GenTime &pos, const QList &oldPos, const QList &newPos); + void addTransition(const ItemInfo &transitionInfo, int endTrack, const QDomElement ¶ms, bool refresh); + void deleteTransition(const ItemInfo &transitionInfo, int endTrack, QDomElement params, bool refresh); + void updateTransition(int track, const GenTime &pos, const QDomElement &oldTransition, const QDomElement &transition, bool updateTransitionWidget); void activateMonitor(); int duration() const; void deleteSelectedClips(); @@ -103,7 +104,7 @@ public: void updateSceneFrameWidth(); //QList tracksList() const; void setTool(PROJECTTOOL tool); - ClipItem *cutClip(ItemInfo info, GenTime cutTime, bool cut, bool execute = true); + ClipItem *cutClip(const ItemInfo &info, const GenTime &cutTime, bool cut, const EffectsList &oldStack = EffectsList(), bool execute = true); void slotSeekToPreviousSnap(); void slotSeekToNextSnap(); double getSnapPointForPos(double pos); @@ -116,7 +117,7 @@ public: QList findId(const QString &clipId); void clipStart(); void clipEnd(); - void doChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, const double speed, const double oldspeed, int strobe, const QString &id); + void doChangeClipSpeed(ItemInfo info, const ItemInfo &speedIndependantInfo, const double speed, const double oldspeed, int strobe, const QString &id); /** @brief Sets the document as modified. */ void setDocumentModified(); void setInPoint(); @@ -142,7 +143,7 @@ public: * * Makes sure no clip on track to lock is selected. */ void lockTrack(int ix, bool lock, bool requestUpdate = true); - void groupClips(bool group = true); + void groupClips(bool group = true, QList itemList = QList(), QUndoCommand *command = NULL); void doGroupClips(QList clipInfos, QList transitionInfos, bool group); void loadGroups(const QDomNodeList &groups); @@ -202,13 +203,16 @@ public: * Check whether given track has a clip with audio in it. */ bool hasAudio(int track) const; - int getFrameWidth(); + int getFrameWidth() const; /** @brief Returns last requested seeking pos (or SEEK_INACTIVE if no seek). */ int seekPosition() const; /** @brief Trigger a monitor refresh. */ void monitorRefresh(); + /** @brief Returns frame number of current mouse position. */ + int getMousePos() const; + public slots: /** @brief Send seek request to MLT. */ void seekCursorPos(int pos); @@ -245,7 +249,7 @@ public slots: /** @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(const CommentedTime &guide); void slotEditGuide(int guidePos = -1); void slotDeleteGuide(int guidePos = -1); void slotDeleteAllGuides(); @@ -271,22 +275,11 @@ public slots: /** @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); + void rebuildGroup(int childTrack, const 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 clips1, QList transitions1, QList clipsCut, QList transitionsCut, QList clips2, QList transitions2, GenTime cutPos, bool cut); - /** @brief Add en effect to a track. * @param effect The new effect xml * @param ix The track index */ @@ -302,11 +295,13 @@ public slots: * @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); - void slotAddEffect(ClipItem *clip, QDomElement effect); + void slotAddEffect(ClipItem *clip, const QDomElement &effect); void slotImportClipKeyframes(GRAPHICSRECTITEM type); /** @brief Get effect parameters ready for MLT*/ static void adjustEffectParameters(EffectsParameterList ¶meters, QDomNodeList params, MltVideoProfile profile, const QString &prefix = QString()); + /** @brief Move playhead to mouse curser position if defined key is pressed */ + void slotAlignPlayheadToMousePos(); protected: virtual void drawBackground(QPainter * painter, const QRectF & rect); @@ -368,6 +363,8 @@ private: QAction *m_ungroupAction; QAction *m_editGuide; QAction *m_deleteGuide; + QList m_audioActions; + QList m_avActions; QActionGroup *m_clipTypeGroup; QTimer m_scrollTimer; QTimer m_thumbsTimer; @@ -388,6 +385,7 @@ private: int m_selectedTrack; int m_spacerOffset; + QMutex m_selectionMutex; QMutex m_mutex; QWaitCondition m_producerNotReady; KStatefulBrush m_activeTrackBrush; @@ -401,7 +399,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); + void updatePositionEffects(ClipItem * item, const ItemInfo &info, bool standalone = true); bool insertDropClips(const QMimeData *data, const QPoint &pos); bool canBePastedTo(QList infoList, int type) const; bool canBePasted(QList items, GenTime offset, int trackOffset) const; @@ -409,14 +407,14 @@ private: ClipItem *getClipUnderCursor() const; AbstractClipItem *getMainActiveClip() const; void resetSelectionGroup(bool selectItems = true); - void groupSelectedItems(QList selection = QList (), bool force = false, bool createNewGroup = false, bool selectNewGroup = false); + void groupSelectedItems(QList selection = QList (), bool createNewGroup = false, bool selectNewGroup = false); /** Get available space for clip move (min and max free positions) */ void getClipAvailableSpace(AbstractClipItem *item, GenTime &minimum, GenTime &maximum); /** Get available space for transition move (min and max free positions) */ void getTransitionAvailableSpace(AbstractClipItem *item, GenTime &minimum, GenTime &maximum); void updateClipTypeActions(ClipItem *clip); /** Whether an item can be moved to a new position without colliding with similar items */ - bool itemCollision(AbstractClipItem *item, ItemInfo newPos); + bool itemCollision(AbstractClipItem *item, const ItemInfo &newPos); /** Selects all items in the scene rect, and sets ok to false if a group going over several tracks is found in it */ QList checkForGroups(const QRectF &rect, bool *ok); /** Adjust clips under another one when working in overwrite mode */ @@ -530,7 +528,7 @@ signals: /** @brief Cursor position changed, repaint ruler.*/ void updateRuler(); /** @brief Send data from a clip to be imported as keyframes for effect / transition.*/ - void importKeyframes(GRAPHICSRECTITEM type, const QString&); + void importKeyframes(GRAPHICSRECTITEM type, const QString&, int maximum); }; #endif