From 708ced36137df7dac653da2aba721885040e9017 Mon Sep 17 00:00:00 2001 From: Peter Bennett Date: Tue, 17 Dec 2024 18:38:41 -0500 Subject: [PATCH] Revert "Remove old service API code from backend" Reverting this because tests fail. This reverts commit f8dad57b18800c881a28957b5caca1fa1dffbbc1. --- .../libmythservicecontracts/CMakeLists.txt | 70 ++++ .../datacontracts/artworkInfo.h | 67 ++++ .../datacontracts/artworkInfoList.h | 77 ++++ .../datacontracts/backendInfo.h | 83 ++++ .../datacontracts/blurayInfo.h | 135 +++++++ .../datacontracts/buildInfo.h | 68 ++++ .../datacontracts/captureCard.h | 191 ++++++++++ .../datacontracts/captureCardList.h | 75 ++++ .../datacontracts/castMember.h | 69 ++++ .../datacontracts/castMemberList.h | 68 ++++ .../datacontracts/channelGroup.h | 67 ++++ .../datacontracts/channelGroupList.h | 68 ++++ .../datacontracts/channelInfoList.h | 97 +++++ .../datacontracts/connectionInfo.h | 82 ++++ .../datacontracts/cutList.h | 77 ++++ .../datacontracts/cutting.h | 60 +++ .../datacontracts/databaseInfo.h | 85 +++++ .../datacontracts/encoder.h | 114 ++++++ .../datacontracts/encoderList.h | 76 ++++ .../datacontracts/envInfo.h | 76 ++++ .../datacontracts/genre.h | 58 +++ .../datacontracts/genreList.h | 77 ++++ .../datacontracts/imageMetadataInfo.h | 58 +++ .../datacontracts/imageMetadataInfoList.h | 84 +++++ .../datacontracts/imageSyncInfo.h | 57 +++ .../datacontracts/input.h | 92 +++++ .../datacontracts/inputList.h | 76 ++++ .../datacontracts/labelValue.h | 75 ++++ .../datacontracts/lineup.h | 121 ++++++ .../datacontracts/logInfo.h | 61 +++ .../datacontracts/logMessage.h | 105 ++++++ .../datacontracts/logMessageList.h | 101 +++++ .../datacontracts/markup.h | 66 ++++ .../datacontracts/markupList.h | 91 +++++ .../datacontracts/musicMetadataInfo.h | 105 ++++++ .../datacontracts/musicMetadataInfoList.h | 105 ++++++ .../datacontracts/programAndChannel.h | 354 ++++++++++++++++++ .../datacontracts/programGuide.h | 124 ++++++ .../datacontracts/programList.h | 103 +++++ .../datacontracts/recRule.h | 219 +++++++++++ .../datacontracts/recRuleFilter.h | 54 +++ .../datacontracts/recRuleFilterList.h | 90 +++++ .../datacontracts/recRuleList.h | 89 +++++ .../datacontracts/recording.h | 133 +++++++ .../datacontracts/settingList.h | 65 ++++ .../datacontracts/storageGroupDir.h | 70 ++++ .../datacontracts/storageGroupDirList.h | 66 ++++ .../datacontracts/timeZoneInfo.h | 65 ++++ .../datacontracts/titleInfo.h | 65 ++++ .../datacontracts/titleInfoList.h | 76 ++++ .../datacontracts/versionInfo.h | 77 ++++ .../datacontracts/videoLookupInfo.h | 189 ++++++++++ .../datacontracts/videoLookupInfoList.h | 93 +++++ .../datacontracts/videoMetadataInfo.h | 177 +++++++++ .../datacontracts/videoMetadataInfoList.h | 107 ++++++ .../datacontracts/videoMultiplex.h | 126 +++++++ .../datacontracts/videoMultiplexList.h | 95 +++++ .../datacontracts/videoSource.h | 92 +++++ .../datacontracts/videoSourceList.h | 80 ++++ .../datacontracts/videoStreamInfo.h | 93 +++++ .../datacontracts/videoStreamInfoList.h | 99 +++++ .../datacontracts/wolInfo.h | 72 ++++ .../libmythservicecontracts.pro | 73 +++- .../services/captureServices.h | 125 +++++++ .../services/channelServices.h | 180 +++++++++ .../services/contentServices.h | 147 ++++++++ .../services/dvrServices.h | 353 +++++++++++++++++ .../services/guideServices.h | 107 ++++++ .../services/imageServices.h | 54 +++ .../services/musicServices.h | 64 ++++ .../services/mythServices.h | 193 ++++++++++ .../services/videoServices.h | 147 ++++++++ 72 files changed, 7352 insertions(+), 1 deletion(-) create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/artworkInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/artworkInfoList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/backendInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/blurayInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/buildInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/captureCard.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/captureCardList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/castMember.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/castMemberList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/channelGroup.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/channelGroupList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/channelInfoList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/connectionInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/cutList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/cutting.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/databaseInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/encoder.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/encoderList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/envInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/genre.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/genreList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/imageMetadataInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/imageMetadataInfoList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/imageSyncInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/input.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/inputList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/labelValue.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/lineup.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/logInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/logMessage.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/logMessageList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/markup.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/markupList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/musicMetadataInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/musicMetadataInfoList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/programAndChannel.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/programGuide.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/programList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/recRule.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/recRuleFilter.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/recRuleFilterList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/recRuleList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/recording.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/settingList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/storageGroupDir.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/storageGroupDirList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/timeZoneInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/titleInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/titleInfoList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/versionInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/videoLookupInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/videoLookupInfoList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/videoMetadataInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/videoMetadataInfoList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/videoMultiplex.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/videoMultiplexList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/videoSource.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/videoSourceList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/videoStreamInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/videoStreamInfoList.h create mode 100644 mythtv/libs/libmythservicecontracts/datacontracts/wolInfo.h create mode 100644 mythtv/libs/libmythservicecontracts/services/captureServices.h create mode 100644 mythtv/libs/libmythservicecontracts/services/channelServices.h create mode 100644 mythtv/libs/libmythservicecontracts/services/contentServices.h create mode 100644 mythtv/libs/libmythservicecontracts/services/dvrServices.h create mode 100644 mythtv/libs/libmythservicecontracts/services/guideServices.h create mode 100644 mythtv/libs/libmythservicecontracts/services/imageServices.h create mode 100644 mythtv/libs/libmythservicecontracts/services/musicServices.h create mode 100644 mythtv/libs/libmythservicecontracts/services/mythServices.h create mode 100644 mythtv/libs/libmythservicecontracts/services/videoServices.h diff --git a/mythtv/libs/libmythservicecontracts/CMakeLists.txt b/mythtv/libs/libmythservicecontracts/CMakeLists.txt index b5891c95007..e94fc6e68fc 100644 --- a/mythtv/libs/libmythservicecontracts/CMakeLists.txt +++ b/mythtv/libs/libmythservicecontracts/CMakeLists.txt @@ -15,18 +15,88 @@ endif() set(HEADERS serviceexp.h service.h datacontracthelper.h) set(DATACONTRACTS_HEADERS + datacontracts/artworkInfo.h + datacontracts/artworkInfoList.h + datacontracts/backendInfo.h + datacontracts/blurayInfo.h + datacontracts/buildInfo.h + datacontracts/captureCard.h + datacontracts/captureCardList.h + datacontracts/castMember.h + datacontracts/castMemberList.h + datacontracts/channelGroup.h + datacontracts/channelGroupList.h + datacontracts/channelInfoList.h + datacontracts/connectionInfo.h + datacontracts/cutList.h + datacontracts/cutting.h + datacontracts/databaseInfo.h + datacontracts/encoder.h + datacontracts/encoderList.h datacontracts/enum.h datacontracts/enumItem.h + datacontracts/envInfo.h datacontracts/frontend.h datacontracts/frontendActionList.h datacontracts/frontendList.h datacontracts/frontendStatus.h + datacontracts/genre.h + datacontracts/genreList.h + datacontracts/imageMetadataInfo.h + datacontracts/imageMetadataInfoList.h + datacontracts/imageSyncInfo.h + datacontracts/input.h + datacontracts/inputList.h + datacontracts/labelValue.h + datacontracts/lineup.h datacontracts/liveStreamInfo.h datacontracts/liveStreamInfoList.h + datacontracts/logInfo.h + datacontracts/logMessage.h + datacontracts/logMessageList.h + datacontracts/markup.h + datacontracts/markupList.h + datacontracts/musicMetadataInfo.h + datacontracts/musicMetadataInfoList.h + datacontracts/programAndChannel.h + datacontracts/programGuide.h + datacontracts/programList.h + datacontracts/recRule.h + datacontracts/recRuleFilter.h + datacontracts/recRuleFilterList.h + datacontracts/recRuleList.h + datacontracts/recording.h + datacontracts/settingList.h + datacontracts/storageGroupDir.h + datacontracts/storageGroupDirList.h + datacontracts/timeZoneInfo.h + datacontracts/titleInfo.h + datacontracts/titleInfoList.h + datacontracts/versionInfo.h + datacontracts/videoLookupInfo.h + datacontracts/videoLookupInfoList.h + datacontracts/videoMetadataInfo.h + datacontracts/videoMetadataInfoList.h + datacontracts/videoMultiplex.h + datacontracts/videoMultiplexList.h + datacontracts/videoSource.h + datacontracts/videoSourceList.h + datacontracts/videoStreamInfo.h + datacontracts/videoStreamInfoList.h + datacontracts/wolInfo.h) set(SERVICES_HEADERS + services/captureServices.h + services/channelServices.h + services/contentServices.h + services/dvrServices.h services/frontendServices.h + services/guideServices.h + services/imageServices.h + services/musicServices.h + services/mythServices.h services/rttiServices.h + services/videoServices.h) # # Declare the library diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/artworkInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/artworkInfo.h new file mode 100644 index 00000000000..e96444fc59c --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/artworkInfo.h @@ -0,0 +1,67 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: artworkInfo.h +// Created : Nov. 12, 2011 +// +// Copyright (c) 2011 Robert McNamara +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef ARTWORKINFO_H_ +#define ARTWORKINFO_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC ArtworkInfo : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( QString URL READ URL WRITE setURL ) + Q_PROPERTY( QString FileName READ FileName WRITE setFileName ) + Q_PROPERTY( QString StorageGroup READ StorageGroup WRITE setStorageGroup ) + Q_PROPERTY( QString Type READ Type WRITE setType ) + + PROPERTYIMP_REF( QString , URL ) + PROPERTYIMP_REF( QString , FileName ) + PROPERTYIMP_REF( QString , StorageGroup ) + PROPERTYIMP_REF( QString , Type ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE explicit ArtworkInfo(QObject *parent = nullptr) + : QObject ( parent ) + { + } + + void Copy( const ArtworkInfo *src ) + { + m_URL = src->m_URL ; + m_FileName = src->m_FileName ; + m_StorageGroup = src->m_StorageGroup ; + m_Type = src->m_Type ; + } + + private: + Q_DISABLE_COPY(ArtworkInfo); +}; + +inline void ArtworkInfo::InitializeCustomTypes() +{ + qRegisterMetaType< ArtworkInfo* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/artworkInfoList.h b/mythtv/libs/libmythservicecontracts/datacontracts/artworkInfoList.h new file mode 100644 index 00000000000..6f23148974b --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/artworkInfoList.h @@ -0,0 +1,77 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: artworkInfoList.h +// Created : Nov. 12, 2011 +// +// Copyright (c) 2011 Robert McNamara +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef ARTWORKINFOLIST_H_ +#define ARTWORKINFOLIST_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "artworkInfo.h" + +namespace DTC +{ + +class SERVICE_PUBLIC ArtworkInfoList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "ArtworkInfos", "type=DTC::ArtworkInfo"); + + Q_PROPERTY( QVariantList ArtworkInfos READ ArtworkInfos ) + + PROPERTYIMP_RO_REF( QVariantList, ArtworkInfos ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE explicit ArtworkInfoList(QObject *parent = nullptr) + : QObject ( parent ) + { + } + + void Copy( const ArtworkInfoList *src ) + { + CopyListContents< ArtworkInfo >( this, m_ArtworkInfos, src->m_ArtworkInfos ); + } + + ArtworkInfo *AddNewArtworkInfo() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new ArtworkInfo( this ); + m_ArtworkInfos.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(ArtworkInfoList); +}; + +inline void ArtworkInfoList::InitializeCustomTypes() +{ + qRegisterMetaType< ArtworkInfoList* >(); + + ArtworkInfo::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/backendInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/backendInfo.h new file mode 100644 index 00000000000..6e7c607bf7c --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/backendInfo.h @@ -0,0 +1,83 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: backendInfo.h +// Created : Dec. 15, 2015 +// +// Copyright (c) 2015 Bill Meek, from: 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef BACKENDINFO_H_ +#define BACKENDINFO_H_ + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "buildInfo.h" +#include "envInfo.h" +#include "logInfo.h" + +namespace DTC +{ + +class SERVICE_PUBLIC BackendInfo : public QObject +{ + Q_OBJECT + + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( QObject* Build READ Build ) + Q_PROPERTY( QObject* Env READ Env ) + Q_PROPERTY( QObject* Log READ Log ) + + PROPERTYIMP_PTR( BuildInfo, Build ) + PROPERTYIMP_PTR( EnvInfo, Env ) + PROPERTYIMP_PTR( LogInfo, Log ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE BackendInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Build ( nullptr ), + m_Env ( nullptr ), + m_Log ( nullptr ) + { + } + + void Copy( const BackendInfo *src ) + { + // We always need to make sure the child object is + // created with the correct parent * + + if (src->m_Build) + Build()->Copy( src->m_Build ); + + if (src->m_Env) + Env()->Copy( src->m_Env ); + + if (src->m_Log) + Log()->Copy( src->m_Log ); + + } + + private: + Q_DISABLE_COPY(BackendInfo); +}; + +using BackendInfoPtr = BackendInfo*; + +inline void BackendInfo::InitializeCustomTypes() +{ + qRegisterMetaType< BackendInfo* >(); + + BuildInfo::InitializeCustomTypes(); + EnvInfo ::InitializeCustomTypes(); + LogInfo ::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/blurayInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/blurayInfo.h new file mode 100644 index 00000000000..838a11cd40d --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/blurayInfo.h @@ -0,0 +1,135 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: blurayInfo.h +// Created : Apr. 22, 2011 +// +// Copyright (c) 2011 Robert McNamara +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef BLURAYINFO_H_ +#define BLURAYINFO_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC BlurayInfo : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( QString Path READ Path WRITE setPath ) + Q_PROPERTY( QString Title READ Title WRITE setTitle ) + Q_PROPERTY( QString AltTitle READ AltTitle WRITE setAltTitle ) + Q_PROPERTY( QString DiscLang READ DiscLang WRITE setDiscLang ) + Q_PROPERTY( uint DiscNum READ DiscNum WRITE setDiscNum ) + Q_PROPERTY( uint TotalDiscNum READ TotalDiscNum WRITE setTotalDiscNum ) + Q_PROPERTY( uint TitleCount READ TitleCount WRITE setTitleCount ) + Q_PROPERTY( uint ThumbCount READ ThumbCount WRITE setThumbCount ) + Q_PROPERTY( QString ThumbPath READ ThumbPath WRITE setThumbPath ) + Q_PROPERTY( bool TopMenuSupported READ TopMenuSupported WRITE setTopMenuSupported ) + Q_PROPERTY( bool FirstPlaySupported READ FirstPlaySupported WRITE setFirstPlaySupported ) + Q_PROPERTY( uint NumHDMVTitles READ NumHDMVTitles WRITE setNumHDMVTitles ) + Q_PROPERTY( uint NumBDJTitles READ NumBDJTitles WRITE setNumBDJTitles ) + Q_PROPERTY( uint NumUnsupportedTitles READ NumUnsupportedTitles WRITE setNumUnsupportedTitles ) + Q_PROPERTY( bool AACSDetected READ AACSDetected WRITE setAACSDetected ) + Q_PROPERTY( bool LibAACSDetected READ LibAACSDetected WRITE setLibAACSDetected ) + Q_PROPERTY( bool AACSHandled READ AACSHandled WRITE setAACSHandled ) + Q_PROPERTY( bool BDPlusDetected READ BDPlusDetected WRITE setBDPlusDetected ) + Q_PROPERTY( bool LibBDPlusDetected READ LibBDPlusDetected WRITE setLibBDPlusDetected ) + Q_PROPERTY( bool BDPlusHandled READ BDPlusHandled WRITE setBDPlusHandled ) + + PROPERTYIMP_REF( QString , Path ) + PROPERTYIMP_REF( QString , Title ) + PROPERTYIMP_REF( QString , AltTitle ) + PROPERTYIMP_REF( QString , DiscLang ) + PROPERTYIMP ( uint , DiscNum ) + PROPERTYIMP ( uint , TotalDiscNum ) + PROPERTYIMP ( uint , TitleCount ) + PROPERTYIMP ( uint , ThumbCount ) + PROPERTYIMP_REF( QString , ThumbPath ) + PROPERTYIMP ( bool , TopMenuSupported ) + PROPERTYIMP ( bool , FirstPlaySupported ) + PROPERTYIMP ( uint , NumHDMVTitles ) + PROPERTYIMP ( uint , NumBDJTitles ) + PROPERTYIMP ( uint , NumUnsupportedTitles ) + PROPERTYIMP ( bool , AACSDetected ) + PROPERTYIMP ( bool , LibAACSDetected ) + PROPERTYIMP ( bool , AACSHandled ) + PROPERTYIMP ( bool , BDPlusDetected ) + PROPERTYIMP ( bool , LibBDPlusDetected ) + PROPERTYIMP ( bool , BDPlusHandled ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE BlurayInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Path ( QString() ), + m_Title ( QString() ), + m_AltTitle ( QString() ), + m_DiscLang ( QString() ), + m_DiscNum ( 0 ), + m_TotalDiscNum ( 0 ), + m_TitleCount ( 0 ), + m_ThumbCount ( 0 ), + m_ThumbPath ( QString() ), + m_TopMenuSupported ( false ), + m_FirstPlaySupported ( false ), + m_NumHDMVTitles ( 0 ), + m_NumBDJTitles ( 0 ), + m_NumUnsupportedTitles ( 0 ), + m_AACSDetected ( false ), + m_LibAACSDetected ( false ), + m_AACSHandled ( false ), + m_BDPlusDetected ( false ), + m_LibBDPlusDetected ( false ), + m_BDPlusHandled ( false ) + { + } + + void Copy( const BlurayInfo *src ) + { + m_Path = src->m_Path ; + m_Title = src->m_Title ; + m_AltTitle = src->m_AltTitle ; + m_DiscLang = src->m_DiscLang ; + m_DiscNum = src->m_DiscNum ; + m_TotalDiscNum = src->m_TotalDiscNum ; + m_TitleCount = src->m_TitleCount ; + m_ThumbCount = src->m_ThumbCount ; + m_ThumbPath = src->m_ThumbPath ; + m_TopMenuSupported = src->m_TopMenuSupported ; + m_FirstPlaySupported = src->m_FirstPlaySupported ; + m_NumHDMVTitles = src->m_NumHDMVTitles ; + m_NumBDJTitles = src->m_NumBDJTitles ; + m_NumUnsupportedTitles = src->m_NumUnsupportedTitles ; + m_AACSDetected = src->m_AACSDetected ; + m_LibAACSDetected = src->m_LibAACSDetected ; + m_AACSHandled = src->m_AACSHandled ; + m_BDPlusDetected = src->m_BDPlusDetected ; + m_LibBDPlusDetected = src->m_LibBDPlusDetected ; + m_BDPlusHandled = src->m_BDPlusHandled ; + } + + private: + Q_DISABLE_COPY(BlurayInfo); +}; + +inline void BlurayInfo::InitializeCustomTypes() +{ + qRegisterMetaType< BlurayInfo* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/buildInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/buildInfo.h new file mode 100644 index 00000000000..a0aeb18fdc7 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/buildInfo.h @@ -0,0 +1,68 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: buildInfo.h +// Created : Dec. 15, 2015 +// +// Copyright (c) 2015 Bill Meek, from: 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef BUILDINFO_H_ +#define BUILDINFO_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC BuildInfo : public QObject +{ + Q_OBJECT + + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( bool LibX264 READ LibX264 WRITE setLibX264 ) + Q_PROPERTY( bool LibDNS_SD READ LibDNS_SD WRITE setLibDNS_SD ) + + PROPERTYIMP_REF( QString , Version ) + PROPERTYIMP ( bool , LibX264 ) + PROPERTYIMP ( bool , LibDNS_SD ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE BuildInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Version ( "" ), + m_LibX264 ( false ), + m_LibDNS_SD( false ) + { + } + + void Copy( const BuildInfo *src ) + { + m_Version = src->m_Version ; + m_LibX264 = src->m_LibX264 ; + m_LibDNS_SD = src->m_LibDNS_SD; + } + + private: + Q_DISABLE_COPY(BuildInfo); +}; + +using BuildInfoPtr = BuildInfo*; + +inline void BuildInfo::InitializeCustomTypes() +{ + qRegisterMetaType< BuildInfo* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/captureCard.h b/mythtv/libs/libmythservicecontracts/datacontracts/captureCard.h new file mode 100644 index 00000000000..687f5cf4925 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/captureCard.h @@ -0,0 +1,191 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: captureCard.h +// Created : Sep. 21, 2011 +// +// Copyright (c) 2011 Robert McNamara +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef CAPTURECARD_H_ +#define CAPTURECARD_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC CaptureCard : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.2" ); + + Q_PROPERTY( uint CardId READ CardId WRITE setCardId ) + Q_PROPERTY( uint ParentId READ ParentId WRITE setParentId ) + Q_PROPERTY( QString VideoDevice READ VideoDevice WRITE setVideoDevice ) + Q_PROPERTY( QString AudioDevice READ AudioDevice WRITE setAudioDevice ) + Q_PROPERTY( QString VBIDevice READ VBIDevice WRITE setVBIDevice ) + Q_PROPERTY( QString CardType READ CardType WRITE setCardType ) + Q_PROPERTY( QString DefaultInput READ DefaultInput WRITE setDefaultInput ) + Q_PROPERTY( uint AudioRateLimit READ AudioRateLimit WRITE setAudioRateLimit ) + Q_PROPERTY( QString HostName READ HostName WRITE setHostName ) + Q_PROPERTY( uint DVBSWFilter READ DVBSWFilter WRITE setDVBSWFilter ) + Q_PROPERTY( uint DVBSatType READ DVBSatType WRITE setDVBSatType ) + Q_PROPERTY( bool DVBWaitForSeqStart READ DVBWaitForSeqStart WRITE setDVBWaitForSeqStart ) + Q_PROPERTY( bool SkipBTAudio READ SkipBTAudio WRITE setSkipBTAudio ) + Q_PROPERTY( bool DVBOnDemand READ DVBOnDemand WRITE setDVBOnDemand ) + Q_PROPERTY( uint DVBDiSEqCType READ DVBDiSEqCType WRITE setDVBDiSEqCType ) + Q_PROPERTY( uint FirewireSpeed READ FirewireSpeed WRITE setFirewireSpeed ) + Q_PROPERTY( QString FirewireModel READ FirewireModel WRITE setFirewireModel ) + Q_PROPERTY( uint FirewireConnection READ FirewireConnection WRITE setFirewireConnection ) + Q_PROPERTY( uint SignalTimeout READ SignalTimeout WRITE setSignalTimeout ) + Q_PROPERTY( uint ChannelTimeout READ ChannelTimeout WRITE setChannelTimeout ) + Q_PROPERTY( uint DVBTuningDelay READ DVBTuningDelay WRITE setDVBTuningDelay ) + Q_PROPERTY( uint Contrast READ Contrast WRITE setContrast ) + Q_PROPERTY( uint Brightness READ Brightness WRITE setBrightness ) + Q_PROPERTY( uint Colour READ Colour WRITE setColour ) + Q_PROPERTY( uint Hue READ Hue WRITE setHue ) + Q_PROPERTY( uint DiSEqCId READ DiSEqCId WRITE setDiSEqCId ) + Q_PROPERTY( bool DVBEITScan READ DVBEITScan WRITE setDVBEITScan ) + Q_PROPERTY( QString InputName READ InputName WRITE setInputName ) + Q_PROPERTY( uint SourceId READ SourceId WRITE setSourceId ) + Q_PROPERTY( QString ExternalCommand READ ExternalCommand WRITE setExternalCommand ) + Q_PROPERTY( QString ChangerDevice READ ChangerDevice WRITE setChangerDevice ) + Q_PROPERTY( QString ChangerModel READ ChangerModel WRITE setChangerModel ) + Q_PROPERTY( QString TuneChannel READ TuneChannel WRITE setTuneChannel ) + Q_PROPERTY( QString StartChannel READ StartChannel WRITE setStartChannel ) + Q_PROPERTY( QString DisplayName READ DisplayName WRITE setDisplayName ) + Q_PROPERTY( bool DishnetEit READ DishnetEit WRITE setDishnetEit ) + Q_PROPERTY( int RecPriority READ RecPriority WRITE setRecPriority ) + Q_PROPERTY( bool QuickTune READ QuickTune WRITE setQuickTune ) + Q_PROPERTY( uint SchedOrder READ SchedOrder WRITE setSchedOrder ) + Q_PROPERTY( uint LiveTVOrder READ LiveTVOrder WRITE setLiveTVOrder ) + Q_PROPERTY( uint RecLimit READ RecLimit WRITE setRecLimit ) + Q_PROPERTY( bool SchedGroup READ SchedGroup WRITE setSchedGroup ) + + PROPERTYIMP ( uint , CardId ) + PROPERTYIMP ( uint , ParentId ) + PROPERTYIMP_REF( QString , VideoDevice ) + PROPERTYIMP_REF( QString , AudioDevice ) + PROPERTYIMP_REF( QString , VBIDevice ) + PROPERTYIMP_REF( QString , CardType ) + PROPERTYIMP_REF( QString , DefaultInput ) + PROPERTYIMP ( uint , AudioRateLimit ) + PROPERTYIMP_REF( QString , HostName ) + PROPERTYIMP ( uint , DVBSWFilter ) + PROPERTYIMP ( uint , DVBSatType ) + PROPERTYIMP ( bool , DVBWaitForSeqStart) + PROPERTYIMP ( bool , SkipBTAudio ) + PROPERTYIMP ( bool , DVBOnDemand ) + PROPERTYIMP ( uint , DVBDiSEqCType ) + PROPERTYIMP ( uint , FirewireSpeed ) + PROPERTYIMP_REF( QString , FirewireModel ) + PROPERTYIMP ( uint , FirewireConnection) + PROPERTYIMP ( uint , SignalTimeout ) + PROPERTYIMP ( uint , ChannelTimeout ) + PROPERTYIMP ( uint , DVBTuningDelay ) + PROPERTYIMP ( uint , Contrast ) + PROPERTYIMP ( uint , Brightness ) + PROPERTYIMP ( uint , Colour ) + PROPERTYIMP ( uint , Hue ) + PROPERTYIMP ( uint , DiSEqCId ) + PROPERTYIMP ( bool , DVBEITScan ) + PROPERTYIMP_REF( QString , InputName ) + PROPERTYIMP ( uint , SourceId ) + PROPERTYIMP_REF( QString , ExternalCommand ) + PROPERTYIMP_REF( QString , ChangerDevice ) + PROPERTYIMP_REF( QString , ChangerModel ) + PROPERTYIMP_REF( QString , TuneChannel ) + PROPERTYIMP_REF( QString , StartChannel ) + PROPERTYIMP_REF( QString , DisplayName ) + PROPERTYIMP ( bool , DishnetEit ) + PROPERTYIMP ( int , RecPriority ) + PROPERTYIMP ( bool , QuickTune ) + PROPERTYIMP ( uint , SchedOrder ) + PROPERTYIMP ( uint , LiveTVOrder ) + PROPERTYIMP ( uint , RecLimit ) + PROPERTYIMP ( bool , SchedGroup ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE CaptureCard(QObject *parent = nullptr) + : QObject ( parent ), m_CardId(0), m_ParentId(0), + m_AudioRateLimit(0), m_DVBSWFilter(0), + m_DVBSatType(0), m_DVBWaitForSeqStart(false), + m_SkipBTAudio(false), m_DVBOnDemand(false), + m_DVBDiSEqCType(0), m_FirewireSpeed(0), + m_FirewireConnection(0), m_SignalTimeout(1000), + m_ChannelTimeout(3000), m_DVBTuningDelay(0), + m_Contrast(0), m_Brightness(0), m_Colour(0), + m_Hue(0), m_DiSEqCId(0), m_DVBEITScan(true), + m_SourceId(0), m_DishnetEit(false), m_RecPriority(0), + m_QuickTune(false), m_SchedOrder(0), m_LiveTVOrder(0), + m_RecLimit(0), m_SchedGroup(false) + { + } + + void Copy( const CaptureCard *src ) + { + m_CardId = src->m_CardId; + m_ParentId = src->m_ParentId; + m_VideoDevice = src->m_VideoDevice; + m_AudioDevice = src->m_AudioDevice; + m_CardType = src->m_CardType; + m_DefaultInput = src->m_DefaultInput; + m_AudioRateLimit = src->m_AudioRateLimit; + m_HostName = src->m_HostName; + m_DVBSWFilter = src->m_DVBSWFilter; + m_DVBSatType = src->m_DVBSatType; + m_DVBWaitForSeqStart = src->m_DVBWaitForSeqStart; + m_SkipBTAudio = src->m_SkipBTAudio; + m_DVBOnDemand = src->m_DVBOnDemand; + m_DVBDiSEqCType = src->m_DVBDiSEqCType; + m_FirewireSpeed = src->m_FirewireSpeed; + m_FirewireModel = src->m_FirewireModel; + m_FirewireConnection = src->m_FirewireConnection; + m_SignalTimeout = src->m_SignalTimeout; + m_ChannelTimeout = src->m_ChannelTimeout; + m_DVBTuningDelay = src->m_DVBTuningDelay; + m_Contrast = src->m_Contrast; + m_Brightness = src->m_Brightness; + m_Colour = src->m_Colour; + m_Hue = src->m_Hue; + m_DiSEqCId = src->m_DiSEqCId; + m_DVBEITScan = src->m_DVBEITScan; + m_InputName = src->m_InputName; + m_SourceId = src->m_SourceId; + m_ExternalCommand = src->m_ExternalCommand; + m_ChangerDevice = src->m_ChangerDevice; + m_ChangerModel = src->m_ChangerModel; + m_TuneChannel = src->m_TuneChannel; + m_StartChannel = src->m_StartChannel; + m_DisplayName = src->m_DisplayName; + m_DishnetEit = src->m_DishnetEit; + m_RecPriority = src->m_RecPriority; + m_QuickTune = src->m_QuickTune; + m_SchedOrder = src->m_SchedOrder; + m_LiveTVOrder = src->m_LiveTVOrder; + m_RecLimit = src->m_RecLimit; + m_SchedGroup = src->m_SchedGroup; + } + + private: + Q_DISABLE_COPY(CaptureCard); +}; + +inline void CaptureCard::InitializeCustomTypes() +{ + qRegisterMetaType< CaptureCard* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/captureCardList.h b/mythtv/libs/libmythservicecontracts/datacontracts/captureCardList.h new file mode 100644 index 00000000000..17f5592f66c --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/captureCardList.h @@ -0,0 +1,75 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: captureCardList.h +// Created : Sep. 21, 2011 +// +// Copyright (c) 2011 Robert McNamara +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef CAPTURECARDLIST_H_ +#define CAPTURECARDLIST_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "captureCard.h" + +namespace DTC +{ + +class SERVICE_PUBLIC CaptureCardList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "CaptureCards", "type=DTC::CaptureCard"); + + Q_PROPERTY( QVariantList CaptureCards READ CaptureCards ) + + PROPERTYIMP_RO_REF( QVariantList, CaptureCards ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE CaptureCardList(QObject *parent = nullptr) + : QObject( parent ) + { + } + + void Copy( const CaptureCardList *src ) + { + CopyListContents< CaptureCard >( this, m_CaptureCards, src->m_CaptureCards ); + } + + CaptureCard *AddNewCaptureCard() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new CaptureCard( this ); + m_CaptureCards.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(CaptureCardList); +}; + +inline void CaptureCardList::InitializeCustomTypes() +{ + qRegisterMetaType< CaptureCardList* >(); + CaptureCard::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/castMember.h b/mythtv/libs/libmythservicecontracts/datacontracts/castMember.h new file mode 100644 index 00000000000..a7e70c7b985 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/castMember.h @@ -0,0 +1,69 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: castMember.h +// Created : Nov. 25, 2013 +// +// Copyright (c) 2013 Stuart Morgan +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef DTCCASTMEMBER_H_ +#define DTCCASTMEMBER_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC CastMember : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "0.99" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_PROPERTY( QString Name READ Name WRITE setName ) + Q_PROPERTY( QString CharacterName READ CharacterName WRITE setCharacterName ) + Q_PROPERTY( QString Role READ Role WRITE setRole ) + Q_PROPERTY( QString TranslatedRole READ TranslatedRole WRITE setTranslatedRole ) + + PROPERTYIMP_REF ( QString , Name ) + PROPERTYIMP_REF ( QString , CharacterName ) + PROPERTYIMP_REF ( QString , Role ) + PROPERTYIMP_REF ( QString , TranslatedRole ) + + public: + + static void InitializeCustomTypes(); + + Q_INVOKABLE explicit CastMember(QObject *parent = nullptr) + : QObject ( parent ) + { + } + + void Copy( const CastMember *src ) + { + m_Name = src->m_Name ; + m_CharacterName = src->m_CharacterName ; + m_Role = src->m_Role ; + m_TranslatedRole = src->m_TranslatedRole; + } + + private: + Q_DISABLE_COPY(CastMember); +}; + +inline void CastMember::InitializeCustomTypes() +{ + qRegisterMetaType< CastMember* >(); +} + +} + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/castMemberList.h b/mythtv/libs/libmythservicecontracts/datacontracts/castMemberList.h new file mode 100644 index 00000000000..13ead2f6400 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/castMemberList.h @@ -0,0 +1,68 @@ +#ifndef CASTMEMBERLIST_H_ +#define CASTMEMBERLIST_H_ + +#include +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "castMember.h" + +namespace DTC +{ + +class SERVICE_PUBLIC CastMemberList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "0.99" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "CastMembers", "type=DTC::CastMember"); + + Q_PROPERTY( QVariantList CastMembers READ CastMembers ) + + PROPERTYIMP_RO_REF( QVariantList, CastMembers ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE explicit CastMemberList(QObject *parent = nullptr) + : QObject( parent ) + { + } + + void Copy( const CastMemberList *src ) + { + CopyListContents< CastMember >( this, m_CastMembers, src->m_CastMembers ); + } + + CastMember *AddNewCastMember() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new CastMember( this ); + m_CastMembers.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(CastMemberList); +}; + +inline void CastMemberList::InitializeCustomTypes() +{ + qRegisterMetaType< CastMemberList* >(); + + CastMember::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/channelGroup.h b/mythtv/libs/libmythservicecontracts/datacontracts/channelGroup.h new file mode 100644 index 00000000000..15bd673da89 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/channelGroup.h @@ -0,0 +1,67 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: channelGroup.h +// Created : Nov. 15, 2013 +// +// Copyright (c) 2013 Stuart Morgan +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef DTCCHANNELGROUP_H_ +#define DTCCHANNELGROUP_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC ChannelGroup : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "0.99" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_PROPERTY( uint GroupId READ GroupId WRITE setGroupId ) + Q_PROPERTY( QString Name READ Name WRITE setName ) + Q_PROPERTY( QString Password READ Password WRITE setPassword ) + + PROPERTYIMP ( uint , GroupId ) + PROPERTYIMP_REF ( QString , Name ) + PROPERTYIMP_REF ( QString , Password ); + + public: + + static void InitializeCustomTypes(); + + Q_INVOKABLE ChannelGroup(QObject *parent = nullptr) + : QObject ( parent ), + m_GroupId ( 0 ) + { + } + + void Copy( const ChannelGroup *src ) + { + m_GroupId = src->m_GroupId ; + m_Name = src->m_Name ; + m_Password = src->m_Password ; + } + + private: + Q_DISABLE_COPY(ChannelGroup); +}; + +inline void ChannelGroup::InitializeCustomTypes() +{ + qRegisterMetaType< ChannelGroup* >(); +} + +} + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/channelGroupList.h b/mythtv/libs/libmythservicecontracts/datacontracts/channelGroupList.h new file mode 100644 index 00000000000..2212211cab2 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/channelGroupList.h @@ -0,0 +1,68 @@ +#ifndef CHANNELGROUPLIST_H_ +#define CHANNELGROUPLIST_H_ + +#include +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "channelGroup.h" + +namespace DTC +{ + +class SERVICE_PUBLIC ChannelGroupList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "ChannelGroups", "type=DTC::ChannelGroup"); + + Q_PROPERTY( QVariantList ChannelGroups READ ChannelGroups ) + + PROPERTYIMP_RO_REF( QVariantList, ChannelGroups ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE ChannelGroupList(QObject *parent = nullptr) + : QObject( parent ) + { + } + + void Copy( const ChannelGroupList *src ) + { + CopyListContents< ChannelGroup >( this, m_ChannelGroups, src->m_ChannelGroups ); + } + + ChannelGroup *AddNewChannelGroup() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new ChannelGroup( this ); + m_ChannelGroups.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(ChannelGroupList); +}; + +inline void ChannelGroupList::InitializeCustomTypes() +{ + qRegisterMetaType< ChannelGroupList* >(); + + ChannelGroup::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/channelInfoList.h b/mythtv/libs/libmythservicecontracts/datacontracts/channelInfoList.h new file mode 100644 index 00000000000..5fac6322499 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/channelInfoList.h @@ -0,0 +1,97 @@ +#ifndef CHANNELINFOLIST_H_ +#define CHANNELINFOLIST_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "programAndChannel.h" + +namespace DTC +{ + +class SERVICE_PUBLIC ChannelInfoList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "ChannelInfos", "type=DTC::ChannelInfo"); + Q_CLASSINFO( "AsOf" , "transient=true" ); + + Q_PROPERTY( int StartIndex READ StartIndex WRITE setStartIndex ) + Q_PROPERTY( int Count READ Count WRITE setCount ) + Q_PROPERTY( int CurrentPage READ CurrentPage WRITE setCurrentPage ) + Q_PROPERTY( int TotalPages READ TotalPages WRITE setTotalPages ) + Q_PROPERTY( int TotalAvailable READ TotalAvailable WRITE setTotalAvailable ) + Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf ) + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer ) + + Q_PROPERTY( QVariantList ChannelInfos READ ChannelInfos ) + + PROPERTYIMP ( int , StartIndex ) + PROPERTYIMP ( int , Count ) + PROPERTYIMP ( int , CurrentPage ) + PROPERTYIMP ( int , TotalPages ) + PROPERTYIMP ( int , TotalAvailable ) + PROPERTYIMP_REF ( QDateTime , AsOf ) + PROPERTYIMP_REF ( QString , Version ) + PROPERTYIMP_REF ( QString , ProtoVer ) + + PROPERTYIMP_RO_REF( QVariantList, ChannelInfos ); + + public: + + static void InitializeCustomTypes(); + + Q_INVOKABLE ChannelInfoList(QObject *parent = nullptr) + : QObject( parent ), + m_StartIndex ( 0 ), + m_Count ( 0 ), + m_CurrentPage ( 0 ), + m_TotalPages ( 0 ), + m_TotalAvailable( 0 ) + { + } + + void Copy( const ChannelInfoList *src ) + { + m_StartIndex = src->m_StartIndex ; + m_Count = src->m_Count ; + m_TotalAvailable= src->m_TotalAvailable ; + m_AsOf = src->m_AsOf ; + m_Version = src->m_Version ; + m_ProtoVer = src->m_ProtoVer ; + + CopyListContents< ChannelInfo >( this, m_ChannelInfos, src->m_ChannelInfos ); + } + + ChannelInfo *AddNewChannelInfo() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new ChannelInfo( this ); + m_ChannelInfos.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(ChannelInfoList); +}; + +inline void ChannelInfoList::InitializeCustomTypes() +{ + qRegisterMetaType< ChannelInfoList* >(); + + ChannelInfo::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/connectionInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/connectionInfo.h new file mode 100644 index 00000000000..9b3d5661373 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/connectionInfo.h @@ -0,0 +1,82 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: connectionInfo.h +// Created : Jan. 15, 2010 +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef CONNECTIONINFO_H_ +#define CONNECTIONINFO_H_ + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "versionInfo.h" +#include "databaseInfo.h" +#include "wolInfo.h" + +namespace DTC +{ + +class SERVICE_PUBLIC ConnectionInfo : public QObject +{ + Q_OBJECT + + Q_CLASSINFO( "version" , "1.1" ); + + Q_PROPERTY( QObject* Version READ Version ) + Q_PROPERTY( QObject* Database READ Database ) + Q_PROPERTY( QObject* WOL READ WOL ) + + PROPERTYIMP_PTR( VersionInfo , Version ) + PROPERTYIMP_PTR( DatabaseInfo, Database ) + PROPERTYIMP_PTR( WOLInfo , WOL ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE ConnectionInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Version ( nullptr ), + m_Database ( nullptr ), + m_WOL ( nullptr ) + { + } + + void Copy( const ConnectionInfo *src ) + { + // We always need to make sure the child object is + // created with the correct parent * + + if (src->m_Version) + Version()->Copy( src->m_Version ); + + if (src->m_Database) + Database()->Copy( src->m_Database ); + + if (src->m_WOL) + WOL ()->Copy( src->m_WOL ); + } + + private: + Q_DISABLE_COPY(ConnectionInfo); +}; + +using ConnectionInfoPtr = ConnectionInfo*; + +inline void ConnectionInfo::InitializeCustomTypes() +{ + qRegisterMetaType< ConnectionInfo* >(); + + VersionInfo ::InitializeCustomTypes(); + DatabaseInfo::InitializeCustomTypes(); + WOLInfo ::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/cutList.h b/mythtv/libs/libmythservicecontracts/datacontracts/cutList.h new file mode 100644 index 00000000000..d157926a5cc --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/cutList.h @@ -0,0 +1,77 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: cutList.h +// Created : Mar. 09, 2014 +// +// Copyright (c) 2014 team MythTV +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef CUTLIST_H_ +#define CUTLIST_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "cutting.h" + +namespace DTC +{ + +class SERVICE_PUBLIC CutList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "Cuttings", "type=DTC::Cutting"); + + Q_PROPERTY( QVariantList Cuttings READ Cuttings ) + + PROPERTYIMP_RO_REF( QVariantList, Cuttings ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE CutList(QObject *parent = nullptr) + : QObject ( parent ) + { + } + + void Copy( const CutList *src ) + { + CopyListContents< Cutting >( this, m_Cuttings, src->m_Cuttings ); + } + + Cutting *AddNewCutting() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new Cutting( this ); + m_Cuttings.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(CutList); +}; + +inline void CutList::InitializeCustomTypes() +{ + qRegisterMetaType< CutList* >(); + + Cutting::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/cutting.h b/mythtv/libs/libmythservicecontracts/datacontracts/cutting.h new file mode 100644 index 00000000000..03c09c3655e --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/cutting.h @@ -0,0 +1,60 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: cutting.h +// Created : Mar. 09, 2014 +// +// Copyright (c) 2014 team MythTV +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef CUTTING_H_ +#define CUTTING_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC Cutting : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( int Mark READ Mark WRITE setMark ) + Q_PROPERTY( qlonglong Offset READ Offset WRITE setOffset ) + + PROPERTYIMP ( int , Mark ) + PROPERTYIMP ( qlonglong , Offset ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE Cutting(QObject *parent = nullptr) + : QObject( parent ), m_Mark(0), m_Offset(0) + { + } + + void Copy( const Cutting *src ) + { + m_Mark = src->m_Mark ; + m_Offset = src->m_Offset ; + } + + private: + Q_DISABLE_COPY(Cutting); +}; + +inline void Cutting::InitializeCustomTypes() +{ + qRegisterMetaType< Cutting* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/databaseInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/databaseInfo.h new file mode 100644 index 00000000000..755921aa0a2 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/databaseInfo.h @@ -0,0 +1,85 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: databaseInfo.h +// Created : Jan. 15, 2010 +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef DATABASEINFO_H_ +#define DATABASEINFO_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC DatabaseInfo : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + Q_PROPERTY( QString Host READ Host WRITE setHost ) + Q_PROPERTY( bool Ping READ Ping WRITE setPing ) + Q_PROPERTY( int Port READ Port WRITE setPort ) + Q_PROPERTY( QString UserName READ UserName WRITE setUserName ) + Q_PROPERTY( QString Password READ Password WRITE setPassword ) + Q_PROPERTY( QString Name READ Name WRITE setName ) + Q_PROPERTY( QString Type READ Type WRITE setType ) + Q_PROPERTY( bool LocalEnabled READ LocalEnabled WRITE setLocalEnabled ) + Q_PROPERTY( QString LocalHostName READ LocalHostName WRITE setLocalHostName ) + + PROPERTYIMP_REF( QString, Host ) + PROPERTYIMP ( bool , Ping ) + PROPERTYIMP ( int , Port ) + PROPERTYIMP_REF( QString, UserName ) + PROPERTYIMP_REF( QString, Password ) + PROPERTYIMP_REF( QString, Name ) + PROPERTYIMP_REF( QString, Type ) + PROPERTYIMP ( bool , LocalEnabled ) + PROPERTYIMP_REF( QString, LocalHostName ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE DatabaseInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Ping ( false ), + m_Port ( 0 ), + m_LocalEnabled( false ) + { + } + + void Copy( const DatabaseInfo *src ) + { + m_Host = src->m_Host ; + m_Ping = src->m_Ping ; + m_Port = src->m_Port ; + m_UserName = src->m_UserName ; + m_Password = src->m_Password ; + m_Name = src->m_Name ; + m_Type = src->m_Type ; + m_LocalEnabled = src->m_LocalEnabled ; + m_LocalHostName= src->m_LocalHostName; + } + + private: + Q_DISABLE_COPY(DatabaseInfo); +}; + +using DatabaseInfoPtr = DatabaseInfo*; + +inline void DatabaseInfo::InitializeCustomTypes() +{ + qRegisterMetaType< DatabaseInfo* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/encoder.h b/mythtv/libs/libmythservicecontracts/datacontracts/encoder.h new file mode 100644 index 00000000000..f4cac0a2625 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/encoder.h @@ -0,0 +1,114 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: encoder.h +// Created : Jan. 15, 2010 +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef ENCODER_H_ +#define ENCODER_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "input.h" +#include "programAndChannel.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC Encoder : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_CLASSINFO( "Inputs", "type=DTC::Input"); + + Q_PROPERTY( int Id READ Id WRITE setId ) + Q_PROPERTY( QString HostName READ HostName WRITE setHostName ) + Q_PROPERTY( bool Local READ Local WRITE setLocal ) + Q_PROPERTY( bool Connected READ Connected WRITE setConnected ) + Q_PROPERTY( int State READ State WRITE setState ) + Q_PROPERTY( int SleepStatus READ SleepStatus WRITE setSleepStatus ) + Q_PROPERTY( bool LowOnFreeSpace READ LowOnFreeSpace WRITE setLowOnFreeSpace ) + + Q_PROPERTY( QVariantList Inputs READ Inputs ) + Q_PROPERTY( QObject* Recording READ Recording ) + + PROPERTYIMP ( int , Id ) + PROPERTYIMP_REF( QString , HostName ) + PROPERTYIMP ( bool , Local ) + PROPERTYIMP ( bool , Connected ) + PROPERTYIMP ( int , State ) + PROPERTYIMP ( int , SleepStatus ) + PROPERTYIMP ( bool , LowOnFreeSpace ) + + PROPERTYIMP_PTR( Program , Recording ) + + PROPERTYIMP_RO_REF( QVariantList, Inputs ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE Encoder(QObject *parent = nullptr) + : QObject ( parent ), + m_Id ( 0 ), + m_Local ( true ), + m_Connected ( false ), + m_State ( 0 ), + m_SleepStatus ( 0 ), + m_LowOnFreeSpace( false ), + m_Recording ( nullptr ) + { + } + + void Copy( const Encoder *src ) + { + m_Id = src->m_Id ; + m_HostName = src->m_HostName ; + m_Local = src->m_Local ; + m_Connected = src->m_Connected ; + m_State = src->m_State ; + m_SleepStatus = src->m_SleepStatus ; + m_LowOnFreeSpace= src->m_LowOnFreeSpace; + m_Recording = nullptr ; + + if ( src->m_Recording != nullptr) + Recording()->Copy( src->m_Recording ); + + CopyListContents< Input >( this, m_Inputs, src->m_Inputs ); + } + + Input *AddNewInput() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new Input( this ); + Inputs().append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(Encoder); +}; + +inline void Encoder::InitializeCustomTypes() +{ + qRegisterMetaType< Encoder* >(); + + Program::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/encoderList.h b/mythtv/libs/libmythservicecontracts/datacontracts/encoderList.h new file mode 100644 index 00000000000..70ade9daff1 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/encoderList.h @@ -0,0 +1,76 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: encoderList.h +// Created : Jan. 15, 2010 +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef ENCODERLIST_H_ +#define ENCODERLIST_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "encoder.h" + +namespace DTC +{ + +class SERVICE_PUBLIC EncoderList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "Encoders", "type=DTC::Encoder"); + + Q_PROPERTY( QVariantList Encoders READ Encoders ) + + PROPERTYIMP_RO_REF( QVariantList, Encoders ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE EncoderList(QObject *parent = nullptr) + : QObject( parent ) + { + } + + void Copy( const EncoderList *src ) + { + CopyListContents< Encoder >( this, m_Encoders, src->m_Encoders ); + } + + Encoder *AddNewEncoder() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new Encoder( this ); + m_Encoders.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(EncoderList); +}; + +inline void EncoderList::InitializeCustomTypes() +{ + qRegisterMetaType< EncoderList* >(); + + Encoder::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/envInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/envInfo.h new file mode 100644 index 00000000000..60183385694 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/envInfo.h @@ -0,0 +1,76 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: envInfo.h +// Created : Dec. 15, 2015 +// +// Copyright (c) 2015 Bill Meek, from: 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef ENVINFO_H_ +#define ENVINFO_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC EnvInfo : public QObject +{ + Q_OBJECT + + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( QString LANG READ LANG WRITE setLANG ) + Q_PROPERTY( QString LCALL READ LCALL WRITE setLCALL ) + Q_PROPERTY( QString LCCTYPE READ LCCTYPE WRITE setLCCTYPE ) + Q_PROPERTY( QString HOME READ HOME WRITE setHOME ) + Q_PROPERTY( QString MYTHCONFDIR READ MYTHCONFDIR WRITE setMYTHCONFDIR ) + + PROPERTYIMP_REF( QString, LANG ) + PROPERTYIMP_REF( QString, LCALL ) + PROPERTYIMP_REF( QString, LCCTYPE ) + PROPERTYIMP_REF( QString, HOME ) + PROPERTYIMP_REF( QString, MYTHCONFDIR ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE EnvInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_LANG ( "" ), + m_LCALL ( "" ), + m_LCCTYPE ( "" ), + m_HOME ( "" ), + m_MYTHCONFDIR ( "" ) + { + } + + void Copy( const EnvInfo *src ) + { + m_LANG = src->m_LANG; + m_LCALL = src->m_LCALL; + m_LCCTYPE = src->m_LCCTYPE; + m_HOME = src->m_HOME; + m_MYTHCONFDIR = src->m_MYTHCONFDIR; + } + + private: + Q_DISABLE_COPY(EnvInfo); +}; + +using EnvInfoPtr = EnvInfo*; + +inline void EnvInfo::InitializeCustomTypes() +{ + qRegisterMetaType< EnvInfo* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/genre.h b/mythtv/libs/libmythservicecontracts/datacontracts/genre.h new file mode 100644 index 00000000000..a77d0e80a95 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/genre.h @@ -0,0 +1,58 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: genre.h +// Created : Mar. 08, 2017 +// +// Copyright (c) 2017 Paul Harrison +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef GENRE_H_ +#define GENRE_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC Genre : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( QString Name READ Name WRITE setName ) + + PROPERTYIMP_REF( QString , Name ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE Genre(QObject *parent = nullptr) + : QObject ( parent ) + { + } + + void Copy( const Genre *src ) + { + m_Name = src->m_Name ; + } + + private: + Q_DISABLE_COPY(Genre); +}; + +inline void Genre::InitializeCustomTypes() +{ + qRegisterMetaType< Genre* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/genreList.h b/mythtv/libs/libmythservicecontracts/datacontracts/genreList.h new file mode 100644 index 00000000000..aeb7db40836 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/genreList.h @@ -0,0 +1,77 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: genreList.h +// Created : Mar. 08, 2017 +// +// Copyright (c) 2017 Paul Harrison +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef GENRELIST_H_ +#define GENRELIST_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "genre.h" + +namespace DTC +{ + +class SERVICE_PUBLIC GenreList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "GenreList", "type=DTC::Genre"); + + Q_PROPERTY( QVariantList GenreList READ Genres ) + + PROPERTYIMP_RO_REF( QVariantList, Genres ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE GenreList(QObject *parent = nullptr) + : QObject ( parent ) + { + } + + void Copy( const GenreList *src ) + { + CopyListContents< Genre >( this, m_Genres, src->m_Genres ); + } + + Genre *AddNewGenre() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new Genre( this ); + m_Genres.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(GenreList); +}; + +inline void GenreList::InitializeCustomTypes() +{ + qRegisterMetaType< GenreList* >(); + + Genre::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/imageMetadataInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/imageMetadataInfo.h new file mode 100644 index 00000000000..8f59480419b --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/imageMetadataInfo.h @@ -0,0 +1,58 @@ +#ifndef IMAGEMETADATAINFO_H +#define IMAGEMETADATAINFO_H + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + + + +namespace DTC +{ + +class SERVICE_PUBLIC ImageMetadataInfo : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.00" ) + + Q_PROPERTY( int Number READ Number WRITE setNumber ) + Q_PROPERTY( QString Tag READ Tag WRITE setTag ) + Q_PROPERTY( QString Label READ Label WRITE setLabel ) + Q_PROPERTY( QString Value READ Value WRITE setValue ) + + PROPERTYIMP ( int , Number ) + PROPERTYIMP_REF( QString , Tag ) + PROPERTYIMP_REF( QString , Label ) + PROPERTYIMP_REF( QString , Value ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE ImageMetadataInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Number ( 0 ) + { + } + + void Copy( const ImageMetadataInfo *src ) + { + m_Number = src->m_Number; + m_Tag = src->m_Tag; + m_Label = src->m_Label; + m_Value = src->m_Value; + } + + private: + Q_DISABLE_COPY(ImageMetadataInfo); +}; + +inline void ImageMetadataInfo::InitializeCustomTypes() +{ + qRegisterMetaType< ImageMetadataInfo* >(); +} + +} // namespace DTC + +#endif // IMAGEMETADATAINFO_H diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/imageMetadataInfoList.h b/mythtv/libs/libmythservicecontracts/datacontracts/imageMetadataInfoList.h new file mode 100644 index 00000000000..b61a8392a80 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/imageMetadataInfoList.h @@ -0,0 +1,84 @@ +#ifndef IMAGEMETADATAINFOLIST_H +#define IMAGEMETADATAINFOLIST_H + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" +#include "imageMetadataInfo.h" + + + +namespace DTC +{ + +class SERVICE_PUBLIC ImageMetadataInfoList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ) + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "ImageMetadataInfos", "type=DTC::ImageMetadataInfo") + + Q_PROPERTY( int Count READ Count WRITE setCount ) + Q_PROPERTY( QString File READ File WRITE setFile ) + Q_PROPERTY( QString Path READ Path WRITE setPath ) + Q_PROPERTY( int Size READ Size WRITE setSize ) + Q_PROPERTY( QString Extension READ Extension WRITE setExtension ) + Q_PROPERTY( QVariantList ImageMetadataInfos READ ImageMetadataInfos ) + + PROPERTYIMP ( int , Count ) + PROPERTYIMP_REF ( QString , File ) + PROPERTYIMP_REF ( QString , Path ) + PROPERTYIMP ( int , Size ) + PROPERTYIMP_REF ( QString , Extension ) + PROPERTYIMP_RO_REF( QVariantList, ImageMetadataInfos ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE ImageMetadataInfoList(QObject *parent = nullptr) + : QObject( parent ), + m_Count ( 0 ), + m_Size ( 0 ) + { + } + + void Copy( const ImageMetadataInfoList *src ) + { + m_Count = src->m_Count; + m_File = src->m_File; + m_Path = src->m_Path; + m_Size = src->m_Size; + m_Extension = src->m_Extension; + + CopyListContents< ImageMetadataInfo >( this, m_ImageMetadataInfos, src->m_ImageMetadataInfos ); + } + + ImageMetadataInfo *AddNewImageMetadataInfo() + { + // We must make sure the object added to the + // QVariantList has a parent of 'this' + auto *pObject = new ImageMetadataInfo( this ); + m_ImageMetadataInfos.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(ImageMetadataInfoList); +}; + +inline void ImageMetadataInfoList::InitializeCustomTypes() +{ + qRegisterMetaType< ImageMetadataInfoList* >(); + + ImageMetadataInfo::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif // IMAGEMETADATAINFOLIST_H diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/imageSyncInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/imageSyncInfo.h new file mode 100644 index 00000000000..c796aa130fe --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/imageSyncInfo.h @@ -0,0 +1,57 @@ +#ifndef IMAGESYNCINFO_H +#define IMAGESYNCINFO_H + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + + + +namespace DTC +{ + +class SERVICE_PUBLIC ImageSyncInfo : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.00" ) + + Q_PROPERTY( bool Running READ Running WRITE setRunning ) + Q_PROPERTY( int Current READ Current WRITE setCurrent ) + Q_PROPERTY( int Total READ Total WRITE setTotal ) + + PROPERTYIMP ( bool , Running ) + PROPERTYIMP ( int , Current ) + PROPERTYIMP ( int , Total ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE ImageSyncInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Running ( false ), + m_Current ( 0 ), + m_Total ( 0 ) + { + } + + void Copy( const ImageSyncInfo *src ) + { + m_Running = src->m_Running; + m_Current = src->m_Current; + m_Total = src->m_Total; + } + + private: + Q_DISABLE_COPY(ImageSyncInfo); +}; + +inline void ImageSyncInfo::InitializeCustomTypes() +{ + qRegisterMetaType< ImageSyncInfo* >(); +} + +} // namespace DTC + +#endif // IMAGESYNCINFO_H diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/input.h b/mythtv/libs/libmythservicecontracts/datacontracts/input.h new file mode 100644 index 00000000000..8541d072ad4 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/input.h @@ -0,0 +1,92 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: input.h +// Created : Nov. 20, 2013 +// +// Copyright (c) 2013 Stuart Morgan +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef INPUT_H_ +#define INPUT_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC Input : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( uint Id READ Id WRITE setId ) + Q_PROPERTY( uint CardId READ CardId WRITE setCardId ) + Q_PROPERTY( uint SourceId READ SourceId WRITE setSourceId ) + Q_PROPERTY( QString InputName READ InputName WRITE setInputName ) + Q_PROPERTY( QString DisplayName READ DisplayName WRITE setDisplayName ) +// Q_PROPERTY( QString StartChan READ StartChan WRITE setStartChan ) + Q_PROPERTY( bool QuickTune READ QuickTune WRITE setQuickTune ) + Q_PROPERTY( int RecPriority READ RecPriority WRITE setRecPriority ) + Q_PROPERTY( int ScheduleOrder READ ScheduleOrder WRITE setScheduleOrder ) + Q_PROPERTY( int LiveTVOrder READ LiveTVOrder WRITE setLiveTVOrder ) + + PROPERTYIMP ( uint , Id ) + PROPERTYIMP ( uint , CardId ) + PROPERTYIMP ( uint , SourceId ) + PROPERTYIMP_REF( QString , InputName ) + PROPERTYIMP_REF( QString , DisplayName ) +// PROPERTYIMP_REF( QString , StartChan ) + PROPERTYIMP ( bool , QuickTune ) + PROPERTYIMP ( uint , RecPriority ) + PROPERTYIMP ( uint , ScheduleOrder ) + PROPERTYIMP ( uint , LiveTVOrder ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE Input(QObject *parent = nullptr) + : QObject ( parent ), + m_Id ( 0 ), + m_CardId ( 0 ), + m_SourceId ( 0 ), + m_QuickTune ( false ), + m_RecPriority ( 0 ), + m_ScheduleOrder ( 0 ), + m_LiveTVOrder ( 0 ) + { + } + + void Copy( const Input *src ) + { + m_Id = src->m_Id; + m_CardId = src->m_CardId; + m_SourceId = src->m_SourceId; + m_InputName = src->m_InputName; + m_DisplayName = src->m_DisplayName; +// m_StartChan = src->m_StartChan; + m_QuickTune = src->m_QuickTune; + m_RecPriority = src->m_RecPriority; + m_ScheduleOrder = src->m_ScheduleOrder; + m_LiveTVOrder = src->m_LiveTVOrder; + } + + private: + Q_DISABLE_COPY(Input); +}; + +inline void Input::InitializeCustomTypes() +{ + qRegisterMetaType< Input* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/inputList.h b/mythtv/libs/libmythservicecontracts/datacontracts/inputList.h new file mode 100644 index 00000000000..039cd5c8c5d --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/inputList.h @@ -0,0 +1,76 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: inputList.h +// Created : Nov. 20, 2013 +// +// Copyright (c) 2013 Stuart Morgan +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef INPUTLIST_H_ +#define INPUTLIST_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "input.h" + +namespace DTC +{ + +class SERVICE_PUBLIC InputList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "Inputs", "type=DTC::Input"); + + Q_PROPERTY( QVariantList Inputs READ Inputs ) + + PROPERTYIMP_RO_REF( QVariantList, Inputs ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE InputList(QObject *parent = nullptr) + : QObject( parent ) + { + } + + void Copy( const InputList *src ) + { + CopyListContents< Input >( this, m_Inputs, src->m_Inputs ); + } + + Input *AddNewInput() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new Input( this ); + m_Inputs.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(InputList); +}; + +inline void InputList::InitializeCustomTypes() +{ + qRegisterMetaType< InputList* >(); + + Input::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/labelValue.h b/mythtv/libs/libmythservicecontracts/datacontracts/labelValue.h new file mode 100644 index 00000000000..f455157f720 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/labelValue.h @@ -0,0 +1,75 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: labelValue.h +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef LABELVALUE_H_ +#define LABELVALUE_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC LabelValue : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( QString Label READ Label + WRITE setLabel ) + Q_PROPERTY( QString Value READ Value + WRITE setValue ) + Q_PROPERTY( QString Description READ Description + WRITE setDescription ) + Q_PROPERTY( bool Active READ Active + WRITE setActive ) + Q_PROPERTY( bool Selected READ Selected + WRITE setSelected ) + + PROPERTYIMP_REF( QString , Label ) + PROPERTYIMP_REF( QString , Value ) + PROPERTYIMP_REF( QString , Description ) + PROPERTYIMP ( bool , Active ) + PROPERTYIMP ( bool , Selected ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE LabelValue(QObject *parent = nullptr) + : QObject ( parent ), + m_Label ( ), + m_Value ( ), + m_Description ( ), + m_Active ( false ), + m_Selected ( false ) + { + } + + void Copy( const LabelValue *src ) + { + m_Label = src->m_Label ; + m_Value = src->m_Value ; + m_Description = src->m_Description ; + m_Active = src->m_Active ; + m_Selected = src->m_Selected ; + } + + private: + Q_DISABLE_COPY(LabelValue); +}; + +inline void LabelValue::InitializeCustomTypes() +{ + qRegisterMetaType< LabelValue* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/lineup.h b/mythtv/libs/libmythservicecontracts/datacontracts/lineup.h new file mode 100644 index 00000000000..66f81a5a3ca --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/lineup.h @@ -0,0 +1,121 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: lineup.h +// Created : Sep. 18, 2011 +// +// Copyright (c) 2011 Robert McNamara +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef LINEUP_H_ +#define LINEUP_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC Lineup : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( QString LineupId READ LineupId WRITE setLineupId ) + Q_PROPERTY( QString Name READ Name WRITE setName ) + Q_PROPERTY( QString DisplayName READ DisplayName WRITE setDisplayName ) + Q_PROPERTY( QString Type READ Type WRITE setType ) + Q_PROPERTY( QString Postal READ Postal WRITE setPostal ) + Q_PROPERTY( QString Device READ Device WRITE setDevice ) + + PROPERTYIMP_REF( QString , LineupId ) + PROPERTYIMP_REF( QString , Name ) + PROPERTYIMP_REF( QString , DisplayName ) + PROPERTYIMP_REF( QString , Type ) + PROPERTYIMP_REF( QString , Postal ) + PROPERTYIMP_REF( QString , Device ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE Lineup(QObject *parent = nullptr) + : QObject ( parent ) + { + } + + void Copy( const Lineup *src ) + { + m_LineupId = src->m_LineupId ; + m_Name = src->m_Name ; + m_DisplayName = src->m_DisplayName ; + m_Type = src->m_Type ; + m_Postal = src->m_Postal ; + m_Device = src->m_Device ; + } + + private: + Q_DISABLE_COPY(Lineup); +}; + +class SERVICE_PUBLIC LineupList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "Lineups", "type=DTC::Lineup"); + + Q_PROPERTY( QVariantList Lineups READ Lineups ) + + PROPERTYIMP_RO_REF( QVariantList, Lineups ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE LineupList(QObject *parent = nullptr) + : QObject( parent ) + { + } + + void Copy( const LineupList *src ) + { + CopyListContents< Lineup >( this, m_Lineups, src->m_Lineups ); + } + + Lineup *AddNewLineup() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new Lineup( this ); + m_Lineups.append( QVariant::fromValue( pObject )); + + return pObject; + } + +}; + +inline void Lineup::InitializeCustomTypes() +{ + qRegisterMetaType< Lineup* >(); +} + +inline void LineupList::InitializeCustomTypes() +{ + qRegisterMetaType< LineupList* >(); + + Lineup::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/logInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/logInfo.h new file mode 100644 index 00000000000..76d3fc19414 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/logInfo.h @@ -0,0 +1,61 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: logInfo.h +// Created : Dec. 15, 2015 +// +// Copyright (c) 2015 Bill Meek, from: 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef LOGINFO_H_ +#define LOGINFO_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC LogInfo : public QObject +{ + Q_OBJECT + + Q_CLASSINFO( "version" , "1.0" ); + Q_CLASSINFO( "defaultProp", "LogArgs" ); + + Q_PROPERTY( QString LogArgs READ LogArgs WRITE setLogArgs ) + + PROPERTYIMP_REF( QString, LogArgs ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE LogInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_LogArgs ( "" ) + { + } + + void Copy( const LogInfo *src ) + { + m_LogArgs = src->m_LogArgs ; + } + + private: + Q_DISABLE_COPY(LogInfo); +}; + +using LogInfoPtr = LogInfo*; + +inline void LogInfo::InitializeCustomTypes() +{ + qRegisterMetaType< LogInfo* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/logMessage.h b/mythtv/libs/libmythservicecontracts/datacontracts/logMessage.h new file mode 100644 index 00000000000..4dd40f766dc --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/logMessage.h @@ -0,0 +1,105 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: logMessage.h +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef LOGMESSAGE_H_ +#define LOGMESSAGE_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC LogMessage : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( QString HostName READ HostName + WRITE setHostName ) + Q_PROPERTY( QString Application READ Application + WRITE setApplication ) + Q_PROPERTY( int PID READ PID + WRITE setPID ) + Q_PROPERTY( int TID READ TID + WRITE setTID ) + Q_PROPERTY( QString Thread READ Thread + WRITE setThread ) + Q_PROPERTY( QString Filename READ Filename + WRITE setFilename ) + Q_PROPERTY( int Line READ Line + WRITE setLine ) + Q_PROPERTY( QString Function READ Function + WRITE setFunction ) + Q_PROPERTY( QDateTime Time READ Time + WRITE setTime ) + Q_PROPERTY( QString Level READ Level + WRITE setLevel ) + Q_PROPERTY( QString Message READ Message + WRITE setMessage ) + + PROPERTYIMP_REF( QString , HostName ) + PROPERTYIMP_REF( QString , Application ) + PROPERTYIMP ( int , PID ) + PROPERTYIMP ( int , TID ) + PROPERTYIMP_REF( QString , Thread ) + PROPERTYIMP_REF( QString , Filename ) + PROPERTYIMP ( int , Line ) + PROPERTYIMP_REF( QString , Function ) + PROPERTYIMP_REF( QDateTime, Time ) + PROPERTYIMP_REF( QString , Level ) + PROPERTYIMP_REF( QString , Message ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE LogMessage(QObject *parent = nullptr) + : QObject ( parent ), + m_HostName ( ), + m_Application ( ), + m_PID ( 0 ), + m_TID ( 0 ), + m_Thread ( ), + m_Filename ( ), + m_Line ( 0 ), + m_Function ( ), + m_Level ( ), + m_Message ( ) + { + } + + void Copy( const LogMessage *src ) + { + m_HostName = src->m_HostName ; + m_Application = src->m_Application ; + m_PID = src->m_PID ; + m_TID = src->m_TID ; + m_Thread = src->m_Thread ; + m_Filename = src->m_Filename ; + m_Line = src->m_Line ; + m_Function = src->m_Function ; + m_Time = src->m_Time ; + m_Level = src->m_Level ; + m_Message = src->m_Message ; + } + + private: + Q_DISABLE_COPY(LogMessage); +}; + +inline void LogMessage::InitializeCustomTypes() +{ + qRegisterMetaType< LogMessage* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/logMessageList.h b/mythtv/libs/libmythservicecontracts/datacontracts/logMessageList.h new file mode 100644 index 00000000000..9cb6d2e014a --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/logMessageList.h @@ -0,0 +1,101 @@ +#ifndef LOGMESSAGELIST_H_ +#define LOGMESSAGELIST_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "labelValue.h" +#include "logMessage.h" + +namespace DTC +{ + +class SERVICE_PUBLIC LogMessageList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "HostNames", "type=DTC::LabelValue"); + Q_CLASSINFO( "Applications", "type=DTC::LabelValue"); + Q_CLASSINFO( "LogMessages", "type=DTC::LogMessage"); + + Q_PROPERTY( QVariantList HostNames READ HostNames ) + Q_PROPERTY( QVariantList Applications READ Applications ) + Q_PROPERTY( QVariantList LogMessages READ LogMessages ) + + PROPERTYIMP_RO_REF( QVariantList, HostNames ) + PROPERTYIMP_RO_REF( QVariantList, Applications ) + PROPERTYIMP_RO_REF( QVariantList, LogMessages ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE LogMessageList(QObject *parent = nullptr) + : QObject( parent ) + { + } + + void Copy( const LogMessageList *src ) + { + CopyListContents< LabelValue >( this, m_HostNames, + src->m_HostNames ); + CopyListContents< LabelValue >( this, m_Applications, + src->m_Applications ); + CopyListContents< LogMessage >( this, m_LogMessages, + src->m_LogMessages ); + } + + LabelValue *AddNewHostName() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new LabelValue( this ); + m_HostNames.append( QVariant::fromValue( pObject )); + + return pObject; + } + + LabelValue *AddNewApplication() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new LabelValue( this ); + m_Applications.append( QVariant::fromValue( pObject )); + + return pObject; + } + + LogMessage *AddNewLogMessage() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new LogMessage( this ); + m_LogMessages.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(LogMessageList); +}; + +inline void LogMessageList::InitializeCustomTypes() +{ + qRegisterMetaType< LogMessageList* >(); + + LogMessage::InitializeCustomTypes(); + LabelValue::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/markup.h b/mythtv/libs/libmythservicecontracts/datacontracts/markup.h new file mode 100644 index 00000000000..809ad59fdc1 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/markup.h @@ -0,0 +1,66 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: markup.h +// Created : Apr. 4, 2021 +// +// Copyright (c) 2021 team MythTV +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef _MARKUP_H_ +#define _MARKUP_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ +Q_NAMESPACE + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC Markup : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( QString Type READ Type WRITE setType ) + Q_PROPERTY( quint64 Frame READ Frame WRITE setFrame ) + Q_PROPERTY( QString Data READ Data WRITE setData ) + + PROPERTYIMP_REF( QString , Type ) + PROPERTYIMP ( quint64 , Frame ) + PROPERTYIMP_REF( QString , Data ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE Markup(QObject *parent = nullptr) + : QObject(parent), m_Frame(0) + { + } + + void Copy( const Markup *src ) + { + m_Type = src->m_Type ; + m_Frame = src->m_Frame ; + m_Data = src->m_Data ; + } + + private: + Q_DISABLE_COPY(Markup); +}; + +inline void Markup::InitializeCustomTypes() +{ + qRegisterMetaType< Markup* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/markupList.h b/mythtv/libs/libmythservicecontracts/datacontracts/markupList.h new file mode 100644 index 00000000000..86eaa683002 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/markupList.h @@ -0,0 +1,91 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: markupList.h +// Created : Apr. 4, 2021 +// +// Copyright (c) 2021 team MythTV +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef MARKUPLIST_H_ +#define MARKUPLIST_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "markup.h" + +namespace DTC +{ + +class SERVICE_PUBLIC MarkupList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "Markups", "type=DTC::Markup"); + + Q_PROPERTY( QVariantList Mark READ Mark ) + Q_PROPERTY( QVariantList Seek READ Seek ) + + PROPERTYIMP_RO_REF( QVariantList, Mark ); + PROPERTYIMP_RO_REF( QVariantList, Seek ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE MarkupList(QObject *parent = nullptr) + : QObject ( parent ) + { + } + + void Copy( const MarkupList *src ) + { + CopyListContents< Markup >( this, m_Mark, src->m_Mark ); + CopyListContents< Markup >( this, m_Seek, src->m_Seek ); + } + + Markup *AddNewMarkup() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new Markup( this ); + m_Mark.append( QVariant::fromValue( pObject )); + + return pObject; + } + + Markup *AddNewSeek() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new Markup( this ); + m_Seek.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(MarkupList); +}; + +inline void MarkupList::InitializeCustomTypes() +{ + qRegisterMetaType< MarkupList* >(); + + Markup::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/musicMetadataInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/musicMetadataInfo.h new file mode 100644 index 00000000000..91f83ddbc05 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/musicMetadataInfo.h @@ -0,0 +1,105 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: musicMetadataInfo.h +// Created : July 20, 2017 +// +// Copyright (c) 2017 Paul Harrison +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef MUSICMETADATAINFO_H_ +#define MUSICMETADATAINFO_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC MusicMetadataInfo : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.00" ); + + Q_PROPERTY( int Id READ Id WRITE setId ) + Q_PROPERTY( QString Artist READ Artist WRITE setArtist ) + Q_PROPERTY( QString CompilationArtist READ CompilationArtist WRITE setCompilationArtist ) + Q_PROPERTY( QString Album READ Album WRITE setAlbum ) + Q_PROPERTY( QString Title READ Title WRITE setTitle ) + Q_PROPERTY( int TrackNo READ TrackNo WRITE setTrackNo ) + Q_PROPERTY( QString Genre READ Genre WRITE setGenre ) + Q_PROPERTY( int Year READ Year WRITE setYear ) + Q_PROPERTY( int PlayCount READ PlayCount WRITE setPlayCount ) + Q_PROPERTY( int Length READ Length WRITE setLength ) + Q_PROPERTY( int Rating READ Rating WRITE setRating ) + Q_PROPERTY( QString FileName READ FileName WRITE setFileName ) + Q_PROPERTY( QString HostName READ HostName WRITE setHostName ) + Q_PROPERTY( QDateTime LastPlayed READ LastPlayed WRITE setLastPlayed ) + Q_PROPERTY( bool Compilation READ Compilation WRITE setCompilation ) + + PROPERTYIMP ( int , Id ) + PROPERTYIMP_REF( QString , Artist ) + PROPERTYIMP_REF( QString , CompilationArtist ) + PROPERTYIMP_REF( QString , Album ) + PROPERTYIMP_REF( QString , Title ) + PROPERTYIMP ( int , TrackNo ) + PROPERTYIMP_REF( QString , Genre ) + PROPERTYIMP ( int , Year ) + PROPERTYIMP ( int , PlayCount ) + PROPERTYIMP ( int , Length ) + PROPERTYIMP ( int , Rating ) + PROPERTYIMP_REF( QString , FileName ) + PROPERTYIMP_REF( QString , HostName ) + PROPERTYIMP_REF( QDateTime , LastPlayed ) + PROPERTYIMP ( bool , Compilation ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE MusicMetadataInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Id ( 0 ), + m_TrackNo ( 0 ), + m_Year ( 0 ), + m_PlayCount ( 0 ), + m_Length ( 0 ), + m_Rating ( 0 ), + m_Compilation ( false ) + { + } + + void Copy( const MusicMetadataInfo *src ) + { + m_Id = src->m_Id; + m_Artist = src->m_Artist; + m_CompilationArtist = src->m_CompilationArtist; + m_Album = src->m_Album; + m_Title = src->m_Title; + m_TrackNo = src->m_TrackNo; + m_Genre = src->m_Genre; + m_Year = src->m_Year; + m_PlayCount = src->m_PlayCount; + m_Length = src->m_Length; + m_Rating = src->m_Rating; + m_FileName = src->m_FileName; + m_HostName = src->m_HostName; + m_LastPlayed = src->m_LastPlayed; + m_Compilation = src->m_Compilation; + } +}; + +inline void MusicMetadataInfo::InitializeCustomTypes() +{ + qRegisterMetaType< MusicMetadataInfo* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/musicMetadataInfoList.h b/mythtv/libs/libmythservicecontracts/datacontracts/musicMetadataInfoList.h new file mode 100644 index 00000000000..d89c7536694 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/musicMetadataInfoList.h @@ -0,0 +1,105 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: musicMetadataInfoList.h +// Created : July 20, 2017 +// +// Copyright (c) 2017 Paul Harrison +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef MUSICMETADATAINFOLIST_H_ +#define MUSICMETADATAINFOLIST_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "musicMetadataInfo.h" + +namespace DTC +{ + +class SERVICE_PUBLIC MusicMetadataInfoList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.00" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "MusicMetadataInfos", "type=DTC::MusicMetadataInfo"); + Q_CLASSINFO( "AsOf" , "transient=true" ); + + Q_PROPERTY( int StartIndex READ StartIndex WRITE setStartIndex ) + Q_PROPERTY( int Count READ Count WRITE setCount ) + Q_PROPERTY( int CurrentPage READ CurrentPage WRITE setCurrentPage ) + Q_PROPERTY( int TotalPages READ TotalPages WRITE setTotalPages ) + Q_PROPERTY( int TotalAvailable READ TotalAvailable WRITE setTotalAvailable ) + Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf ) + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer ) + + Q_PROPERTY( QVariantList MusicMetadataInfos READ MusicMetadataInfos ) + + PROPERTYIMP ( int , StartIndex ) + PROPERTYIMP ( int , Count ) + PROPERTYIMP ( int , CurrentPage ) + PROPERTYIMP ( int , TotalPages ) + PROPERTYIMP ( int , TotalAvailable ) + PROPERTYIMP_REF ( QDateTime , AsOf ) + PROPERTYIMP_REF ( QString , Version ) + PROPERTYIMP_REF ( QString , ProtoVer ) + + PROPERTYIMP_RO_REF( QVariantList, MusicMetadataInfos ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE MusicMetadataInfoList(QObject *parent = nullptr) + : QObject( parent ), + m_StartIndex ( 0 ), + m_Count ( 0 ), + m_CurrentPage ( 0 ), + m_TotalPages ( 0 ), + m_TotalAvailable( 0 ) + { + } + + void Copy( const MusicMetadataInfoList *src ) + { + m_StartIndex = src->m_StartIndex ; + m_Count = src->m_Count ; + m_TotalAvailable= src->m_TotalAvailable ; + m_AsOf = src->m_AsOf ; + m_Version = src->m_Version ; + m_ProtoVer = src->m_ProtoVer ; + + CopyListContents< MusicMetadataInfo >( this, m_MusicMetadataInfos, src->m_MusicMetadataInfos ); + } + + MusicMetadataInfo *AddNewMusicMetadataInfo() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new MusicMetadataInfo( this ); + m_MusicMetadataInfos.append( QVariant::fromValue( pObject )); + + return pObject; + } + +}; + +inline void MusicMetadataInfoList::InitializeCustomTypes() +{ + qRegisterMetaType< MusicMetadataInfoList* >(); + + MusicMetadataInfo::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/programAndChannel.h b/mythtv/libs/libmythservicecontracts/datacontracts/programAndChannel.h new file mode 100644 index 00000000000..8c1fff83d73 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/programAndChannel.h @@ -0,0 +1,354 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: program.h +// Created : Jan. 15, 2010 +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef PROGRAM_H_ +#define PROGRAM_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "recording.h" +#include "artworkInfoList.h" +#include "castMemberList.h" + +namespace DTC +{ + +class Program; + + +class SERVICE_PUBLIC ChannelInfo : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "2.2" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "Programs", "type=DTC::Program"); + + Q_PROPERTY( uint ChanId READ ChanId WRITE setChanId ) + Q_PROPERTY( QString ChanNum READ ChanNum WRITE setChanNum ) + Q_PROPERTY( QString CallSign READ CallSign WRITE setCallSign ) + Q_PROPERTY( QString IconURL READ IconURL WRITE setIconURL ) + Q_PROPERTY( QString ChannelName READ ChannelName WRITE setChannelName ) + + Q_PROPERTY( uint MplexId READ MplexId WRITE setMplexId ) + Q_PROPERTY( uint ServiceId READ ServiceId WRITE setServiceId ) + Q_PROPERTY( uint ATSCMajorChan READ ATSCMajorChan WRITE setATSCMajorChan ) + Q_PROPERTY( uint ATSCMinorChan READ ATSCMinorChan WRITE setATSCMinorChan ) + Q_PROPERTY( QString Format READ Format WRITE setFormat ) + Q_PROPERTY( QString FrequencyId READ FrequencyId WRITE setFrequencyId ) + Q_PROPERTY( int FineTune READ FineTune WRITE setFineTune ) + Q_PROPERTY( QString ChanFilters READ ChanFilters WRITE setChanFilters ) + Q_PROPERTY( int SourceId READ SourceId WRITE setSourceId ) + Q_PROPERTY( int InputId READ InputId WRITE setInputId ) + Q_PROPERTY( bool CommFree READ CommFree WRITE setCommFree ) + Q_PROPERTY( bool UseEIT READ UseEIT WRITE setUseEIT ) + Q_PROPERTY( bool Visible READ Visible WRITE setVisible ) + Q_PROPERTY( QString ExtendedVisible READ ExtendedVisible WRITE setExtendedVisible ) + Q_PROPERTY( QString XMLTVID READ XMLTVID WRITE setXMLTVID ) + Q_PROPERTY( QString DefaultAuth READ DefaultAuth WRITE setDefaultAuth ) + Q_PROPERTY( QString ChannelGroups READ ChannelGroups WRITE setChannelGroups ) + Q_PROPERTY( QString Inputs READ Inputs WRITE setInputs ) + Q_PROPERTY( uint ServiceType READ ServiceType WRITE setServiceType ) + + Q_PROPERTY( QVariantList Programs READ Programs ) + + PROPERTYIMP ( uint , ChanId ) + PROPERTYIMP_REF ( QString , ChanNum ) + PROPERTYIMP_REF ( QString , CallSign ) + PROPERTYIMP_REF ( QString , IconURL ) + PROPERTYIMP_REF ( QString , ChannelName ) + PROPERTYIMP ( uint , MplexId ) + PROPERTYIMP ( uint , ServiceId ) + PROPERTYIMP ( uint , ATSCMajorChan ) + PROPERTYIMP ( uint , ATSCMinorChan ) + PROPERTYIMP_REF ( QString , Format ) + PROPERTYIMP_REF ( QString , FrequencyId ) + PROPERTYIMP ( int , FineTune ) + PROPERTYIMP_REF ( QString , ChanFilters ) + PROPERTYIMP ( int , SourceId ) + PROPERTYIMP ( int , InputId ) + PROPERTYIMP ( bool , CommFree ) + PROPERTYIMP ( bool , UseEIT ) + PROPERTYIMP ( bool , Visible ) + PROPERTYIMP_REF ( QString , ExtendedVisible ) + PROPERTYIMP_REF ( QString , XMLTVID ) + PROPERTYIMP_REF ( QString , DefaultAuth ) + PROPERTYIMP_REF ( QString , ChannelGroups ) + PROPERTYIMP_REF ( QString , Inputs ) + PROPERTYIMP ( uint , ServiceType ) + + PROPERTYIMP_RO_REF( QVariantList, Programs ) + + // Used only by Serializer + PROPERTYIMP( bool, SerializeDetails ) + + public: + + static void InitializeCustomTypes(); + + Q_INVOKABLE explicit ChannelInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_ChanId ( 0 ), + m_MplexId ( 0 ), + m_ServiceId ( 0 ), + m_ATSCMajorChan ( 0 ), + m_ATSCMinorChan ( 0 ), + m_FineTune ( 0 ), + m_SourceId ( 0 ), + m_InputId ( 0 ), + m_CommFree ( false ), + m_UseEIT ( false ), + m_Visible ( true ), + m_ServiceType ( 0 ), + m_SerializeDetails( true ) + { + } + + void Copy( const ChannelInfo *src ) + { + m_ChanId = src->m_ChanId ; + m_ChanNum = src->m_ChanNum ; + m_CallSign = src->m_CallSign ; + m_IconURL = src->m_IconURL ; + m_ChannelName = src->m_ChannelName ; + m_ChanFilters = src->m_ChanFilters ; + m_SourceId = src->m_SourceId ; + m_InputId = src->m_InputId ; + m_CommFree = src->m_CommFree ; + m_UseEIT = src->m_UseEIT ; + m_Visible = src->m_Visible ; + m_ChannelGroups = src->m_ChannelGroups; + m_Inputs = src->m_Inputs; + + CopyListContents< Program >( this, m_Programs, src->m_Programs ); + } + + Program *AddNewProgram(); + + private: + Q_DISABLE_COPY(ChannelInfo); +}; + +class SERVICE_PUBLIC Program : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.12" ); + Q_CLASSINFO( "defaultProp", "Description" ); + Q_CLASSINFO( "deprecated" , "FileSize,FileName,HostName"); + + Q_PROPERTY( QDateTime StartTime READ StartTime WRITE setStartTime ) + Q_PROPERTY( QDateTime EndTime READ EndTime WRITE setEndTime ) + Q_PROPERTY( QString Title READ Title WRITE setTitle ) + Q_PROPERTY( QString SubTitle READ SubTitle WRITE setSubTitle ) + Q_PROPERTY( QString Category READ Category WRITE setCategory ) + Q_PROPERTY( QString CatType READ CatType WRITE setCatType ) + Q_PROPERTY( bool Repeat READ Repeat WRITE setRepeat ) + Q_PROPERTY( int VideoProps READ VideoProps WRITE setVideoProps) + Q_PROPERTY( QString VideoPropNames READ VideoPropNames WRITE setVideoPropNames ) + Q_PROPERTY( int AudioProps READ AudioProps WRITE setAudioProps) + Q_PROPERTY( QString AudioPropNames READ AudioPropNames WRITE setAudioPropNames ) + Q_PROPERTY( int SubProps READ SubProps WRITE setSubProps ) + Q_PROPERTY( QString SubPropNames READ SubPropNames WRITE setSubPropNames ) + + Q_PROPERTY( QString SeriesId READ SeriesId WRITE setSeriesId ) + Q_PROPERTY( QString ProgramId READ ProgramId WRITE setProgramId ) + Q_PROPERTY( double Stars READ Stars WRITE setStars ) + Q_PROPERTY( QDateTime LastModified READ LastModified WRITE setLastModified ) + Q_PROPERTY( int ProgramFlags READ ProgramFlags WRITE setProgramFlags ) + Q_PROPERTY( QString ProgramFlagNames READ ProgramFlagNames WRITE setProgramFlagNames ) + Q_PROPERTY( QDate Airdate READ Airdate WRITE setAirdate ) + Q_PROPERTY( QString Description READ Description WRITE setDescription ) + Q_PROPERTY( QString Inetref READ Inetref WRITE setInetref ) + Q_PROPERTY( int Season READ Season WRITE setSeason ) + Q_PROPERTY( int Episode READ Episode WRITE setEpisode ) + Q_PROPERTY( int TotalEpisodes READ TotalEpisodes WRITE setTotalEpisodes ) + + // ---- + // DEPRECATED + // These don't belong here, they are Recording only metadata + Q_PROPERTY( qlonglong FileSize READ FileSize WRITE setFileSize ) + Q_PROPERTY( QString FileName READ FileName WRITE setFileName ) + Q_PROPERTY( QString HostName READ HostName WRITE setHostName ) + // ---- + + Q_PROPERTY( QObject* Channel READ Channel ) + Q_PROPERTY( QObject* Recording READ Recording ) + Q_PROPERTY( QObject* Artwork READ Artwork ) + Q_PROPERTY( QObject* Cast READ Cast ) + + PROPERTYIMP_REF( QDateTime , StartTime ) + PROPERTYIMP_REF( QDateTime , EndTime ) + PROPERTYIMP_REF( QString , Title ) + PROPERTYIMP_REF( QString , SubTitle ) + PROPERTYIMP_REF( QString , Category ) + PROPERTYIMP_REF( QString , CatType ) + PROPERTYIMP ( bool , Repeat ) + + PROPERTYIMP_REF( QString , SeriesId ) + PROPERTYIMP_REF( QString , ProgramId ) + PROPERTYIMP ( double , Stars ) + PROPERTYIMP_REF( QDateTime , LastModified ) + PROPERTYIMP ( int , ProgramFlags ) + PROPERTYIMP_REF( QString , ProgramFlagNames ) + PROPERTYIMP ( int , VideoProps ) + PROPERTYIMP_REF( QString , VideoPropNames ) + PROPERTYIMP ( int , AudioProps ) + PROPERTYIMP_REF( QString , AudioPropNames ) + PROPERTYIMP ( int , SubProps ) + PROPERTYIMP_REF( QString , SubPropNames ) + PROPERTYIMP ( QDate , Airdate ) + PROPERTYIMP_REF( QString , Description ) + PROPERTYIMP_REF( QString , Inetref ) + PROPERTYIMP ( int , Season ) + PROPERTYIMP ( int , Episode ) + PROPERTYIMP ( int , TotalEpisodes) + + // ---- + // DEPRECATED + // These don't belong here, they are Recording only metadata + PROPERTYIMP ( qlonglong , FileSize ) + PROPERTYIMP_REF( QString , FileName ) + PROPERTYIMP_REF( QString , HostName ) + // ---- + + PROPERTYIMP_PTR( ChannelInfo , Channel ) + PROPERTYIMP_PTR( RecordingInfo , Recording ) + PROPERTYIMP_PTR( ArtworkInfoList, Artwork ) + PROPERTYIMP_PTR( CastMemberList , Cast ) + + // Used only by Serializer + PROPERTYIMP( bool, SerializeDetails ) + PROPERTYIMP( bool, SerializeChannel ) + PROPERTYIMP( bool, SerializeRecording ) + PROPERTYIMP( bool, SerializeArtwork ) + PROPERTYIMP( bool, SerializeCast ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE explicit Program(QObject *parent = nullptr) + : QObject ( parent ), + m_Repeat ( false ), + m_Stars ( 0 ), + m_ProgramFlags ( 0 ), + m_VideoProps ( 0 ), + m_AudioProps ( 0 ), + m_SubProps ( 0 ), + m_Season ( 0 ), + m_Episode ( 0 ), + m_TotalEpisodes ( 0 ), + m_FileSize ( 0 ), // DEPRECATED + m_Channel ( nullptr ), + m_Recording ( nullptr ), + m_Artwork ( nullptr ), + m_Cast ( nullptr ), + m_SerializeDetails ( true ), + m_SerializeChannel ( true ), + m_SerializeRecording ( true ), + m_SerializeArtwork ( true ), + m_SerializeCast ( true ) + { + } + + void Copy( const Program *src ) + { + m_StartTime = src->m_StartTime; + m_EndTime = src->m_EndTime; + m_Title = src->m_Title; + m_SubTitle = src->m_SubTitle; + m_Category = src->m_Category; + m_CatType = src->m_CatType; + m_Repeat = src->m_Repeat; + m_SeriesId = src->m_SeriesId; + m_ProgramId = src->m_ProgramId; + m_Stars = src->m_Stars; + m_LastModified = src->m_LastModified; + m_ProgramFlags = src->m_ProgramFlags; + m_VideoProps = src->m_VideoProps; + m_AudioProps = src->m_AudioProps; + m_SubProps = src->m_SubProps; + m_Airdate = src->m_Airdate; + m_Description = src->m_Description; + m_Inetref = src->m_Inetref; + m_Season = src->m_Season; + m_Episode = src->m_Episode; + m_TotalEpisodes = src->m_TotalEpisodes; + // DEPRECATED + m_FileSize = src->m_FileSize; + m_FileName = src->m_FileName; + m_HostName = src->m_HostName; + // ---- + m_SerializeDetails = src->m_SerializeDetails; + m_SerializeChannel = src->m_SerializeChannel; + m_SerializeRecording= src->m_SerializeRecording; + m_SerializeArtwork = src->m_SerializeArtwork; + m_SerializeCast = src->m_SerializeCast; + + if ( src->m_Channel != nullptr) + Channel()->Copy( src->m_Channel ); + + if ( src->m_Recording != nullptr) + Recording()->Copy( src->m_Recording ); + + if ( src->m_Artwork != nullptr) + Artwork()->Copy( src->m_Artwork ); + + if (src->m_Cast != nullptr) + Cast()->Copy( src->m_Cast ); + } + +}; + +inline Program *ChannelInfo::AddNewProgram() +{ + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new Program( this ); + m_Programs.append( QVariant::fromValue( pObject )); + + return pObject; +} + +inline void ChannelInfo::InitializeCustomTypes() +{ + qRegisterMetaType< ChannelInfo* >(); + + if (qMetaTypeId() == 0) + Program::InitializeCustomTypes(); +} + +inline void Program::InitializeCustomTypes() +{ + qRegisterMetaType< Program* >(); + + if (qMetaTypeId() == QMetaType::UnknownType) + ChannelInfo::InitializeCustomTypes(); + + if (qMetaTypeId() == QMetaType::UnknownType) + RecordingInfo::InitializeCustomTypes(); + + if (qMetaTypeId() == QMetaType::UnknownType) + ArtworkInfoList::InitializeCustomTypes(); + + if (qMetaTypeId() == QMetaType::UnknownType) + CastMemberList::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/programGuide.h b/mythtv/libs/libmythservicecontracts/datacontracts/programGuide.h new file mode 100644 index 00000000000..e8b56e4c449 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/programGuide.h @@ -0,0 +1,124 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: programGuide.h +// Created : Jan. 15, 2010 +// +// Purpose : +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef PROGRAMGUIDE_H_ +#define PROGRAMGUIDE_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "programAndChannel.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// +// +// +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC ProgramGuide : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "Channels", "type=DTC::ChannelInfo"); + Q_CLASSINFO( "AsOf" , "transient=true" ); + + Q_PROPERTY( QDateTime StartTime READ StartTime WRITE setStartTime ) + Q_PROPERTY( QDateTime EndTime READ EndTime WRITE setEndTime ) + Q_PROPERTY( bool Details READ Details WRITE setDetails ) + + Q_PROPERTY( int StartIndex READ StartIndex WRITE setStartIndex ) + Q_PROPERTY( int Count READ Count WRITE setCount ) + Q_PROPERTY( int TotalAvailable READ TotalAvailable WRITE setTotalAvailable ) + Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf ) + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer ) + + Q_PROPERTY( QVariantList Channels READ Channels ) + + PROPERTYIMP_REF ( QDateTime , StartTime ) + PROPERTYIMP_REF ( QDateTime , EndTime ) + PROPERTYIMP ( bool , Details ) + + PROPERTYIMP ( int , StartIndex ) + PROPERTYIMP ( int , Count ) + PROPERTYIMP ( int , TotalAvailable) + PROPERTYIMP_REF ( QDateTime , AsOf ) + PROPERTYIMP_REF ( QString , Version ) + PROPERTYIMP_REF ( QString , ProtoVer ) + + PROPERTYIMP_RO_REF( QVariantList, Channels ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE ProgramGuide(QObject *parent = nullptr) + : QObject ( parent ), + m_Details ( false ), + m_StartIndex ( 0 ), + m_Count ( 0 ), + m_TotalAvailable ( 0 ) + { + } + + void Copy( const ProgramGuide *src ) + { + m_StartTime = src->m_StartTime ; + m_EndTime = src->m_EndTime ; + m_Details = src->m_Details ; + m_StartIndex = src->m_StartIndex ; + m_Count = src->m_Count ; + m_TotalAvailable = src->m_TotalAvailable ; + m_AsOf = src->m_AsOf ; + m_Version = src->m_Version ; + m_ProtoVer = src->m_ProtoVer ; + + CopyListContents< ChannelInfo >( this, m_Channels, src->m_Channels ); + } + + ChannelInfo *AddNewChannel() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new ChannelInfo( this ); + Channels().append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(ProgramGuide); +}; + +inline void ProgramGuide::InitializeCustomTypes() +{ + qRegisterMetaType< ProgramGuide* >(); + + ChannelInfo::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/programList.h b/mythtv/libs/libmythservicecontracts/datacontracts/programList.h new file mode 100644 index 00000000000..ee56077d032 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/programList.h @@ -0,0 +1,103 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: programs.h +// Created : Jan. 15, 2010 +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef PROGRAMS_H_ +#define PROGRAMS_H_ + +#include +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "programAndChannel.h" + +namespace DTC +{ + +class SERVICE_PUBLIC ProgramList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "Programs", "type=DTC::Program"); + Q_CLASSINFO( "AsOf" , "transient=true" ); + + Q_PROPERTY( int StartIndex READ StartIndex WRITE setStartIndex ) + Q_PROPERTY( int Count READ Count WRITE setCount ) + Q_PROPERTY( int TotalAvailable READ TotalAvailable WRITE setTotalAvailable ) + Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf ) + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer ) + + Q_PROPERTY( QVariantList Programs READ Programs ) + + PROPERTYIMP ( int , StartIndex ) + PROPERTYIMP ( int , Count ) + PROPERTYIMP ( int , TotalAvailable ) + PROPERTYIMP_REF ( QDateTime , AsOf ) + PROPERTYIMP_REF ( QString , Version ) + PROPERTYIMP_REF ( QString , ProtoVer ) + + PROPERTYIMP_RO_REF( QVariantList, Programs ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE explicit ProgramList(QObject *parent = nullptr) + : QObject ( parent ), + m_StartIndex ( 0 ), + m_Count ( 0 ), + m_TotalAvailable( 0 ) + { + } + + void Copy( const ProgramList *src ) + { + m_StartIndex = src->m_StartIndex ; + m_Count = src->m_Count ; + m_TotalAvailable= src->m_TotalAvailable ; + m_AsOf = src->m_AsOf ; + m_Version = src->m_Version ; + m_ProtoVer = src->m_ProtoVer ; + + CopyListContents< Program >( this, m_Programs, src->m_Programs ); + } + + Program *AddNewProgram() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new Program( this ); + m_Programs.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(ProgramList); +}; + +inline void ProgramList::InitializeCustomTypes() +{ + qRegisterMetaType< ProgramList* >(); + + Program::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/recRule.h b/mythtv/libs/libmythservicecontracts/datacontracts/recRule.h new file mode 100644 index 00000000000..3f64d150ae2 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/recRule.h @@ -0,0 +1,219 @@ +#ifndef RECRULE_H_ +#define RECRULE_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC RecRule : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "2.10" ); + + Q_PROPERTY( int Id READ Id WRITE setId ) + Q_PROPERTY( int ParentId READ ParentId WRITE setParentId ) + Q_PROPERTY( bool Inactive READ Inactive WRITE setInactive ) + Q_PROPERTY( QString Title READ Title WRITE setTitle ) + Q_PROPERTY( QString SubTitle READ SubTitle WRITE setSubTitle ) + Q_PROPERTY( QString Description READ Description WRITE setDescription ) + Q_PROPERTY( uint Season READ Season WRITE setSeason ) + Q_PROPERTY( uint Episode READ Episode WRITE setEpisode ) + Q_PROPERTY( QString Category READ Category WRITE setCategory ) + + Q_PROPERTY( QDateTime StartTime READ StartTime WRITE setStartTime ) + Q_PROPERTY( QDateTime EndTime READ EndTime WRITE setEndTime ) + + Q_PROPERTY( QString SeriesId READ SeriesId WRITE setSeriesId ) + Q_PROPERTY( QString ProgramId READ ProgramId WRITE setProgramId ) + Q_PROPERTY( QString Inetref READ Inetref WRITE setInetref ) + + Q_PROPERTY( int ChanId READ ChanId WRITE setChanId ) + Q_PROPERTY( QString CallSign READ CallSign WRITE setCallSign ) + Q_PROPERTY( int FindDay READ FindDay WRITE setFindDay ) + Q_PROPERTY( QTime FindTime READ FindTime WRITE setFindTime ) + Q_PROPERTY( QString Type READ Type WRITE setType ) + Q_PROPERTY( QString SearchType READ SearchType WRITE setSearchType ) + Q_PROPERTY( int RecPriority READ RecPriority WRITE setRecPriority ) + Q_PROPERTY( uint PreferredInput READ PreferredInput WRITE setPreferredInput ) + Q_PROPERTY( int StartOffset READ StartOffset WRITE setStartOffset ) + Q_PROPERTY( int EndOffset READ EndOffset WRITE setEndOffset ) + Q_PROPERTY( QString DupMethod READ DupMethod WRITE setDupMethod ) + Q_PROPERTY( QString DupIn READ DupIn WRITE setDupIn ) + Q_PROPERTY( bool NewEpisOnly READ NewEpisOnly WRITE setNewEpisOnly ) + Q_PROPERTY( uint Filter READ Filter WRITE setFilter ) + + Q_PROPERTY( QString RecProfile READ RecProfile WRITE setRecProfile ) + Q_PROPERTY( QString RecGroup READ RecGroup WRITE setRecGroup ) + Q_PROPERTY( QString StorageGroup READ StorageGroup WRITE setStorageGroup ) + Q_PROPERTY( QString PlayGroup READ PlayGroup WRITE setPlayGroup ) + + Q_PROPERTY( bool AutoExpire READ AutoExpire WRITE setAutoExpire ) + Q_PROPERTY( int MaxEpisodes READ MaxEpisodes WRITE setMaxEpisodes ) + Q_PROPERTY( bool MaxNewest READ MaxNewest WRITE setMaxNewest ) + + Q_PROPERTY( bool AutoCommflag READ AutoCommflag WRITE setAutoCommflag ) + Q_PROPERTY( bool AutoTranscode READ AutoTranscode WRITE setAutoTranscode ) + Q_PROPERTY( bool AutoMetaLookup READ AutoMetaLookup WRITE setAutoMetaLookup ) + Q_PROPERTY( bool AutoUserJob1 READ AutoUserJob1 WRITE setAutoUserJob1 ) + Q_PROPERTY( bool AutoUserJob2 READ AutoUserJob2 WRITE setAutoUserJob2 ) + Q_PROPERTY( bool AutoUserJob3 READ AutoUserJob3 WRITE setAutoUserJob3 ) + Q_PROPERTY( bool AutoUserJob4 READ AutoUserJob4 WRITE setAutoUserJob4 ) + Q_PROPERTY( int Transcoder READ Transcoder WRITE setTranscoder ) + + Q_PROPERTY( QDateTime NextRecording READ NextRecording WRITE setNextRecording ) + Q_PROPERTY( QDateTime LastRecorded READ LastRecorded WRITE setLastRecorded ) + Q_PROPERTY( QDateTime LastDeleted READ LastDeleted WRITE setLastDeleted ) + Q_PROPERTY( int AverageDelay READ Transcoder WRITE setTranscoder ) + + PROPERTYIMP ( int , Id ) + PROPERTYIMP ( int , ParentId ) + PROPERTYIMP ( bool , Inactive ) + PROPERTYIMP_REF( QString , Title ) + PROPERTYIMP_REF( QString , SubTitle ) + PROPERTYIMP_REF( QString , Description ) + PROPERTYIMP ( uint , Season ) + PROPERTYIMP ( uint , Episode ) + PROPERTYIMP_REF( QString , Category ) + PROPERTYIMP_REF( QDateTime , StartTime ) + PROPERTYIMP_REF( QDateTime , EndTime ) + PROPERTYIMP_REF( QString , SeriesId ) + PROPERTYIMP_REF( QString , ProgramId ) + PROPERTYIMP_REF( QString , Inetref ) + PROPERTYIMP ( int , ChanId ) + PROPERTYIMP_REF( QString , CallSign ) + PROPERTYIMP ( int , FindDay ) + PROPERTYIMP ( QTime , FindTime ) + PROPERTYIMP_REF( QString , Type ) + PROPERTYIMP_REF( QString , SearchType ) + PROPERTYIMP ( int , RecPriority ) + PROPERTYIMP ( uint , PreferredInput ) + PROPERTYIMP ( int , StartOffset ) + PROPERTYIMP ( int , EndOffset ) + PROPERTYIMP_REF( QString , DupMethod ) + PROPERTYIMP_REF( QString , DupIn ) + PROPERTYIMP ( bool , NewEpisOnly ) + PROPERTYIMP ( uint , Filter ) + PROPERTYIMP_REF( QString , RecProfile ) + PROPERTYIMP_REF( QString , RecGroup ) + PROPERTYIMP_REF( QString , StorageGroup ) + PROPERTYIMP_REF( QString , PlayGroup ) + PROPERTYIMP ( bool , AutoExpire ) + PROPERTYIMP ( int , MaxEpisodes ) + PROPERTYIMP ( bool , MaxNewest ) + PROPERTYIMP ( bool , AutoCommflag ) + PROPERTYIMP ( bool , AutoTranscode ) + PROPERTYIMP ( bool , AutoMetaLookup ) + PROPERTYIMP ( bool , AutoUserJob1 ) + PROPERTYIMP ( bool , AutoUserJob2 ) + PROPERTYIMP ( bool , AutoUserJob3 ) + PROPERTYIMP ( bool , AutoUserJob4 ) + PROPERTYIMP ( int , Transcoder ) + PROPERTYIMP_REF( QDateTime , NextRecording ) + PROPERTYIMP_REF( QDateTime , LastRecorded ) + PROPERTYIMP_REF( QDateTime , LastDeleted ) + PROPERTYIMP ( int , AverageDelay ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE explicit RecRule(QObject *parent = nullptr) + : QObject ( parent ), + m_Id ( 0 ), + m_ParentId ( 0 ), + m_Inactive ( false ), + m_Season ( 0 ), + m_Episode ( 0 ), + m_ChanId ( 0 ), + m_FindDay ( 0 ), + m_RecPriority ( 0 ), + m_PreferredInput( 0 ), + m_StartOffset ( 0 ), + m_EndOffset ( 0 ), + m_NewEpisOnly ( false ), + m_Filter ( 0 ), + m_AutoExpire ( false ), + m_MaxEpisodes ( 0 ), + m_MaxNewest ( false ), + m_AutoCommflag ( false ), + m_AutoTranscode ( false ), + m_AutoMetaLookup( false ), + m_AutoUserJob1 ( false ), + m_AutoUserJob2 ( false ), + m_AutoUserJob3 ( false ), + m_AutoUserJob4 ( false ), + m_Transcoder ( 0 ), + m_AverageDelay ( 0 ) + { + } + + void Copy( const RecRule *src ) + { + m_Id = src->m_Id ; + m_ParentId = src->m_ParentId ; + m_Inactive = src->m_Inactive ; + m_Title = src->m_Title ; + m_SubTitle = src->m_SubTitle ; + m_Description = src->m_Description ; + m_Season = src->m_Season ; + m_Episode = src->m_Episode ; + m_Category = src->m_Category ; + m_StartTime = src->m_StartTime ; + m_EndTime = src->m_EndTime ; + m_SeriesId = src->m_SeriesId ; + m_ProgramId = src->m_ProgramId ; + m_Inetref = src->m_Inetref ; + m_ChanId = src->m_ChanId ; + m_CallSign = src->m_CallSign ; + m_FindDay = src->m_FindDay ; + m_FindTime = src->m_FindTime ; + m_Type = src->m_Type ; + m_SearchType = src->m_SearchType ; + m_RecPriority = src->m_RecPriority ; + m_PreferredInput= src->m_PreferredInput; + m_StartOffset = src->m_StartOffset ; + m_EndOffset = src->m_EndOffset ; + m_DupMethod = src->m_DupMethod ; + m_DupIn = src->m_DupIn ; + m_NewEpisOnly = src->m_NewEpisOnly ; + m_Filter = src->m_Filter ; + m_RecProfile = src->m_RecProfile ; + m_RecGroup = src->m_RecGroup ; + m_StorageGroup = src->m_StorageGroup ; + m_PlayGroup = src->m_PlayGroup ; + m_AutoExpire = src->m_AutoExpire ; + m_MaxEpisodes = src->m_MaxEpisodes ; + m_MaxNewest = src->m_MaxNewest ; + m_AutoCommflag = src->m_AutoCommflag ; + m_AutoTranscode = src->m_AutoTranscode ; + m_AutoMetaLookup= src->m_AutoMetaLookup; + m_AutoUserJob1 = src->m_AutoUserJob1 ; + m_AutoUserJob2 = src->m_AutoUserJob2 ; + m_AutoUserJob3 = src->m_AutoUserJob3 ; + m_AutoUserJob4 = src->m_AutoUserJob4 ; + m_Transcoder = src->m_Transcoder ; + m_NextRecording = src->m_NextRecording ; + m_LastRecorded = src->m_LastRecorded ; + m_LastDeleted = src->m_LastDeleted ; + m_AverageDelay = src->m_AverageDelay ; + } + + private: + Q_DISABLE_COPY(RecRule); +}; + +inline void RecRule::InitializeCustomTypes() +{ + qRegisterMetaType< RecRule* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/recRuleFilter.h b/mythtv/libs/libmythservicecontracts/datacontracts/recRuleFilter.h new file mode 100644 index 00000000000..6d714521999 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/recRuleFilter.h @@ -0,0 +1,54 @@ +#ifndef RECRULEFILTER_H_ +#define RECRULEFILTER_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC RecRuleFilter : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( int Id READ Id WRITE setId ) + Q_PROPERTY( QString Description READ Description WRITE setDescription ) + + PROPERTYIMP ( int , Id ) + PROPERTYIMP_REF( QString , Description ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE RecRuleFilter(QObject *parent = nullptr) + : QObject ( parent ), + m_Id ( 0 ) + { + } + + void Copy( const RecRuleFilter *src ) + { + m_Id = src->m_Id ; + m_Description = src->m_Description ; + } + + private: + Q_DISABLE_COPY(RecRuleFilter); +}; + +inline void RecRuleFilter::InitializeCustomTypes() +{ + qRegisterMetaType< RecRuleFilter* >(); +} + +} // namespace DTC + +#endif + diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/recRuleFilterList.h b/mythtv/libs/libmythservicecontracts/datacontracts/recRuleFilterList.h new file mode 100644 index 00000000000..adfdd70b7d8 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/recRuleFilterList.h @@ -0,0 +1,90 @@ + +#ifndef RECRULEFILTERLIST_H_ +#define RECRULEFILTERLIST_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "recRuleFilter.h" + +namespace DTC +{ + +class SERVICE_PUBLIC RecRuleFilterList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "RecRuleFilters", "type=DTC::RecRuleFilter"); + Q_CLASSINFO( "AsOf" , "transient=true" ); + + Q_PROPERTY( int StartIndex READ StartIndex WRITE setStartIndex ) + Q_PROPERTY( int Count READ Count WRITE setCount ) + Q_PROPERTY( int TotalAvailable READ TotalAvailable WRITE setTotalAvailable ) + Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf ) + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer ) + + Q_PROPERTY( QVariantList RecRuleFilters READ RecRuleFilters ) + + PROPERTYIMP ( int , StartIndex ) + PROPERTYIMP ( int , Count ) + PROPERTYIMP ( int , TotalAvailable ) + PROPERTYIMP_REF ( QDateTime , AsOf ) + PROPERTYIMP_REF ( QString , Version ) + PROPERTYIMP_REF ( QString , ProtoVer ) + + PROPERTYIMP_RO_REF( QVariantList, RecRuleFilters ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE RecRuleFilterList(QObject *parent = nullptr) + : QObject ( parent ), + m_StartIndex ( 0 ), + m_Count ( 0 ), + m_TotalAvailable ( 0 ) + { + } + + void Copy( const RecRuleFilterList *src ) + { + m_AsOf = src->m_AsOf ; + m_Version = src->m_Version ; + m_ProtoVer = src->m_ProtoVer ; + + CopyListContents< RecRuleFilter >( this, m_RecRuleFilters, src->m_RecRuleFilters ); + } + + RecRuleFilter *AddNewRecRuleFilter() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new RecRuleFilter( this ); + m_RecRuleFilters.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(RecRuleFilterList); +}; + +inline void RecRuleFilterList::InitializeCustomTypes() +{ + qRegisterMetaType< RecRuleFilterList* >(); + + RecRuleFilter::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/recRuleList.h b/mythtv/libs/libmythservicecontracts/datacontracts/recRuleList.h new file mode 100644 index 00000000000..48b57135e57 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/recRuleList.h @@ -0,0 +1,89 @@ +#ifndef RECRULELIST_H_ +#define RECRULELIST_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "recRule.h" + +namespace DTC +{ + +class SERVICE_PUBLIC RecRuleList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "RecRules", "type=DTC::RecRule"); + Q_CLASSINFO( "AsOf" , "transient=true" ); + + Q_PROPERTY( int StartIndex READ StartIndex WRITE setStartIndex ) + Q_PROPERTY( int Count READ Count WRITE setCount ) + Q_PROPERTY( int TotalAvailable READ TotalAvailable WRITE setTotalAvailable ) + Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf ) + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer ) + + Q_PROPERTY( QVariantList RecRules READ RecRules ) + + PROPERTYIMP ( int , StartIndex ) + PROPERTYIMP ( int , Count ) + PROPERTYIMP ( int , TotalAvailable ) + PROPERTYIMP_REF ( QDateTime , AsOf ) + PROPERTYIMP_REF ( QString , Version ) + PROPERTYIMP_REF ( QString , ProtoVer ) + + PROPERTYIMP_RO_REF( QVariantList, RecRules ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE RecRuleList(QObject *parent = nullptr) + : QObject ( parent ), + m_StartIndex ( 0 ), + m_Count ( 0 ), + m_TotalAvailable ( 0 ) + { + } + + void Copy( const RecRuleList *src ) + { + m_AsOf = src->m_AsOf ; + m_Version = src->m_Version ; + m_ProtoVer = src->m_ProtoVer ; + + CopyListContents< RecRule >( this, m_RecRules, src->m_RecRules ); + } + + RecRule *AddNewRecRule() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new RecRule( this ); + m_RecRules.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(RecRuleList); +}; + +inline void RecRuleList::InitializeCustomTypes() +{ + qRegisterMetaType< RecRuleList* >(); + + RecRule::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/recording.h b/mythtv/libs/libmythservicecontracts/datacontracts/recording.h new file mode 100644 index 00000000000..6f1d4d32436 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/recording.h @@ -0,0 +1,133 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: recording.h +// Created : Jan. 15, 2010 +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef RECORDING_H_ +#define RECORDING_H_ + +#include +#include + +#include "libmythbase/programtypes.h" +#include "libmythbase/recordingstatus.h" +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC RecordingInfo : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.3" ); + + Q_PROPERTY( uint RecordedId READ RecordedId WRITE setRecordedId ) + Q_PROPERTY( RecStatus::Type Status READ Status WRITE setStatus ) + Q_PROPERTY( int Priority READ Priority WRITE setPriority ) + Q_PROPERTY( QDateTime StartTs READ StartTs WRITE setStartTs ) + Q_PROPERTY( QDateTime EndTs READ EndTs WRITE setEndTs ) + + Q_PROPERTY( qlonglong FileSize READ FileSize WRITE setFileSize ) // v1.3 + Q_PROPERTY( QString FileName READ FileName WRITE setFileName ) // v1.3 + Q_PROPERTY( QString HostName READ HostName WRITE setHostName ) // v1.3 + Q_PROPERTY( QDateTime LastModified READ LastModified WRITE setLastModified ) // v1.3 + + Q_PROPERTY( int RecordId READ RecordId WRITE setRecordId ) + Q_PROPERTY( QString RecGroup READ RecGroup WRITE setRecGroup ) + Q_PROPERTY( QString PlayGroup READ PlayGroup WRITE setPlayGroup ) + Q_PROPERTY( QString StorageGroup READ StorageGroup WRITE setStorageGroup ) + Q_PROPERTY( int RecType READ RecType WRITE setRecType ) + Q_PROPERTY( int DupInType READ DupInType WRITE setDupInType ) + Q_PROPERTY( int DupMethod READ DupMethod WRITE setDupMethod ) + Q_PROPERTY( int EncoderId READ EncoderId WRITE setEncoderId ) + Q_PROPERTY( QString EncoderName READ EncoderName WRITE setEncoderName ) + Q_PROPERTY( QString Profile READ Profile WRITE setProfile ) + + PROPERTYIMP ( uint , RecordedId ) + PROPERTYIMP_ENUM( RecStatus::Type , Status ) + PROPERTYIMP ( int , Priority ) + PROPERTYIMP_REF ( QDateTime , StartTs ) + PROPERTYIMP_REF ( QDateTime , EndTs ) + + PROPERTYIMP ( qlonglong , FileSize ) // v1.3 + PROPERTYIMP_REF ( QString , FileName ) // v1.3 + PROPERTYIMP_REF ( QString , HostName ) // v1.3 + PROPERTYIMP_REF ( QDateTime , LastModified) // v1.3 + + PROPERTYIMP ( int , RecordId ) + PROPERTYIMP_REF ( QString , RecGroup ) + PROPERTYIMP_REF ( QString , StorageGroup) + PROPERTYIMP_REF ( QString , PlayGroup ) + PROPERTYIMP_ENUM( RecordingType , RecType ) + PROPERTYIMP_ENUM( RecordingDupInType , DupInType ) + PROPERTYIMP_ENUM( RecordingDupMethodType , DupMethod ) + PROPERTYIMP ( int , EncoderId ) + PROPERTYIMP_REF ( QString , EncoderName ) + PROPERTYIMP_REF ( QString , Profile ) + + // Used only by Serializer + PROPERTYIMP( bool, SerializeDetails ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE explicit RecordingInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_RecordedId ( 0 ), + m_Status ( RecStatus::Unknown ), + m_Priority ( 0 ), + m_FileSize ( 0 ), + m_RecordId ( 0 ), + m_RecType ( kNotRecording ), + m_DupInType ( kDupsInRecorded ), + m_DupMethod ( kDupCheckNone ), + m_EncoderId ( 0 ), + m_SerializeDetails( true ) + { + } + + void Copy( const RecordingInfo *src ) + { + m_RecordedId = src->m_RecordedId ; + m_Status = src->m_Status ; + m_Priority = src->m_Priority ; + m_StartTs = src->m_StartTs ; + m_EndTs = src->m_EndTs ; + m_FileSize = src->m_FileSize ; + m_FileName = src->m_FileName ; + m_HostName = src->m_HostName ; + m_LastModified = src->m_LastModified ; + m_RecordId = src->m_RecordId ; + m_RecGroup = src->m_RecGroup ; + m_StorageGroup = src->m_StorageGroup ; + m_PlayGroup = src->m_PlayGroup ; + m_RecType = src->m_RecType ; + m_DupInType = src->m_DupInType ; + m_DupMethod = src->m_DupMethod ; + m_EncoderId = src->m_EncoderId ; + m_EncoderName = src->m_EncoderName ; + m_Profile = src->m_Profile ; + m_SerializeDetails= src->m_SerializeDetails ; + } + + private: + Q_DISABLE_COPY(RecordingInfo); +}; + +inline void RecordingInfo::InitializeCustomTypes() +{ + qRegisterMetaType< RecordingInfo* >(); + + RecStatus::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/settingList.h b/mythtv/libs/libmythservicecontracts/datacontracts/settingList.h new file mode 100644 index 00000000000..7dc0d3366d2 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/settingList.h @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: settingList.h +// Created : Jan. 15, 2010 +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef SETTINGLIST_H_ +#define SETTINGLIST_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC SettingList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "Settings", "type=QString;name=String"); + + Q_PROPERTY( QString HostName READ HostName WRITE setHostName ) + Q_PROPERTY( QVariantMap Settings READ Settings ) + + PROPERTYIMP_REF ( QString, HostName ) + PROPERTYIMP_RO_REF( QVariantMap, Settings ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE SettingList(QObject *parent = nullptr) + : QObject( parent ) + { + } + + void Copy( const SettingList *src ) + { + m_HostName = src->m_HostName; + m_Settings = src->m_Settings; + } + + private: + Q_DISABLE_COPY(SettingList); +}; + +inline void SettingList::InitializeCustomTypes() +{ + qRegisterMetaType< SettingList* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/storageGroupDir.h b/mythtv/libs/libmythservicecontracts/datacontracts/storageGroupDir.h new file mode 100644 index 00000000000..b1fbebd8047 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/storageGroupDir.h @@ -0,0 +1,70 @@ +#ifndef STORAGEGROUPDIR_H_ +#define STORAGEGROUPDIR_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC StorageGroupDir : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.1" ); + + Q_PROPERTY( int Id READ Id WRITE setId ) + Q_PROPERTY( QString GroupName READ GroupName WRITE setGroupName ) + Q_PROPERTY( QString HostName READ HostName WRITE setHostName ) + Q_PROPERTY( QString DirName READ DirName WRITE setDirName ) + Q_PROPERTY( bool DirRead READ DirRead WRITE setDirRead ) + Q_PROPERTY( bool DirWrite READ DirWrite WRITE setDirWrite ) + Q_PROPERTY( uint KiBFree READ KiBFree WRITE setKiBFree ) + + PROPERTYIMP ( int , Id ) + PROPERTYIMP_REF( QString , GroupName ) + PROPERTYIMP_REF( QString , HostName ) + PROPERTYIMP_REF( QString , DirName ) + PROPERTYIMP ( bool , DirRead ) + PROPERTYIMP ( bool , DirWrite ) + PROPERTYIMP ( uint , KiBFree ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE StorageGroupDir(QObject *parent = nullptr) + : QObject ( parent ), + m_Id ( 0 ), + m_DirRead ( false ), + m_DirWrite ( false ), + m_KiBFree ( 0 ) + { + } + + void Copy( const StorageGroupDir *src ) + { + m_Id = src->m_Id ; + m_GroupName = src->m_GroupName ; + m_HostName = src->m_HostName ; + m_DirName = src->m_DirName ; + m_DirRead = src->m_DirRead ; + m_DirWrite = src->m_DirWrite ; + m_KiBFree = src->m_KiBFree ; + } + + private: + Q_DISABLE_COPY(StorageGroupDir); +}; + +inline void StorageGroupDir::InitializeCustomTypes() +{ + qRegisterMetaType< StorageGroupDir* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/storageGroupDirList.h b/mythtv/libs/libmythservicecontracts/datacontracts/storageGroupDirList.h new file mode 100644 index 00000000000..bd049157c46 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/storageGroupDirList.h @@ -0,0 +1,66 @@ +#ifndef STORAGEGROUPDIRLIST_H_ +#define STORAGEGROUPDIRLIST_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "storageGroupDir.h" + +namespace DTC +{ + +class SERVICE_PUBLIC StorageGroupDirList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "StorageGroupDirs", "type=DTC::StorageGroupDir"); + + Q_PROPERTY( QVariantList StorageGroupDirs READ StorageGroupDirs ) + + PROPERTYIMP_RO_REF( QVariantList, StorageGroupDirs ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE StorageGroupDirList(QObject *parent = nullptr) + : QObject( parent ) + { + } + + void Copy( const StorageGroupDirList *src ) + { + CopyListContents< StorageGroupDir >( this, m_StorageGroupDirs, src->m_StorageGroupDirs ); + } + + StorageGroupDir *AddNewStorageGroupDir() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new StorageGroupDir( this ); + m_StorageGroupDirs.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(StorageGroupDirList); +}; + +inline void StorageGroupDirList::InitializeCustomTypes() +{ + qRegisterMetaType< StorageGroupDirList* >(); + + StorageGroupDir::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/timeZoneInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/timeZoneInfo.h new file mode 100644 index 00000000000..487f22671ce --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/timeZoneInfo.h @@ -0,0 +1,65 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: timeZoneInfo.h +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef TIMEZONEINFO_H_ +#define TIMEZONEINFO_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC TimeZoneInfo : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( QString TimeZoneID READ TimeZoneID + WRITE setTimeZoneID ) + Q_PROPERTY( int UTCOffset READ UTCOffset + WRITE setUTCOffset ) + Q_PROPERTY( QDateTime CurrentDateTime READ CurrentDateTime + WRITE setCurrentDateTime ) + + PROPERTYIMP_REF( QString , TimeZoneID ) + PROPERTYIMP ( int , UTCOffset ) + PROPERTYIMP_REF( QDateTime, CurrentDateTime ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE TimeZoneInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_TimeZoneID ( ), + m_UTCOffset ( 0 ) + { + } + + void Copy( const TimeZoneInfo *src ) + { + m_TimeZoneID = src->m_TimeZoneID ; + m_UTCOffset = src->m_UTCOffset ; + m_CurrentDateTime = src->m_CurrentDateTime; + } + + private: + Q_DISABLE_COPY(TimeZoneInfo); +}; + +inline void TimeZoneInfo::InitializeCustomTypes() +{ + qRegisterMetaType< TimeZoneInfo* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/titleInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/titleInfo.h new file mode 100644 index 00000000000..4349ec7649f --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/titleInfo.h @@ -0,0 +1,65 @@ +//////////////////////////////////////////////////////////////////////////// +// Program Name: titleInfo.h +// Created : June 14, 2013 +// +// Copyright (c) 2013 Chris Pinkham +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +//////////////////////////////////////////////////////////////////////////// + +#ifndef TITLEINFO_H_ +#define TITLEINFO_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC TitleInfo : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.1" ); + + Q_PROPERTY( QString Title READ Title WRITE setTitle ) + Q_PROPERTY( QString Inetref READ Inetref WRITE setInetref ) + Q_PROPERTY( int Count READ Count WRITE setCount ) + + PROPERTYIMP_REF( QString , Title ) + PROPERTYIMP_REF( QString , Inetref ) + PROPERTYIMP ( int , Count ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE TitleInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Count(0) + { + } + + void Copy( const TitleInfo *src ) + { + m_Title = src->m_Title ; + m_Inetref = src->m_Inetref ; + m_Count = src->m_Count ; + } + + private: + Q_DISABLE_COPY(TitleInfo); +}; + +inline void TitleInfo::InitializeCustomTypes() +{ + qRegisterMetaType< TitleInfo* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/titleInfoList.h b/mythtv/libs/libmythservicecontracts/datacontracts/titleInfoList.h new file mode 100644 index 00000000000..228155aa46c --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/titleInfoList.h @@ -0,0 +1,76 @@ +//////////////////////////////////////////////////////////////////////////// +// Program Name: titleInfoList.h +// Created : June 14, 2013 +// +// Copyright (c) 2013 Chris Pinkham +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +//////////////////////////////////////////////////////////////////////////// + +#ifndef TITLEINFOLIST_H_ +#define TITLEINFOLIST_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "titleInfo.h" + +namespace DTC +{ + +class SERVICE_PUBLIC TitleInfoList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "TitleInfos", "type=DTC::TitleInfo"); + + Q_PROPERTY( QVariantList TitleInfos READ TitleInfos ) + + PROPERTYIMP_RO_REF( QVariantList, TitleInfos ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE TitleInfoList(QObject *parent = nullptr) + : QObject( parent ) + { + } + + void Copy( const TitleInfoList *src ) + { + CopyListContents< TitleInfo >( this, m_TitleInfos, src->m_TitleInfos ); + } + + TitleInfo *AddNewTitleInfo() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new TitleInfo( this ); + m_TitleInfos.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(TitleInfoList); +}; + +inline void TitleInfoList::InitializeCustomTypes() +{ + qRegisterMetaType< TitleInfoList* >(); + + TitleInfo::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/versionInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/versionInfo.h new file mode 100644 index 00000000000..061c1d36792 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/versionInfo.h @@ -0,0 +1,77 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: versionInfo.h +// Created : Jul. 26, 2011 +// +// Copyright (c) 2011 Raymond Wagner +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef VERSIONINFO_H_ +#define VERSIONINFO_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC VersionInfo : public QObject +{ + Q_OBJECT + + Q_CLASSINFO( "version" , "1.0" ); + Q_CLASSINFO( "defaultProp", "Command" ); + + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( QString Branch READ Branch WRITE setBranch ) + Q_PROPERTY( QString Protocol READ Protocol WRITE setProtocol ) + Q_PROPERTY( QString Binary READ Binary WRITE setBinary ) + Q_PROPERTY( QString Schema READ Schema WRITE setSchema ) + + PROPERTYIMP_REF( QString, Version ) + PROPERTYIMP_REF( QString, Branch ) + PROPERTYIMP_REF( QString, Protocol ) + PROPERTYIMP_REF( QString, Binary ) + PROPERTYIMP_REF( QString, Schema ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE VersionInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Version ( "" ), + m_Branch ( "" ), + m_Protocol( "" ), + m_Binary ( "" ), + m_Schema ( "" ) + { + } + + void Copy( const VersionInfo *src ) + { + m_Version = src->m_Version; + m_Branch = src->m_Branch; + m_Protocol = src->m_Protocol; + m_Binary = src->m_Binary; + m_Schema = src->m_Schema; + } + + private: + Q_DISABLE_COPY(VersionInfo); +}; + +using VersionInfoPtr = VersionInfo*; + +inline void VersionInfo::InitializeCustomTypes() +{ + qRegisterMetaType< VersionInfo* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/videoLookupInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/videoLookupInfo.h new file mode 100644 index 00000000000..cb6750799d4 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/videoLookupInfo.h @@ -0,0 +1,189 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: VideoLookupInfo.h +// Created : Jul. 19, 2011 +// +// Copyright (c) 2011 Robert McNamara +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef VIDEOLOOKUPINFO_H_ +#define VIDEOLOOKUPINFO_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC ArtworkItem : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.02" ); + + Q_PROPERTY( QString Type READ Type WRITE setType ) + Q_PROPERTY( QString Url READ Url WRITE setUrl ) + Q_PROPERTY( QString Thumbnail READ Thumbnail WRITE setThumbnail ) + Q_PROPERTY( int Width READ Width WRITE setWidth ) + Q_PROPERTY( int Height READ Height WRITE setHeight ) + + PROPERTYIMP_REF( QString , Type ) + PROPERTYIMP_REF( QString , Url ) + PROPERTYIMP_REF( QString , Thumbnail ) + PROPERTYIMP ( int , Width ) + PROPERTYIMP ( int , Height ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE ArtworkItem(QObject *parent = nullptr) + : QObject ( parent ) + { + m_Width = 0 ; + m_Height = 0 ; + } + + void Copy( const ArtworkItem *src ) + { + m_Type = src->m_Type ; + m_Url = src->m_Url ; + m_Thumbnail = src->m_Thumbnail ; + m_Width = src->m_Width ; + m_Height = src->m_Height ; + } + + private: + Q_DISABLE_COPY(ArtworkItem); +}; + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC VideoLookup : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_CLASSINFO( "Artwork", "type=DTC::ArtworkItem"); + + Q_PROPERTY( QString Title READ Title WRITE setTitle ) + Q_PROPERTY( QString SubTitle READ SubTitle WRITE setSubTitle ) + Q_PROPERTY( int Season READ Season WRITE setSeason ) + Q_PROPERTY( int Episode READ Episode WRITE setEpisode ) + Q_PROPERTY( int Year READ Year WRITE setYear ) + Q_PROPERTY( QString Tagline READ Tagline WRITE setTagline ) + Q_PROPERTY( QString Description READ Description WRITE setDescription ) + Q_PROPERTY( QString Certification READ Certification WRITE setCertification ) + Q_PROPERTY( QString Inetref READ Inetref WRITE setInetref ) + Q_PROPERTY( QString Collectionref READ Collectionref WRITE setCollectionref ) + Q_PROPERTY( QString HomePage READ HomePage WRITE setHomePage ) + Q_PROPERTY( QDateTime ReleaseDate READ ReleaseDate WRITE setReleaseDate ) + Q_PROPERTY( float UserRating READ UserRating WRITE setUserRating ) + Q_PROPERTY( int Length READ Length WRITE setLength ) + Q_PROPERTY( QString Language READ Language WRITE setLanguage ) + Q_PROPERTY( QStringList Countries READ Countries WRITE setCountries ) + Q_PROPERTY( float Popularity READ Popularity WRITE setPopularity ) + Q_PROPERTY( int Budget READ Budget WRITE setBudget ) + Q_PROPERTY( int Revenue READ Revenue WRITE setRevenue ) + Q_PROPERTY( QString IMDB READ IMDB WRITE setIMDB ) + Q_PROPERTY( QString TMSRef READ TMSRef WRITE setTMSRef ) + + Q_PROPERTY( QVariantList Artwork READ Artwork ) + + PROPERTYIMP_REF( QString , Title ) + PROPERTYIMP_REF( QString , SubTitle ) + PROPERTYIMP ( int , Season ) + PROPERTYIMP ( int , Episode ) + PROPERTYIMP ( int , Year ) + PROPERTYIMP_REF( QString , Tagline ) + PROPERTYIMP_REF( QString , Description ) + PROPERTYIMP_REF( QString , Certification ) + PROPERTYIMP_REF( QString , Inetref ) + PROPERTYIMP_REF( QString , Collectionref ) + PROPERTYIMP_REF( QString , HomePage ) + PROPERTYIMP_REF( QDateTime , ReleaseDate ) + PROPERTYIMP ( float , UserRating ) + PROPERTYIMP ( int , Length ) + PROPERTYIMP_REF( QString , Language ) + PROPERTYIMP_REF( QStringList, Countries ) + PROPERTYIMP ( float , Popularity ) + PROPERTYIMP ( int , Budget ) + PROPERTYIMP ( int , Revenue ) + PROPERTYIMP_REF( QString , IMDB ) + PROPERTYIMP_REF( QString , TMSRef ) + + PROPERTYIMP_RO_REF( QVariantList, Artwork) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE VideoLookup(QObject *parent = nullptr) + : QObject ( parent ) + { + m_Season = 0 ; + m_Episode = 0 ; + m_Year = 0 ; + m_UserRating = 0.0 ; + m_Length = 0.0 ; + m_Popularity = 0.0 ; + m_Budget = 0 ; + m_Revenue = 0 ; + } + + void Copy( const VideoLookup *src ) + { + m_Title = src->m_Title ; + m_SubTitle = src->m_SubTitle ; + m_Season = src->m_Season ; + m_Episode = src->m_Episode ; + m_Year = src->m_Year ; + m_Tagline = src->m_Tagline ; + m_Description = src->m_Description ; + m_Certification = src->m_Certification ; + m_Inetref = src->m_Inetref ; + m_Collectionref = src->m_Collectionref ; + m_HomePage = src->m_HomePage ; + m_ReleaseDate = src->m_ReleaseDate ; + m_UserRating = src->m_UserRating ; + m_Length = src->m_Length ; + m_Popularity = src->m_Popularity ; + m_Budget = src->m_Budget ; + m_Revenue = src->m_Revenue ; + m_IMDB = src->m_IMDB ; + m_TMSRef = src->m_TMSRef ; + + CopyListContents< ArtworkItem >( this, m_Artwork, src->m_Artwork ); + } + + ArtworkItem *AddNewArtwork() + { + auto *pObject = new ArtworkItem( this ); + Artwork().append( QVariant::fromValue( pObject )); + + return pObject; + } + +}; + +inline void ArtworkItem::InitializeCustomTypes() +{ + qRegisterMetaType< ArtworkItem* >(); +} + +inline void VideoLookup::InitializeCustomTypes() +{ + qRegisterMetaType< VideoLookup* >(); + + ArtworkItem::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/videoLookupInfoList.h b/mythtv/libs/libmythservicecontracts/datacontracts/videoLookupInfoList.h new file mode 100644 index 00000000000..118f5a73ab3 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/videoLookupInfoList.h @@ -0,0 +1,93 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: videoLookupInfoList.h +// Created : Jul. 19, 2011 +// +// Copyright (c) 2011 Robert McNamara +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef VIDEOLOOKUPINFOLIST_H_ +#define VIDEOLOOKUPINFOLIST_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "videoLookupInfo.h" + +namespace DTC +{ + +class SERVICE_PUBLIC VideoLookupList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "VideoLookups", "type=DTC::VideoLookup"); + Q_CLASSINFO( "AsOf" , "transient=true" ); + + Q_PROPERTY( int Count READ Count WRITE setCount ) + Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf ) + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer ) + + Q_PROPERTY( QVariantList VideoLookups READ VideoLookups ) + + PROPERTYIMP ( int , Count ) + PROPERTYIMP_REF ( QDateTime , AsOf ) + PROPERTYIMP_REF ( QString , Version ) + PROPERTYIMP_REF ( QString , ProtoVer ) + + PROPERTYIMP_RO_REF( QVariantList, VideoLookups ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE VideoLookupList(QObject *parent = nullptr) + : QObject( parent ), + m_Count ( 0 ) + { + } + + void Copy( const VideoLookupList *src ) + { + m_Count = src->m_Count ; + m_AsOf = src->m_AsOf ; + m_Version = src->m_Version ; + m_ProtoVer = src->m_ProtoVer ; + + CopyListContents< VideoLookup >( this, m_VideoLookups, src->m_VideoLookups ); + } + + VideoLookup *AddNewVideoLookup() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new VideoLookup( this ); + m_VideoLookups.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(VideoLookupList); +}; + +inline void VideoLookupList::InitializeCustomTypes() +{ + qRegisterMetaType< VideoLookupList* >(); + + VideoLookup::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/videoMetadataInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/videoMetadataInfo.h new file mode 100644 index 00000000000..7535d18a77d --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/videoMetadataInfo.h @@ -0,0 +1,177 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: videoMetadataInfo.h +// Created : Apr. 21, 2011 +// +// Copyright (c) 2010 Robert McNamara +// Copyright (c) 2013 Stuart Morgan +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef VIDEOMETADATAINFO_H_ +#define VIDEOMETADATAINFO_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" +#include "artworkInfoList.h" +#include "castMemberList.h" +#include "genreList.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC VideoMetadataInfo : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "2.01" ); + + Q_PROPERTY( int Id READ Id WRITE setId ) + Q_PROPERTY( QString Title READ Title WRITE setTitle ) + Q_PROPERTY( QString SubTitle READ SubTitle WRITE setSubTitle ) + Q_PROPERTY( QString Tagline READ Tagline WRITE setTagline ) + Q_PROPERTY( QString Director READ Director WRITE setDirector ) + Q_PROPERTY( QString Studio READ Studio WRITE setStudio ) + Q_PROPERTY( QString Description READ Description WRITE setDescription ) + Q_PROPERTY( QString Certification READ Certification WRITE setCertification ) + Q_PROPERTY( QString Inetref READ Inetref WRITE setInetref ) + Q_PROPERTY( int Collectionref READ Collectionref WRITE setCollectionref ) + Q_PROPERTY( QString HomePage READ HomePage WRITE setHomePage ) + Q_PROPERTY( QDateTime ReleaseDate READ ReleaseDate WRITE setReleaseDate ) + Q_PROPERTY( QDateTime AddDate READ AddDate WRITE setAddDate ) + Q_PROPERTY( float UserRating READ UserRating WRITE setUserRating ) + Q_PROPERTY( int ChildID READ ChildID WRITE setChildID ) + Q_PROPERTY( int Length READ Length WRITE setLength ) + Q_PROPERTY( int PlayCount READ PlayCount WRITE setPlayCount ) + Q_PROPERTY( int Season READ Season WRITE setSeason ) + Q_PROPERTY( int Episode READ Episode WRITE setEpisode ) + Q_PROPERTY( int ParentalLevel READ ParentalLevel WRITE setParentalLevel ) + Q_PROPERTY( bool Visible READ Visible WRITE setVisible ) + Q_PROPERTY( bool Watched READ Watched WRITE setWatched ) + Q_PROPERTY( bool Processed READ Processed WRITE setProcessed ) + Q_PROPERTY( QString ContentType READ ContentType WRITE setContentType ) + Q_PROPERTY( QString FileName READ FileName WRITE setFileName ) + Q_PROPERTY( QString Hash READ Hash WRITE setHash ) + Q_PROPERTY( QString HostName READ HostName WRITE setHostName ) + Q_PROPERTY( QString Coverart READ Coverart WRITE setCoverart ) + Q_PROPERTY( QString Fanart READ Fanart WRITE setFanart ) + Q_PROPERTY( QString Banner READ Banner WRITE setBanner ) + Q_PROPERTY( QString Screenshot READ Screenshot WRITE setScreenshot ) + Q_PROPERTY( QString Trailer READ Trailer WRITE setTrailer ) + + Q_PROPERTY( QObject* Artwork READ Artwork ) + Q_PROPERTY( QObject* Cast READ Cast ) + Q_PROPERTY( QObject* Genres READ Genres ) + + PROPERTYIMP ( int , Id ) + PROPERTYIMP_REF( QString , Title ) + PROPERTYIMP_REF( QString , SubTitle ) + PROPERTYIMP_REF( QString , Tagline ) + PROPERTYIMP_REF( QString , Director ) + PROPERTYIMP_REF( QString , Studio ) + PROPERTYIMP_REF( QString , Description ) + PROPERTYIMP_REF( QString , Certification ) + PROPERTYIMP_REF( QString , Inetref ) + PROPERTYIMP ( int , Collectionref ) + PROPERTYIMP_REF( QString , HomePage ) + PROPERTYIMP_REF( QDateTime , ReleaseDate ) + PROPERTYIMP_REF( QDateTime , AddDate ) + PROPERTYIMP ( float , UserRating ) + PROPERTYIMP ( int , ChildID ) + PROPERTYIMP ( int , Length ) + PROPERTYIMP ( int , PlayCount ) + PROPERTYIMP ( int , Season ) + PROPERTYIMP ( int , Episode ) + PROPERTYIMP ( int , ParentalLevel ) + PROPERTYIMP ( bool , Visible ) + PROPERTYIMP ( bool , Watched ) + PROPERTYIMP ( bool , Processed ) + PROPERTYIMP_REF( QString , ContentType ) + PROPERTYIMP_REF( QString , FileName ) + PROPERTYIMP_REF( QString , Hash ) + PROPERTYIMP_REF( QString , HostName ) + PROPERTYIMP_REF( QString , Coverart ) + PROPERTYIMP_REF( QString , Fanart ) + PROPERTYIMP_REF( QString , Banner ) + PROPERTYIMP_REF( QString , Screenshot ) + PROPERTYIMP_REF( QString , Trailer ) + + PROPERTYIMP_PTR( ArtworkInfoList , Artwork ) + PROPERTYIMP_PTR( CastMemberList , Cast ) + PROPERTYIMP_PTR( GenreList , Genres ) + + PROPERTYIMP ( bool , SerializeArtwork) + PROPERTYIMP ( bool , SerializeCast ) + PROPERTYIMP ( bool , SerializeGenres ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE VideoMetadataInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Id ( 0 ), + m_Collectionref ( 0 ), + m_UserRating ( 0 ), + m_ChildID ( 0 ), + m_Length ( 0 ), + m_PlayCount ( 0 ), + m_Season ( 0 ), + m_Episode ( 0 ), + m_ParentalLevel ( 0 ), + m_Visible ( false ), + m_Watched ( false ), + m_Processed ( false ), + m_Artwork ( nullptr ), + m_Cast ( nullptr ), + m_Genres ( nullptr ), + m_SerializeArtwork( true ), + m_SerializeCast ( true ), + m_SerializeGenres ( true ) + { + } + + void Copy( const VideoMetadataInfo *src ) + { + m_Id = src->m_Id; + m_SerializeArtwork = src->m_SerializeArtwork; + m_SerializeCast = src->m_SerializeCast; + m_SerializeGenres = src->m_SerializeGenres; + + if ( src->m_Artwork != nullptr) + Artwork()->Copy( src->m_Artwork ); + + if (src->m_Cast != nullptr) + Cast()->Copy( src->m_Cast ); + + if (src->m_Genres != nullptr) + Genres()->Copy( src->m_Genres ); + + } + + private: + Q_DISABLE_COPY(VideoMetadataInfo); +}; + +inline void VideoMetadataInfo::InitializeCustomTypes() +{ + qRegisterMetaType< VideoMetadataInfo* >(); + + if (qMetaTypeId() == QMetaType::UnknownType) + ArtworkInfoList::InitializeCustomTypes(); + + if (qMetaTypeId() == QMetaType::UnknownType) + CastMemberList::InitializeCustomTypes(); + + if (qMetaTypeId() == QMetaType::UnknownType) + GenreList::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/videoMetadataInfoList.h b/mythtv/libs/libmythservicecontracts/datacontracts/videoMetadataInfoList.h new file mode 100644 index 00000000000..eb0b2d7a567 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/videoMetadataInfoList.h @@ -0,0 +1,107 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: videoMetadataInfoList.h +// Created : Apr. 21, 2011 +// +// Copyright (c) 2011 Robert McNamara +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef VIDEOMETADATAINFOLIST_H_ +#define VIDEOMETADATAINFOLIST_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "videoMetadataInfo.h" + +namespace DTC +{ + +class SERVICE_PUBLIC VideoMetadataInfoList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.02" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "VideoMetadataInfos", "type=DTC::VideoMetadataInfo"); + Q_CLASSINFO( "AsOf" , "transient=true" ); + + Q_PROPERTY( int StartIndex READ StartIndex WRITE setStartIndex ) + Q_PROPERTY( int Count READ Count WRITE setCount ) + Q_PROPERTY( int CurrentPage READ CurrentPage WRITE setCurrentPage ) + Q_PROPERTY( int TotalPages READ TotalPages WRITE setTotalPages ) + Q_PROPERTY( int TotalAvailable READ TotalAvailable WRITE setTotalAvailable ) + Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf ) + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer ) + + Q_PROPERTY( QVariantList VideoMetadataInfos READ VideoMetadataInfos ) + + PROPERTYIMP ( int , StartIndex ) + PROPERTYIMP ( int , Count ) + PROPERTYIMP ( int , CurrentPage ) + PROPERTYIMP ( int , TotalPages ) + PROPERTYIMP ( int , TotalAvailable ) + PROPERTYIMP_REF ( QDateTime , AsOf ) + PROPERTYIMP_REF ( QString , Version ) + PROPERTYIMP_REF ( QString , ProtoVer ) + + PROPERTYIMP_RO_REF( QVariantList, VideoMetadataInfos ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE VideoMetadataInfoList(QObject *parent = nullptr) + : QObject( parent ), + m_StartIndex ( 0 ), + m_Count ( 0 ), + m_CurrentPage ( 0 ), + m_TotalPages ( 0 ), + m_TotalAvailable( 0 ) + { + } + + void Copy( const VideoMetadataInfoList *src ) + { + m_StartIndex = src->m_StartIndex ; + m_Count = src->m_Count ; + m_TotalAvailable= src->m_TotalAvailable ; + m_AsOf = src->m_AsOf ; + m_Version = src->m_Version ; + m_ProtoVer = src->m_ProtoVer ; + + CopyListContents< VideoMetadataInfo >( this, m_VideoMetadataInfos, src->m_VideoMetadataInfos ); + } + + VideoMetadataInfo *AddNewVideoMetadataInfo() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new VideoMetadataInfo( this ); + m_VideoMetadataInfos.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(VideoMetadataInfoList); +}; + +inline void VideoMetadataInfoList::InitializeCustomTypes() +{ + qRegisterMetaType< VideoMetadataInfoList* >(); + + VideoMetadataInfo::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/videoMultiplex.h b/mythtv/libs/libmythservicecontracts/datacontracts/videoMultiplex.h new file mode 100644 index 00000000000..ebbfe406ef9 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/videoMultiplex.h @@ -0,0 +1,126 @@ +#ifndef VIDEOMULTIPLEX_H_ +#define VIDEOMULTIPLEX_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC VideoMultiplex : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.1" ); + + Q_PROPERTY( int MplexId READ MplexId WRITE setMplexId ) + Q_PROPERTY( int SourceId READ SourceId WRITE setSourceId ) + Q_PROPERTY( int TransportId READ TransportId WRITE setTransportId ) + Q_PROPERTY( int NetworkId READ NetworkId WRITE setNetworkId ) + Q_PROPERTY( long long Frequency READ Frequency WRITE setFrequency ) + Q_PROPERTY( QString Inversion READ Inversion WRITE setInversion ) + Q_PROPERTY( long long SymbolRate READ SymbolRate WRITE setSymbolRate ) + Q_PROPERTY( QString FEC READ FEC WRITE setFEC ) + Q_PROPERTY( QString Polarity READ Polarity WRITE setPolarity ) + Q_PROPERTY( QString Modulation READ Modulation WRITE setModulation ) + Q_PROPERTY( QString Bandwidth READ Bandwidth WRITE setBandwidth ) + Q_PROPERTY( QString LPCodeRate READ LPCodeRate WRITE setLPCodeRate ) + Q_PROPERTY( QString HPCodeRate READ HPCodeRate WRITE setHPCodeRate ) + Q_PROPERTY( QString TransmissionMode READ TransmissionMode WRITE setTransmissionMode ) + Q_PROPERTY( QString GuardInterval READ GuardInterval WRITE setGuardInterval ) + Q_PROPERTY( bool Visible READ Visible WRITE setVisible ) + Q_PROPERTY( QString Constellation READ Constellation WRITE setConstellation ) + Q_PROPERTY( QString Hierarchy READ Hierarchy WRITE setHierarchy ) + Q_PROPERTY( QString ModulationSystem READ ModulationSystem WRITE setModulationSystem ) + Q_PROPERTY( QString RollOff READ RollOff WRITE setRollOff ) + Q_PROPERTY( QString SIStandard READ SIStandard WRITE setSIStandard ) + Q_PROPERTY( int ServiceVersion READ ServiceVersion WRITE setServiceVersion ) + Q_PROPERTY( QDateTime UpdateTimeStamp READ UpdateTimeStamp WRITE setUpdateTimeStamp ) + Q_PROPERTY( QString DefaultAuthority READ DefaultAuthority WRITE setDefaultAuthority ) + + PROPERTYIMP ( int , MplexId ) + PROPERTYIMP ( int , SourceId ) + PROPERTYIMP ( int , TransportId ) + PROPERTYIMP ( int , NetworkId ) + PROPERTYIMP ( long long , Frequency ) + PROPERTYIMP_REF( QString , Inversion ) + PROPERTYIMP ( long long , SymbolRate ) + PROPERTYIMP_REF( QString , FEC ) + PROPERTYIMP_REF( QString , Polarity ) + PROPERTYIMP_REF( QString , Modulation ) + PROPERTYIMP_REF( QString , Bandwidth ) + PROPERTYIMP_REF( QString , LPCodeRate ) + PROPERTYIMP_REF( QString , HPCodeRate ) + PROPERTYIMP_REF( QString , TransmissionMode ) + PROPERTYIMP_REF( QString , GuardInterval ) + PROPERTYIMP ( bool , Visible ) + PROPERTYIMP_REF( QString , Constellation ) + PROPERTYIMP_REF( QString , Hierarchy ) + PROPERTYIMP_REF( QString , ModulationSystem ) + PROPERTYIMP_REF( QString , RollOff ) + PROPERTYIMP_REF( QString , SIStandard ) + PROPERTYIMP ( int , ServiceVersion ) + PROPERTYIMP_REF( QDateTime , UpdateTimeStamp ) + PROPERTYIMP_REF( QString , DefaultAuthority ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE VideoMultiplex(QObject *parent = nullptr) + : QObject ( parent ), + m_MplexId ( 0 ), + m_SourceId ( 0 ), + m_TransportId ( 0 ), + m_NetworkId ( 0 ), + m_Frequency ( 0 ), + m_SymbolRate ( 0 ), + m_Visible ( false ), + m_ServiceVersion( 0 ) + { + } + + void Copy( const VideoMultiplex *src ) + { + m_MplexId = src->m_MplexId ; + m_SourceId = src->m_SourceId ; + m_TransportId = src->m_TransportId ; + m_NetworkId = src->m_NetworkId ; + m_Frequency = src->m_Frequency ; + m_Inversion = src->m_Inversion ; + m_SymbolRate = src->m_SymbolRate ; + m_FEC = src->m_FEC ; + m_Polarity = src->m_Polarity ; + m_Modulation = src->m_Modulation ; + m_Bandwidth = src->m_Bandwidth ; + m_LPCodeRate = src->m_LPCodeRate ; + m_HPCodeRate = src->m_HPCodeRate ; + m_TransmissionMode = src->m_TransmissionMode ; + m_GuardInterval = src->m_GuardInterval ; + m_Visible = src->m_Visible ; + m_Constellation = src->m_Constellation ; + m_Hierarchy = src->m_Hierarchy ; + m_ModulationSystem = src->m_ModulationSystem ; + m_RollOff = src->m_RollOff ; + m_SIStandard = src->m_SIStandard ; + m_ServiceVersion = src->m_ServiceVersion ; + m_UpdateTimeStamp = src->m_UpdateTimeStamp ; + m_DefaultAuthority = src->m_DefaultAuthority ; + } + + private: + Q_DISABLE_COPY(VideoMultiplex); +}; + +inline void VideoMultiplex::InitializeCustomTypes() +{ + qRegisterMetaType< VideoMultiplex* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/videoMultiplexList.h b/mythtv/libs/libmythservicecontracts/datacontracts/videoMultiplexList.h new file mode 100644 index 00000000000..e5343519f0a --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/videoMultiplexList.h @@ -0,0 +1,95 @@ +#ifndef VIDEOMULTIPLEXLIST_H_ +#define VIDEOMULTIPLEXLIST_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "videoMultiplex.h" + +namespace DTC +{ + +class SERVICE_PUBLIC VideoMultiplexList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "VideoMultiplexes", "type=DTC::VideoMultiplex"); + Q_CLASSINFO( "AsOf" , "transient=true" ); + + Q_PROPERTY( int StartIndex READ StartIndex WRITE setStartIndex ) + Q_PROPERTY( int Count READ Count WRITE setCount ) + Q_PROPERTY( int CurrentPage READ CurrentPage WRITE setCurrentPage ) + Q_PROPERTY( int TotalPages READ TotalPages WRITE setTotalPages ) + Q_PROPERTY( int TotalAvailable READ TotalAvailable WRITE setTotalAvailable ) + Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf ) + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer ) + + Q_PROPERTY( QVariantList VideoMultiplexes READ VideoMultiplexes ) + + PROPERTYIMP ( int , StartIndex ) + PROPERTYIMP ( int , Count ) + PROPERTYIMP ( int , CurrentPage ) + PROPERTYIMP ( int , TotalPages ) + PROPERTYIMP ( int , TotalAvailable ) + PROPERTYIMP_REF ( QDateTime , AsOf ) + PROPERTYIMP_REF ( QString , Version ) + PROPERTYIMP_REF ( QString , ProtoVer ) + + PROPERTYIMP_RO_REF( QVariantList, VideoMultiplexes ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE VideoMultiplexList(QObject *parent = nullptr) + : QObject( parent ), + m_StartIndex ( 0 ), + m_Count ( 0 ), + m_CurrentPage ( 0 ), + m_TotalPages ( 0 ), + m_TotalAvailable ( 0 ) + { + } + + void Copy( const VideoMultiplexList *src ) + { + m_AsOf = src->m_AsOf ; + m_Version = src->m_Version ; + m_ProtoVer = src->m_ProtoVer ; + + CopyListContents< VideoMultiplex >( this, m_VideoMultiplexes, src->m_VideoMultiplexes ); + } + + VideoMultiplex *AddNewVideoMultiplex() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new VideoMultiplex( this ); + m_VideoMultiplexes.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(VideoMultiplexList); +}; + +inline void VideoMultiplexList::InitializeCustomTypes() +{ + qRegisterMetaType< VideoMultiplexList* >(); + + VideoMultiplex::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/videoSource.h b/mythtv/libs/libmythservicecontracts/datacontracts/videoSource.h new file mode 100644 index 00000000000..6f42085b6d1 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/videoSource.h @@ -0,0 +1,92 @@ +#ifndef VIDEOSOURCE_H_ +#define VIDEOSOURCE_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC VideoSource : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + Q_PROPERTY( int Id READ Id WRITE setId ) + Q_PROPERTY( QString SourceName READ SourceName WRITE setSourceName ) + Q_PROPERTY( QString Grabber READ Grabber WRITE setGrabber ) + Q_PROPERTY( QString UserId READ UserId WRITE setUserId ) + Q_PROPERTY( QString FreqTable READ FreqTable WRITE setFreqTable ) + Q_PROPERTY( QString LineupId READ LineupId WRITE setLineupId ) + Q_PROPERTY( QString Password READ Password WRITE setPassword ) + Q_PROPERTY( bool UseEIT READ UseEIT WRITE setUseEIT ) + Q_PROPERTY( QString ConfigPath READ ConfigPath WRITE setConfigPath ) + Q_PROPERTY( int NITId READ NITId WRITE setNITId ) + Q_PROPERTY( uint BouquetId READ BouquetId WRITE setBouquetId ) + Q_PROPERTY( uint RegionId READ RegionId WRITE setRegionId ) + Q_PROPERTY( uint ScanFrequency READ ScanFrequency WRITE setScanFrequency ) + Q_PROPERTY( uint LCNOffset READ LCNOffset WRITE setLCNOffset ) + + PROPERTYIMP ( int , Id ) + PROPERTYIMP_REF( QString , SourceName ) + PROPERTYIMP_REF( QString , Grabber ) + PROPERTYIMP_REF( QString , UserId ) + PROPERTYIMP_REF( QString , FreqTable ) + PROPERTYIMP_REF( QString , LineupId ) + PROPERTYIMP_REF( QString , Password ) + PROPERTYIMP ( bool , UseEIT ) + PROPERTYIMP_REF( QString , ConfigPath ) + PROPERTYIMP ( int , NITId ) + PROPERTYIMP ( uint , BouquetId ) + PROPERTYIMP ( uint , RegionId ) + PROPERTYIMP ( uint , ScanFrequency ) + PROPERTYIMP ( uint , LCNOffset ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE VideoSource(QObject *parent = nullptr) + : QObject ( parent ), + m_Id ( 0 ), + m_UseEIT ( false ), + m_NITId ( 0 ), + m_BouquetId ( 0 ), + m_RegionId ( 0 ), + m_ScanFrequency ( 0 ) + { + } + + void Copy( const VideoSource *src ) + { + m_Id = src->m_Id ; + m_SourceName = src->m_SourceName ; + m_Grabber = src->m_Grabber ; + m_UserId = src->m_UserId ; + m_FreqTable = src->m_FreqTable ; + m_LineupId = src->m_LineupId ; + m_Password = src->m_Password ; + m_UseEIT = src->m_UseEIT ; + m_ConfigPath = src->m_ConfigPath ; + m_NITId = src->m_NITId ; + m_BouquetId = src->m_BouquetId ; + m_RegionId = src->m_RegionId ; + m_ScanFrequency = src->m_ScanFrequency ; + } + + private: + Q_DISABLE_COPY(VideoSource); +}; + +inline void VideoSource::InitializeCustomTypes() +{ + qRegisterMetaType< VideoSource* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/videoSourceList.h b/mythtv/libs/libmythservicecontracts/datacontracts/videoSourceList.h new file mode 100644 index 00000000000..a94fca98688 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/videoSourceList.h @@ -0,0 +1,80 @@ +#ifndef VIDEOSOURCELIST_H_ +#define VIDEOSOURCELIST_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "videoSource.h" + +namespace DTC +{ + +class SERVICE_PUBLIC VideoSourceList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.0" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "VideoSources", "type=DTC::VideoSource"); + Q_CLASSINFO( "AsOf" , "transient=true" ); + + Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf ) + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer ) + + Q_PROPERTY( QVariantList VideoSources READ VideoSources ) + + PROPERTYIMP_REF ( QDateTime , AsOf ) + PROPERTYIMP_REF ( QString , Version ) + PROPERTYIMP_REF ( QString , ProtoVer ) + + PROPERTYIMP_RO_REF( QVariantList, VideoSources ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE VideoSourceList(QObject *parent = nullptr) + : QObject( parent ) + { + } + + void Copy( const VideoSourceList *src ) + { + m_AsOf = src->m_AsOf ; + m_Version = src->m_Version ; + m_ProtoVer = src->m_ProtoVer ; + + CopyListContents< VideoSource >( this, m_VideoSources, src->m_VideoSources ); + } + + VideoSource *AddNewVideoSource() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new VideoSource( this ); + m_VideoSources.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(VideoSourceList); +}; + +inline void VideoSourceList::InitializeCustomTypes() +{ + qRegisterMetaType< VideoSourceList* >(); + + VideoSource::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/videoStreamInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/videoStreamInfo.h new file mode 100644 index 00000000000..1a688e600c1 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/videoStreamInfo.h @@ -0,0 +1,93 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: videoStreamInfo.h +// Created : May. 30, 2020 +// +// Copyright (c) 2020 Peter Bennett +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef VIDEOSTREAMINFO_H_ +#define VIDEOSTREAMINFO_H_ + +#include +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC VideoStreamInfo : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.00" ); + + Q_PROPERTY( QString CodecType READ CodecType WRITE setCodecType ) + Q_PROPERTY( QString CodecName READ CodecName WRITE setCodecName ) + Q_PROPERTY( int Width READ Width WRITE setWidth ) + Q_PROPERTY( int Height READ Height WRITE setHeight ) + Q_PROPERTY( float AspectRatio READ AspectRatio WRITE setAspectRatio ) + Q_PROPERTY( QString FieldOrder READ FieldOrder WRITE setFieldOrder ) + Q_PROPERTY( float FrameRate READ FrameRate WRITE setFrameRate ) + Q_PROPERTY( float AvgFrameRate READ AvgFrameRate WRITE setAvgFrameRate ) + Q_PROPERTY( int Channels READ Channels WRITE setChannels ) + Q_PROPERTY( qlonglong Duration READ Duration WRITE setDuration ) + + PROPERTYIMP_REF( QString , CodecType ) + PROPERTYIMP_REF( QString , CodecName ) + PROPERTYIMP ( int , Width ) + PROPERTYIMP ( int , Height ) + PROPERTYIMP ( float , AspectRatio ) + PROPERTYIMP_REF( QString , FieldOrder ) + PROPERTYIMP ( float , FrameRate ) + PROPERTYIMP ( float , AvgFrameRate ) + PROPERTYIMP ( int , Channels ) + PROPERTYIMP ( qlonglong , Duration ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE VideoStreamInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Width ( 0 ), + m_Height ( 0 ), + m_AspectRatio ( 0 ), + m_FrameRate ( 0 ), + m_AvgFrameRate ( 0 ), + m_Channels ( 0 ), + m_Duration ( 0 ) + { + } + + void Copy( const VideoStreamInfo *src ) + { + m_CodecType = src->m_CodecType ; + m_CodecName = src->m_CodecName ; + m_Width = src->m_Width ; + m_Height = src->m_Height ; + m_AspectRatio = src->m_AspectRatio ; + m_FieldOrder = src->m_FieldOrder ; + m_FrameRate = src->m_FrameRate ; + m_AvgFrameRate = src->m_AvgFrameRate ; + m_Channels = src->m_Channels ; + m_Duration = src->m_Duration ; + } + + private: + Q_DISABLE_COPY(VideoStreamInfo); +}; + +inline void VideoStreamInfo::InitializeCustomTypes() +{ + qRegisterMetaType< VideoStreamInfo* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/videoStreamInfoList.h b/mythtv/libs/libmythservicecontracts/datacontracts/videoStreamInfoList.h new file mode 100644 index 00000000000..8986b8498a5 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/videoStreamInfoList.h @@ -0,0 +1,99 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: videoStreamInfoList.h +// Created : May. 30, 2020 +// +// Copyright (c) 2011 Peter Bennett +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef VIDEOSTREAMINFOLIST_H_ +#define VIDEOSTREAMINFOLIST_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +#include "videoStreamInfo.h" + +namespace DTC +{ + +class SERVICE_PUBLIC VideoStreamInfoList : public QObject +{ + Q_OBJECT + Q_CLASSINFO( "version", "1.00" ); + + // Q_CLASSINFO Used to augment Metadata for properties. + // See datacontracthelper.h for details + + Q_CLASSINFO( "VideoStreamInfos", "type=DTC::VideoStreamInfo"); + Q_CLASSINFO( "AsOf" , "transient=true" ); + + Q_PROPERTY( int Count READ Count WRITE setCount ) + Q_PROPERTY( QDateTime AsOf READ AsOf WRITE setAsOf ) + Q_PROPERTY( QString Version READ Version WRITE setVersion ) + Q_PROPERTY( QString ProtoVer READ ProtoVer WRITE setProtoVer ) + Q_PROPERTY( int ErrorCode READ ErrorCode WRITE setErrorCode ) + Q_PROPERTY( QString ErrorMsg READ ErrorMsg WRITE setErrorMsg ) + + Q_PROPERTY( QVariantList VideoStreamInfos READ VideoStreamInfos ) + + PROPERTYIMP ( int , Count ) + PROPERTYIMP_REF ( QDateTime , AsOf ) + PROPERTYIMP_REF ( QString , Version ) + PROPERTYIMP_REF ( QString , ProtoVer ) + PROPERTYIMP ( int , ErrorCode ) + PROPERTYIMP_REF ( QString , ErrorMsg ) + + PROPERTYIMP_RO_REF( QVariantList, VideoStreamInfos ); + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE VideoStreamInfoList(QObject *parent = nullptr) + : QObject( parent ), + m_Count ( 0 ) + { + } + + void Copy( const VideoStreamInfoList *src ) + { + m_Count = src->m_Count ; + m_AsOf = src->m_AsOf ; + m_Version = src->m_Version ; + m_ProtoVer = src->m_ProtoVer ; + m_ErrorCode = src->m_ErrorCode ; + m_ErrorMsg = src->m_ErrorMsg ; + + CopyListContents< VideoStreamInfo >( this, m_VideoStreamInfos, src->m_VideoStreamInfos ); + } + + VideoStreamInfo *AddNewVideoStreamInfo() + { + // We must make sure the object added to the QVariantList has + // a parent of 'this' + + auto *pObject = new VideoStreamInfo( this ); + m_VideoStreamInfos.append( QVariant::fromValue( pObject )); + + return pObject; + } + + private: + Q_DISABLE_COPY(VideoStreamInfoList); +}; + +inline void VideoStreamInfoList::InitializeCustomTypes() +{ + qRegisterMetaType< VideoStreamInfoList* >(); + + VideoStreamInfo::InitializeCustomTypes(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/datacontracts/wolInfo.h b/mythtv/libs/libmythservicecontracts/datacontracts/wolInfo.h new file mode 100644 index 00000000000..3bf9d8d3a47 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/datacontracts/wolInfo.h @@ -0,0 +1,72 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: wolInfo.h +// Created : Jan. 15, 2010 +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef WOLINFO_H_ +#define WOLINFO_H_ + +#include + +#include "libmythservicecontracts/serviceexp.h" +#include "libmythservicecontracts/datacontracthelper.h" + +namespace DTC +{ + +class SERVICE_PUBLIC WOLInfo : public QObject +{ + Q_OBJECT + + Q_CLASSINFO( "version" , "1.0" ); + Q_CLASSINFO( "defaultProp", "Command" ); + + Q_PROPERTY( bool Enabled READ Enabled WRITE setEnabled ) + Q_PROPERTY( int Reconnect READ Reconnect WRITE setReconnect ) + Q_PROPERTY( int Retry READ Retry WRITE setRetry ) + Q_PROPERTY( QString Command READ Command WRITE setCommand ) + + PROPERTYIMP ( bool , Enabled ) + PROPERTYIMP ( int , Reconnect ) + PROPERTYIMP ( int , Retry ) + PROPERTYIMP_REF( QString, Command ) + + public: + + static inline void InitializeCustomTypes(); + + Q_INVOKABLE WOLInfo(QObject *parent = nullptr) + : QObject ( parent ), + m_Enabled ( false ), + m_Reconnect( 0 ), + m_Retry ( 0 ) + { + } + + void Copy( const WOLInfo *src ) + { + m_Enabled = src->m_Enabled ; + m_Reconnect= src->m_Reconnect; + m_Retry = src->m_Retry ; + m_Command = src->m_Command ; + } + + private: + Q_DISABLE_COPY(WOLInfo); +}; + +using WOLInfoPtr = WOLInfo*; + +inline void WOLInfo::InitializeCustomTypes() +{ + qRegisterMetaType< WOLInfo* >(); +} + +} // namespace DTC + +#endif diff --git a/mythtv/libs/libmythservicecontracts/libmythservicecontracts.pro b/mythtv/libs/libmythservicecontracts/libmythservicecontracts.pro index 8a18a38d4b6..a28718a8fe8 100644 --- a/mythtv/libs/libmythservicecontracts/libmythservicecontracts.pro +++ b/mythtv/libs/libmythservicecontracts/libmythservicecontracts.pro @@ -20,25 +20,96 @@ INCLUDEPATH += .. HEADERS += serviceexp.h service.h datacontracthelper.h +HEADERS += services/mythServices.h services/guideServices.h +HEADERS += services/contentServices.h services/dvrServices.h +HEADERS += services/channelServices.h services/videoServices.h +HEADERS += services/captureServices.h services/musicServices.h HEADERS += services/frontendServices.h +HEADERS += services/imageServices.h HEADERS += services/rttiServices.h HEADERS += datacontracts/enum.h datacontracts/enumItem.h -HEADERS += datacontracts/frontendActionList.h datacontracts/frontendStatus.h +HEADERS += datacontracts/connectionInfo.h datacontracts/databaseInfo.h +HEADERS += datacontracts/programAndChannel.h datacontracts/programGuide.h +HEADERS += datacontracts/recording.h datacontracts/settingList.h +HEADERS += datacontracts/wolInfo.h datacontracts/programList.h +HEADERS += datacontracts/encoder.h datacontracts/encoderList.h +HEADERS += datacontracts/storageGroupDir.h datacontracts/storageGroupDirList.h +HEADERS += datacontracts/channelInfoList.h datacontracts/videoSource.h +HEADERS += datacontracts/videoSourceList.h datacontracts/videoMultiplex.h +HEADERS += datacontracts/videoMultiplexList.h datacontracts/videoMetadataInfo.h +HEADERS += datacontracts/videoMetadataInfoList.h datacontracts/blurayInfo.h +HEADERS += datacontracts/videoStreamInfoList.h datacontracts/videoStreamInfo.h +HEADERS += datacontracts/timeZoneInfo.h datacontracts/videoLookupInfo.h +HEADERS += datacontracts/videoLookupInfoList.h datacontracts/versionInfo.h +HEADERS += datacontracts/lineup.h datacontracts/captureCard.h +HEADERS += datacontracts/captureCardList.h datacontracts/recRule.h +HEADERS += datacontracts/recRuleList.h datacontracts/artworkInfo.h +HEADERS += datacontracts/artworkInfoList.h datacontracts/frontendStatus.h +HEADERS += datacontracts/frontendActionList.h HEADERS += datacontracts/liveStreamInfo.h datacontracts/liveStreamInfoList.h +HEADERS += datacontracts/titleInfo.h datacontracts/titleInfoList.h +HEADERS += datacontracts/labelValue.h +HEADERS += datacontracts/logMessage.h datacontracts/logMessageList.h +HEADERS += datacontracts/imageMetadataInfoList.h datacontracts/imageMetadataInfo.h +HEADERS += datacontracts/imageSyncInfo.h datacontracts/channelGroup.h +HEADERS += datacontracts/channelGroupList.h datacontracts/input.h +HEADERS += datacontracts/inputList.h +HEADERS += datacontracts/recRuleFilter.h datacontracts/recRuleFilterList.h +HEADERS += datacontracts/castMember.h datacontracts/castMemberList.h HEADERS += datacontracts/frontend.h datacontracts/frontendList.h +HEADERS += datacontracts/cutting.h datacontracts/cutList.h +HEADERS += datacontracts/markup.h datacontracts/markupList.h +HEADERS += datacontracts/backendInfo.h datacontracts/envInfo.h +HEADERS += datacontracts/buildInfo.h datacontracts/logInfo.h +HEADERS += datacontracts/genre.h datacontracts/genreList.h +HEADERS += datacontracts/musicMetadataInfo.h datacontracts/musicMetadataInfoList.h SOURCES += service.cpp inc.path = $${PREFIX}/include/mythtv/libmythservicecontracts/ inc.files = serviceexp.h service.h datacontracthelper.h +incServices.path = $${PREFIX}/include/mythtv/libmythservicecontracts/services/ +incServices.files = services/mythServices.h services/guideServices.h +incServices.files += services/contentServices.h services/dvrServices.h +incServices.files += services/channelServices.h services/videoServices.h +incServices.files += services/captureServices.h services/musicServices.h incServices.files += services/frontendServices.h +incServices.files += services/imageServices.h incServices.files += services/rttiServices.h +incDatacontracts.path = $${PREFIX}/include/mythtv/libmythservicecontracts/datacontracts/ +incDatacontracts.files = datacontracts/connectionInfo.h datacontracts/databaseInfo.h +incDatacontracts.files += datacontracts/programAndChannel.h datacontracts/programGuide.h +incDatacontracts.files += datacontracts/recording.h datacontracts/settingList.h +incDatacontracts.files += datacontracts/wolInfo.h datacontracts/channelInfoList.h +incDatacontracts.files += datacontracts/videoSource.h datacontracts/videoSourceList.h +incDatacontracts.files += datacontracts/videoMultiplex.h datacontracts/videoMultiplexList.h +incDatacontracts.files += datacontracts/videoMetadataInfo.h datacontracts/videoMetadataInfoList.h +incDatacontracts.files += datacontracts/videoSTreamInfo.h datacontracts/videoStreamInfoList.h +incDatacontracts.files += datacontracts/musicMetadataInfo.h datacontracts/musicMetadataInfoList.h +incDatacontracts.files += datacontracts/blurayInfo.h datacontracts/videoLookupInfo.h +incDatacontracts.files += datacontracts/timeZoneInfo.h datacontracts/videoLookupInfoList.h +incDatacontracts.files += datacontracts/versionInfo.h datacontracts/lineup.h +incDatacontracts.files += datacontracts/captureCard.h datacontracts/captureCardList.h +incDatacontracts.files += datacontracts/recRule.h datacontracts/recRuleList.h +incDatacontracts.files += datacontracts/artworkInfo.h datacontracts/artworkInfoList.h incDatacontracts.files += datacontracts/frontendStatus.h datacontracts/frontendActionList.h incDatacontracts.files += datacontracts/liveStreamInfo.h datacontracts/liveStreamInfoList.h +incDatacontracts.files += datacontracts/titleInfo.h datacontracts/titleInfoList.h +incDatacontracts.files += datacontracts/labelValue.h +incDatacontracts.files += datacontracts/logMessage.h datacontracts/logMessageList.h +incDatacontracts.files += datacontracts/imageMetadataInfoList.h datacontracts/imageMetadataInfo.h +incDatacontracts.files += datacontracts/imageSyncInfo.h datacontracts/channelGroup.h +incDatacontracts.files += datacontracts/channelGroupList.h datacontracts/input.h +incDatacontracts.files += datacontracts/inputList.h +incDatacontracts.files += datacontracts/recRuleFilter.h datacontracts/recRuleFilterList.h +incDatacontracts.files += datacontracts/castMember.h datacontracts/castMemberList.h incDatacontracts.files += datacontracts/enum.h datacontracts/enumItem.h +incDatacontracts.files += datacontracts/cutting.h datacontracts/cutList.h +incDatacontracts.files += datacontracts/backendInfo.h datacontracts/envInfo.h +incDatacontracts.files += datacontracts/buildInfo.h datacontracts/logInfo.h INSTALLS += inc incServices incDatacontracts diff --git a/mythtv/libs/libmythservicecontracts/services/captureServices.h b/mythtv/libs/libmythservicecontracts/services/captureServices.h new file mode 100644 index 00000000000..05c99ab4245 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/services/captureServices.h @@ -0,0 +1,125 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: captureServices.h +// Created : Sep. 21, 2011 +// +// Purpose - Capture Card Services API Interface definition +// +// Copyright (c) 2011 Robert McNamara +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef CAPTURESERVICES_H_ +#define CAPTURESERVICES_H_ + +#include +#include + +#include "libmythservicecontracts/service.h" + +#include "libmythservicecontracts/datacontracts/captureCard.h" +#include "libmythservicecontracts/datacontracts/captureCardList.h" + +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// +// Notes - +// +// * This implementation can't handle declared default parameters +// +// * When called, any missing params are sent default values for its datatype +// +// * Q_CLASSINFO( "_Method", ...) is used to determine HTTP method +// type. Defaults to "BOTH", available values: +// "GET", "POST" or "BOTH" +// +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC CaptureServices : public Service +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.4" ); + Q_CLASSINFO( "RemoveCaptureCard_Method", "POST" ) + Q_CLASSINFO( "AddCaptureCard_Method", "POST" ) + Q_CLASSINFO( "UpdateCaptureCard_Method", "POST" ) + Q_CLASSINFO( "RemoveCardInput_Method", "POST" ) + Q_CLASSINFO( "AddCardInput_Method", "POST" ) + Q_CLASSINFO( "UpdateCardInput_Method", "POST" ) + + public: + + // Must call InitializeCustomTypes for each unique Custom Type used + // in public slots below. + + CaptureServices( QObject *parent = nullptr ) : Service( parent ) + { + DTC::CaptureCard::InitializeCustomTypes(); + DTC::CaptureCardList::InitializeCustomTypes(); + } + + public slots: + + virtual DTC::CaptureCardList* GetCaptureCardList ( const QString &HostName, + const QString &CardType ) = 0; + + virtual DTC::CaptureCard* GetCaptureCard ( int CardId ) = 0; + + virtual bool RemoveCaptureCard ( int CardId ) = 0; + + virtual int AddCaptureCard ( const QString &VideoDevice, + const QString &AudioDevice, + const QString &VBIDevice, + const QString &CardType, + uint AudioRateLimit, + const QString &HostName, + uint DVBSWFilter, + uint DVBSatType, + bool DVBWaitForSeqStart, + bool SkipBTAudio, + bool DVBOnDemand, + uint DVBDiSEqCType, + uint FirewireSpeed, + const QString &FirewireModel, + uint FirewireConnection, + uint SignalTimeout, + uint ChannelTimeout, + uint DVBTuningDelay, + uint Contrast, + uint Brightness, + uint Colour, + uint Hue, + uint DiSEqCId, + bool DVBEITScan) = 0; + + virtual bool UpdateCaptureCard ( int CardId, + const QString &Setting, + const QString &Value ) = 0; + + // Card Inputs + + virtual bool RemoveCardInput ( int CardInputId) = 0; + + virtual int AddCardInput ( uint CardId, + uint SourceId, + const QString &InputName, + const QString &ExternalCommand, + const QString &ChangerDevice, + const QString &ChangerModel, + const QString &HostName, + const QString &TuneChan, + const QString &StartChan, + const QString &DisplayName, + bool DishnetEIT, + uint RecPriority, + uint Quicktune, + uint SchedOrder, + uint LiveTVOrder) = 0; + + virtual bool UpdateCardInput ( int CardInputId, + const QString &Setting, + const QString &Value ) = 0; +}; + +#endif diff --git a/mythtv/libs/libmythservicecontracts/services/channelServices.h b/mythtv/libs/libmythservicecontracts/services/channelServices.h new file mode 100644 index 00000000000..cfb48f00a25 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/services/channelServices.h @@ -0,0 +1,180 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: channelServices.h +// Created : Apr. 8, 2011 +// +// Purpose - Channel Services API Interface definition +// +// Copyright (c) 2010 Robert McNamara +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef CHANNELSERVICES_H_ +#define CHANNELSERVICES_H_ + +#include "libmythservicecontracts/service.h" + +#include "libmythservicecontracts/datacontracts/channelInfoList.h" +#include "libmythservicecontracts/datacontracts/lineup.h" +#include "libmythservicecontracts/datacontracts/videoMultiplex.h" +#include "libmythservicecontracts/datacontracts/videoMultiplexList.h" +#include "libmythservicecontracts/datacontracts/videoSource.h" +#include "libmythservicecontracts/datacontracts/videoSourceList.h" + +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// +// Notes - +// +// * This implementation can't handle declared default parameters +// +// * When called, any missing params are sent default values for its datatype +// +// * Q_CLASSINFO( "_Method", ...) is used to determine HTTP method +// type. Defaults to "BOTH", available values: +// "GET", "POST" or "BOTH" +// +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC ChannelServices : public Service +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.10" ); + Q_CLASSINFO( "AddDBChannel_Method", "POST" ) + Q_CLASSINFO( "UpdateDBChannel_Method", "POST" ) + Q_CLASSINFO( "RemoveDBChannel_Method", "POST" ) + Q_CLASSINFO( "AddVideoSource_Method", "POST" ) + Q_CLASSINFO( "UpdateVideoSource_Method", "POST" ) + Q_CLASSINFO( "RemoveVideoSource_Method", "POST" ) + + public: + + // Must call InitializeCustomTypes for each unique Custom Type used + // in public slots below. + + ChannelServices( QObject *parent = nullptr ) : Service( parent ) + { + DTC::ChannelInfoList::InitializeCustomTypes(); + DTC::VideoSource::InitializeCustomTypes(); + DTC::VideoSourceList::InitializeCustomTypes(); + DTC::VideoMultiplex::InitializeCustomTypes(); + DTC::VideoMultiplexList::InitializeCustomTypes(); + DTC::Lineup::InitializeCustomTypes(); + DTC::LineupList::InitializeCustomTypes(); + } + + public slots: + + /* Channel Methods */ + + virtual DTC::ChannelInfoList* GetChannelInfoList ( uint SourceID, + uint ChannelGroupID, + uint StartIndex, + uint Count, + bool OnlyVisible, + bool Details, + bool OrderByName, + bool GroupByCallsign, + bool OnlyTunable ) = 0; + + virtual DTC::ChannelInfo* GetChannelInfo ( uint ChanID ) = 0; + + virtual bool AddDBChannel ( uint MplexID, + uint SourceID, + uint ChannelID, + const QString &CallSign, + const QString &ChannelName, + const QString &ChannelNumber, + uint ServiceID, + uint ATSCMajorChannel, + uint ATSCMinorChannel, + bool UseEIT, + bool Visible, + const QString &ExtendedVisible, + const QString &FrequencyID, + const QString &Icon, + const QString &Format, + const QString &XMLTVID, + const QString &DefaultAuthority, + uint ServiceType ) = 0; + + virtual bool UpdateDBChannel ( uint MplexID, + uint SourceID, + uint ChannelID, + const QString &CallSign, + const QString &ChannelName, + const QString &ChannelNumber, + uint ServiceID, + uint ATSCMajorChannel, + uint ATSCMinorChannel, + bool UseEIT, + bool Visible, + const QString &ExtendedVisible, + const QString &FrequencyID, + const QString &Icon, + const QString &Format, + const QString &XMLTVID, + const QString &DefaultAuthority, + uint ServiceType ) = 0; + + virtual bool RemoveDBChannel ( uint ChannelID ) = 0; + + /* Video Source Methods */ + + virtual DTC::VideoSourceList* GetVideoSourceList ( void ) = 0; + + virtual DTC::VideoSource* GetVideoSource ( uint SourceID ) = 0; + + virtual int AddVideoSource ( const QString &SourceName, + const QString &Grabber, + const QString &UserId, + const QString &FreqTable, + const QString &LineupId, + const QString &Password, + bool UseEIT, + const QString &ConfigPath, + int NITId, + uint BouquetId, + uint RegionId, + uint ScanFrequency, + uint LCNOffset ) = 0; + + virtual bool RemoveVideoSource ( uint SourceID ) = 0; + + virtual bool UpdateVideoSource ( uint SourceID, + const QString &SourceName, + const QString &Grabber, + const QString &UserId, + const QString &FreqTable, + const QString &LineupId, + const QString &Password, + bool UseEIT, + const QString &ConfigPath, + int NITId, + uint BouquetId, + uint RegionId, + uint ScanFrequency, + uint LCNOffset ) = 0; + + virtual DTC::LineupList* GetDDLineupList ( const QString &Source, + const QString &UserId, + const QString &Password ) = 0; + + virtual int FetchChannelsFromSource( uint SourceId, + uint CardId, + bool WaitForFinish ) = 0; + + /* Multiplex Methods */ + + virtual DTC::VideoMultiplexList* GetVideoMultiplexList ( uint SourceID, + uint StartIndex, + uint Count ) = 0; + + virtual DTC::VideoMultiplex* GetVideoMultiplex ( uint MplexID ) = 0; + + virtual QStringList GetXMLTVIdList ( uint SourceID ) = 0; +}; + +#endif diff --git a/mythtv/libs/libmythservicecontracts/services/contentServices.h b/mythtv/libs/libmythservicecontracts/services/contentServices.h new file mode 100644 index 00000000000..724ee3b375d --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/services/contentServices.h @@ -0,0 +1,147 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: contentServices.h +// Created : Mar. 7, 2011 +// +// Purpose - Content Services API Interface definition +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef CONTENTSERVICES_H_ +#define CONTENTSERVICES_H_ + +#include +#include + +#include "libmythservicecontracts/service.h" + +#include "libmythservicecontracts/datacontracts/artworkInfoList.h" +#include "libmythservicecontracts/datacontracts/liveStreamInfoList.h" + +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// +// Notes - +// +// * This implementation can't handle declared default parameters +// +// * When called, any missing params are sent default values for its datatype +// +// * Q_CLASSINFO( "_Method", ...) is used to determine HTTP method +// type. Defaults to "BOTH", available values: +// "GET", "POST" or "BOTH" +// +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC ContentServices : public Service //, public QScriptable ??? +{ + Q_OBJECT + Q_CLASSINFO( "version" , "2.0" ); + Q_CLASSINFO( "DownloadFile_Method", "POST" ) + + public: + + // Must call InitializeCustomTypes for each unique Custom Type used + // in public slots below. + + ContentServices( QObject *parent = nullptr ) : Service( parent ) + { + DTC::ArtworkInfoList::InitializeCustomTypes(); + DTC::LiveStreamInfoList::InitializeCustomTypes(); + } + + public slots: + + virtual QFileInfo GetFile ( const QString &StorageGroup, + const QString &FileName ) = 0; + + virtual QFileInfo GetImageFile ( const QString &StorageGroup, + const QString &FileName, + int Width, int Height ) = 0; + + virtual QStringList GetFileList ( const QString &StorageGroup ) = 0; + + virtual QStringList GetDirList ( const QString &StorageGroup ) = 0; + + virtual QFileInfo GetRecordingArtwork ( const QString &Type, + const QString &Inetref, + int Season, int Width, + int Height ) = 0; + + virtual DTC::ArtworkInfoList* + GetRecordingArtworkList( int RecordedId, + int ChanId, + const QDateTime &StartTime ) = 0; + + virtual DTC::ArtworkInfoList* + GetProgramArtworkList( const QString &Inetref, + int Season ) = 0; + + + virtual QFileInfo GetVideoArtwork ( const QString &Type, + int Id, int Width, + int Height ) = 0; + + virtual QFileInfo GetAlbumArt ( int Id, int Width, int Height ) = 0; + + virtual QFileInfo GetPreviewImage ( int RecordedId, + int ChanId, + const QDateTime &StartTime, + int Width, + int Height, + int SecsIn, + const QString &Format) = 0; + + virtual QFileInfo GetRecording ( int RecordedId, + int ChanId, + const QDateTime &StartTime ) = 0; + + virtual QFileInfo GetMusic ( int Id ) = 0; + virtual QFileInfo GetVideo ( int Id ) = 0; + + virtual QString GetHash ( const QString &StorageGroup, + const QString &FileName ) = 0; + + virtual bool DownloadFile ( const QString &URL, + const QString &StorageGroup ) = 0; + + virtual DTC::LiveStreamInfo *AddLiveStream ( const QString &StorageGroup, + const QString &FileName, + const QString &HostName, + int MaxSegments, + int Width, + int Height, + int Bitrate, + int AudioBitrate, + int SampleRate ) = 0; + + virtual DTC::LiveStreamInfo *AddRecordingLiveStream ( int RecordedId, + int ChanId, + const QDateTime &StartTime, + int MaxSegments, + int Width, + int Height, + int Bitrate, + int AudioBitrate, + int SampleRate ) = 0; + + virtual DTC::LiveStreamInfo *AddVideoLiveStream ( int Id, + int MaxSegments, + int Width, + int Height, + int Bitrate, + int AudioBitrate, + int SampleRate ) = 0; + + virtual DTC::LiveStreamInfo *GetLiveStream ( int Id ) = 0; + virtual DTC::LiveStreamInfoList *GetLiveStreamList ( const QString &FileName ) = 0; + + virtual DTC::LiveStreamInfo *StopLiveStream ( int Id ) = 0; + virtual bool RemoveLiveStream ( int Id ) = 0; +}; + +#endif diff --git a/mythtv/libs/libmythservicecontracts/services/dvrServices.h b/mythtv/libs/libmythservicecontracts/services/dvrServices.h new file mode 100644 index 00000000000..b63f69ec9dd --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/services/dvrServices.h @@ -0,0 +1,353 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: dvrServices.h +// Created : Mar. 7, 2011 +// +// Purpose - DVR Services API Interface definition +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef DVRSERVICES_H_ +#define DVRSERVICES_H_ + +#include "libmythservicecontracts/service.h" + +#include "libmythservicecontracts/datacontracts/cutList.h" +#include "libmythservicecontracts/datacontracts/encoderList.h" +#include "libmythservicecontracts/datacontracts/input.h" +#include "libmythservicecontracts/datacontracts/inputList.h" +#include "libmythservicecontracts/datacontracts/markupList.h" +#include "libmythservicecontracts/datacontracts/programList.h" +#include "libmythservicecontracts/datacontracts/recRule.h" +#include "libmythservicecontracts/datacontracts/recRuleFilter.h" +#include "libmythservicecontracts/datacontracts/recRuleFilterList.h" +#include "libmythservicecontracts/datacontracts/recRuleList.h" +#include "libmythservicecontracts/datacontracts/titleInfoList.h" + +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// +// Notes - +// +// * This implementation can't handle declared default parameters +// +// * When called, any missing params are sent default values for its datatype +// +// * Q_CLASSINFO( "_Method", ...) is used to determine HTTP method +// type. Defaults to "BOTH", available values: +// "GET", "POST" or "BOTH" +// +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC DvrServices : public Service //, public QScriptable ??? +{ + Q_OBJECT + Q_CLASSINFO( "version" , "7.0" ) + Q_CLASSINFO( "RemoveRecorded_Method", "POST" ) + Q_CLASSINFO( "AddRecordedCredits_Method", "POST" ) + Q_CLASSINFO( "AddRecordedProgram_Method", "POST" ) + Q_CLASSINFO( "DeleteRecording_Method", "POST" ) + Q_CLASSINFO( "UnDeleteRecording", "POST" ) + Q_CLASSINFO( "UpdateRecordedWatchedStatus_Method", "POST" ) + Q_CLASSINFO( "SetSavedBookmark_Method", "POST" ) + Q_CLASSINFO( "AddRecordSchedule_Method", "POST" ) + Q_CLASSINFO( "UpdateRecordSchedule_Method", "POST" ) + Q_CLASSINFO( "RemoveRecordSchedule_Method", "POST" ) + Q_CLASSINFO( "AddDontRecordSchedule", "POST" ) + Q_CLASSINFO( "EnableRecordSchedule_Method", "POST" ) + Q_CLASSINFO( "DisableRecordSchedule_Method", "POST" ) + Q_CLASSINFO( "ManageJobQueue_Method", "POST" ) + Q_CLASSINFO( "SetRecordedMarkup_Method", "POST" ) + + + public: + + // Must call InitializeCustomTypes for each unique Custom Type used + // in public slots below. + + DvrServices( QObject *parent = nullptr ) : Service( parent ) + { + DTC::ProgramList::InitializeCustomTypes(); + DTC::EncoderList::InitializeCustomTypes(); + DTC::InputList::InitializeCustomTypes(); + DTC::RecRuleList::InitializeCustomTypes(); + DTC::TitleInfoList::InitializeCustomTypes(); + DTC::RecRuleFilterList::InitializeCustomTypes(); + DTC::CutList::InitializeCustomTypes(); + DTC::MarkupList::InitializeCustomTypes(); + } + + public slots: + + virtual DTC::ProgramList* GetExpiringList ( int StartIndex, + int Count ) = 0; + + virtual DTC::ProgramList* GetRecordedList ( bool Descending, + int StartIndex, + int Count, + const QString &TitleRegEx, + const QString &RecGroup, + const QString &StorageGroup, + const QString &Category, + const QString &Sort, + bool IgnoreLiveTV, + bool IgnoreDeleted ) = 0; + + virtual DTC::ProgramList* GetOldRecordedList ( bool Descending, + int StartIndex, + int Count, + const QDateTime &StartTime, + const QDateTime &EndTime, + const QString &Title, + const QString &SeriesId, + int RecordId, + const QString &Sort) = 0; + + virtual DTC::Program* GetRecorded ( int RecordedId, + int ChanId, + const QDateTime &StartTime ) = 0; + + virtual bool AddRecordedCredits ( int RecordedId, + const QJsonObject & json) = 0; + + virtual int AddRecordedProgram ( const QJsonObject & json ) = 0; + + virtual bool RemoveRecorded ( int RecordedId, + int ChanId, + const QDateTime &StartTime, + bool ForceDelete, + bool AllowRerecord ) = 0; + + virtual bool DeleteRecording ( int RecordedId, + int ChanId, + const QDateTime &StartTime, + bool ForceDelete, + bool AllowRerecord ) = 0; + + virtual bool UnDeleteRecording ( int RecordedId, + int ChanId, + const QDateTime &StartTime ) = 0; + + virtual bool StopRecording ( int RecordedId ) = 0; + + virtual bool ReactivateRecording ( int RecordedId, + int ChanId, + const QDateTime &StartTime ) = 0; + + virtual bool RescheduleRecordings ( void ) = 0; + + virtual bool AllowReRecord ( int RecordedId ) = 0; + + virtual bool UpdateRecordedWatchedStatus ( int RecordedId, + int ChanId, + const QDateTime &StartTime, + bool Watched) = 0; + + virtual long GetSavedBookmark ( int RecordedId, + int ChanId, + const QDateTime &StartTime, + const QString &OffsetType ) = 0; + + virtual bool SetSavedBookmark ( int RecordedId, + int ChanId, + const QDateTime &StartTime, + const QString &OffsetType, + long Offset ) = 0; + + virtual DTC::CutList* GetRecordedCutList ( int RecordedId, + int ChanId, + const QDateTime &StartTime, + const QString &OffsetType ) = 0; + + virtual DTC::CutList* GetRecordedCommBreak ( int RecordedId, + int ChanId, + const QDateTime &StartTime, + const QString &OffsetType ) = 0; + + virtual DTC::CutList* GetRecordedSeek ( int RecordedId, + const QString &OffsetType ) = 0; + + virtual DTC::MarkupList* GetRecordedMarkup ( int RecordedId ) = 0; + + virtual bool SetRecordedMarkup ( int RecordedId, + const QJsonObject & json ) = 0; + + virtual DTC::ProgramList* GetConflictList ( int StartIndex, + int Count, + int RecordId ) = 0; + + virtual DTC::ProgramList* GetUpcomingList ( int StartIndex, + int Count, + bool ShowAll, + int RecordId, + int RecStatus ) = 0; + + virtual DTC::EncoderList* GetEncoderList ( ) = 0; + + virtual DTC::InputList* GetInputList ( ) = 0; + + virtual QStringList GetRecGroupList ( ) = 0; + + virtual QStringList GetProgramCategories ( bool OnlyRecorded ) = 0; + + virtual QStringList GetRecStorageGroupList ( ) = 0; + + virtual QStringList GetPlayGroupList ( ) = 0; + + virtual DTC::RecRuleFilterList* GetRecRuleFilterList ( ) = 0; + + virtual QStringList GetTitleList ( const QString &RecGroup ) = 0; + + virtual DTC::TitleInfoList* GetTitleInfoList ( ) = 0; + + // Recording Rules + + virtual uint AddRecordSchedule ( const QString& Title, + const QString& Subtitle, + const QString& Description, + const QString& Category, + const QDateTime& StartTime, + const QDateTime& EndTime, + const QString& SeriesId, + const QString& ProgramId, + int ChanId, + const QString& Station, + int FindDay, + QTime FindTime, + int ParentId, + bool Inactive, + uint Season, + uint Episode, + const QString& Inetref, + QString Type, + QString SearchType, + int RecPriority, + uint PreferredInput, + int StartOffset, + int EndOffset, + const QDateTime& LastRecorded, + QString DupMethod, + QString DupIn, + bool NewEpisOnly, + uint Filter, + QString RecProfile, + QString RecGroup, + QString StorageGroup, + QString PlayGroup, + bool AutoExpire, + int MaxEpisodes, + bool MaxNewest, + bool AutoCommflag, + bool AutoTranscode, + bool AutoMetaLookup, + bool AutoUserJob1, + bool AutoUserJob2, + bool AutoUserJob3, + bool AutoUserJob4, + int Transcoder ) = 0; + + virtual bool UpdateRecordSchedule ( uint RecordId, + const QString& Title, + const QString& Subtitle, + const QString& Description, + const QString& Category, + const QDateTime& StartTime, + const QDateTime& EndTime, + const QString& SeriesId, + const QString& ProgramId, + int ChanId, + const QString& Station, + int FindDay, + QTime FindTime, + bool Inactive, + uint Season, + uint Episode, + const QString& Inetref, + QString Type, + QString SearchType, + int RecPriority, + uint PreferredInput, + int StartOffset, + int EndOffset, + QString DupMethod, + QString DupIn, + bool NewEpisOnly, + uint Filter, + QString RecProfile, + QString RecGroup, + QString StorageGroup, + QString PlayGroup, + bool AutoExpire, + int MaxEpisodes, + bool MaxNewest, + bool AutoCommflag, + bool AutoTranscode, + bool AutoMetaLookup, + bool AutoUserJob1, + bool AutoUserJob2, + bool AutoUserJob3, + bool AutoUserJob4, + int Transcoder ) = 0; + + virtual bool RemoveRecordSchedule ( uint RecordId ) = 0; + + virtual bool AddDontRecordSchedule ( int ChanId, + const QDateTime &StartTime, + bool NeverRecord ) = 0; + + virtual DTC::RecRuleList* GetRecordScheduleList ( int StartIndex, + int Count, + const QString &Sort, + bool Descending ) = 0; + + virtual DTC::RecRule* GetRecordSchedule ( uint RecordId, + const QString& Template, + int RecordedId, + int ChanId, + const QDateTime& StartTime, + bool MakeOverride ) = 0; + + virtual bool EnableRecordSchedule ( uint RecordId ) = 0; + + virtual bool DisableRecordSchedule ( uint RecordId ) = 0; + + virtual int RecordedIdForKey ( int ChanId, + const QDateTime &StartTime ) = 0; + + virtual int RecordedIdForPathname ( const QString &Pathname ) = 0; + + // The following are all temporary, pending implementation of a + // 'enum metadata' endpoint + virtual QString RecStatusToString ( int RecStatus ) = 0; + + virtual QString RecStatusToDescription( int RecStatus, + int RecType, + const QDateTime &StartTime ) = 0; + + virtual QString RecTypeToString ( const QString& RecType ) = 0; + + virtual QString RecTypeToDescription ( const QString& RecType ) = 0; + + virtual QString DupMethodToString ( const QString& DupMethod ) = 0; + + virtual QString DupMethodToDescription( const QString& DupMethod ) = 0; + + virtual QString DupInToString ( const QString& DupIn ) = 0; + + virtual QString DupInToDescription ( const QString& DupIn ) = 0; + + virtual int ManageJobQueue ( const QString &Action, + const QString &JobName, + int JobId, + int RecordedId, + QDateTime JobStartTime, + QString RemoteHost, + QString JobArgs ) = 0; + +}; + +#endif diff --git a/mythtv/libs/libmythservicecontracts/services/guideServices.h b/mythtv/libs/libmythservicecontracts/services/guideServices.h new file mode 100644 index 00000000000..3da17e06f8f --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/services/guideServices.h @@ -0,0 +1,107 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: guideservices.h +// Created : Mar. 7, 2011 +// +// Purpose - Program Guide Services API Interface definition +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef GUIDESERVICES_H_ +#define GUIDESERVICES_H_ + +#include + +#include "libmythservicecontracts/service.h" + +#include "libmythservicecontracts/datacontracts/channelGroupList.h" +#include "libmythservicecontracts/datacontracts/programAndChannel.h" +#include "libmythservicecontracts/datacontracts/programGuide.h" +#include "libmythservicecontracts/datacontracts/programList.h" + +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// +// Notes - +// +// * This implementation can't handle declared default parameters +// +// * When called, any missing params are sent default values for its datatype +// +// * Q_CLASSINFO( "_Method", ...) is used to determine HTTP method +// type. Defaults to "BOTH", available values: +// "GET", "POST" or "BOTH" +// +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC GuideServices : public Service //, public QScriptable ??? +{ + Q_OBJECT + Q_CLASSINFO( "version" , "2.4" ) + Q_CLASSINFO( "AddToChannelGroup_Method", "POST" ) + Q_CLASSINFO( "RemoveFromChannelGroup_Method", "POST" ) + + public: + + // Must call InitializeCustomTypes for each unique Custom Type used + // in public slots below. + + GuideServices( QObject *parent = nullptr ) : Service( parent ) + { + DTC::ProgramGuide::InitializeCustomTypes(); + DTC::ProgramList ::InitializeCustomTypes(); + DTC::Program ::InitializeCustomTypes(); + DTC::ChannelGroup::InitializeCustomTypes(); + DTC::ChannelGroupList::InitializeCustomTypes(); + } + + public slots: + + virtual DTC::ProgramGuide* GetProgramGuide ( const QDateTime &StartTime , + const QDateTime &EndTime , + bool Details, + int ChannelGroupId, + int StartIndex, + int Count, + bool WithInvisible) = 0; + + virtual DTC::ProgramList* GetProgramList ( int StartIndex, + int Count, + const QDateTime &StartTime , + const QDateTime &EndTime , + int ChanId, + const QString &TitleFilter, + const QString &CategoryFilter, + const QString &PersonFilter, + const QString &KeywordFilter, + bool OnlyNew, + bool Details, + const QString &Sort, + bool Descending, + bool WithInvisible) = 0; + + virtual DTC::Program* GetProgramDetails ( int ChanId, + const QDateTime &StartTime ) = 0; + + virtual QFileInfo GetChannelIcon ( int ChanId, + int Width , + int Height ) = 0; + + virtual DTC::ChannelGroupList* GetChannelGroupList ( bool IncludeEmpty ) = 0; + + virtual QStringList GetCategoryList ( ) = 0; + + virtual QStringList GetStoredSearches ( const QString &Type ) = 0; + + virtual bool AddToChannelGroup ( int ChannelGroupId, + int ChanId ) = 0; + + virtual bool RemoveFromChannelGroup ( int ChannelGroupId, + int ChanId ) = 0; +}; + +#endif diff --git a/mythtv/libs/libmythservicecontracts/services/imageServices.h b/mythtv/libs/libmythservicecontracts/services/imageServices.h new file mode 100644 index 00000000000..f64ce12f69a --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/services/imageServices.h @@ -0,0 +1,54 @@ +#ifndef IMAGESERVICES_H_ +#define IMAGESERVICES_H_ + +#include +#include + +#include "libmythservicecontracts/service.h" + +#include "libmythservicecontracts/datacontracts/imageMetadataInfoList.h" +#include "libmythservicecontracts/datacontracts/imageSyncInfo.h" + + + +class SERVICE_PUBLIC ImageServices : public Service +{ + Q_OBJECT + Q_CLASSINFO( "version" , "2.0" ) + Q_CLASSINFO( "RemoveImage_Method", "POST" ) + Q_CLASSINFO( "RenameImage_Method", "POST" ) + Q_CLASSINFO( "StartSync_Method", "POST" ) + Q_CLASSINFO( "StopSync_Method", "POST" ) + Q_CLASSINFO( "CreateThumbnail_Method", "POST" ) + + public: + + // Must call InitializeCustomTypes for each unique + // Custom Type used in public slots below. + ImageServices( QObject *parent = nullptr ) : Service( parent ) + { + // Must call InitializeCustomTypes for each + // unique Custom Type used in public slots below. + DTC::ImageMetadataInfoList::InitializeCustomTypes(); + DTC::ImageSyncInfo::InitializeCustomTypes(); + } + + public slots: + + virtual QString GetImageInfo ( int Id, + const QString &Tag ) = 0; + + virtual DTC::ImageMetadataInfoList* GetImageInfoList ( int Id ) = 0; + + virtual bool RemoveImage ( int Id ) = 0; + virtual bool RenameImage ( int Id, + const QString &NewName ) = 0; + + virtual bool StartSync ( void ) = 0; + virtual bool StopSync ( void ) = 0; + virtual DTC::ImageSyncInfo* GetSyncStatus ( void ) = 0; + + virtual bool CreateThumbnail ( int Id ) = 0; +}; + +#endif diff --git a/mythtv/libs/libmythservicecontracts/services/musicServices.h b/mythtv/libs/libmythservicecontracts/services/musicServices.h new file mode 100644 index 00000000000..594bdfabed6 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/services/musicServices.h @@ -0,0 +1,64 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: musicServices.h +// Created : July 20, 2017 +// +// Purpose - Imported Music Services API Interface definition +// +// Copyright (c) 2017 Paul Harrison +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef MUSICSERVICES_H_ +#define MUSICSERVICES_H_ + +#include +#include + +#include "libmythservicecontracts/service.h" + +#include "libmythservicecontracts/datacontracts/musicMetadataInfoList.h" + +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// +// Notes - +// +// * This implementation can't handle declared default parameters +// +// * When called, any missing params are sent default values for its datatype +// +// * Q_CLASSINFO( "_Method", ...) is used to determine HTTP method +// type. Defaults to "BOTH", available values: +// "GET", "POST" or "BOTH" +// +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC MusicServices : public Service //, public QScriptable ??? +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.0" ); + + public: + + // Must call InitializeCustomTypes for each unique Custom Type used + // in public slots below. + + MusicServices( QObject *parent = nullptr ) : Service( parent ) + { + DTC::MusicMetadataInfoList::InitializeCustomTypes(); + } + + public slots: + + // Music Metadata + + virtual DTC::MusicMetadataInfoList* GetTrackList ( int StartIndex, + int Count ) = 0; + + virtual DTC::MusicMetadataInfo* GetTrack ( int Id ) = 0; +}; + +#endif diff --git a/mythtv/libs/libmythservicecontracts/services/mythServices.h b/mythtv/libs/libmythservicecontracts/services/mythServices.h new file mode 100644 index 00000000000..1e2cbf59e3d --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/services/mythServices.h @@ -0,0 +1,193 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: mythservices.h +// Created : Jan. 19, 2010 +// +// Purpose - Myth Services API Interface definition +// +// Copyright (c) 2010 David Blain +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef MYTHSERVICES_H_ +#define MYTHSERVICES_H_ + +#include + +#include "libmythservicecontracts/service.h" + +#include "libmythservicecontracts/datacontracts/backendInfo.h" +#include "libmythservicecontracts/datacontracts/connectionInfo.h" +#include "libmythservicecontracts/datacontracts/frontendList.h" +#include "libmythservicecontracts/datacontracts/logMessage.h" +#include "libmythservicecontracts/datacontracts/logMessageList.h" +#include "libmythservicecontracts/datacontracts/settingList.h" +#include "libmythservicecontracts/datacontracts/storageGroupDirList.h" +#include "libmythservicecontracts/datacontracts/timeZoneInfo.h" + +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// +// Notes - +// +// * This implementation can't handle declared default parameters +// +// * When called, any missing params are sent default values for its datatype +// +// * Q_CLASSINFO( "_Method", ...) is used to determine HTTP method +// type. Defaults to "BOTH", available values: +// "GET", "POST" or "BOTH" +// +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC MythServices : public Service //, public QScriptable ??? +{ + Q_OBJECT + Q_CLASSINFO( "version" , "5.2" ); + Q_CLASSINFO( "AddStorageGroupDir_Method", "POST" ) + Q_CLASSINFO( "RemoveStorageGroupDir_Method", "POST" ) + Q_CLASSINFO( "PutSetting_Method", "POST" ) + Q_CLASSINFO( "ChangePassword_Method", "POST" ) + Q_CLASSINFO( "TestDBSettings_Method", "POST" ) + Q_CLASSINFO( "SendMessage_Method", "POST" ) + Q_CLASSINFO( "SendNotification_Method", "POST" ) + Q_CLASSINFO( "BackupDatabase_Method", "POST" ) + Q_CLASSINFO( "CheckDatabase_Method", "POST" ) + Q_CLASSINFO( "DelayShutdown_Method", "POST" ) + Q_CLASSINFO( "ProfileSubmit_Method", "POST" ) + Q_CLASSINFO( "ProfileDelete_Method", "POST" ) + Q_CLASSINFO( "ManageDigestUser_Method", "POST" ) + Q_CLASSINFO( "ManageUrlProtection_Method", "POST" ) + + public: + + // Must call InitializeCustomTypes for each unique Custom Type used + // in public slots below. + + MythServices( QObject *parent = nullptr ) : Service( parent ) + { + DTC::ConnectionInfo ::InitializeCustomTypes(); + DTC::SettingList ::InitializeCustomTypes(); + DTC::StorageGroupDirList::InitializeCustomTypes(); + DTC::TimeZoneInfo ::InitializeCustomTypes(); + DTC::LogMessage ::InitializeCustomTypes(); + DTC::LogMessageList ::InitializeCustomTypes(); + DTC::FrontendList ::InitializeCustomTypes(); + DTC::BackendInfo ::InitializeCustomTypes(); + } + + public slots: + + virtual DTC::ConnectionInfo* GetConnectionInfo ( const QString &Pin ) = 0; + + virtual QString GetHostName ( ) = 0; + virtual QStringList GetHosts ( ) = 0; + virtual QStringList GetKeys ( ) = 0; + + virtual DTC::StorageGroupDirList* GetStorageGroupDirs ( const QString &GroupName, + const QString &HostName ) = 0; + + virtual bool AddStorageGroupDir ( const QString &GroupName, + const QString &DirName, + const QString &HostName ) = 0; + + virtual bool RemoveStorageGroupDir( const QString &GroupName, + const QString &DirName, + const QString &HostName ) = 0; + + virtual DTC::TimeZoneInfo* GetTimeZone ( ) = 0; + + virtual QString GetFormatDate ( const QDateTime& Date, + bool ShortDate ) = 0; + virtual QString GetFormatDateTime ( const QDateTime& DateTime, + bool ShortDate ) = 0; + virtual QString GetFormatTime ( const QDateTime& Time ) = 0; + virtual QDateTime ParseISODateString ( const QString &DateTime ) = 0; + + virtual DTC::LogMessageList* GetLogs ( const QString &HostName, + const QString &Application, + int PID, + int TID, + const QString &Thread, + const QString &Filename, + int Line, + const QString &Function, + const QDateTime &FromTime, + const QDateTime &ToTime, + const QString &Level, + const QString &MsgContains ) = 0; + + virtual DTC::FrontendList* GetFrontends ( bool OnLine ) = 0; + + virtual QString GetSetting ( const QString &HostName, + const QString &Key, + const QString &Default ) = 0; + + virtual DTC::SettingList* GetSettingList ( const QString &HostName ) = 0; + + virtual bool PutSetting ( const QString &HostName, + const QString &Key, + const QString &Value ) = 0; + + virtual bool ChangePassword ( const QString &UserName, + const QString &OldPassword, + const QString &NewPassword ) = 0; + + virtual bool TestDBSettings ( const QString &HostName, + const QString &UserName, + const QString &Password, + const QString &DBName, + int dbPort) = 0; + + virtual bool SendMessage ( const QString &Message, + const QString &Address, + int udpPort, + int Timeout ) = 0; + + virtual bool SendNotification ( bool Error, + const QString &Type, + const QString &Message, + const QString &Origin, + const QString &Description, + const QString &Image, + const QString &Extra, + const QString &ProgressText, + float Progress, + int Timeout, + bool Fullscreen, + uint Visibility, + uint Priority, + const QString &Address, + int udpPort ) = 0; + + virtual bool BackupDatabase ( void ) = 0; + + virtual bool CheckDatabase ( bool Repair ) = 0; + + virtual bool DelayShutdown ( void ) = 0; + + virtual bool ProfileSubmit ( void ) = 0; + + virtual bool ProfileDelete ( void ) = 0; + + virtual QString ProfileURL ( void ) = 0; + + virtual QString ProfileUpdated ( void ) = 0; + + virtual QString ProfileText ( void ) = 0; + + virtual DTC::BackendInfo* GetBackendInfo ( void ) = 0; + + virtual bool ManageDigestUser ( const QString &Action, + const QString &UserName, + const QString &Password, + const QString &NewPassword, + const QString &AdminPassword ) = 0; + + virtual bool ManageUrlProtection ( const QString &Services, + const QString &AdminPassword) = 0; +}; + +#endif diff --git a/mythtv/libs/libmythservicecontracts/services/videoServices.h b/mythtv/libs/libmythservicecontracts/services/videoServices.h new file mode 100644 index 00000000000..0ef56c00242 --- /dev/null +++ b/mythtv/libs/libmythservicecontracts/services/videoServices.h @@ -0,0 +1,147 @@ +////////////////////////////////////////////////////////////////////////////// +// Program Name: contentServices.h +// Created : Apr. 21, 2011 +// +// Purpose - Imported Video Services API Interface definition +// +// Copyright (c) 2011 Robert McNamara +// +// Licensed under the GPL v2 or later, see LICENSE for details +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef VIDEOSERVICES_H_ +#define VIDEOSERVICES_H_ + +#include +#include + +#include "libmythservicecontracts/service.h" + +#include "libmythservicecontracts/datacontracts/blurayInfo.h" +#include "libmythservicecontracts/datacontracts/videoLookupInfoList.h" +#include "libmythservicecontracts/datacontracts/videoMetadataInfoList.h" +#include "libmythservicecontracts/datacontracts/videoStreamInfoList.h" + +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// +// Notes - +// +// * This implementation can't handle declared default parameters +// +// * When called, any missing params are sent default values for its datatype +// +// * Q_CLASSINFO( "_Method", ...) is used to determine HTTP method +// type. Defaults to "BOTH", available values: +// "GET", "POST" or "BOTH" +// +///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// + +class SERVICE_PUBLIC VideoServices : public Service //, public QScriptable ??? +{ + Q_OBJECT + Q_CLASSINFO( "version" , "1.5" ); + Q_CLASSINFO( "AddVideo_Method", "POST" ) + Q_CLASSINFO( "RemoveVideoFromDB_Method", "POST" ) + Q_CLASSINFO( "UpdateVideoWatchedStatus_Method", "POST" ) + Q_CLASSINFO( "UpdateVideoMetadata_Method", "POST" ) + Q_CLASSINFO( "SetSavedBookmark_Method", "POST" ) + + public: + + // Must call InitializeCustomTypes for each unique Custom Type used + // in public slots below. + + VideoServices( QObject *parent = nullptr ) : Service( parent ) + { + DTC::VideoMetadataInfoList::InitializeCustomTypes(); + DTC::VideoLookupList::InitializeCustomTypes(); + DTC::BlurayInfo::InitializeCustomTypes(); + DTC::VideoStreamInfoList::InitializeCustomTypes(); + } + + public slots: + + // Video Metadata + + virtual DTC::VideoMetadataInfoList* GetVideoList ( const QString &Folder, + const QString &Sort, + bool Descending, + int StartIndex, + int Count ) = 0; + + virtual DTC::VideoMetadataInfo* GetVideo ( int Id ) = 0; + + virtual DTC::VideoMetadataInfo* GetVideoByFileName ( const QString &FileName ) = 0; + + virtual DTC::VideoLookupList* LookupVideo ( const QString &Title, + const QString &Subtitle, + const QString &Inetref, + int Season, + int Episode, + const QString &GrabberType, + bool AllowGeneric) = 0; + + virtual bool AddVideo ( const QString &FileName, + const QString &HostName ) = 0; + + virtual bool RemoveVideoFromDB ( int Id ) = 0; + // Bluray Metadata + + virtual DTC::BlurayInfo* GetBluray ( const QString &Path ) = 0; + + virtual bool UpdateVideoWatchedStatus ( int Id, + bool Watched ) = 0; + + virtual bool UpdateVideoMetadata ( int Id, + const QString &Title, + const QString &SubTitle, + const QString &TagLine, + const QString &Director, + const QString &Studio, + const QString &Plot, + const QString &Rating, + const QString &Inetref, + int CollectionRef, + const QString &HomePage, + int Year, + const QDate &ReleaseDate, + float UserRating, + int Length, + int PlayCount, + int Season, + int Episode, + int ShowLevel, + const QString &FileName, + const QString &Hash, + const QString &CoverFile, + int ChildID, + bool Browse, + bool Watched, + bool Processed, + const QString &PlayCommand, + int Category, + const QString &Trailer, + const QString &Host, + const QString &Screenshot, + const QString &Banner, + const QString &Fanart, + const QDate &InsertDate, + const QString &ContentType, + const QString &Genres, + const QString &Cast, + const QString &Countries) = 0; + + virtual DTC::VideoStreamInfoList* GetStreamInfo ( const QString &StorageGroup, + const QString &FileName ) = 0; + + virtual long GetSavedBookmark ( int Id) = 0; + + virtual bool SetSavedBookmark ( int Id, + long Offset ) = 0; + +}; + +#endif