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 *metadata(
const QString &
id);
47 QmlMetadata *metadataForService(Mlt::Service *service);
48 QmlFilter *currentFilter()
const
50 return m_currentFilter.data();
52 bool isOutputTrackSelected()
const;
53 void onUndoOrRedo(Mlt::Service &service);
54 int currentIndex()
const
56 return m_currentFilterIndex;
58 void addOrEditFilter(Mlt::Filter *filter,
const QStringList &key_properties);
61 void timerEvent(QTimerEvent *);
64 void currentFilterChanged(QmlFilter *filter, QmlMetadata *meta,
int index);
65 void statusChanged(QString);
66 void filterChanged(Mlt::Service *);
70 void setProducer(Mlt::Producer *producer = 0);
71 void setCurrentFilter(
int attachedIndex);
72 void onFadeInChanged();
73 void onFadeOutChanged();
74 void onServiceInChanged(
int delta, Mlt::Service *service = 0);
75 void onServiceOutChanged(
int delta, Mlt::Service *service = 0);
77 void onProducerChanged();
80 void handleAttachedModelChange();
81 void handleAttachedModelAboutToReset();
82 void addMetadata(QmlMetadata *);
83 void handleAttachedRowsAboutToBeRemoved(
const QModelIndex &parent,
int first,
int last);
84 void handleAttachedRowsRemoved(
const QModelIndex &parent,
int first,
int last);
85 void handleAttachedRowsInserted(
const QModelIndex &parent,
int first,
int last);
86 void handleAttachDuplicateFailed(
int index);
87 void onQmlFilterChanged(
const QString &name);
90 void loadFilterSets();
91 void loadFilterMetadata();
93 QFuture<void> m_future;
94 QScopedPointer<QmlFilter> m_currentFilter;
95 Mlt::Service m_mltService;
96 MetadataModel m_metadataModel;
97 MotionTrackerModel m_motionTrackerModel;
98 AttachedFiltersModel m_attachedModel;
99 int m_currentFilterIndex;