Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ServicesAPI: add the genre list to the output from Video/GetVideoList
- Loading branch information
Paul Harrison
committed
Mar 8, 2017
1 parent
ab4513f
commit ab1c3e8
Showing
8 changed files
with
211 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
////////////////////////////////////////////////////////////////////////////// | ||
// Program Name: genre.h | ||
// Created : Mar. 08, 2017 | ||
// | ||
// Copyright (c) 2017 Paul Harrison <pharrison@mythtv.org> | ||
// | ||
// Licensed under the GPL v2 or later, see COPYING for details | ||
// | ||
////////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef GENRE_H_ | ||
#define GENRE_H_ | ||
|
||
#include <QString> | ||
|
||
#include "serviceexp.h" | ||
#include "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 ( QString , Name ) | ||
|
||
public: | ||
|
||
static inline void InitializeCustomTypes(); | ||
|
||
public: | ||
|
||
Genre(QObject *parent = 0) | ||
: QObject ( parent ) | ||
{ | ||
} | ||
|
||
Genre( const Genre &src ) | ||
{ | ||
Copy( src ); | ||
} | ||
|
||
void Copy( const Genre &src ) | ||
{ | ||
m_Name = src.m_Name ; | ||
} | ||
}; | ||
|
||
} // namespace DTC | ||
|
||
Q_DECLARE_METATYPE( DTC::Genre ) | ||
Q_DECLARE_METATYPE( DTC::Genre* ) | ||
|
||
namespace DTC | ||
{ | ||
inline void Genre::InitializeCustomTypes() | ||
{ | ||
qRegisterMetaType< Genre >(); | ||
qRegisterMetaType< Genre* >(); | ||
} | ||
} | ||
|
||
#endif |
89 changes: 89 additions & 0 deletions
89
mythtv/libs/libmythservicecontracts/datacontracts/genreList.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,89 @@ | ||
////////////////////////////////////////////////////////////////////////////// | ||
// Program Name: genreList.h | ||
// Created : Mar. 08, 2017 | ||
// | ||
// Copyright (c) 2017 Paul Harrison <pharrison@mythtv.org> | ||
// | ||
// Licensed under the GPL v2 or later, see COPYING for details | ||
// | ||
////////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef GENRELIST_H_ | ||
#define GENRELIST_H_ | ||
|
||
#include <QString> | ||
#include <QVariantList> | ||
|
||
#include "serviceexp.h" | ||
#include "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 Genres READ Genres DESIGNABLE true ) | ||
|
||
PROPERTYIMP_RO_REF( QVariantList, Genres ) | ||
|
||
public: | ||
|
||
static inline void InitializeCustomTypes(); | ||
|
||
public: | ||
|
||
GenreList(QObject *parent = 0) | ||
: QObject ( parent ) | ||
{ | ||
} | ||
|
||
GenreList( const GenreList &src ) | ||
{ | ||
Copy( src ); | ||
} | ||
|
||
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' | ||
|
||
Genre *pObject = new Genre( this ); | ||
m_Genres.append( QVariant::fromValue<QObject *>( pObject )); | ||
|
||
return pObject; | ||
} | ||
|
||
}; | ||
|
||
} // namespace DTC | ||
|
||
Q_DECLARE_METATYPE( DTC::GenreList ) | ||
Q_DECLARE_METATYPE( DTC::GenreList* ) | ||
|
||
namespace DTC | ||
{ | ||
inline void GenreList::InitializeCustomTypes() | ||
{ | ||
qRegisterMetaType< GenreList >(); | ||
qRegisterMetaType< GenreList* >(); | ||
|
||
Genre::InitializeCustomTypes(); | ||
} | ||
} | ||
|
||
#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
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