Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Dvr GetTitleInfoList Services API endpoint
Currently this returns a list of unique titles/InetRef combinations, but it could be extended to include other info later.
- Loading branch information
Showing
6 changed files
with
193 additions
and
0 deletions.
There are no files selected for viewing
67 changes: 67 additions & 0 deletions
67
mythtv/libs/libmythservicecontracts/datacontracts/titleInfo.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
//////////////////////////////////////////////////////////////////////////// | ||
// Program Name: titleInfo.h | ||
// Created : June 14, 2013 | ||
// | ||
// Copyright (c) 2013 Chris Pinkham <cpinkham@mythtv.org> | ||
// | ||
// Licensed under the GPL v2 or later, see COPYING for details | ||
// | ||
//////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef TITLEINFO_H_ | ||
#define TITLEINFO_H_ | ||
|
||
#include <QString> | ||
|
||
#include "serviceexp.h" | ||
#include "datacontracthelper.h" | ||
|
||
namespace DTC | ||
{ | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
|
||
class SERVICE_PUBLIC TitleInfo : public QObject | ||
{ | ||
Q_OBJECT | ||
Q_CLASSINFO( "version" , "1.0" ); | ||
|
||
Q_PROPERTY( QString Title READ Title WRITE setTitle ) | ||
Q_PROPERTY( QString Inetref READ Inetref WRITE setInetref ) | ||
|
||
PROPERTYIMP ( QString , Title ) | ||
PROPERTYIMP ( QString , Inetref ) | ||
|
||
public: | ||
|
||
static void InitializeCustomTypes() | ||
{ | ||
qRegisterMetaType< TitleInfo >(); | ||
qRegisterMetaType< TitleInfo* >(); | ||
} | ||
|
||
public: | ||
|
||
TitleInfo(QObject *parent = 0) | ||
: QObject ( parent ) | ||
{ | ||
} | ||
|
||
TitleInfo( const TitleInfo &src ) | ||
{ | ||
Copy( src ); | ||
} | ||
|
||
void Copy( const TitleInfo &src ) | ||
{ | ||
m_Title = src.m_Title ; | ||
m_Inetref = src.m_Inetref ; | ||
} | ||
}; | ||
|
||
} // namespace DTC | ||
|
||
Q_DECLARE_METATYPE( DTC::TitleInfo ) | ||
Q_DECLARE_METATYPE( DTC::TitleInfo* ) | ||
|
||
#endif |
83 changes: 83 additions & 0 deletions
83
mythtv/libs/libmythservicecontracts/datacontracts/titleInfoList.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
//////////////////////////////////////////////////////////////////////////// | ||
// Program Name: titleInfoList.h | ||
// Created : June 14, 2013 | ||
// | ||
// Copyright (c) 2013 Chris Pinkham <cpinkham@mythtv.org> | ||
// | ||
// Licensed under the GPL v2 or later, see COPYING for details | ||
// | ||
//////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef TITLEINFOLIST_H_ | ||
#define TITLEINFOLIST_H_ | ||
|
||
#include <QVariantList> | ||
|
||
#include "serviceexp.h" | ||
#include "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 DESIGNABLE true ) | ||
|
||
PROPERTYIMP_RO_REF( QVariantList, TitleInfos ) | ||
|
||
public: | ||
|
||
static void InitializeCustomTypes() | ||
{ | ||
qRegisterMetaType< TitleInfoList >(); | ||
qRegisterMetaType< TitleInfoList* >(); | ||
|
||
TitleInfo::InitializeCustomTypes(); | ||
} | ||
|
||
public: | ||
|
||
TitleInfoList(QObject *parent = 0) | ||
: QObject( parent ) | ||
{ | ||
} | ||
|
||
TitleInfoList( const TitleInfoList &src ) | ||
{ | ||
Copy( src ); | ||
} | ||
|
||
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' | ||
|
||
TitleInfo *pObject = new TitleInfo( this ); | ||
m_TitleInfos.append( QVariant::fromValue<QObject *>( pObject )); | ||
|
||
return pObject; | ||
} | ||
|
||
}; | ||
|
||
} // namespace DTC | ||
|
||
Q_DECLARE_METATYPE( DTC::TitleInfoList ) | ||
Q_DECLARE_METATYPE( DTC::TitleInfoList* ) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters