18 #ifndef ATTACHEDFILTERSMODEL_H 19 #define ATTACHEDFILTERSMODEL_H 21 #include <QAbstractListModel> 22 #include <MltFilter.h> 23 #include <MltProducer.h> 28 class AttachedFiltersModel :
public QAbstractListModel
31 Q_PROPERTY(QString producerTitle READ producerTitle NOTIFY trackTitleChanged)
32 Q_PROPERTY(
bool isProducerSelected READ isProducerSelected NOTIFY isProducerSelectedChanged)
35 TypeDisplayRole = Qt::UserRole + 1
38 explicit AttachedFiltersModel(QObject *parent = 0);
40 Mlt::Filter* getFilter(
int row)
const;
41 QmlMetadata* getMetadata(
int row)
const;
42 void setProducer(Mlt::Producer* producer = 0);
43 QString producerTitle()
const;
44 bool isProducerSelected()
const;
45 Mlt::Producer* producer()
const {
return m_producer.data(); }
48 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
49 Qt::ItemFlags flags(
const QModelIndex &index)
const;
50 QVariant data(
const QModelIndex &index,
int role)
const;
51 bool setData(
const QModelIndex& index,
const QVariant& value,
int role = Qt::EditRole);
52 QHash<int, QByteArray> roleNames()
const;
53 Qt::DropActions supportedDropActions()
const;
54 bool insertRows(
int row,
int count,
const QModelIndex &parent);
55 bool removeRows(
int row,
int count,
const QModelIndex &parent);
56 bool moveRows(
const QModelIndex & sourceParent,
int sourceRow,
int count,
const QModelIndex & destinationParent,
int destinationRow);
60 void duplicateAddFailed(
int index);
61 void trackTitleChanged();
62 void isProducerSelectedChanged();
63 void addedOrRemoved(Mlt::Producer*);
66 void add(QmlMetadata* meta);
68 bool move(
int fromRow,
int toRow);
71 static void producerChanged(mlt_properties owner, AttachedFiltersModel* model);
72 void reset(Mlt::Producer *producer = 0);
76 QScopedPointer<Mlt::Producer> m_producer;
77 QScopedPointer<Mlt::Event> m_event;
78 typedef QList<QmlMetadata*> MetadataList;
79 MetadataList m_metaList;
80 typedef QList<int> IndexMap;
81 IndexMap m_mltIndexMap;
84 #endif // ATTACHEDFILTERSMODEL_H