MythTV  master
musicMetadataInfo.h
Go to the documentation of this file.
1 // Program Name: musicMetadataInfo.h
3 // Created : July 20, 2017
4 //
5 // Copyright (c) 2017 Paul Harrison <pharrison@mythtv.org>
6 //
7 // Licensed under the GPL v2 or later, see COPYING for details
8 //
10 
11 #ifndef MUSICMETADATAINFO_H_
12 #define MUSICMETADATAINFO_H_
13 
14 #include <QString>
15 #include <QDateTime>
16 
17 #include "serviceexp.h"
18 #include "datacontracthelper.h"
19 
20 namespace DTC
21 {
22 
24 
25 class SERVICE_PUBLIC MusicMetadataInfo : public QObject
26 {
27  Q_OBJECT
28  Q_CLASSINFO( "version" , "1.00" );
29 
30  Q_PROPERTY( int Id READ Id WRITE setId )
31  Q_PROPERTY( QString Artist READ Artist WRITE setArtist )
32  Q_PROPERTY( QString CompilationArtist READ CompilationArtist WRITE setCompilationArtist )
33  Q_PROPERTY( QString Album READ Album WRITE setAlbum )
34  Q_PROPERTY( QString Title READ Title WRITE setTitle )
35  Q_PROPERTY( int TrackNo READ TrackNo WRITE setTrackNo )
36  Q_PROPERTY( QString Genre READ Genre WRITE setGenre )
37  Q_PROPERTY( int Year READ Year WRITE setYear )
38  Q_PROPERTY( int PlayCount READ PlayCount WRITE setPlayCount )
39  Q_PROPERTY( int Length READ Length WRITE setLength )
40  Q_PROPERTY( int Rating READ Rating WRITE setRating )
41  Q_PROPERTY( QString FileName READ FileName WRITE setFileName )
42  Q_PROPERTY( QString HostName READ HostName WRITE setHostName )
43  Q_PROPERTY( QDateTime LastPlayed READ LastPlayed WRITE setLastPlayed )
44  Q_PROPERTY( bool Compilation READ Compilation WRITE setCompilation )
45 
46  PROPERTYIMP ( int , Id )
47  PROPERTYIMP ( QString , Artist )
48  PROPERTYIMP ( QString , CompilationArtist )
49  PROPERTYIMP ( QString , Album )
50  PROPERTYIMP ( QString , Title )
51  PROPERTYIMP ( int , TrackNo )
52  PROPERTYIMP ( QString , Genre )
53  PROPERTYIMP ( int , Year )
54  PROPERTYIMP ( int , PlayCount )
55  PROPERTYIMP ( int , Length )
56  PROPERTYIMP ( int , Rating )
57  PROPERTYIMP ( QString , FileName )
58  PROPERTYIMP ( QString , HostName )
59  PROPERTYIMP ( QDateTime , LastPlayed )
60  PROPERTYIMP ( bool , Compilation )
61 
62  public:
63 
64  static inline void InitializeCustomTypes();
65 
66  Q_INVOKABLE MusicMetadataInfo(QObject *parent = nullptr)
67  : QObject ( parent ),
68  m_Id ( 0 ),
69  m_TrackNo ( 0 ),
70  m_Year ( 0 ),
71  m_PlayCount ( 0 ),
72  m_Length ( 0 ),
73  m_Rating ( 0 ),
74  m_Compilation ( false )
75  {
76  }
77 
78  void Copy( const MusicMetadataInfo *src )
79  {
80  m_Id = src->m_Id;
81  m_Artist = src->m_Artist;
82  m_CompilationArtist = src->m_CompilationArtist;
83  m_Album = src->m_Album;
84  m_Title = src->m_Title;
85  m_TrackNo = src->m_TrackNo;
86  m_Genre = src->m_Genre;
87  m_Year = src->m_Year;
88  m_PlayCount = src->m_PlayCount;
89  m_Length = src->m_Length;
90  m_Rating = src->m_Rating;
91  m_FileName = src->m_FileName;
92  m_HostName = src->m_HostName;
93  m_LastPlayed = src->m_LastPlayed;
94  m_Compilation = src->m_Compilation;
95  }
96 };
97 
99 {
100  qRegisterMetaType< MusicMetadataInfo* >();
101 }
102 
103 } // namespace DTC
104 
105 #endif
static void InitializeCustomTypes()
#define PROPERTYIMP(type, name)
#define SERVICE_PUBLIC
Definition: serviceexp.h:9
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
void Copy(const MusicMetadataInfo *src)