18#ifndef PLAYLISTMODEL_H
19#define PLAYLISTMODEL_H
21#include <QAbstractTableModel>
24#include "MltPlaylist.h"
28class PlaylistModel :
public QAbstractTableModel
51 FIELD_INDEX = Qt::UserRole,
60 static const int THUMBNAIL_WIDTH = 80;
61 static const int THUMBNAIL_HEIGHT = 45;
63 explicit PlaylistModel(QObject *parent = 0);
65 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
66 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
67 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const;
68 QVariant headerData(
int section, Qt::Orientation orientation,
int role)
const;
69 Qt::DropActions supportedDropActions()
const;
70 bool insertRows(
int row,
int count,
const QModelIndex &parent = QModelIndex());
71 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex());
72 bool moveRows(
const QModelIndex &sourceParent,
int sourceRow,
int count,
73 const QModelIndex &destinationParent,
int destinationChild);
74 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder);
75 Qt::ItemFlags flags(
const QModelIndex &index)
const;
76 QStringList mimeTypes()
const;
77 QMimeData *mimeData(
const QModelIndexList &indexes)
const;
78 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
79 const QModelIndex &parent);
80 QModelIndex incrementIndex(
const QModelIndex &index)
const;
81 QModelIndex decrementIndex(
const QModelIndex &index)
const;
82 QModelIndex createIndex(
int row,
int column)
const;
83 void createIfNeeded();
84 void showThumbnail(
int row);
85 void refreshThumbnails();
86 Mlt::Playlist *playlist()
90 void setPlaylist(Mlt::Playlist &playlist);
91 void setInOut(
int row,
int in,
int out);
93 ViewMode viewMode()
const;
94 void setViewMode(ViewMode mode);
102 void dropped(
const QMimeData *data,
int row);
103 void moveClip(
int from,
int to);
104 void inChanged(
int in);
105 void outChanged(
int out);
106 void removing(Mlt::Service *service);
111 void append(Mlt::Producer &,
bool emitModified =
true);
112 void insert(Mlt::Producer &,
int row);
113 void remove(
int row);
114 void update(
int row, Mlt::Producer &producer,
bool copyFilters =
false);
115 void updateThumbnails(
int row);
116 void appendBlank(
int frames);
117 void insertBlank(
int frames,
int row);
119 void move(
int from,
int to);
122 Mlt::Playlist *m_playlist;
125 QList<int> m_rowsRemoved;
128 void onRowsAboutToBeRemoved(
const QModelIndex &parent,
int first,
int last);