Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/topic_replay.h
T

121 lines
2.6 KiB
C++
Executable File

#pragma once
#include <AudioVideoManagement/logger.h>
#include <AudioVideoManagement/Shared/playback_app.h>
#include <PluginInterfaces/topic_replay_interface.h>
#include <QString>
#include <QRect>
#include <QVector>
#include <QWidget>
#include <boost/optional.hpp>
#include <memory>
#include <AudioVideoManagement/ava_control.h>
#include <AudioVideoManagement/ava_session.h>
namespace AudioVideoManagement
{
enum class AvaStreamType;
class ScreenPlacementHelper : public QWidget
{
Q_OBJECT
public:
ScreenPlacementHelper(QWidget *parent = nullptr)
: QWidget(parent)
{
setWindowTitle(QStringLiteral("Topic Replay Screen Placement Helper"));
setWindowFlags(Qt::FramelessWindowHint);
setAttribute(Qt::WA_TranslucentBackground);
activateWindow();
show();
}
protected:
void moveEvent(QMoveEvent *) override
{
emitNewGeometry();
}
void resizeEvent(QResizeEvent *) override
{
emitNewGeometry();
}
void emitNewGeometry()
{
emit widgetPlaced(geometry());
}
signals:
void widgetPlaced(const QRect &geometry);
};
class DataInterface;
class AvaControl;
class VdControl;
struct AvaScriptEntry;
class TopicReplay final : public QObject, public ::TopicReplay::Interface
{
Q_OBJECT
public:
TopicReplay(DataInterface *dataIfc, bool isAudio);
~TopicReplay();
QWidget *createWidget() override;
bool playbackInit(const QJsonObject &attributes) override;
bool playbackStart(int secondsOffset) override;
bool playbackPause() override;
bool playbackStop() override;
bool exportTopic(const QJsonObject &attributes,
const QString &folderPath,
TopicEditorBase::ExportNotifier *pExportNotifier) override;
private slots:
void onWidgetPlaced(const QRect &geometry);
void avScriptFinished(const QString &exportDir, AvaStreamType streamType, bool success);
void slotSetScriptResponse(const AvaStreamInfo &, AvaStreamState);
private:
AvaControl* getAvaControl();
VdControl* getVdControl();
class ExportScript;
const bool m_isAudio;
PlaybackAppHandle m_appHandle;
DataInterface *m_dataIfc;
QString m_scriptName;
bool m_isPlaying{false};
QScopedPointer<ScreenPlacementHelper> m_screenPlacementHelper;
boost::optional<QRect> m_dialogGeometry;
QScopedPointer<ExportScript> m_exportScript;
LOGGER_T m_logger;
QJsonObject m_playbackAttributes;
};
}