14#include <adtffiltersdk/graph_object.h>
17#include <plugins/recorder_intf.h>
18#include <plugins/player_intf.h>
42 Q_PROPERTY(
bool connected READ isConnected)
45 cScriptRecorderClient(filter::interface_client<services::ant::IRecorder> oClient, QJSEngine& oEngine):
46 m_oClient(oClient), m_oEngine(oEngine)
54 Q_INVOKABLE
void start(
const QString& strFileName =
"")
62 Q_INVOKABLE
void split(
const QString& strFileName =
"")
70 Q_INVOKABLE
void stop(
const QString& strFileName =
"")
78 Q_INVOKABLE
void addMarker(
double fTimeStamp,
const QString& strName =
"",
const QString& strAdditional =
"")
81 ->AddMarker(
static_cast<tTimeStamp
>(fTimeStamp), strName.toStdString().c_str(),
82 strAdditional.toStdString().c_str()));
88 Q_INVOKABLE
void dropHistory()
97 return m_oClient.IsValid();
100 filter::interface_client<services::ant::IRecorder> m_oClient;
101 QJSEngine& m_oEngine;
119 THROW_IF_FAILED_DESC(_runtime->GetObject(m_pClient),
"Unable to aquire player interface");
126 Q_INVOKABLE
void open(
const QString& strFileNames,
bool bLoadReferencedFiles)
171 THROW_IF_FAILED(m_pClient->GetTimeRange(tmStart, tmEnd));
172 QVariantList oReturnValue;
173 oReturnValue.push_back(
static_cast<qint64
>(base::duration_cast<base::tNanoSeconds>(tmStart).nCount));
174 oReturnValue.push_back(
static_cast<qint64
>(base::duration_cast<base::tNanoSeconds>(tmEnd).nCount));
184 return base::duration_cast<base::tNanoSeconds>(m_pClient->GetCurrentTime()).nCount;
192 SCRIPT_ERROR_IF_FAILED(m_pClient->SeekToTime(base::duration_cast<tTimeStamp>(base::tNanoSeconds{tmTime})));
197 ucom::object_ptr<services::ant::IPlayer> m_pClient;
198 QJSEngine& m_oEngine;
216 Q_PROPERTY(
bool connected READ isConnected)
220 m_oClient(oClient), m_oEngine(oEngine)
230 Q_INVOKABLE QObject* getObject(
const QString& strName =
"")
234 THROW_IF_FAILED(m_oClient->GetObject(strName.toLocal8Bit().data(), pObject));
243 return m_oClient.IsValid();
246 filter::interface_client<ui::giant::IQtShared> m_oClient;
247 QJSEngine& m_oEngine;
Definition interface_clients.h:112
Q_INVOKABLE qint64 getCurrentTime()
Definition interface_clients.h:182
Q_INVOKABLE void open(const QString &strFileNames, bool bLoadReferencedFiles)
Definition interface_clients.h:126
Q_INVOKABLE void reset()
Definition interface_clients.h:158
Q_INVOKABLE void pause()
Definition interface_clients.h:150
Q_INVOKABLE void seekToTime(qint64 tmTime)
Definition interface_clients.h:190
Q_INVOKABLE void close()
Definition interface_clients.h:134
Q_INVOKABLE QVariantList getTimeRange()
Definition interface_clients.h:166
Q_INVOKABLE void play()
Definition interface_clients.h:142
Definition interface_clients.h:213
Definition interface_clients.h:39
#define EXCEPTION_TO_SCRIPT_ERROR(__return_value)
Converts an exception to an error code.
Definition error_handling.h:24
#define SCRIPT_ERROR_IF_FAILED(__exp)
Throws an error/exception in case of error in script.
Definition error_handling.h:32
Namespace for the ADTF JavaScript Filter SDK.
Definition clock.h:22
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtfui_pkg.h:13