]> git.sesse.net Git - kdenlive/blob - src/customtrackview.h
Fix unnecessary refresh of effect stack, set effect param description as tooltip
[kdenlive] / src / customtrackview.h
1 /***************************************************************************
2  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20
21 #ifndef CUSTOMTRACKVIEW_H
22 #define CUSTOMTRACKVIEW_H
23
24 #include <kdeversion.h>
25 #include <KColorScheme>
26
27 #include <QGraphicsView>
28 #include <QGraphicsItemAnimation>
29 #include <QTimeLine>
30 #include <QMenu>
31 #include <QUndoStack>
32 #include <QMutex>
33 #include <QWaitCondition>
34
35 #include "kdenlivedoc.h"
36 #include "docclipbase.h"
37 #include "guide.h"
38 #include "effectslist.h"
39 #include "customtrackscene.h"
40
41 class ClipItem;
42 class AbstractClipItem;
43 class AbstractGroupItem;
44 class Transition;
45 class AudioCorrelation;
46
47 class CustomTrackView : public QGraphicsView
48 {
49     Q_OBJECT
50
51 public:
52     CustomTrackView(KdenliveDoc *doc, CustomTrackScene* projectscene, QWidget *parent = 0);
53     virtual ~ CustomTrackView();
54     virtual void mousePressEvent(QMouseEvent * event);
55     virtual void mouseReleaseEvent(QMouseEvent * event);
56     virtual void mouseMoveEvent(QMouseEvent * event);
57     virtual void mouseDoubleClickEvent(QMouseEvent *event);
58     void addTrack(TrackInfo type, int ix = -1);
59     void removeTrack(int ix);
60     /** @brief Makes the document use new track infos (name, type, ...). */
61     void configTracks(QList <TrackInfo> trackInfos);
62     int cursorPos();
63     void checkAutoScroll();
64     /**
65       Move the clip at \c start to \c end.
66
67       If \c out_actualEnd is not NULL, it will be set to the position the clip really ended up at.
68       For example, attempting to move a clip to t = -1 s will actually move it to t = 0 s.
69       */
70     bool moveClip(const ItemInfo &start, const ItemInfo &end, bool refresh, ItemInfo *out_actualEnd = NULL);
71     void moveGroup(QList <ItemInfo> startClip, QList <ItemInfo> startTransition, const GenTime &offset, const int trackOffset, bool reverseMove = false);
72     /** move transition, startPos = (old start, old end), endPos = (new start, new end) */
73     void moveTransition(const ItemInfo &start, const ItemInfo &end, bool refresh);
74     void resizeClip(const ItemInfo &start, const ItemInfo &end, bool dontWorry = false);
75     void addClip(QDomElement xml, const QString &clipId, ItemInfo info, EffectsList list = EffectsList(), bool overwrite = false, bool push = false, bool refresh = true);
76     void deleteClip(ItemInfo info, bool refresh = true);
77     void slotDeleteClipMarker(const QString &comment, const QString &id, const GenTime &position);
78     void slotDeleteAllClipMarkers(const QString &id);
79     void addMarker(const QString &id, const CommentedTime marker);
80     void addData(const QString &id, const QString &key, const QString &data);
81     void setScale(double scaleFactor, double verticalScale);
82     void deleteClip(const QString &clipId);
83     /** @brief An effect was dropped on @param clip */
84     void slotDropEffect(ClipItem *clip, QDomElement effect, GenTime pos, int track);
85     /** @brief Add effect to current clip */
86     void slotAddEffect(QDomElement effect, GenTime pos, int track);
87     void slotAddGroupEffect(QDomElement effect, AbstractGroupItem *group, AbstractClipItem *dropTarget = NULL);
88     void addEffect(int track, GenTime pos, QDomElement effect);
89     void deleteEffect(int track, GenTime pos, QDomElement effect);
90     void updateEffect(int track, GenTime pos, QDomElement insertedEffect, bool refreshEffectStack = false);
91     /** @brief Enable / disable a list of effects */
92     void updateEffectState(int track, GenTime pos, QList <int> effectIndexes, bool disable, bool updateEffectStack);
93     void moveEffect(int track, GenTime pos, QList <int> oldPos, QList <int> newPos);
94     void addTransition(ItemInfo transitionInfo, int endTrack, QDomElement params, bool refresh);
95     void deleteTransition(ItemInfo transitionInfo, int endTrack, QDomElement params, bool refresh);
96     void updateTransition(int track, GenTime pos,  QDomElement oldTransition, QDomElement transition, bool updateTransitionWidget);
97     void moveTransition(GenTime oldpos, GenTime newpos);
98     void activateMonitor();
99     int duration() const;
100     void deleteSelectedClips();
101     /** @brief Cuts all clips that are selected at the timeline cursor position. */
102     void cutSelectedClips();
103     void setContextMenu(QMenu *timeline, QMenu *clip, QMenu *transition, QActionGroup *clipTypeGroup, QMenu *markermenu);
104     bool checkTrackHeight();
105     void updateSceneFrameWidth();
106     //QList <TrackInfo> tracksList() const;
107     void setTool(PROJECTTOOL tool);
108     ClipItem *cutClip(ItemInfo info, GenTime cutTime, bool cut, bool execute = true);
109     void slotSeekToPreviousSnap();
110     void slotSeekToNextSnap();
111     double getSnapPointForPos(double pos);
112     void editKeyFrame(const GenTime &pos, const int track, const int index, const QString &keyframes);
113     bool findString(const QString &text);
114     void selectFound(QString track, QString pos);
115     bool findNextString(const QString &text);
116     void initSearchStrings();
117     void clearSearchStrings();
118     QList<ItemInfo> findId(const QString &clipId);
119     void clipStart();
120     void clipEnd();
121     void doChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, const double speed, const double oldspeed, int strobe, const QString &id);
122     /** @brief Sets the document as modified. */
123     void setDocumentModified();
124     void setInPoint();
125     void setOutPoint();
126
127     /** @brief Prepares inserting space.
128     *
129     * Shows a dialog to configure length and track. */
130     void slotInsertSpace();
131     /** @brief Prepares removing space. */
132     void slotRemoveSpace();
133     void insertSpace(QList<ItemInfo> clipsToMove, QList<ItemInfo> transToMove, int track, const GenTime &duration, const GenTime &offset);
134     ClipItem *getActiveClipUnderCursor(bool allowOutsideCursor = false) const;
135     void deleteTimelineTrack(int ix, TrackInfo trackinfo);
136     void saveThumbnails();
137     void autoTransition();
138     void initCursorPos(int pos);
139
140     /** @brief Locks or unlocks a track.
141     * @param ix number of track
142     * @param lock whether to lock or unlock
143     * @param requestUpdate (default = true) Whether to request an update of the icon in the track header
144     *
145     * Makes sure no clip on track to lock is selected. */
146     void lockTrack(int ix, bool lock, bool requestUpdate = true);
147     void groupClips(bool group = true);
148     void doGroupClips(QList <ItemInfo> clipInfos, QList <ItemInfo> transitionInfos, bool group);
149     void loadGroups(const QDomNodeList &groups);
150
151     /** @brief Creates SplitAudioCommands for selected clips. */
152     void splitAudio();
153
154     /// Define which clip to take as reference for automatic audio alignment
155     void setAudioAlignReference();
156
157     /// Automatically align the currently selected clips to synchronize their audio with the reference's audio
158     void alignAudio();
159
160     /** @brief Seperates the audio of a clip to a audio track.
161     * @param pos Position of the clip to split
162     * @param track Track of the clip
163     * @param split Split or unsplit */
164     void doSplitAudio(const GenTime &pos, int track, EffectsList effects, bool split);
165     void setVideoOnly();
166     void setAudioOnly();
167     void setAudioAndVideo();
168     void doChangeClipType(const GenTime &pos, int track, bool videoOnly, bool audioOnly);
169     int hasGuide(int pos, int offset);
170     void reloadTransitionLumas();
171     void updateProjectFps();
172     double fps() const;
173     int selectedTrack() const;
174     QStringList selectedClips() const;
175     QList<ClipItem *> selectedClipItems() const;
176     /** @brief Checks wheter an item can be inserted (make sure it does not overlap another item) */
177     bool canBePastedTo(ItemInfo info, int type) const;
178
179     /** @brief Selects a clip.
180     * @param add Whether to select or deselect
181     * @param group (optional) Whether to add the clip to a group
182     * @param track (optional) The track of the clip (has to be combined with @param pos)
183     * @param pos (optional) The position of the clip (has to be combined with @param track) */
184     void selectClip(bool add, bool group = false, int track = -1, int pos = -1);
185     void selectTransition(bool add, bool group = false);
186     QStringList extractTransitionsLumas();
187     void setEditMode(EDITMODE mode);
188
189     /** @brief Inserts @param clip.
190     * @param clip The clip to insert
191     * @param in The inpoint of the clip (crop from start)
192     * @param out The outpoint of the clip (crop from end)
193     *
194     * Inserts at the position of timeline cursor and selected track. */
195     void insertClipCut(DocClipBase *clip, int in, int out);
196     void clearSelection(bool emitInfo = true);
197     void editItemDuration();
198     void buildGuidesMenu(QMenu *goMenu) const;
199     /** update the timeline objects when palette changes */
200     void updatePalette();
201     /** @brief Returns true if a track has audio data on it.
202     * @param track The track number
203     *
204     * Check whether given track has a clip with audio in it. */
205     bool hasAudio(int track) const;
206
207     int getFrameWidth();
208     /** @brief Returns last requested seeking pos (or SEEK_INACTIVE if no seek). */
209     int seekPosition() const;
210
211     /** @brief Trigger a monitor refresh. */
212     void monitorRefresh();
213     
214 public slots:
215     /** @brief Send seek request to MLT. */
216     void seekCursorPos(int pos);
217     /** @brief Move timeline cursor to new position. */
218     void setCursorPos(int pos);
219     void moveCursorPos(int delta);
220     void updateCursorPos();
221     void slotDeleteEffect(ClipItem *clip, int track, QDomElement effect, bool affectGroup = true);
222     void slotChangeEffectState(ClipItem *clip, int track, QList <int> effectIndexes, bool disable);
223     void slotChangeEffectPosition(ClipItem *clip, int track, QList <int> currentPos, int newPos);
224     void slotUpdateClipEffect(ClipItem *clip, int track, QDomElement oldeffect, QDomElement effect, int ix, bool refreshEffectStack = true);
225     void slotUpdateClipRegion(ClipItem *clip, int ix, QString region);
226     void slotRefreshEffects(ClipItem *clip);
227     void setDuration(int duration);
228     void slotAddTransition(ClipItem* clip, ItemInfo transitionInfo, int endTrack, QDomElement transition = QDomElement());
229     void slotAddTransitionToSelectedClips(QDomElement transition);
230     void slotTransitionUpdated(Transition *, QDomElement);
231     void slotSwitchTrackAudio(int ix);
232     void slotSwitchTrackVideo(int ix);
233     void slotSwitchTrackLock(int ix);
234     void slotUpdateClip(const QString &clipId, bool reload = true);
235     
236     /** @brief Add extra data to a clip. */
237     void slotAddClipExtraData(const QString &id, const QString &key, const QString &data = QString(), QUndoCommand *groupCommand = 0);
238     /** @brief Creates a AddClipCommand to add, edit or delete a marker.
239      * @param id Id of the marker's clip
240      * @param t Position of the marker
241      * @param c Comment of the marker */
242     void slotAddClipMarker(const QString &id, QList <CommentedTime> newMarker, QUndoCommand *groupCommand = 0);
243     void slotLoadClipMarkers(const QString &id);
244     void slotSaveClipMarkers(const QString &id);
245     bool addGuide(const GenTime &pos, const QString &comment);
246
247     /** @brief Shows a dialog for adding a guide.
248      * @param dialog (default = true) false = do not show the dialog but use current position as position and comment */
249     void slotAddGuide(bool dialog = true);
250     void slotEditGuide(CommentedTime guide);
251     void slotEditGuide(int guidePos = -1);
252     void slotDeleteGuide(int guidePos = -1);
253     void slotDeleteAllGuides();
254     void editGuide(const GenTime &oldPos, const GenTime &pos, const QString &comment);
255     void copyClip();
256     void pasteClip();
257     void pasteClipEffects();
258     void slotUpdateAllThumbs();
259     void slotCheckPositionScrolling();
260     void slotInsertTrack(int ix);
261
262     /** @brief Shows a dialog for selecting a track to delete.
263     * @param ix Number of the track, which should be pre-selected in the dialog */
264     void slotDeleteTrack(int ix);
265     /** @brief Shows the configure tracks dialog. */
266     void slotConfigTracks(int ix);
267     void clipNameChanged(const QString &id, const QString &name);
268     void slotTrackUp();
269     void slotTrackDown();
270     void slotSelectTrack(int ix);
271     void insertZoneOverwrite(QStringList data, int in);
272
273     /** @brief Rebuilds a group to fit again after children changed.
274     * @param childTrack the track of one of the groups children
275     * @param childPos The position of the same child */
276     void rebuildGroup(int childTrack, GenTime childPos);
277     /** @brief Rebuilds a group to fit again after children changed.
278     * @param group The group to rebuild */
279     void rebuildGroup(AbstractGroupItem *group);
280
281     /** @brief Cuts a group into two parts.
282     * @param clips1 Clips before the cut
283     * @param transitions1 Transitions before the cut
284     * @param clipsCut Clips that need to be cut
285     * @param transitionsCut Transitions that need to be cut
286     * @param clips2 Clips behind the cut
287     * @param transitions2 Transitions behind the cut
288     * @param cutPos Absolute position of the cut
289     * @param cut true = cut, false = "uncut" */
290     void slotRazorGroup(QList <ItemInfo> clips1, QList <ItemInfo> transitions1, QList <ItemInfo> clipsCut, QList <ItemInfo> transitionsCut, QList <ItemInfo> clips2, QList <ItemInfo> transitions2, GenTime cutPos, bool cut);
291
292     /** @brief Add en effect to a track.
293     * @param effect The new effect xml
294     * @param ix The track index */
295     void slotAddTrackEffect(const QDomElement &effect, int ix);
296     /** @brief Select all clips in selected track. */
297     void slotSelectClipsInTrack();
298     /** @brief Select all clips in timeline. */
299     void slotSelectAllClips();
300
301     /** @brief Update the list of snap points (sticky timeline hotspots).
302     * @param selected The currently selected clip if any
303     * @param offsetList The list of points that should also snap (for example when movin a clip, start and end points should snap
304     * @param skipSelectedItems if true, the selected item start and end points will not be added to snap list */
305     void updateSnapPoints(AbstractClipItem *selected, QList <GenTime> offsetList = QList <GenTime> (), bool skipSelectedItems = false);
306     
307     void slotAddEffect(ClipItem *clip, QDomElement effect);
308     void slotImportClipKeyframes(GRAPHICSRECTITEM type);
309
310     /** @brief Get effect parameters ready for MLT*/
311     static void adjustEffectParameters(EffectsParameterList &parameters, QDomNodeList params, MltVideoProfile profile, const QString &prefix = QString());
312         /** @brief Move playhead to mouse curser position if defined key is pressed */
313     void slotAlignPlayheadToMousePos();
314
315 protected:
316     virtual void drawBackground(QPainter * painter, const QRectF & rect);
317     //virtual void drawForeground ( QPainter * painter, const QRectF & rect );
318     virtual void dragEnterEvent(QDragEnterEvent * event);
319     virtual void dragMoveEvent(QDragMoveEvent * event);
320     virtual void dragLeaveEvent(QDragLeaveEvent * event);
321     /** @brief Something has been dropped onto the timeline */
322     virtual void dropEvent(QDropEvent * event);
323     virtual void wheelEvent(QWheelEvent * e);
324     virtual void keyPressEvent(QKeyEvent * event);
325     virtual QStringList mimeTypes() const;
326     virtual Qt::DropActions supportedDropActions() const;
327
328 private:
329     int m_ct;
330     int m_tracksHeight;
331     int m_projectDuration;
332     int m_cursorPos;
333     KdenliveDoc *m_document;
334     CustomTrackScene *m_scene;
335     QGraphicsLineItem *m_cursorLine;
336     ItemInfo m_dragItemInfo;
337     ItemInfo m_selectionGroupInfo;
338     OPERATIONTYPE m_operationMode;
339     OPERATIONTYPE m_moveOpMode;
340     AbstractClipItem *m_dragItem;
341     Guide *m_dragGuide;
342     QUndoStack *m_commandStack;
343     QGraphicsItem *m_visualTip;
344     QGraphicsItemAnimation *m_animation;
345     QTimeLine *m_animationTimer;
346     QColor m_tipColor;
347     QPen m_tipPen;
348     QPoint m_clickPoint;
349     QPoint m_clickEvent;
350     QList <CommentedTime> m_searchPoints;
351     QList <Guide *> m_guides;
352
353     ClipItem *getClipItemAt(int pos, int track);
354     ClipItem *getClipItemAt(GenTime pos, int track);
355     ClipItem *getClipItemAtEnd(GenTime pos, int track);
356     ClipItem *getClipItemAtStart(GenTime pos, int track);
357     Transition *getTransitionItem(TransitionInfo info);
358     Transition *getTransitionItemAt(int pos, int track);
359     Transition *getTransitionItemAt(GenTime pos, int track);
360     Transition *getTransitionItemAtEnd(GenTime pos, int track);
361     Transition *getTransitionItemAtStart(GenTime pos, int track);
362     void checkScrolling();
363     /** Should we auto scroll while playing (keep in sync with KdenliveSettings::autoscroll() */
364     bool m_autoScroll;
365     void displayContextMenu(QPoint pos, AbstractClipItem *clip, AbstractGroupItem *group);
366     QMenu *m_timelineContextMenu;
367     QMenu *m_timelineContextClipMenu;
368     QMenu *m_timelineContextTransitionMenu;
369     QMenu *m_markerMenu;
370     QAction *m_autoTransition;
371     QAction *m_pasteEffectsAction;
372     QAction *m_ungroupAction;
373     QAction *m_editGuide;
374     QAction *m_deleteGuide;
375     QList <QAction*> m_audioActions;
376     QList <QAction*> m_avActions;
377     QActionGroup *m_clipTypeGroup;
378     QTimer m_scrollTimer;
379     QTimer m_thumbsTimer;
380     int m_scrollOffset;
381     bool m_clipDrag;
382
383     int m_findIndex;
384     PROJECTTOOL m_tool;
385     QCursor m_razorCursor;
386     QCursor m_spacerCursor;
387     /** list containing items currently copied in the timeline */
388     QList<AbstractClipItem *> m_copiedItems;
389     /** Used to get the point in timeline where a context menu was opened */
390     QPoint m_menuPosition;
391     bool m_blockRefresh;
392     AbstractGroupItem *m_selectionGroup;
393     QList <ClipItem *> m_waitingThumbs;
394     int m_selectedTrack;
395     int m_spacerOffset;
396
397     QMutex m_mutex;
398     QWaitCondition m_producerNotReady;
399     KStatefulBrush m_activeTrackBrush;
400
401     AudioCorrelation *m_audioCorrelator;
402     ClipItem *m_audioAlignmentReference;
403
404     /** stores the state of the control modifier during mouse press.
405      * Will then be used to identify whether we resize a group or only one item of it. */
406     bool m_controlModifier;
407
408     /** Get the index of the video track that is just below current track */
409     int getPreviousVideoTrack(int track);
410     void updatePositionEffects(ClipItem * item, ItemInfo info, bool standalone = true);
411     bool insertDropClips(const QMimeData *data, const QPoint &pos);
412     bool canBePastedTo(QList <ItemInfo> infoList, int type) const;
413     bool canBePasted(QList<AbstractClipItem *> items, GenTime offset, int trackOffset) const;
414     bool canBeMoved(QList<AbstractClipItem *> items, GenTime offset, int trackOffset) const;
415     ClipItem *getClipUnderCursor() const;
416     AbstractClipItem *getMainActiveClip() const;
417     void resetSelectionGroup(bool selectItems = true);
418     void groupSelectedItems(QList <QGraphicsItem *> selection = QList <QGraphicsItem *>(), bool createNewGroup = false, bool selectNewGroup = false);
419     /** Get available space for clip move (min and max free positions) */
420     void getClipAvailableSpace(AbstractClipItem *item, GenTime &minimum, GenTime &maximum);
421     /** Get available space for transition move (min and max free positions) */
422     void getTransitionAvailableSpace(AbstractClipItem *item, GenTime &minimum, GenTime &maximum);
423     void updateClipTypeActions(ClipItem *clip);
424     /** Whether an item can be moved to a new position without colliding with similar items */
425     bool itemCollision(AbstractClipItem *item, ItemInfo newPos);
426     /** Selects all items in the scene rect, and sets ok to false if a group going over several tracks is found in it */
427     QList<QGraphicsItem *> checkForGroups(const QRectF &rect, bool *ok);
428     /** Adjust clips under another one when working in overwrite mode */
429     void adjustTimelineClips(EDITMODE mode, ClipItem *item, ItemInfo posinfo, QUndoCommand *command);
430     void adjustTimelineTransitions(EDITMODE mode, Transition *item, QUndoCommand *command);
431     /** Adjust keyframes when pasted to another clip */
432     void adjustKeyfames(GenTime oldstart, GenTime newstart, GenTime duration, QDomElement xml);
433
434     /** @brief Removes the tip and stops the animation timer. */
435     void removeTipAnimation();
436     /** @brief Creates a new tip animation.
437     * @param clip clip to display the tip on
438     * @param mode operation mode for which the tip should be displayed
439     * @param size size of the tip */
440     void setTipAnimation(AbstractClipItem *clip, OPERATIONTYPE mode, const double size);
441
442     /** @brief Takes care of updating effects and attached transitions during a resize from start.
443     * @param item Item to resize
444     * @param oldInfo The item's info before resizement (set to item->info() is @param check true)
445     * @param pos New startPos
446     * @param check (optional, default = false) Whether to check for collisions
447     * @param command (optional) Will be used as parent command (for undo history) */
448     void prepareResizeClipStart(AbstractClipItem *item, ItemInfo oldInfo, int pos, bool check = false, QUndoCommand *command = NULL);
449
450     /** @brief Takes care of updating effects and attached transitions during a resize from end.
451     * @param item Item to resize
452     * @param oldInfo The item's info before resizement (set to item->info() is @param check true)
453     * @param pos New endPos
454     * @param check (optional, default = false) Whether to check for collisions
455     * @param command (optional) Will be used as parent command (for undo history) */
456     void prepareResizeClipEnd(AbstractClipItem *item, ItemInfo oldInfo, int pos, bool check = false, QUndoCommand *command = NULL);
457
458     /** @brief Collects information about the group's children to pass it on to RazorGroupCommand.
459     * @param group The group to cut
460     * @param cutPos The absolute position of the cut */
461     void razorGroup(AbstractGroupItem *group, GenTime cutPos);
462
463     /** @brief Gets the effect parameters that will be passed to Mlt. */
464     EffectsParameterList getEffectArgs(const QDomElement &effect);
465
466     /** @brief Update Tracknames to fit again after track was added/deleted.
467      * @param track Number of track which was added/deleted
468      * @param added true = track added, false = track deleted
469      * 
470      * The default track name consists of type + number. If we add/delete a track the number has to be adjusted
471      * if the name is still the default one. */
472     void updateTrackNames(int track, bool added);
473
474     /** @brief Updates the duration stored in a track's TrackInfo.
475      * @param track Number of track as used in ItemInfo (not the numbering used in KdenliveDoc) (negative for all tracks)
476      * @param command If effects need to be updated the commands to do this will be attached to this undo command
477      * 
478      * In addition to update the duration in TrackInfo it updates effects with keyframes on the track. */
479     void updateTrackDuration(int track, QUndoCommand *command);
480
481     /** @brief Adjusts effects after a clip resize.
482      * @param item The item that was resized
483      * @param oldInfo pre resize info
484      * @param fromStart false = resize from end
485      * @param command Used as a parent for EditEffectCommand */
486     void adjustEffects(ClipItem *item, ItemInfo oldInfo, QUndoCommand *command);
487     
488     /** @brief Prepare an add clip command for an effect */
489     void processEffect(ClipItem *item, QDomElement effect, int offset, QUndoCommand *effectCommand);
490
491 private slots:
492     void slotRefreshGuides();
493     void slotEnableRefresh();
494     void slotCheckMouseScrolling();
495     void slotEditTimeLineGuide();
496     void slotDeleteTimeLineGuide();
497     void slotFetchNextThumbs();
498     void checkTrackSequence(int track);
499     void slotGoToMarker(QAction *action);
500     void slotResetMenuPosition();
501     void slotDoResetMenuPosition();
502     /** @brief Re-create the clip thumbnails.
503      *  @param id The clip's Id string.
504      *  @param resetThumbs Should we recreate the timeline thumbnails. */
505     void slotRefreshThumbs(const QString &id, bool resetThumbs);
506     /** @brief A Filter job producer results. */
507     void slotGotFilterJobResults(const QString &id, int startPos, int track, stringMap filterParams, stringMap extra);
508
509
510 signals:
511     void cursorMoved(int, int);
512     void zoomIn();
513     void zoomOut();
514     void mousePosition(int);
515     /** @brief A clip was selected in timeline, update the effect stack
516      *  @param clip The clip
517      *  @param raise If true, the effect stack widget will be raised (come to front). */
518     void clipItemSelected(ClipItem *clip, bool raise = true);
519     void transitionItemSelected(Transition*, int track = 0, QPoint p = QPoint(), bool update = false);
520     void activateDocumentMonitor();
521     void trackHeightChanged();
522     void tracksChanged();
523     void displayMessage(const QString &, MessageType);
524     void showClipFrame(DocClipBase *, QPoint, bool, const int);
525     void doTrackLock(int, bool);
526     void updateClipMarkers(DocClipBase *);
527     void updateClipExtraData(DocClipBase *);
528     void updateTrackHeaders();
529     void playMonitor();
530     /** @brief Monitor document changes (for example the presence of audio data in timeline for export widget.*/
531     void documentModified();
532     void forceClipProcessing(const QString &);
533     void showTrackEffects(int, TrackInfo);
534     /** @brief Update the track effect button that shows if a track has effects or not.*/
535     void updateTrackEffectState(int);
536     /** @brief Cursor position changed, repaint ruler.*/
537     void updateRuler();
538     /** @brief Send data from a clip to be imported as keyframes for effect / transition.*/
539     void importKeyframes(GRAPHICSRECTITEM type, const QString&, int maximum);
540 };
541
542 #endif
543