18 #ifndef TIMELINEDOCK_H 19 #define TIMELINEDOCK_H 21 #include <QDockWidget> 22 #include <QQuickWidget> 23 #include <QApplication> 24 #include "models/multitrackmodel.h" 25 #include "sharedframe.h" 36 class TimelineDock :
public QDockWidget
39 Q_PROPERTY(
int position READ position WRITE setPosition NOTIFY positionChanged)
40 Q_PROPERTY(
int currentTrack READ currentTrack WRITE setCurrentTrack NOTIFY currentTrackChanged)
41 Q_PROPERTY(QList<int> selection READ selection WRITE setSelection NOTIFY selectionChanged)
44 explicit TimelineDock(QWidget *parent = 0);
52 MultitrackModel* model() {
return &m_model; }
53 int position()
const {
return m_position; }
54 void setPosition(
int position);
55 Mlt::ClipInfo* getClipInfo(
int trackIndex,
int clipIndex);
56 Mlt::Producer* producerForClip(
int trackIndex,
int clipIndex);
57 int clipIndexAtPlayhead(
int trackIndex = -1);
58 int clipIndexAtPosition(
int trackIndex,
int position);
59 void chooseClipAtPosition(
int position,
int& trackIndex,
int& clipIndex);
60 void setCurrentTrack(
int currentTrack);
61 int currentTrack()
const;
62 int clipCount(
int trackIndex)
const;
66 void makeTracksShorter();
67 void makeTracksTaller();
68 void setSelection(QList<int> selection = QList<int>(),
int trackIndex = -1,
bool isMultitrack =
false);
69 QList<int> selection()
const;
70 void saveAndClearSelection();
71 void restoreSelection();
72 void selectClipUnderPlayhead();
73 int centerOfClip(
int trackIndex,
int clipIndex);
74 bool isTrackLocked(
int trackIndex)
const;
75 void trimClipAtPlayhead(TrimLocation location,
bool ripple);
76 bool isRipple()
const;
77 Q_INVOKABLE
bool isMultitrackSelected()
const {
return m_selection.isMultitrackSelected; }
78 Q_INVOKABLE
int selectedTrack()
const {
return m_selection.selectedTrack; }
79 Q_INVOKABLE
bool isFloating()
const {
return QDockWidget::isFloating(); }
80 Q_INVOKABLE
void copyToSource();
81 Q_INVOKABLE
static void openProperties();
84 void currentTrackChanged();
85 void selectionChanged();
86 void seeked(
int position);
87 void positionChanged();
88 void clipOpened(Mlt::Producer* producer);
89 void dragging(
const QPointF& pos,
int duration);
91 void dropAccepted(
const QString &xml);
92 void fadeInChanged(
int duration);
93 void fadeOutChanged(
int duration);
94 void selected(Mlt::Producer* producer);
96 void showStatusMessage(QString);
98 void clipMoved(
int fromTrack,
int toTrack,
int clipIndex,
int position,
bool ripple);
99 void filteredClicked();
100 void imageDurationChanged();
101 void transitionAdded(
int trackIndex,
int clipIndex,
int position,
bool ripple);
104 void addAudioTrack();
105 void addVideoTrack();
107 void onSeeked(
int position);
108 void append(
int trackIndex);
109 void remove(
int trackIndex,
int clipIndex);
110 bool mergeClipWithNext(
int trackIndex,
int clipIndex,
bool dryrun);
111 void lift(
int trackIndex,
int clipIndex);
112 void removeSelection(
bool withCopy =
false);
113 void liftSelection();
114 void selectTrack(
int by);
115 void selectTrackHead(
int trackIndex);
116 void selectMultitrack();
117 void copyClip(
int trackIndex,
int clipIndex);
118 void setTrackName(
int trackIndex,
const QString& value);
119 void toggleTrackMute(
int trackIndex);
120 void toggleTrackHidden(
int trackIndex);
121 void setTrackComposite(
int trackIndex,
bool composite);
122 void setTrackLock(
int trackIndex,
bool lock);
123 bool moveClip(
int fromTrack,
int toTrack,
int clipIndex,
int position,
bool ripple);
124 void onClipMoved(
int fromTrack,
int toTrack,
int clipIndex,
int position,
bool ripple);
125 bool trimClipIn(
int trackIndex,
int clipIndex,
int oldClipIndex,
int delta,
bool ripple);
126 bool trimClipOut(
int trackIndex,
int clipIndex,
int delta,
bool ripple);
127 void insert(
int trackIndex,
int position = -1,
const QString &xml = QString());
128 void overwrite(
int trackIndex,
int position = -1,
const QString &xml = QString());
129 void appendFromPlaylist(Mlt::Playlist* playlist);
130 void splitClip(
int trackIndex = -1,
int clipIndex = -1);
131 void fadeIn(
int trackIndex,
int clipIndex = -1,
int duration = -1);
132 void fadeOut(
int trackIndex,
int clipIndex = -1,
int duration = -1);
133 void seekPreviousEdit();
135 void seekInPoint(
int clipIndex);
136 void clearSelectionIfInvalid();
139 void onProducerChanged(Mlt::Producer*);
140 void emitSelectedFromSelection();
141 void remakeAudioLevels(
int trackIndex,
int clipIndex,
bool force =
true);
142 void commitTrimCommand();
143 void onRowsInserted(
const QModelIndex& parent,
int first,
int last);
144 void onRowsRemoved(
const QModelIndex& parent,
int first,
int last);
145 void detachAudio(
int trackIndex,
int clipIndex);
148 void dragEnterEvent(QDragEnterEvent* event);
149 void dragMoveEvent(QDragMoveEvent* event);
150 void dragLeaveEvent(QDragLeaveEvent* event);
151 void dropEvent(QDropEvent* event);
152 bool event(QEvent *event);
153 void keyPressEvent(QKeyEvent* event);
154 void keyReleaseEvent(QKeyEvent* event);
157 bool isBlank(
int trackIndex,
int clipIndex);
158 void pulseLockButtonOnTrack(
int trackIndex);
160 Ui::TimelineDock *ui;
161 QQuickWidget m_quickView;
162 MultitrackModel m_model;
164 QScopedPointer<Timeline::UpdateCommand> m_updateCommand;
165 bool m_ignoreNextPositionChange;
167 QList<int> selectedClips;
169 bool isMultitrackSelected;
171 Selection m_selection;
172 Selection m_savedSelection;
173 QScopedPointer<Timeline::TrimCommand> m_trimCommand;
174 QScopedPointer<UndoHelper> m_undoHelper;
176 int m_transitionDelta;
179 void load(
bool force =
false);
180 void onTopLevelChanged(
bool floating);
181 void onTransitionAdded(
int trackIndex,
int clipIndex,
int position,
bool ripple);
184 #endif // TIMELINEDOCK_H The SharedFrame provides thread safe access to Mlt::Frame data.
Definition: sharedframe.h:48