18 #ifndef GLAXNIMATEPRODUCERWIDGET_H
19 #define GLAXNIMATEPRODUCERWIDGET_H
21 #include "abstractproducerwidget.h"
22 #include "sharedframe.h"
24 #include <QDataStream>
25 #include <QLocalServer>
26 #include <QLocalSocket>
28 #include <QSharedMemory>
31 class GlaxnimateIpcServer :
public QObject
38 Mlt::Producer m_producer;
39 std::unique_ptr<Mlt::Profile> m_profile;
40 std::unique_ptr<Mlt::Producer> m_glaxnimateProducer;
43 void setProducer(
const Mlt::Producer &producer,
bool hideCurrentTrack);
47 std::unique_ptr<ParentResources> parent;
48 std::unique_ptr<QLocalServer> m_server;
49 std::unique_ptr<QDataStream> m_stream;
50 bool m_isProtocolValid =
false;
51 std::unique_ptr<QSharedMemory> m_sharedMemory;
52 QPointer<QLocalSocket> m_socket;
54 static GlaxnimateIpcServer &instance();
55 static void newFile(
const QString &filename,
int duration);
57 void launch(
const Mlt::Producer &producer,
58 QString filename = QString(),
59 bool hideCurrentTrack =
true);
64 void onSocketError(QLocalSocket::LocalSocketError socketError);
68 int toMltFps(
float frame)
const;
69 bool copyToShared(
const QImage &image);
74 class GlaxnimateProducerWidget;
76 class QFileSystemWatcher;
81 class GlaxnimateProducerWidget :
public QWidget,
public AbstractProducerWidget
83 friend GlaxnimateIpcServer;
88 explicit GlaxnimateProducerWidget(QWidget *parent = 0);
89 ~GlaxnimateProducerWidget();
92 Mlt::Producer *newProducer(Mlt::Profile &);
93 virtual void setProducer(Mlt::Producer *);
94 Mlt::Properties getPreset()
const;
95 void loadPreset(Mlt::Properties &);
96 void setLaunchOnNew(
bool launch);
99 void producerChanged(Mlt::Producer *);
106 void on_colorButton_clicked();
107 void on_preset_selected(
void *p);
108 void on_preset_saveClicked();
109 void on_lineEdit_editingFinished();
110 void on_notesTextEdit_textChanged();
111 void on_editButton_clicked();
112 void onFileChanged(
const QString &path);
113 void on_reloadButton_clicked();
114 void on_durationSpinBox_editingFinished();
117 Ui::GlaxnimateProducerWidget *ui;
119 std::unique_ptr<QFileSystemWatcher> m_watcher;
120 bool m_launchOnNew =
true;
The SharedFrame provides thread safe access to Mlt::Frame data.
Definition: sharedframe.h:50