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"
32class 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
44 return m_currentFilter.data();
48 void timerEvent(QTimerEvent *);
51 void currentFilterChanged(QmlFilter *filter, QmlMetadata *meta,
int index);
52 void statusChanged(QString);
53 void filterChanged(Mlt::Service *);
56 void setProducer(Mlt::Producer *producer = 0);
57 void setCurrentFilter(
int attachedIndex,
bool isNew =
false);
58 void onFadeInChanged();
59 void onFadeOutChanged();
60 void onServiceInChanged(
int delta, Mlt::Service *service = 0);
61 void onServiceOutChanged(
int delta, Mlt::Service *service = 0);
63 void onProducerChanged();
66 void handleAttachedModelChange();
67 void handleAttachedModelAboutToReset();
68 void addMetadata(QmlMetadata *);
69 void handleAttachedRowsRemoved(
const QModelIndex &parent,
int first,
int last);
70 void handleAttachedRowsInserted(
const QModelIndex &parent,
int first,
int last);
71 void handleAttachDuplicateFailed(
int index);
72 void onQmlFilterChanged();
73 void onQmlFilterChanged(
const QString &name);
76 void loadFilterMetadata();
78 QFuture<void> m_future;
79 QScopedPointer<QmlFilter> m_currentFilter;
80 Mlt::Service *m_mltService;
81 MetadataModel m_metadataModel;
82 AttachedFiltersModel m_attachedModel;
83 int m_currentFilterIndex;