18 #ifndef MLTCONTROLLER_H 19 #define MLTCONTROLLER_H 24 #include <QScopedPointer> 26 #include "transportcontrol.h" 33 const int kMaxImageDurationSecs = 3600 * 4;
34 extern const QString XmlMimeType;
36 class TransportControl :
public TransportControllable
40 void play(
double speed = 1.0);
43 void seek(
int position);
44 void rewind(
bool forceChangeDirection);
45 void fastForward(
bool forceChangeDirection);
46 void previous(
int currentPosition);
47 void next(
int currentPosition);
56 virtual int reconfigure(
bool isMulti) = 0;
59 static Controller& singleton(QObject *parent = 0);
60 virtual ~Controller();
61 static void destroy();
63 virtual QObject* videoWidget() = 0;
64 virtual int setProducer(Mlt::Producer*,
bool isMulti =
false);
65 virtual int open(
const QString& url);
66 bool openXML(
const QString& filename);
68 virtual int displayWidth()
const = 0;
69 virtual int displayHeight()
const = 0;
72 virtual void play(
double speed = 1.0);
75 bool enableJack(
bool enable =
true);
76 void setVolume(
double volume,
bool muteOnPause =
true);
77 double volume()
const;
78 void onWindowResize();
79 virtual void seek(
int position);
80 void refreshConsumer(
bool scrubAudio =
false);
81 void saveXML(
const QString& filename, Service* service = 0,
bool withRelativePaths =
true);
82 QString XML(Service* service = 0,
bool withProfile =
false,
bool withMetadata =
false);
83 int consumerChanged();
84 void setProfile(
const QString& profile_name);
85 void setAudioChannels(
int audioChannels);
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;
93 void rewind(
bool forceChangeDirection);
94 void fastForward(
bool forceChangeDirection);
95 void previous(
int currentPosition);
96 void next(
int currentPosition);
99 void restart(
const QString& xml =
"");
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 int audioChannels()
const {
118 return m_audioChannels;
120 Mlt::Repository* repository()
const {
123 Mlt::Profile& profile()
const {
126 Mlt::Producer* producer()
const {
127 return m_producer.data();
129 Mlt::Consumer* consumer()
const {
130 return m_consumer.data();
132 const QString& URL()
const {
135 const TransportControllable* transportControl()
const {
136 return &m_transportControl;
138 Mlt::Producer* savedProducer()
const {
139 return m_savedProducer.data();
141 void setSavedProducer(Mlt::Producer* producer);
142 static Mlt::Filter* getFilter(
const QString& name, Mlt::Service* service);
145 Mlt::Repository* m_repo;
146 QScopedPointer<Mlt::Producer> m_producer;
147 QScopedPointer<Mlt::FilteredConsumer> m_consumer;
150 QScopedPointer<Mlt::Profile> m_profile;
152 QScopedPointer<Mlt::Filter> m_jackFilter;
155 TransportControl m_transportControl;
156 QScopedPointer<Mlt::Producer> m_savedProducer;
157 QScopedPointer<Mlt::Producer> m_filtersClipboard;
158 unsigned m_skipJackEvents;
160 static void on_jack_started(mlt_properties owner,
void*
object, mlt_position *position);
161 void onJackStarted(
int position);
162 static void on_jack_stopped(mlt_properties owner,
void*
object, mlt_position *position);
163 void onJackStopped(
int position);
169 #define MLT Mlt::Controller::singleton() 171 #endif // MLTCONTROLLER_H Definition: encodedock.h:35