18#ifndef FILTERCONTROLLER_H
19#define FILTERCONTROLLER_H
21#include "models/attachedfiltersmodel.h"
22#include "models/metadatamodel.h"
23#include "models/motiontrackermodel.h"
24#include "qmltypes/qmlfilter.h"
25#include "qmltypes/qmlmetadata.h"
29#include <QScopedPointer>
33class FilterController :
public QObject
38 explicit FilterController(QObject *parent = 0);
39 MetadataModel *metadataModel();
40 MotionTrackerModel *motionTrackerModel() {
return &m_motionTrackerModel; }
41 AttachedFiltersModel *attachedModel();
43 QmlMetadata *metadata(
const QString &
id);
44 QmlMetadata *metadataForService(Mlt::Service *service);
45 QmlFilter *currentFilter()
const {
return m_currentFilter.data(); }
46 bool isOutputTrackSelected()
const;
47 void onUndoOrRedo(Mlt::Service &service);
48 int currentIndex()
const {
return m_currentFilterIndex; }
49 void addOrEditFilter(Mlt::Filter *filter,
const QStringList &key_properties);
50 void setTrackTransitionService(
const QString &service);
53 void timerEvent(QTimerEvent *);
56 void currentFilterChanged(QmlFilter *filter, QmlMetadata *meta,
int index);
57 void statusChanged(QString);
58 void filterChanged(Mlt::Service *);
62 void setProducer(Mlt::Producer *producer = 0);
63 void setCurrentFilter(
int attachedIndex);
64 void onFadeInChanged();
65 void onFadeOutChanged();
67 void onServiceInChanged(
int delta, Mlt::Service *service = 0);
68 void onServiceOutChanged(
int delta, Mlt::Service *service = 0);
70 void onProducerChanged();
71 void pauseUndoTracking();
72 void resumeUndoTracking();
75 void handleAttachedModelChange();
76 void handleAttachedModelAboutToReset();
77 void addMetadata(QmlMetadata *);
78 void handleAttachedRowsAboutToBeRemoved(
const QModelIndex &parent,
int first,
int last);
79 void handleAttachedRowsRemoved(
const QModelIndex &parent,
int first,
int last);
80 void handleAttachedRowsInserted(
const QModelIndex &parent,
int first,
int last);
81 void handleAttachDuplicateFailed(
int index);
82 void onQmlFilterChanged(
const QString &name);
85 void loadFilterSets();
86 void loadFilterMetadata();
88 QFuture<void> m_future;
89 QScopedPointer<QmlFilter> m_currentFilter;
90 Mlt::Service m_mltService;
91 MetadataModel m_metadataModel;
92 MotionTrackerModel m_motionTrackerModel;
93 AttachedFiltersModel m_attachedModel;
94 int m_currentFilterIndex;