18 #ifndef PLAYLISTMODEL_H
19 #define PLAYLISTMODEL_H
21 #include <QAbstractTableModel>
23 #include <QStringList>
24 #include "MltPlaylist.h"
28 class PlaylistModel :
public QAbstractTableModel
62 FIELD_INDEX = Qt::UserRole,
70 FIELD_MEDIA_TYPE_ENUM,
75 static const int THUMBNAIL_WIDTH = 80;
76 static const int THUMBNAIL_HEIGHT = 45;
78 explicit PlaylistModel(QObject *parent = 0);
80 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
81 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
82 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const;
83 QVariant headerData(
int section, Qt::Orientation orientation,
int role)
const;
84 Qt::DropActions supportedDropActions()
const;
85 bool insertRows(
int row,
int count,
const QModelIndex &parent = QModelIndex());
86 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex());
87 bool moveRows(
const QModelIndex &sourceParent,
int sourceRow,
int count,
88 const QModelIndex &destinationParent,
int destinationChild);
89 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder);
90 Qt::ItemFlags flags(
const QModelIndex &index)
const;
91 QStringList mimeTypes()
const;
92 QMimeData *mimeData(
const QModelIndexList &indexes)
const;
93 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
94 const QModelIndex &parent);
95 QModelIndex createIndex(
int row,
int column)
const;
96 void createIfNeeded();
97 void showThumbnail(
int row);
98 void refreshThumbnails();
99 Mlt::Playlist *playlist()
103 void setPlaylist(Mlt::Playlist &playlist);
104 void setInOut(
int row,
int in,
int out);
106 ViewMode viewMode()
const;
107 void setViewMode(ViewMode mode);
108 void setBin(
int row,
const QString &name);
109 void renameBin(
const QString &bin,
const QString &newName = QString());
117 void dropped(
const QMimeData *data,
int row);
118 void moveClip(
int from,
int to);
119 void inChanged(
int in);
120 void outChanged(
int out);
121 void removing(Mlt::Service *service);
126 void append(Mlt::Producer &,
bool emitModified =
true);
127 void insert(Mlt::Producer &,
int row);
128 void remove(
int row);
129 void update(
int row, Mlt::Producer &producer,
bool copyFilters =
false);
130 void updateThumbnails(
int row);
131 void appendBlank(
int frames);
132 void insertBlank(
int frames,
int row);
134 void move(
int from,
int to);
137 Mlt::Playlist *m_playlist;
140 QList<int> m_rowsRemoved;
143 void onRowsAboutToBeRemoved(
const QModelIndex &parent,
int first,
int last);