18 #ifndef FILTERCONTROLLER_H
19 #define FILTERCONTROLLER_H
22 #include <QScopedPointer>
24 #include "models/metadatamodel.h"
25 #include "models/attachedfiltersmodel.h"
26 #include "qmltypes/qmlmetadata.h"
27 #include "qmltypes/qmlfilter.h"
32 class FilterController :
public QObject
37 explicit FilterController(QObject* parent = 0);
38 MetadataModel* metadataModel();
39 AttachedFiltersModel* attachedModel();
41 QmlMetadata* metadataForService(Mlt::Service *service);
42 QmlFilter* currentFilter()
const {
return m_currentFilter.data(); }
45 void timerEvent(QTimerEvent*);
48 void currentFilterChanged(QmlFilter* filter, QmlMetadata* meta,
int index);
49 void statusChanged(QString);
50 void filterChanged(Mlt::Filter*);
53 void setProducer(Mlt::Producer *producer = 0);
54 void setCurrentFilter(
int attachedIndex,
bool isNew =
false);
55 void onFadeInChanged();
56 void onFadeOutChanged();
57 void onFilterInChanged(
int delta, Mlt::Filter* filter = 0);
58 void onFilterOutChanged(
int delta, Mlt::Filter* filter = 0);
60 void onProducerChanged();
63 void handleAttachedModelChange();
64 void handleAttachedModelAboutToReset();
65 void addMetadata(QmlMetadata*);
66 void handleAttachedRowsRemoved(
const QModelIndex & parent,
int first,
int last);
67 void handleAttachedRowsInserted(
const QModelIndex & parent,
int first,
int last);
68 void handleAttachDuplicateFailed(
int index);
69 void onQmlFilterChanged();
70 void onQmlFilterChanged(
const QString& name);
73 void loadFilterMetadata();
75 QFuture<void> m_future;
76 QScopedPointer<QmlFilter> m_currentFilter;
77 Mlt::Filter* m_mltFilter;
78 MetadataModel m_metadataModel;
79 AttachedFiltersModel m_attachedModel;
80 int m_currentFilterIndex;