MythTV  master
videoMetadataInfo.h
Go to the documentation of this file.
1 // Program Name: videoMetadataInfo.h
3 // Created : Apr. 21, 2011
4 //
5 // Copyright (c) 2010 Robert McNamara <rmcnamara@mythtv.org>
6 // Copyright (c) 2013 Stuart Morgan <smorgan@mythtv.org>
7 //
8 // Licensed under the GPL v2 or later, see COPYING for details
9 //
11 
12 #ifndef VIDEOMETADATAINFO_H_
13 #define VIDEOMETADATAINFO_H_
14 
15 #include <QString>
16 #include <QDateTime>
17 
18 #include "serviceexp.h"
19 #include "datacontracthelper.h"
20 #include "artworkInfoList.h"
21 #include "castMemberList.h"
22 #include "genreList.h"
23 
24 namespace DTC
25 {
26 
28 
29 class SERVICE_PUBLIC VideoMetadataInfo : public QObject
30 {
31  Q_OBJECT
32  Q_CLASSINFO( "version" , "2.01" );
33 
34  Q_PROPERTY( int Id READ Id WRITE setId )
35  Q_PROPERTY( QString Title READ Title WRITE setTitle )
36  Q_PROPERTY( QString SubTitle READ SubTitle WRITE setSubTitle )
37  Q_PROPERTY( QString Tagline READ Tagline WRITE setTagline )
38  Q_PROPERTY( QString Director READ Director WRITE setDirector )
39  Q_PROPERTY( QString Studio READ Studio WRITE setStudio )
40  Q_PROPERTY( QString Description READ Description WRITE setDescription )
41  Q_PROPERTY( QString Certification READ Certification WRITE setCertification )
42  Q_PROPERTY( QString Inetref READ Inetref WRITE setInetref )
43  Q_PROPERTY( int Collectionref READ Collectionref WRITE setCollectionref )
44  Q_PROPERTY( QString HomePage READ HomePage WRITE setHomePage )
45  Q_PROPERTY( QDateTime ReleaseDate READ ReleaseDate WRITE setReleaseDate )
46  Q_PROPERTY( QDateTime AddDate READ AddDate WRITE setAddDate )
47  Q_PROPERTY( float UserRating READ UserRating WRITE setUserRating )
48  Q_PROPERTY( int ChildID READ ChildID WRITE setChildID )
49  Q_PROPERTY( int Length READ Length WRITE setLength )
50  Q_PROPERTY( int PlayCount READ PlayCount WRITE setPlayCount )
51  Q_PROPERTY( int Season READ Season WRITE setSeason )
52  Q_PROPERTY( int Episode READ Episode WRITE setEpisode )
53  Q_PROPERTY( int ParentalLevel READ ParentalLevel WRITE setParentalLevel )
54  Q_PROPERTY( bool Visible READ Visible WRITE setVisible )
55  Q_PROPERTY( bool Watched READ Watched WRITE setWatched )
56  Q_PROPERTY( bool Processed READ Processed WRITE setProcessed )
57  Q_PROPERTY( QString ContentType READ ContentType WRITE setContentType )
58  Q_PROPERTY( QString FileName READ FileName WRITE setFileName )
59  Q_PROPERTY( QString Hash READ Hash WRITE setHash )
60  Q_PROPERTY( QString HostName READ HostName WRITE setHostName )
61  Q_PROPERTY( QString Coverart READ Coverart WRITE setCoverart )
62  Q_PROPERTY( QString Fanart READ Fanart WRITE setFanart )
63  Q_PROPERTY( QString Banner READ Banner WRITE setBanner )
64  Q_PROPERTY( QString Screenshot READ Screenshot WRITE setScreenshot )
65  Q_PROPERTY( QString Trailer READ Trailer WRITE setTrailer )
66 
67  Q_PROPERTY( QObject* Artwork READ Artwork DESIGNABLE SerializeArtwork )
68  Q_PROPERTY( QObject* Cast READ Cast DESIGNABLE SerializeCast )
69  Q_PROPERTY( QObject* Genres READ Genres DESIGNABLE SerializeGenres )
70 
71  PROPERTYIMP ( int , Id )
72  PROPERTYIMP ( QString , Title )
73  PROPERTYIMP ( QString , SubTitle )
74  PROPERTYIMP ( QString , Tagline )
75  PROPERTYIMP ( QString , Director )
76  PROPERTYIMP ( QString , Studio )
77  PROPERTYIMP ( QString , Description )
78  PROPERTYIMP ( QString , Certification )
79  PROPERTYIMP ( QString , Inetref )
80  PROPERTYIMP ( int , Collectionref )
81  PROPERTYIMP ( QString , HomePage )
82  PROPERTYIMP ( QDateTime , ReleaseDate )
83  PROPERTYIMP ( QDateTime , AddDate )
84  PROPERTYIMP ( float , UserRating )
85  PROPERTYIMP ( int , ChildID )
86  PROPERTYIMP ( int , Length )
87  PROPERTYIMP ( int , PlayCount )
88  PROPERTYIMP ( int , Season )
89  PROPERTYIMP ( int , Episode )
90  PROPERTYIMP ( int , ParentalLevel )
91  PROPERTYIMP ( bool , Visible )
92  PROPERTYIMP ( bool , Watched )
93  PROPERTYIMP ( bool , Processed )
94  PROPERTYIMP ( QString , ContentType )
95  PROPERTYIMP ( QString , FileName )
96  PROPERTYIMP ( QString , Hash )
97  PROPERTYIMP ( QString , HostName )
98  PROPERTYIMP ( QString , Coverart )
99  PROPERTYIMP ( QString , Fanart )
100  PROPERTYIMP ( QString , Banner )
101  PROPERTYIMP ( QString , Screenshot )
102  PROPERTYIMP ( QString , Trailer )
103 
104  PROPERTYIMP_PTR( ArtworkInfoList , Artwork )
105  PROPERTYIMP_PTR( CastMemberList , Cast )
106  PROPERTYIMP_PTR( GenreList , Genres )
107 
108  PROPERTYIMP ( bool , SerializeArtwork)
109  PROPERTYIMP ( bool , SerializeCast )
110  PROPERTYIMP ( bool , SerializeGenres )
111 
112  public:
113 
114  static inline void InitializeCustomTypes();
115 
116  public:
117 
118  VideoMetadataInfo(QObject *parent = 0)
119  : QObject ( parent ),
120  m_Id ( 0 ),
121  m_Collectionref ( 0 ),
122  m_UserRating ( 0 ),
123  m_ChildID ( 0 ),
124  m_Length ( 0 ),
125  m_PlayCount ( 0 ),
126  m_Season ( 0 ),
127  m_Episode ( 0 ),
128  m_ParentalLevel ( 0 ),
129  m_Visible ( false ),
130  m_Watched ( false ),
131  m_Processed ( false ),
132  m_Artwork ( NULL ),
133  m_Cast ( NULL ),
134  m_Genres ( NULL ),
135  m_SerializeArtwork( true ),
136  m_SerializeCast ( true ),
137  m_SerializeGenres ( true )
138  {
139  }
140 
142  {
143  Copy( src );
144  }
145 
146  void Copy( const VideoMetadataInfo &src )
147  {
148  m_Id = src.m_Id;
149  m_SerializeArtwork = src.m_SerializeArtwork;
150  m_SerializeCast = src.m_SerializeCast;
151  m_SerializeGenres = src.m_SerializeGenres;
152 
153  if ( src.m_Artwork != NULL)
154  Artwork()->Copy( src.m_Artwork );
155 
156  if (src.m_Cast != NULL)
157  Cast()->Copy( src.m_Cast );
158 
159  if (src.m_Genres != NULL)
160  Genres()->Copy( src.m_Genres );
161 
162  }
163 };
164 
165 } // namespace DTC
166 
169 
170 namespace DTC
171 {
173 {
174  qRegisterMetaType< VideoMetadataInfo >();
175  qRegisterMetaType< VideoMetadataInfo* >();
176 
177  if (QMetaType::type( "DTC::ArtworkInfoList" ) == 0)
178  ArtworkInfoList::InitializeCustomTypes();
179 
180  if (QMetaType::type( "DTC::CastMemberList" ) == 0)
181  CastMemberList::InitializeCustomTypes();
182 
183  if (QMetaType::type( "DTC::GenreMemberList" ) == 0)
184  GenreList::InitializeCustomTypes();
185 }
186 }
187 
188 #endif
static void InitializeCustomTypes()
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:83
Q_DECLARE_METATYPE(GrabberScript *)
__u32 type
Definition: videodev2.h:1038
VideoMetadataInfo(const VideoMetadataInfo &src)
VERBOSE_PREAMBLE Most Errors or other very important messages true
Definition: verbosedefs.h:91
ContentType
Definition: httprequest.h:61
void Copy(const VideoMetadataInfo &src)