18#ifndef PLAYLISTMODEL_H
19#define PLAYLISTMODEL_H
21#include <QAbstractTableModel>
24#include "mltcontroller.h"
25#include "MltPlaylist.h"
29class PlaylistModel :
public QAbstractTableModel
52 FIELD_INDEX = Qt::UserRole,
61 static const int THUMBNAIL_WIDTH = 80;
62 static const int THUMBNAIL_HEIGHT = 45;
64 explicit PlaylistModel(QObject *parent = 0);
66 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
67 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
68 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const;
69 QVariant headerData(
int section, Qt::Orientation orientation,
int role)
const;
70 Qt::DropActions supportedDropActions()
const;
71 bool insertRows(
int row,
int count,
const QModelIndex &parent = QModelIndex());
72 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex());
73 bool moveRows(
const QModelIndex &sourceParent,
int sourceRow,
int count,
74 const QModelIndex &destinationParent,
int destinationChild);
75 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder);
76 Qt::ItemFlags flags(
const QModelIndex &index)
const;
77 QStringList mimeTypes()
const;
78 QMimeData *mimeData(
const QModelIndexList &indexes)
const;
79 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
80 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()
91 void setPlaylist(Mlt::Playlist &playlist);
92 void setInOut(
int row,
int in,
int out);
94 ViewMode viewMode()
const;
95 void setViewMode(ViewMode mode);
103 void dropped(
const QMimeData *data,
int row);
104 void moveClip(
int from,
int to);
105 void inChanged(
int in);
106 void outChanged(
int out);
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;