18#ifndef GLAXNIMATEPRODUCERWIDGET_H
19#define GLAXNIMATEPRODUCERWIDGET_H
23#include <QLocalSocket>
24#include <QLocalServer>
26#include <QSharedMemory>
27#include "sharedframe.h"
29#include "abstractproducerwidget.h"
31class 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, QString filename = QString(),
58 bool hideCurrentTrack =
true);
63 void onSocketError(QLocalSocket::LocalSocketError socketError);
67 int toMltFps(
float frame)
const;
68 bool copyToShared(
const QImage &image);
73class GlaxnimateProducerWidget;
75class QFileSystemWatcher;
80class GlaxnimateProducerWidget :
public QWidget,
public AbstractProducerWidget
82 friend GlaxnimateIpcServer;
87 explicit GlaxnimateProducerWidget(QWidget *parent = 0);
88 ~GlaxnimateProducerWidget();
91 Mlt::Producer *newProducer(Mlt::Profile &);
92 virtual void setProducer(Mlt::Producer *);
93 Mlt::Properties getPreset()
const;
94 void loadPreset(Mlt::Properties &);
97 void producerChanged(Mlt::Producer *);
104 void on_colorButton_clicked();
105 void on_preset_selected(
void *p);
106 void on_preset_saveClicked();
107 void on_lineEdit_editingFinished();
108 void on_notesTextEdit_textChanged();
109 void on_editButton_clicked();
110 void onFileChanged(
const QString &path);
111 void on_reloadButton_clicked();
112 void on_durationSpinBox_editingFinished();
115 Ui::GlaxnimateProducerWidget *ui;
117 std::unique_ptr<QFileSystemWatcher> m_watcher;
The SharedFrame provides thread safe access to Mlt::Frame data.
Definition sharedframe.h:49