18 #ifndef PLAYLISTCOMMANDS_H
19 #define PLAYLISTCOMMANDS_H
21 #include "models/playlistmodel.h"
24 #include <QUndoCommand>
31 enum { UndoIdTrimClipIn = 0, UndoIdTrimClipOut, UndoIdUpdate };
33 class AppendCommand :
public QUndoCommand
36 AppendCommand(PlaylistModel &model,
38 bool emitModified =
true,
39 QUndoCommand *parent = 0);
44 PlaylistModel &m_model;
50 class InsertCommand :
public QUndoCommand
53 InsertCommand(PlaylistModel &model,
const QString &xml,
int row, QUndoCommand *parent = 0);
58 PlaylistModel &m_model;
64 class UpdateCommand :
public QUndoCommand
67 UpdateCommand(PlaylistModel &model,
const QString &xml,
int row, QUndoCommand *parent = 0);
72 int id()
const {
return UndoIdUpdate; }
73 bool mergeWith(
const QUndoCommand *other);
76 PlaylistModel &m_model;
83 class RemoveCommand :
public QUndoCommand
86 RemoveCommand(PlaylistModel &model,
int row, QUndoCommand *parent = 0);
91 PlaylistModel &m_model;
97 class MoveCommand :
public QUndoCommand
100 MoveCommand(PlaylistModel &model,
int from,
int to, QUndoCommand *parent = 0);
105 PlaylistModel &m_model;
110 class ClearCommand :
public QUndoCommand
113 ClearCommand(PlaylistModel &model, QUndoCommand *parent = 0);
118 PlaylistModel &m_model;
120 QVector<QUuid> m_uuids;
123 class SortCommand :
public QUndoCommand
126 SortCommand(PlaylistModel &model,
int column, Qt::SortOrder order, QUndoCommand *parent = 0);
131 PlaylistModel &m_model;
133 Qt::SortOrder m_order;
135 QVector<QUuid> m_uuids;
138 class TrimClipInCommand :
public QUndoCommand
141 TrimClipInCommand(PlaylistModel &model,
int row,
int in, QUndoCommand *parent =
nullptr);
146 int id()
const {
return UndoIdTrimClipIn; }
147 bool mergeWith(
const QUndoCommand *other);
150 PlaylistModel &m_model;
157 class TrimClipOutCommand :
public QUndoCommand
160 TrimClipOutCommand(PlaylistModel &model,
int row,
int out, QUndoCommand *parent =
nullptr);
165 int id()
const {
return UndoIdTrimClipOut; }
166 bool mergeWith(
const QUndoCommand *other);
169 PlaylistModel &m_model;
176 class ReplaceCommand :
public QUndoCommand
179 ReplaceCommand(PlaylistModel &model,
const QString &xml,
int row, QUndoCommand *parent = 0);
184 PlaylistModel &m_model;
191 class NewBinCommand :
public QUndoCommand
194 NewBinCommand(PlaylistModel &model,
197 QUndoCommand *parent = 0);
202 PlaylistModel &m_model;
203 QTreeWidget *m_binTree;
205 Mlt::Properties m_oldBins;
208 class MoveToBinCommand :
public QUndoCommand
211 MoveToBinCommand(PlaylistModel &model,
214 const QList<int> &rows,
215 QUndoCommand *parent = 0);
220 PlaylistModel &m_model;
221 QTreeWidget *m_binTree;
229 QList<oldData> m_oldData;
232 class RenameBinCommand :
public QUndoCommand
235 RenameBinCommand(PlaylistModel &model,
238 const QString &newName = QString(),
239 QUndoCommand *parent = 0);
242 static void rebuildBinList(PlaylistModel &model, QTreeWidget *binTree);
245 PlaylistModel &m_model;
246 QTreeWidget *m_binTree;
249 QList<int> m_removedRows;