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(QVariantList selection READ selectionForJS WRITE setSelectionFromJS 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 setSelectionFromJS(
const QVariantList& list);
69 void setSelection(QList<QPoint> selection = QList<QPoint>(),
int trackIndex = -1,
bool isMultitrack =
false);
70 QVariantList selectionForJS()
const;
71 QList<QPoint> selection()
const;
72 void saveAndClearSelection();
73 void restoreSelection();
74 void selectClipUnderPlayhead();
75 int centerOfClip(
int trackIndex,
int clipIndex);
76 bool isTrackLocked(
int trackIndex)
const;
77 void trimClipAtPlayhead(TrimLocation location,
bool ripple);
78 bool isRipple()
const;
79 Q_INVOKABLE
bool isMultitrackSelected()
const {
return m_selection.isMultitrackSelected; }
80 Q_INVOKABLE
int selectedTrack()
const {
return m_selection.selectedTrack; }
81 Q_INVOKABLE
bool isFloating()
const {
return QDockWidget::isFloating(); }
82 Q_INVOKABLE
void copyToSource();
83 Q_INVOKABLE
static void openProperties();
86 void currentTrackChanged();
87 void selectionChanged();
88 void seeked(
int position);
89 void positionChanged();
90 void clipOpened(Mlt::Producer* producer);
91 void dragging(
const QPointF& pos,
int duration);
93 void dropAccepted(
const QString &xml);
94 void fadeInChanged(
int duration);
95 void fadeOutChanged(
int duration);
96 void selected(Mlt::Producer* producer);
98 void showStatusMessage(QString);
100 void clipMoved(
int fromTrack,
int toTrack,
int clipIndex,
int position,
bool ripple);
101 void filteredClicked();
102 void imageDurationChanged();
103 void transitionAdded(
int trackIndex,
int clipIndex,
int position,
bool ripple);
106 void addAudioTrack();
107 void addVideoTrack();
109 void onSeeked(
int position);
110 void append(
int trackIndex);
111 void remove(
int trackIndex,
int clipIndex);
112 bool mergeClipWithNext(
int trackIndex,
int clipIndex,
bool dryrun);
113 void lift(
int trackIndex,
int clipIndex);
114 void removeSelection(
bool withCopy =
false);
115 void liftSelection();
116 void selectTrack(
int by);
117 void selectTrackHead(
int trackIndex);
118 void selectMultitrack();
119 void copyClip(
int trackIndex,
int clipIndex);
120 void setTrackName(
int trackIndex,
const QString& value);
121 void toggleTrackMute(
int trackIndex);
122 void toggleTrackHidden(
int trackIndex);
123 void setTrackComposite(
int trackIndex,
bool composite);
124 void setTrackLock(
int trackIndex,
bool lock);
125 bool moveClip(
int fromTrack,
int toTrack,
int clipIndex,
int position,
bool ripple);
126 void onClipMoved(
int fromTrack,
int toTrack,
int clipIndex,
int position,
bool ripple);
127 bool trimClipIn(
int trackIndex,
int clipIndex,
int oldClipIndex,
int delta,
bool ripple);
128 bool trimClipOut(
int trackIndex,
int clipIndex,
int delta,
bool ripple);
129 void insert(
int trackIndex,
int position = -1,
const QString &xml = QString(),
bool seek =
true);
130 void overwrite(
int trackIndex,
int position = -1,
const QString &xml = QString(),
bool seek =
true);
131 void appendFromPlaylist(Mlt::Playlist* playlist);
132 void splitClip(
int trackIndex = -1,
int clipIndex = -1);
133 void fadeIn(
int trackIndex,
int clipIndex = -1,
int duration = -1);
134 void fadeOut(
int trackIndex,
int clipIndex = -1,
int duration = -1);
135 void seekPreviousEdit();
137 void seekInPoint(
int clipIndex);
138 void clearSelectionIfInvalid();
141 void onProducerChanged(Mlt::Producer*);
142 void emitSelectedFromSelection();
143 void remakeAudioLevels(
int trackIndex,
int clipIndex,
bool force =
true);
144 void commitTrimCommand();
145 void onRowsInserted(
const QModelIndex& parent,
int first,
int last);
146 void onRowsRemoved(
const QModelIndex& parent,
int first,
int last);
147 void detachAudio(
int trackIndex,
int clipIndex);
151 void dragEnterEvent(QDragEnterEvent* event);
152 void dragMoveEvent(QDragMoveEvent* event);
153 void dragLeaveEvent(QDragLeaveEvent* event);
154 void dropEvent(QDropEvent* event);
155 bool event(QEvent *event);
156 void keyPressEvent(QKeyEvent* event);
157 void keyReleaseEvent(QKeyEvent* event);
160 bool isBlank(
int trackIndex,
int clipIndex);
161 void pulseLockButtonOnTrack(
int trackIndex);
163 Ui::TimelineDock *ui;
164 QQuickWidget m_quickView;
165 MultitrackModel m_model;
167 QScopedPointer<Timeline::UpdateCommand> m_updateCommand;
168 bool m_ignoreNextPositionChange;
170 QList<QPoint> selectedClips;
172 bool isMultitrackSelected;
174 Selection m_selection;
175 Selection m_savedSelection;
176 QScopedPointer<Timeline::TrimCommand> m_trimCommand;
177 QScopedPointer<UndoHelper> m_undoHelper;
179 int m_transitionDelta;
182 void load(
bool force =
false);
183 void onTopLevelChanged(
bool floating);
184 void onTransitionAdded(
int trackIndex,
int clipIndex,
int position,
bool ripple);
185 void onInserted(
int trackIndex,
int clipIndex);
186 void onOverWritten(
int trackIndex,
int clipIndex);
189 #endif // TIMELINEDOCK_H The SharedFrame provides thread safe access to Mlt::Frame data.
Definition: sharedframe.h:48