18#ifndef FILTERCONTROLLER_H
19#define FILTERCONTROLLER_H
22#include <QScopedPointer>
24#include "models/metadatamodel.h"
25#include "models/motiontrackermodel.h"
26#include "models/attachedfiltersmodel.h"
27#include "qmltypes/qmlmetadata.h"
28#include "qmltypes/qmlfilter.h"
33class FilterController :
public QObject
38 explicit FilterController(QObject *parent = 0);
39 MetadataModel *metadataModel();
40 MotionTrackerModel *motionTrackerModel()
42 return &m_motionTrackerModel;
44 AttachedFiltersModel *attachedModel();
46 QmlMetadata *metadataForService(Mlt::Service *service);
47 QmlFilter *currentFilter()
const
49 return m_currentFilter.data();
51 bool isOutputTrackSelected()
const;
54 void timerEvent(QTimerEvent *);
57 void currentFilterChanged(QmlFilter *filter, QmlMetadata *meta,
int index);
58 void statusChanged(QString);
59 void filterChanged(Mlt::Service *);
62 void setProducer(Mlt::Producer *producer = 0);
63 void setCurrentFilter(
int attachedIndex,
bool isNew =
false);
64 void onFadeInChanged();
65 void onFadeOutChanged();
66 void onServiceInChanged(
int delta, Mlt::Service *service = 0);
67 void onServiceOutChanged(
int delta, Mlt::Service *service = 0);
69 void onProducerChanged();
72 void handleAttachedModelChange();
73 void handleAttachedModelAboutToReset();
74 void addMetadata(QmlMetadata *);
75 void handleAttachedRowsAboutToBeRemoved(
const QModelIndex &parent,
int first,
int last);
76 void handleAttachedRowsRemoved(
const QModelIndex &parent,
int first,
int last);
77 void handleAttachedRowsInserted(
const QModelIndex &parent,
int first,
int last);
78 void handleAttachDuplicateFailed(
int index);
79 void onQmlFilterChanged(
const QString &name);
82 void loadFilterSets();
83 void loadFilterMetadata();
85 QFuture<void> m_future;
86 QScopedPointer<QmlFilter> m_currentFilter;
87 Mlt::Service *m_mltService;
88 MetadataModel m_metadataModel;
89 MotionTrackerModel m_motionTrackerModel;
90 AttachedFiltersModel m_attachedModel;
91 int m_currentFilterIndex;