19 #ifndef MLTCONTROLLER_H 20 #define MLTCONTROLLER_H 25 #include <QScopedPointer> 27 #include "transportcontrol.h" 34 const int kMaxImageDurationSecs = 3600 * 4;
35 extern const QString XmlMimeType;
37 class TransportControl :
public TransportControllable
41 void play(
double speed = 1.0);
44 void seek(
int position);
47 void previous(
int currentPosition);
48 void next(
int currentPosition);
57 virtual int reconfigure(
bool isMulti) = 0;
60 static Controller& singleton(QObject *parent = 0);
61 virtual ~Controller();
62 static void destroy();
64 virtual QObject* videoWidget() = 0;
65 virtual int setProducer(Mlt::Producer*,
bool isMulti =
false);
66 virtual int open(
const QString& url);
67 bool openXML(
const QString& filename);
69 virtual int displayWidth()
const = 0;
70 virtual int displayHeight()
const = 0;
73 virtual void play(
double speed = 1.0);
76 bool enableJack(
bool enable =
true);
77 void setVolume(
double volume,
bool muteOnPause =
true);
78 double volume()
const;
79 void onWindowResize();
80 virtual void seek(
int position);
81 void refreshConsumer(
bool scrubAudio =
false);
82 void saveXML(
const QString& filename, Service* service = 0,
bool withRelativePaths =
true);
83 QString XML(Service* service = 0,
bool withProfile =
false);
84 int consumerChanged();
85 void setProfile(
const QString& profile_name);
86 QString resource()
const;
87 bool isSeekable(Mlt::Producer* p = 0)
const;
89 bool isSeekableClip();
90 bool isPlaylist()
const;
91 bool isMultitrack()
const;
92 bool isImageProducer(Service* service)
const;
95 void previous(
int currentPosition);
96 void next(
int currentPosition);
101 QImage image(Frame *frame,
int width,
int height);
102 QImage image(Mlt::Producer& producer,
int frameNumber,
int width,
int height);
103 void updateAvformatCaching(
int trackCount);
104 bool isAudioFilter(
const QString& name);
105 int realTime()
const;
106 void setImageDurationFromDefault(Service* service)
const;
107 QUuid uuid(Mlt::Properties &properties)
const;
108 void setUuid(Mlt::Properties &properties, QUuid uid)
const;
109 QUuid ensureHasUuid(Mlt::Properties& properties)
const;
110 static void copyFilters(Mlt::Producer& fromProducer, Mlt::Producer& toProducer);
111 void copyFilters(Mlt::Producer* producer = 0);
112 void pasteFilters(Mlt::Producer* producer = 0);
113 bool hasFiltersOnClipboard()
const {
114 return m_filtersClipboard->is_valid() && m_filtersClipboard->filter_count() > 0;
117 Mlt::Repository* repository()
const {
120 Mlt::Profile& profile()
const {
123 Mlt::Producer* producer()
const {
126 Mlt::Consumer* consumer()
const {
129 const QString& URL()
const {
132 const TransportControllable* transportControl()
const {
133 return &m_transportControl;
135 Mlt::Producer* savedProducer()
const {
136 return m_savedProducer.data();
138 void setSavedProducer(Mlt::Producer* producer);
141 Mlt::Repository* m_repo;
142 Mlt::Producer* m_producer;
143 Mlt::FilteredConsumer* m_consumer;
146 Mlt::Profile* m_profile;
147 Mlt::Filter* m_jackFilter;
150 TransportControl m_transportControl;
151 QScopedPointer<Mlt::Producer> m_savedProducer;
152 QScopedPointer<Mlt::Producer> m_filtersClipboard;
154 static void on_jack_started(mlt_properties owner,
void*
object, mlt_position *position);
155 void onJackStarted(
int position);
156 static void on_jack_stopped(mlt_properties owner,
void*
object, mlt_position *position);
157 void onJackStopped(
int position);
162 #define MLT Mlt::Controller::singleton() 164 #endif // MLTCONTROLLER_H Definition: encodedock.h:35