18 #ifndef PLAYLISTMODEL_H 19 #define PLAYLISTMODEL_H 21 #include <QAbstractTableModel> 22 #include <qmimedata.h> 23 #include <QStringList> 24 #include "mltcontroller.h" 25 #include "MltPlaylist.h" 27 #define kDetailedMode "detailed" 28 #define kIconsMode "icons" 29 #define kTiledMode "tiled" 31 class PlaylistModel :
public QAbstractTableModel
54 FIELD_INDEX = Qt::UserRole,
63 static const int THUMBNAIL_WIDTH = 80;
64 static const int THUMBNAIL_HEIGHT = 45;
66 explicit PlaylistModel(QObject *parent = 0);
68 int rowCount(
const QModelIndex& parent = QModelIndex())
const;
69 int columnCount(
const QModelIndex& parent = QModelIndex())
const;
70 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const;
71 QVariant headerData(
int section, Qt::Orientation orientation,
int role)
const;
72 Qt::DropActions supportedDropActions()
const;
73 bool insertRows(
int row,
int count,
const QModelIndex & parent = QModelIndex());
74 bool removeRows(
int row,
int count,
const QModelIndex & parent = QModelIndex());
75 bool moveRows(
const QModelIndex &sourceParent,
int sourceRow,
int count,
const QModelIndex &destinationParent,
int destinationChild);
76 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder);
77 Qt::ItemFlags flags(
const QModelIndex &index)
const;
78 QStringList mimeTypes()
const;
79 QMimeData *mimeData(
const QModelIndexList &indexes)
const;
80 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent);
81 QModelIndex incrementIndex(
const QModelIndex& index)
const;
82 QModelIndex decrementIndex(
const QModelIndex& index)
const;
83 QModelIndex createIndex(
int row,
int column)
const;
84 void createIfNeeded();
85 void showThumbnail(
int row);
86 void refreshThumbnails();
87 Mlt::Playlist* playlist() {
return m_playlist; }
88 void setPlaylist(Mlt::Playlist& playlist);
89 void setInOut(
int row,
int in,
int out);
91 ViewMode viewMode()
const;
92 void setViewMode(ViewMode mode);
100 void dropped(
const QMimeData *data,
int row);
101 void moveClip(
int from,
int to);
102 void inChanged(
int in);
103 void outChanged(
int out);
108 void append(Mlt::Producer&,
bool emitModified =
true);
109 void insert(Mlt::Producer&,
int row);
110 void remove(
int row);
111 void update(
int row, Mlt::Producer& producer);
112 void updateThumbnails(
int row);
113 void appendBlank(
int frames);
114 void insertBlank(
int frames,
int row);
116 void move(
int from,
int to);
119 Mlt::Playlist* m_playlist;
122 QList<int> m_rowsRemoved;
125 #endif // PLAYLISTMODEL_H