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)
33 Q_PROPERTY(
bool supportsLinks READ supportsLinks NOTIFY supportsLinksChanged)
36 TypeDisplayRole = Qt::UserRole + 1,
40 explicit AttachedFiltersModel(QObject *parent = 0);
42 Mlt::Service* getService(
int row)
const;
43 QmlMetadata* getMetadata(
int row)
const;
44 void setProducer(Mlt::Producer* producer = 0);
45 QString producerTitle()
const;
46 bool isProducerSelected()
const;
47 bool supportsLinks()
const;
48 Mlt::Producer* producer()
const {
return m_producer.data(); }
51 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
52 Qt::ItemFlags flags(
const QModelIndex &index)
const;
53 QVariant data(
const QModelIndex &index,
int role)
const;
54 bool setData(
const QModelIndex& index,
const QVariant& value,
int role = Qt::EditRole);
55 QHash<int, QByteArray> roleNames()
const;
56 Qt::DropActions supportedDropActions()
const;
57 bool insertRows(
int row,
int count,
const QModelIndex &parent);
58 bool removeRows(
int row,
int count,
const QModelIndex &parent);
59 bool moveRows(
const QModelIndex & sourceParent,
int sourceRow,
int count,
const QModelIndex & destinationParent,
int destinationRow);
63 void duplicateAddFailed(
int index);
64 void trackTitleChanged();
65 void isProducerSelectedChanged();
66 void supportsLinksChanged();
67 void addedOrRemoved(Mlt::Producer*);
68 void requestConvert(QString,
bool set709Convert,
bool withSubClip);
71 void add(QmlMetadata* meta);
73 bool move(
int fromRow,
int toRow);
76 static void producerChanged(mlt_properties owner, AttachedFiltersModel* model);
77 void reset(Mlt::Producer *producer = 0);
78 int mltFilterIndex(
int row)
const;
79 int mltLinkIndex(
int row)
const;
83 int m_normFilterCount;
84 QScopedPointer<Mlt::Producer> m_producer;
85 QScopedPointer<Mlt::Event> m_event;
86 typedef QList<QmlMetadata*> MetadataList;
87 MetadataList m_metaList;