14#include <adtffiltersdk/graph_object.h>
17#include <plugins/recorder_intf.h>
18#include <plugins/player_intf.h>
45 Q_PROPERTY(
bool connected READ isConnected)
48 cScriptRecorderClient(filter::interface_client<services::ant::IRecorder> oClient, QJSEngine& oEngine):
49 m_oClient(oClient), m_oEngine(oEngine)
57 Q_INVOKABLE
void start(
const QString& strFileName =
"")
65 Q_INVOKABLE
void split(
const QString& strFileName =
"")
73 Q_INVOKABLE
void stop(
const QString& strFileName =
"")
81 Q_INVOKABLE
void addMarker(
double fTimeStamp,
const QString& strName =
"",
const QString& strAdditional =
"")
84 ->AddMarker(
static_cast<tTimeStamp
>(fTimeStamp), strName.toStdString().c_str(),
85 strAdditional.toStdString().c_str()));
91 Q_INVOKABLE
void dropHistory()
100 return m_oClient.IsValid();
103 filter::interface_client<services::ant::IRecorder> m_oClient;
104 QJSEngine& m_oEngine;
122 THROW_IF_FAILED_DESC(_runtime->GetObject(m_pClient),
"Unable to aquire player interface");
129 Q_INVOKABLE
void open(
const QString& strFileNames,
bool bLoadReferencedFiles)
174 THROW_IF_FAILED(m_pClient->GetTimeRange(tmStart, tmEnd));
175 QVariantList oReturnValue;
176 oReturnValue.push_back(
static_cast<qint64
>(base::duration_cast<base::tNanoSeconds>(tmStart).nCount));
177 oReturnValue.push_back(
static_cast<qint64
>(base::duration_cast<base::tNanoSeconds>(tmEnd).nCount));
187 return base::duration_cast<base::tNanoSeconds>(m_pClient->GetCurrentTime()).nCount;
195 SCRIPT_ERROR_IF_FAILED(m_pClient->SeekToTime(base::duration_cast<tTimeStamp>(base::tNanoSeconds{tmTime})));
200 ucom::object_ptr<services::ant::IPlayer> m_pClient;
201 QJSEngine& m_oEngine;
215 Q_PROPERTY(QJSValue Theme READ themeEnum CONSTANT)
220 THROW_IF_FAILED_DESC(_runtime->GetObject(m_pClient),
"Unable to aquire xsystem interface");
223 QJSValue themeEnum()
const noexcept
225 return m_oEngine.newQMetaObject(&staticMetaObject);
244 Q_INVOKABLE
void setTheme(
const QJSValue& oTheme)
252 Q_INVOKABLE
void setScaling(
double fFactor)
261 const auto nTheme = oTheme.toInt();
262 if (!oTheme.isNumber() || oTheme.toNumber() != nTheme || !QMetaEnum::fromType<Theme>().valueToKey(nTheme))
264 THROW_ERROR_DESC(ERR_INVALID_ARG,
"Invalid theme: %s", oTheme.toString().toLocal8Bit().data());
270 ucom::object_ptr<ui::v2::IQtXSystem> m_pClient;
271 QJSEngine& m_oEngine;
289 Q_PROPERTY(
bool connected READ isConnected)
293 m_oClient(oClient), m_oEngine(oEngine)
303 Q_INVOKABLE QObject* getObject(
const QString& strName =
"")
307 THROW_IF_FAILED(m_oClient->GetObject(strName.toLocal8Bit().data(), pObject));
316 return m_oClient.IsValid();
319 filter::interface_client<ui::giant::IQtShared> m_oClient;
320 QJSEngine& m_oEngine;
Definition interface_clients.h:115
Q_INVOKABLE qint64 getCurrentTime()
Definition interface_clients.h:185
Q_INVOKABLE void open(const QString &strFileNames, bool bLoadReferencedFiles)
Definition interface_clients.h:129
Q_INVOKABLE void reset()
Definition interface_clients.h:161
Q_INVOKABLE void pause()
Definition interface_clients.h:153
Q_INVOKABLE void seekToTime(qint64 tmTime)
Definition interface_clients.h:193
Q_INVOKABLE void close()
Definition interface_clients.h:137
Q_INVOKABLE QVariantList getTimeRange()
Definition interface_clients.h:169
Q_INVOKABLE void play()
Definition interface_clients.h:145
Definition interface_clients.h:286
Definition interface_clients.h:42
Definition interface_clients.h:212
eThemeMode
Theme mode.
Definition qtxsystem_intf.h:549
@ System
System theme mode.
Definition qtxsystem_intf.h:553
@ Light
Light theme mode.
Definition qtxsystem_intf.h:557
@ Dark
Dark theme mode.
Definition qtxsystem_intf.h:561
#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