Skip to content

Commit

Permalink
Revert "Remove old service API code from backend"
Browse files Browse the repository at this point in the history
Reverting this because tests fail.

This reverts commit f8dad57.
  • Loading branch information
bennettpeter committed Dec 17, 2024
1 parent f8dad57 commit 708ced3
Show file tree
Hide file tree
Showing 72 changed files with 7,352 additions and 1 deletion.
70 changes: 70 additions & 0 deletions mythtv/libs/libmythservicecontracts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
67 changes: 67 additions & 0 deletions mythtv/libs/libmythservicecontracts/datacontracts/artworkInfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//////////////////////////////////////////////////////////////////////////////
// Program Name: artworkInfo.h
// Created : Nov. 12, 2011
//
// Copyright (c) 2011 Robert McNamara <[email protected]>
//
// Licensed under the GPL v2 or later, see LICENSE for details
//
//////////////////////////////////////////////////////////////////////////////

#ifndef ARTWORKINFO_H_
#define ARTWORKINFO_H_

#include <QString>

#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
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
//////////////////////////////////////////////////////////////////////////////
// Program Name: artworkInfoList.h
// Created : Nov. 12, 2011
//
// Copyright (c) 2011 Robert McNamara <[email protected]>
//
// Licensed under the GPL v2 or later, see LICENSE for details
//
//////////////////////////////////////////////////////////////////////////////

#ifndef ARTWORKINFOLIST_H_
#define ARTWORKINFOLIST_H_

#include <QString>
#include <QVariantList>

#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<QObject *>( pObject ));

return pObject;
}

private:
Q_DISABLE_COPY(ArtworkInfoList);
};

inline void ArtworkInfoList::InitializeCustomTypes()
{
qRegisterMetaType< ArtworkInfoList* >();

ArtworkInfo::InitializeCustomTypes();
}

} // namespace DTC

#endif
83 changes: 83 additions & 0 deletions mythtv/libs/libmythservicecontracts/datacontracts/backendInfo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
//////////////////////////////////////////////////////////////////////////////
// Program Name: backendInfo.h
// Created : Dec. 15, 2015
//
// Copyright (c) 2015 Bill Meek, from: 2010 David Blain <[email protected]>
//
// 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
Loading

0 comments on commit 708ced3

Please sign in to comment.