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