1 #ifndef FRONTENDSTATUS_H
2 #define FRONTENDSTATUS_H
12 Q_CLASSINFO(
"version",
"1.1");
14 Q_CLASSINFO(
"State",
"type=QString");
15 Q_CLASSINFO(
"ChapterTimes",
"type=QString;name=Chapter");
16 Q_CLASSINFO(
"SubtitleTracks",
"type=QString;name=Track");
17 Q_CLASSINFO(
"AudioTracks",
"type=QString;name=Track");
19 Q_PROPERTY(QString
Name READ
Name WRITE setName)
20 Q_PROPERTY(QString Version READ Version WRITE setVersion)
22 Q_PROPERTY(QVariantList ChapterTimes READ ChapterTimes)
23 Q_PROPERTY(QVariantMap SubtitleTracks READ SubtitleTracks)
24 Q_PROPERTY(QVariantMap AudioTracks READ AudioTracks)
35 static inline
void InitializeCustomTypes();
37 Q_INVOKABLE explicit
FrontendStatus(QObject *parent =
nullptr) : QObject(parent)
44 m_Version = src->m_Version;
45 m_State = src->m_State;
46 m_ChapterTimes = src->m_ChapterTimes;
47 m_SubtitleTracks = src->m_SubtitleTracks;
48 m_AudioTracks = src->m_AudioTracks;
53 if (m_State.contains(
"chaptertimes"))
55 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
56 auto type =
static_cast<QMetaType::Type
>(m_State[
"chaptertimes"].type());
58 auto type = m_State[
"chaptertimes"].typeId();
60 if (
type == QMetaType::QVariantList)
61 m_ChapterTimes = m_State[
"chaptertimes"].toList();
62 m_State.remove(
"chaptertimes");
65 if (m_State.contains(
"subtitletracks"))
67 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
68 auto type =
static_cast<QMetaType::Type
>(m_State[
"subtitletracks"].type());
70 auto type = m_State[
"subtitletracks"].typeId();
72 if (
type == QMetaType::QVariantMap)
73 m_SubtitleTracks = m_State[
"subtitletracks"].toMap();
74 m_State.remove(
"subtitletracks");
77 if (m_State.contains(
"audiotracks"))
79 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
80 auto type =
static_cast<QMetaType::Type
>(m_State[
"audiotracks"].type());
82 auto type = m_State[
"audiotracks"].typeId();
84 if (
type == QMetaType::QVariantMap)
85 m_AudioTracks = m_State[
"audiotracks"].toMap();
86 m_State.remove(
"audiotracks");
95 qRegisterMetaType<FrontendStatus*>();
100 #endif // FRONTENDSTATUS_H