MythTV  master
musicmetadata.h
Go to the documentation of this file.
1 #ifndef MUSICMETADATA_H_
2 #define MUSICMETADATA_H_
3 
4 // C/C++
5 #include <array>
6 #include <cstdint>
7 #include <utility>
8 
9 // qt
10 #include <QCoreApplication>
11 #include <QDateTime>
12 #include <QImage>
13 #include <QMap>
14 #include <QMetaType>
15 #include <QStringList>
16 
17 // MythTV
18 #include "libmythbase/mthread.h"
20 #include "libmythbase/mythtypes.h"
22 
23 class AllMusic;
24 class AlbumArtImages;
25 class LyricsData;
26 class MetaIO;
27 
29 {
37 };
38 
40 {
41  public:
42  AlbumArtImage(void) :
43  m_filename(""), m_hostname(""), m_description("") {}
44  explicit AlbumArtImage(const AlbumArtImage * const image) :
45  m_id(image->m_id), m_filename(image->m_filename),
46  m_hostname(image->m_hostname), m_imageType(image->m_imageType),
47  m_description(image->m_description), m_embedded(image->m_embedded) {}
48  int m_id {0};
49  QString m_filename;
50  QString m_hostname;
51  ImageType m_imageType {IT_UNKNOWN};
52  QString m_description;
53  bool m_embedded {false};
54 };
55 
56 using AlbumArtList = QList<AlbumArtImage*>;
57 
59 {
61  RT_CD = 1,
63 };
64 
65 static constexpr uint8_t METADATA_BITS_FOR_REPO { 8 };
66 static constexpr uint8_t METADATA_REPO_SHIFT { 24 };
67 static constexpr uint32_t METADATA_REPO_MASK { 0xff000000 };
68 static constexpr uint32_t METADATA_ID_MASK { 0x00ffffff };
69 
70 static constexpr uint32_t ID_TO_ID(uint32_t x) { return x & METADATA_ID_MASK; };
71 static constexpr uint32_t ID_TO_REPO(uint32_t x) { return x >> METADATA_REPO_SHIFT; };
72 
73 static constexpr const char* METADATA_INVALID_FILENAME { "**NOT FOUND**" };
74 
75 static constexpr const char* STREAMUPDATEURL { "https://services.mythtv.org/music/data/?data=streams" };
76 static constexpr size_t STREAMURLCOUNT { 5 };
77 
78 using UrlList = std::array<QString,STREAMURLCOUNT>;
79 
81 {
82  Q_DECLARE_TR_FUNCTIONS(MusicMetadata);
83 
84  public:
85 
86  using IdType = uint32_t;
87 
88  explicit MusicMetadata(QString lfilename = "", QString lartist = "", QString lcompilation_artist = "",
89  QString lalbum = "", QString ltitle = "", QString lgenre = "",
90  int lyear = 0, int ltracknum = 0, std::chrono::milliseconds llength = 0ms, int lid = 0,
91  int lrating = 0, int lplaycount = 0, QDateTime llastplay = QDateTime(),
92  QDateTime ldateadded = QDateTime(), bool lcompilation = false, QString lformat = "")
93  : m_artist(std::move(lartist)),
94  m_compilationArtist(std::move(lcompilation_artist)),
95  m_album(std::move(lalbum)),
96  m_title(std::move(ltitle)),
97  m_genre(std::move(lgenre)),
98  m_format(std::move(lformat)),
99  m_year(lyear),
100  m_trackNum(ltracknum),
101  m_length(llength),
102  m_rating(lrating),
103  m_lastPlay(std::move(llastplay)),
104  m_dateAdded(std::move(ldateadded)),
105  m_playCount(lplaycount),
106  m_compilation(lcompilation),
107  m_id(lid),
108  m_filename(std::move(lfilename))
109  {
110  checkEmptyFields();
111  }
112 
113  MusicMetadata(int lid, QString lbroadcaster, QString lchannel, QString ldescription, const UrlList &lurls, QString llogourl,
114  QString lgenre, QString lmetaformat, QString lcountry, QString llanguage, QString lformat);
115 
116  ~MusicMetadata();
117 
119  {
120  *this = other;
121  m_changed = false;
122  }
123 
124  MusicMetadata& operator=(const MusicMetadata &rhs);
125 
126  QString Artist() const { return m_artist; }
127  QString ArtistSort() const { return m_artistSort; }
128  void setArtist(const QString &lartist,
129  const QString &lartist_sort = nullptr)
130  {
131  m_artist = lartist;
132  m_artistId = -1;
133  m_artistSort = lartist_sort;
134  m_formattedArtist.clear(); m_formattedTitle.clear();
135  ensureSortFields();
136  }
137 
138  QString CompilationArtist() const { return m_compilationArtist; }
139  QString CompilationArtistSort() const { return m_compilationArtistSort; }
140  void setCompilationArtist(const QString &lcompilation_artist,
141  const QString &lcompilation_artist_sort = nullptr)
142  {
143  m_compilationArtist = lcompilation_artist;
144  m_compartistId = -1;
145  m_compilationArtistSort = lcompilation_artist_sort;
146  m_formattedArtist.clear(); m_formattedTitle.clear();
147  ensureSortFields();
148  }
149 
150  QString Album() const { return m_album; }
151  QString AlbumSort() const { return m_albumSort; }
152  void setAlbum(const QString &lalbum,
153  const QString &lalbum_sort = nullptr)
154  {
155  m_album = lalbum;
156  m_albumId = -1;
157  m_albumSort = lalbum_sort;
158  m_formattedArtist.clear(); m_formattedTitle.clear();
159  ensureSortFields();
160  }
161 
162  QString Title() const { return m_title; }
163  QString TitleSort() const { return m_titleSort; }
164  void setTitle(const QString &ltitle,
165  const QString &ltitle_sort = nullptr)
166  {
167  m_title = ltitle;
168  m_titleSort = ltitle_sort;
169  ensureSortFields();
170  }
171 
172  QString FormatArtist();
173  QString FormatTitle();
174 
175  QString Genre() const { return m_genre; }
176  void setGenre(const QString &lgenre) {
177  m_genre = lgenre;
178  m_genreId = -1;
179  }
180 
181  void setDirectoryId(int ldirectoryid) { m_directoryId = ldirectoryid; }
182  int getDirectoryId();
183 
184  void setArtistId(int lartistid) { m_artistId = lartistid; }
185  int getArtistId();
186 
187  void setCompilationArtistId(int lartistid) { m_compartistId = lartistid; }
188  int getCompilationArtistId();
189 
190  void setAlbumId(int lalbumid) { m_albumId = lalbumid; }
191  int getAlbumId();
192 
193  void setGenreId(int lgenreid) { m_genreId = lgenreid; }
194  int getGenreId();
195 
196  int Year() const { return m_year; }
197  void setYear(int lyear) { m_year = lyear; }
198 
199  int Track() const { return m_trackNum; }
200  void setTrack(int ltrack) { m_trackNum = ltrack; }
201 
202  int GetTrackCount() const { return m_trackCount; }
203  void setTrackCount(int ltrackcount) { m_trackCount = ltrackcount; }
204 
205  std::chrono::milliseconds Length() const { return m_length; }
206  template <typename T, std::enable_if_t<std::chrono::__is_duration<T>::value, bool> = true>
207  void setLength(T llength) { m_length = llength; }
208 
209  int DiscNumber() const {return m_discNum;}
210  void setDiscNumber(int discnum) { m_discNum = discnum; }
211 
212  int DiscCount() const {return m_discCount;}
213  void setDiscCount(int disccount) { m_discCount = disccount; }
214 
215  int Playcount() const { return m_playCount; }
216  void setPlaycount(int lplaycount) { m_playCount = lplaycount; }
217 
218  IdType ID() const { return m_id; }
219  void setID(IdType lid) { m_id = lid; }
220  void setRepo(RepoType repo) { m_id = (m_id & METADATA_ID_MASK) | (repo << METADATA_REPO_SHIFT); }
221 
222  bool isCDTrack(void) const { return ID_TO_REPO(m_id) == RT_CD; }
223  bool isDBTrack(void) const { return ID_TO_REPO(m_id) == RT_Database; }
224  bool isRadio(void) const { return ID_TO_REPO(m_id) == RT_Radio; }
225 
226  QString Filename(bool find = true);
227  void setFilename(const QString &lfilename);
228  QString getLocalFilename(void);
229 
230  QString Hostname(void) { return m_hostname; }
231  void setHostname(const QString &host) { m_hostname = host; }
232 
233  uint64_t FileSize() const { return m_fileSize; }
234  void setFileSize(uint64_t lfilesize) { m_fileSize = lfilesize; }
235 
236  QString Format() const { return m_format; }
237  void setFormat(const QString &lformat) { m_format = lformat; }
238 
239  int Rating() const { return m_rating; }
240  void decRating();
241  void incRating();
242  void setRating(int lrating) { m_rating = lrating; }
243 
244  QDateTime LastPlay() const { return m_lastPlay; }
245  void setLastPlay();
246  void setLastPlay(const QDateTime& lastPlay);
247 
248  int PlayCount() const { return m_playCount; }
249  void incPlayCount();
250 
251  // track is part of a compilation album
252  bool Compilation() const { return m_compilation; }
253  void setCompilation(bool state)
254  {
255  m_compilation = state;
256  m_formattedArtist.clear();
257  m_formattedTitle.clear();
258  }
259  bool determineIfCompilation(bool cd = false);
260 
261  // for radio streams
262  void setBroadcaster(const QString &broadcaster) { m_broadcaster = broadcaster; }
263  QString Broadcaster(void) { return m_broadcaster; }
264 
265  void setChannel(const QString &channel) { m_channel = channel; }
266  QString Channel(void) { return m_channel; }
267 
268  void setDescription(const QString &description) { m_description = description; }
269  QString Description(void) { return m_description; }
270 
271  void setUrl(const QString &url, size_t index = 0);
272  QString Url(size_t index = 0);
273 
274  void setLogoUrl(const QString &logourl) { m_logoUrl = logourl; }
275  QString LogoUrl(void) { return m_logoUrl; }
276 
277  void setMetadataFormat(const QString &metaformat) { m_metaFormat = metaformat; }
278  QString MetadataFormat(void) { return m_metaFormat; }
279 
280  void setCountry(const QString &country) { m_country = country; }
281  QString Country(void) { return m_country; }
282 
283  void setLanguage(const QString &language) { m_language = language; }
284  QString Language(void) { return m_language; }
285 
286  void setEmbeddedAlbumArt(AlbumArtList &albumart);
287 
288  void reloadMetadata(void);
289  void dumpToDatabase(void);
290  void setField(const QString &field, const QString &data);
291  void getField(const QString& field, QString *data);
292  void toMap(InfoMap &metadataMap, const QString &prefix = "");
293 
294  void persist(void);
295 
296  bool hasChanged(void) const { return m_changed; }
297 
298  bool compare(MusicMetadata *mdata) const;
299 
300  // static functions
301  static MusicMetadata *createFromFilename(const QString &filename);
302  static MusicMetadata *createFromID(int trackid);
303  static void setArtistAndTrackFormats();
304  static QStringList fillFieldList(const QString& field);
305  static bool updateStreamList(void);
306 
307  // this looks for any image available - preferring a front cover if available
308  QString getAlbumArtFile(void);
309  // this looks only for the given image type
310  QString getAlbumArtFile(ImageType type);
311 
312  AlbumArtImages *getAlbumArtImages(void);
313  void reloadAlbumArtImages(void);
314 
315  LyricsData *getLyricsData(void);
316 
317  MetaIO *getTagger(void);
318 
319  private:
320  void setCompilationFormatting(bool cd = false);
321  QString formatReplaceSymbols(const QString &format);
322  void checkEmptyFields(void);
323  void ensureSortFields(void);
324  void saveHostname(void);
325 
326  QString m_artist;
327  QString m_artistSort;
330  QString m_album;
331  QString m_albumSort;
332  QString m_title;
333  QString m_titleSort;
336  QString m_genre;
337  QString m_format;
338  int m_year {0};
339  int m_trackNum {0};
340  int m_trackCount {0};
341  int m_discNum {0};
342  int m_discCount {0};
343  std::chrono::milliseconds m_length {0ms};
344  int m_rating {0};
345  int m_directoryId {-1};
346  int m_artistId {-1};
347  int m_compartistId {-1};
348  int m_albumId {-1};
349  int m_genreId {-1};
350  QDateTime m_lastPlay;
351  QDateTime m_tempLastPlay;
352  QDateTime m_dateAdded;
353  int m_playCount {0};
354  int m_tempPlayCount {0};
355  bool m_compilation {false};
356 
357  AlbumArtImages *m_albumArt {nullptr};
358 
359  LyricsData *m_lyricsData {nullptr};
360 
361  IdType m_id {0};
362  QString m_filename; // file name as stored in the DB
363  QString m_hostname; // host where file is located as stored in the DB
364  QString m_actualFilename; // actual URL of the file if found
365  uint64_t m_fileSize {0};
366  bool m_changed {false};
367 
368  // radio stream stuff
369  QString m_broadcaster;
370  QString m_channel;
371  QString m_description;
373  QString m_logoUrl;
374  QString m_metaFormat;
375  QString m_country;
376  QString m_language;
377 
378  // Various formatting strings
379  static QString s_formatNormalFileArtist;
380  static QString s_formatNormalFileTrack;
381  static QString s_formatNormalCdArtist;
382  static QString s_formatNormalCdTrack;
383 
388 };
389 
392 
395 
399 
400 //---------------------------------------------------------------------------
401 
403 {
404 
405  public:
406 
407  explicit MetadataLoadingThread(AllMusic *parent_ptr)
408  : MThread("MetadataLoading"), m_parent(parent_ptr) {}
409  void run() override; // MThread
410 
411  private:
412 
413  AllMusic *m_parent {nullptr};
414 };
415 
416 //---------------------------------------------------------------------------
417 
419 {
420  Q_DECLARE_TR_FUNCTIONS(AllMusic);
421 
422  public:
423 
424  AllMusic(void);
425  ~AllMusic();
426 
427  MusicMetadata* getMetadata(int an_id);
428  bool updateMetadata(int an_id, MusicMetadata *the_track);
429  int count() const { return m_numPcs; }
430  int countLoaded() const { return m_numLoaded; }
431  void save();
432  bool startLoading(void);
433  void resync(); // After a CD rip, for example
434 
435  // cd stuff
436  void clearCDData(void);
437  void addCDTrack(const MusicMetadata &the_track);
438  bool checkCDTrack(MusicMetadata *the_track);
439  MusicMetadata* getCDMetadata(int m_the_track);
440  QString getCDTitle(void) const { return m_cdTitle; }
441  void setCDTitle(const QString &a_title) { m_cdTitle = a_title; }
442  int getCDTrackCount(void) const { return m_cdData.count(); }
443 
444  bool doneLoading() const { return m_doneLoading; }
445  bool cleanOutThreads();
446 
447  MetadataPtrList *getAllMetadata(void) { return &m_allMusic; }
448  MetadataPtrList *getAllCDMetadata(void) { return &m_cdData; }
449 
450  bool isValidID(int an_id);
451 
452  private:
454 
455  int m_numPcs {0};
456  int m_numLoaded {0};
457 
458  using MusicMap = QMap<int, MusicMetadata*>;
460 
461  // cd stuff
462  MetadataPtrList m_cdData; // More than one cd player?
463  QString m_cdTitle;
464 
465  MetadataLoadingThread *m_metadataLoader {nullptr};
466  bool m_doneLoading {false};
467 
468  int m_playCountMin {0};
469  int m_playCountMax {0};
470  qint64 m_lastPlayMin {0};
471  qint64 m_lastPlayMax {0};
472 };
473 
474 using StreamList = QList<MusicMetadata*>;
475 
477 {
478  public:
479 
480  AllStream(void);
481  ~AllStream();
482 
483  void loadStreams(void);
484 
485  bool isValidID(MusicMetadata::IdType an_id);
486 
487  MusicMetadata* getMetadata(MusicMetadata::IdType an_id);
488 
489  StreamList *getStreams(void) { return &m_streamList; }
490 
491  void addStream(MusicMetadata *mdata);
492  void removeStream(MusicMetadata *mdata);
493  void updateStream(MusicMetadata *mdata);
494 
495  private:
497 };
498 
499 //----------------------------------------------------------------------------
500 
502 {
503  public:
504  explicit AlbumArtScannerThread(QStringList strList) :
505  MThread("AlbumArtScanner"), m_strList(std::move(strList)) {}
506 
507  void run() override // MThread
508  {
509  RunProlog();
511  RunEpilog();
512  }
513 
514  QStringList getResult(void) { return m_strList; }
515 
516  private:
517  QStringList m_strList;
518 };
519 
521 {
522  Q_DECLARE_TR_FUNCTIONS(AlbumArtImages);
523 
524  public:
525  explicit AlbumArtImages(MusicMetadata *metadata, bool loadFromDB = true);
526  ~AlbumArtImages();
527 
528  void scanForImages(void);
529  void addImage(const AlbumArtImage * newImage);
530  uint getImageCount() { return m_imageList.size(); }
531  AlbumArtImage *getImage(ImageType type);
532  AlbumArtImage *getImageByID(int imageID);
533  QStringList getImageFilenames(void) const;
534  AlbumArtList *getImageList(void) { return &m_imageList; }
535  AlbumArtImage *getImageAt(uint index);
536 
537  void dumpToDatabase(void);
538 
539  static ImageType guessImageType(const QString &filename);
540  static QString getTypeName(ImageType type);
541  static QString getTypeFilename(ImageType type);
542  static ImageType getImageTypeFromName(const QString &name);
543 
544  private:
545  void findImages(void);
546 
547  MusicMetadata *m_parent {nullptr};
549 };
550 
552 
553 #endif
MusicMetadata::AlbumSort
QString AlbumSort() const
Definition: musicmetadata.h:151
MusicMetadata::setDirectoryId
void setDirectoryId(int ldirectoryid)
Definition: musicmetadata.h:181
AllMusic::countLoaded
int countLoaded() const
Definition: musicmetadata.h:430
MusicMetadata::Title
QString Title() const
Definition: musicmetadata.h:162
MusicMetadata::LogoUrl
QString LogoUrl(void)
Definition: musicmetadata.h:275
MusicMetadata::Genre
QString Genre() const
Definition: musicmetadata.h:175
MusicMetadata::GetTrackCount
int GetTrackCount() const
Definition: musicmetadata.h:202
MusicMetadata::setDescription
void setDescription(const QString &description)
Definition: musicmetadata.h:268
MusicMetadata::setBroadcaster
void setBroadcaster(const QString &broadcaster)
Definition: musicmetadata.h:262
MusicMetadata::hasChanged
bool hasChanged(void) const
Definition: musicmetadata.h:296
MusicMetadata::s_formatCompilationCdArtist
static QString s_formatCompilationCdArtist
Definition: musicmetadata.h:386
AlbumArtScannerThread::AlbumArtScannerThread
AlbumArtScannerThread(QStringList strList)
Definition: musicmetadata.h:504
MusicMetadata::m_hostname
QString m_hostname
Definition: musicmetadata.h:363
AlbumArtImage::AlbumArtImage
AlbumArtImage(void)
Definition: musicmetadata.h:42
MythCoreContext::SendReceiveStringList
bool SendReceiveStringList(QStringList &strlist, bool quickTimeout=false, bool block=true)
Send a message to the backend and wait for a response.
Definition: mythcorecontext.cpp:1371
MusicMetadata::m_description
QString m_description
Definition: musicmetadata.h:371
AllMusic
Definition: musicmetadata.h:418
AllMusic::getAllCDMetadata
MetadataPtrList * getAllCDMetadata(void)
Definition: musicmetadata.h:448
MusicMetadata::MetadataFormat
QString MetadataFormat(void)
Definition: musicmetadata.h:278
AllMusic::m_allMusic
MetadataPtrList m_allMusic
Definition: musicmetadata.h:453
MusicMetadata::setDiscNumber
void setDiscNumber(int discnum)
Definition: musicmetadata.h:210
MusicMetadata::CompilationArtist
QString CompilationArtist() const
Definition: musicmetadata.h:138
AlbumArtImages::getImageList
AlbumArtList * getImageList(void)
Definition: musicmetadata.h:534
MusicMetadata::m_urls
UrlList m_urls
Definition: musicmetadata.h:372
MusicMetadata::setArtistId
void setArtistId(int lartistid)
Definition: musicmetadata.h:184
AlbumArtScannerThread::run
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
Definition: musicmetadata.h:507
MusicMetadata::m_title
QString m_title
Definition: musicmetadata.h:332
STREAMUPDATEURL
static constexpr const char * STREAMUPDATEURL
Definition: musicmetadata.h:75
operator==
bool operator==(MusicMetadata &a, MusicMetadata &b)
Definition: musicmetadata.cpp:40
MusicMetadata::m_compilationArtistSort
QString m_compilationArtistSort
Definition: musicmetadata.h:329
MusicMetadata::setTrack
void setTrack(int ltrack)
Definition: musicmetadata.h:200
MusicMetadata::isRadio
bool isRadio(void) const
Definition: musicmetadata.h:224
AllMusic::m_musicMap
MusicMap m_musicMap
Definition: musicmetadata.h:459
MusicMetadata::m_artistSort
QString m_artistSort
Definition: musicmetadata.h:327
MetaIO
Definition: metaio.h:17
MusicMetadata::setChannel
void setChannel(const QString &channel)
Definition: musicmetadata.h:265
STREAMURLCOUNT
static constexpr size_t STREAMURLCOUNT
Definition: musicmetadata.h:76
MusicMetadata::ID
IdType ID() const
Definition: musicmetadata.h:218
MusicMetadata::setAlbum
void setAlbum(const QString &lalbum, const QString &lalbum_sort=nullptr)
Definition: musicmetadata.h:152
METADATA_BITS_FOR_REPO
static constexpr uint8_t METADATA_BITS_FOR_REPO
Definition: musicmetadata.h:65
MusicMetadata::Track
int Track() const
Definition: musicmetadata.h:199
MusicMetadata::MusicMetadata
MusicMetadata(QString lfilename="", QString lartist="", QString lcompilation_artist="", QString lalbum="", QString ltitle="", QString lgenre="", int lyear=0, int ltracknum=0, std::chrono::milliseconds llength=0ms, int lid=0, int lrating=0, int lplaycount=0, QDateTime llastplay=QDateTime(), QDateTime ldateadded=QDateTime(), bool lcompilation=false, QString lformat="")
Definition: musicmetadata.h:88
MusicMetadata::setRating
void setRating(int lrating)
Definition: musicmetadata.h:242
METADATA_REPO_SHIFT
static constexpr uint8_t METADATA_REPO_SHIFT
Definition: musicmetadata.h:66
AllMusic::setCDTitle
void setCDTitle(const QString &a_title)
Definition: musicmetadata.h:441
MThread::RunProlog
void RunProlog(void)
Sets up a thread, call this if you reimplement run().
Definition: mthread.cpp:196
IT_BACKCOVER
@ IT_BACKCOVER
Definition: musicmetadata.h:32
MusicMetadata
Definition: musicmetadata.h:80
MusicMetadata::Length
std::chrono::milliseconds Length() const
Definition: musicmetadata.h:205
AllMusic::count
int count() const
Definition: musicmetadata.h:429
mythmetaexp.h
MusicMetadata::Artist
QString Artist() const
Definition: musicmetadata.h:126
RT_Database
@ RT_Database
Definition: musicmetadata.h:60
hardwareprofile.distros.mythtv_data.data_mythtv.prefix
string prefix
Definition: data_mythtv.py:40
MetadataLoadingThread
Definition: musicmetadata.h:402
MusicMetadata::m_format
QString m_format
Definition: musicmetadata.h:337
MusicMetadata::m_formattedTitle
QString m_formattedTitle
Definition: musicmetadata.h:335
ID_TO_REPO
static constexpr uint32_t ID_TO_REPO(uint32_t x)
Definition: musicmetadata.h:71
MusicMetadata::CompilationArtistSort
QString CompilationArtistSort() const
Definition: musicmetadata.h:139
AllMusic::m_cdTitle
QString m_cdTitle
Definition: musicmetadata.h:463
AllMusic::getAllMetadata
MetadataPtrList * getAllMetadata(void)
Definition: musicmetadata.h:447
InfoMap
QHash< QString, QString > InfoMap
Definition: mythtypes.h:15
AllStream::m_streamList
StreamList m_streamList
Definition: musicmetadata.h:496
MusicMetadata::Channel
QString Channel(void)
Definition: musicmetadata.h:266
AlbumArtImages::getImageCount
uint getImageCount()
Definition: musicmetadata.h:530
RepoType
RepoType
Definition: musicmetadata.h:58
MusicMetadata::setHostname
void setHostname(const QString &host)
Definition: musicmetadata.h:231
MusicMetadata::Description
QString Description(void)
Definition: musicmetadata.h:269
MusicMetadata::m_dateAdded
QDateTime m_dateAdded
Definition: musicmetadata.h:352
METADATA_INVALID_FILENAME
static constexpr const char * METADATA_INVALID_FILENAME
Definition: musicmetadata.h:73
MusicMetadata::Playcount
int Playcount() const
Definition: musicmetadata.h:215
AllMusic::doneLoading
bool doneLoading() const
Definition: musicmetadata.h:444
MusicMetadata::m_lastPlay
QDateTime m_lastPlay
Definition: musicmetadata.h:350
MusicMetadata::MusicMetadata
MusicMetadata(const MusicMetadata &other)
Definition: musicmetadata.h:118
RT_Radio
@ RT_Radio
Definition: musicmetadata.h:62
AlbumArtScannerThread
Definition: musicmetadata.h:501
MusicMetadata::setLength
void setLength(T llength)
Definition: musicmetadata.h:207
operator!=
bool operator!=(MusicMetadata &a, MusicMetadata &b)
Definition: musicmetadata.cpp:45
MusicMetadata::s_formatCompilationFileTrack
static QString s_formatCompilationFileTrack
Definition: musicmetadata.h:385
RT_CD
@ RT_CD
Definition: musicmetadata.h:61
MusicMetadata::m_tempLastPlay
QDateTime m_tempLastPlay
Definition: musicmetadata.h:351
MusicMetadata::Language
QString Language(void)
Definition: musicmetadata.h:284
ID_TO_ID
static constexpr uint32_t ID_TO_ID(uint32_t x)
Definition: musicmetadata.h:70
MusicMetadata::setLanguage
void setLanguage(const QString &language)
Definition: musicmetadata.h:283
MusicMetadata::setGenre
void setGenre(const QString &lgenre)
Definition: musicmetadata.h:176
AllStream::getStreams
StreamList * getStreams(void)
Definition: musicmetadata.h:489
AllStream
Definition: musicmetadata.h:476
MusicMetadata::setTitle
void setTitle(const QString &ltitle, const QString &ltitle_sort=nullptr)
Definition: musicmetadata.h:164
MusicMetadata::setFileSize
void setFileSize(uint64_t lfilesize)
Definition: musicmetadata.h:234
MusicMetadata::ArtistSort
QString ArtistSort() const
Definition: musicmetadata.h:127
AllMusic::getCDTitle
QString getCDTitle(void) const
Definition: musicmetadata.h:440
METADATA_ID_MASK
static constexpr uint32_t METADATA_ID_MASK
Definition: musicmetadata.h:68
mythtypes.h
MusicMetadata::isDBTrack
bool isDBTrack(void) const
Definition: musicmetadata.h:223
MusicMetadata::m_channel
QString m_channel
Definition: musicmetadata.h:370
AllMusic::m_cdData
MetadataPtrList m_cdData
Definition: musicmetadata.h:462
MusicMetadata::setMetadataFormat
void setMetadataFormat(const QString &metaformat)
Definition: musicmetadata.h:277
MThread::RunEpilog
void RunEpilog(void)
Cleans up a thread's resources, call this if you reimplement run().
Definition: mthread.cpp:209
MConcurrent::run
void run(const QString &name, Class *object, void(Class::*fn)())
Definition: mconcurrent.h:137
AllMusic::getCDTrackCount
int getCDTrackCount(void) const
Definition: musicmetadata.h:442
METADATA_REPO_MASK
static constexpr uint32_t METADATA_REPO_MASK
Definition: musicmetadata.h:67
LyricsData
Definition: lyricsdata.h:48
uint
unsigned int uint
Definition: compat.h:79
IT_ARTIST
@ IT_ARTIST
Definition: musicmetadata.h:35
IT_CD
@ IT_CD
Definition: musicmetadata.h:33
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:55
MusicMetadata::m_album
QString m_album
Definition: musicmetadata.h:330
MusicMetadata::s_formatCompilationCdTrack
static QString s_formatCompilationCdTrack
Definition: musicmetadata.h:387
StreamList
QList< MusicMetadata * > StreamList
Definition: musicmetadata.h:474
MusicMetadata::Album
QString Album() const
Definition: musicmetadata.h:150
MusicMetadata::IdType
uint32_t IdType
Definition: musicmetadata.h:86
MusicMetadata::setCompilationArtist
void setCompilationArtist(const QString &lcompilation_artist, const QString &lcompilation_artist_sort=nullptr)
Definition: musicmetadata.h:140
MusicMetadata::isCDTrack
bool isCDTrack(void) const
Definition: musicmetadata.h:222
AlbumArtImage::m_hostname
QString m_hostname
Definition: musicmetadata.h:50
IT_UNKNOWN
@ IT_UNKNOWN
Definition: musicmetadata.h:30
MusicMetadata::m_formattedArtist
QString m_formattedArtist
Definition: musicmetadata.h:334
MusicMetadata::setArtist
void setArtist(const QString &lartist, const QString &lartist_sort=nullptr)
Definition: musicmetadata.h:128
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(ImageType)
MusicMetadata::Hostname
QString Hostname(void)
Definition: musicmetadata.h:230
mythcorecontext.h
AlbumArtImages
Definition: musicmetadata.h:520
AlbumArtList
QList< AlbumArtImage * > AlbumArtList
Definition: musicmetadata.h:56
MusicMetadata::FileSize
uint64_t FileSize() const
Definition: musicmetadata.h:233
AlbumArtImage::AlbumArtImage
AlbumArtImage(const AlbumArtImage *const image)
Definition: musicmetadata.h:44
MusicMetadata::TitleSort
QString TitleSort() const
Definition: musicmetadata.h:163
MusicMetadata::Format
QString Format() const
Definition: musicmetadata.h:236
MusicMetadata::setDiscCount
void setDiscCount(int disccount)
Definition: musicmetadata.h:213
MusicMetadata::m_language
QString m_language
Definition: musicmetadata.h:376
MusicMetadata::m_metaFormat
QString m_metaFormat
Definition: musicmetadata.h:374
std
Definition: mythchrono.h:23
MusicMetadata::m_artist
QString m_artist
Definition: musicmetadata.h:326
MusicMetadata::Country
QString Country(void)
Definition: musicmetadata.h:281
AllMusic::MusicMap
QMap< int, MusicMetadata * > MusicMap
Definition: musicmetadata.h:458
MusicMetadata::setAlbumId
void setAlbumId(int lalbumid)
Definition: musicmetadata.h:190
MusicMetadata::LastPlay
QDateTime LastPlay() const
Definition: musicmetadata.h:244
AlbumArtImage
Definition: musicmetadata.h:39
MusicMetadata::Compilation
bool Compilation() const
Definition: musicmetadata.h:252
IT_LAST
@ IT_LAST
Definition: musicmetadata.h:36
MusicMetadata::m_albumSort
QString m_albumSort
Definition: musicmetadata.h:331
MusicMetadata::m_logoUrl
QString m_logoUrl
Definition: musicmetadata.h:373
MusicMetadata::m_broadcaster
QString m_broadcaster
Definition: musicmetadata.h:369
MThread
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:48
UrlList
std::array< QString, STREAMURLCOUNT > UrlList
Definition: musicmetadata.h:78
mthread.h
MusicMetadata::PlayCount
int PlayCount() const
Definition: musicmetadata.h:248
MusicMetadata::s_formatNormalFileTrack
static QString s_formatNormalFileTrack
Definition: musicmetadata.h:380
MusicMetadata::m_genre
QString m_genre
Definition: musicmetadata.h:336
MusicMetadata::setPlaycount
void setPlaycount(int lplaycount)
Definition: musicmetadata.h:216
MusicMetadata::setTrackCount
void setTrackCount(int ltrackcount)
Definition: musicmetadata.h:203
AlbumArtScannerThread::getResult
QStringList getResult(void)
Definition: musicmetadata.h:514
IT_FRONTCOVER
@ IT_FRONTCOVER
Definition: musicmetadata.h:31
MusicMetadata::Broadcaster
QString Broadcaster(void)
Definition: musicmetadata.h:263
MetadataPtrList
QList< MusicMetadata * > MetadataPtrList
Definition: musicmetadata.h:396
MusicMetadata::setRepo
void setRepo(RepoType repo)
Definition: musicmetadata.h:220
MusicMetadata::setYear
void setYear(int lyear)
Definition: musicmetadata.h:197
MusicMetadata::Rating
int Rating() const
Definition: musicmetadata.h:239
MusicMetadata::s_formatCompilationFileArtist
static QString s_formatCompilationFileArtist
Definition: musicmetadata.h:384
MusicMetadata::setID
void setID(IdType lid)
Definition: musicmetadata.h:219
MusicMetadata::m_compilationArtist
QString m_compilationArtist
Definition: musicmetadata.h:328
MusicMetadata::setCompilation
void setCompilation(bool state)
Definition: musicmetadata.h:253
MetadataLoadingThread::MetadataLoadingThread
MetadataLoadingThread(AllMusic *parent_ptr)
Definition: musicmetadata.h:407
MusicMetadata::setFormat
void setFormat(const QString &lformat)
Definition: musicmetadata.h:237
IT_INLAY
@ IT_INLAY
Definition: musicmetadata.h:34
AlbumArtImage::m_description
QString m_description
Definition: musicmetadata.h:52
MusicMetadata::m_actualFilename
QString m_actualFilename
Definition: musicmetadata.h:364
MusicMetadata::m_titleSort
QString m_titleSort
Definition: musicmetadata.h:333
build_compdb.filename
filename
Definition: build_compdb.py:21
AlbumArtScannerThread::m_strList
QStringList m_strList
Definition: musicmetadata.h:517
MusicMetadata::setCountry
void setCountry(const QString &country)
Definition: musicmetadata.h:280
META_PUBLIC
#define META_PUBLIC
Definition: mythmetaexp.h:9
MusicMetadata::m_filename
QString m_filename
Definition: musicmetadata.h:362
MusicMetadata::setCompilationArtistId
void setCompilationArtistId(int lartistid)
Definition: musicmetadata.h:187
ImageType
ImageType
Definition: musicmetadata.h:28
AlbumArtImages::m_imageList
AlbumArtList m_imageList
Definition: musicmetadata.h:548
MusicMetadata::s_formatNormalFileArtist
static QString s_formatNormalFileArtist
Definition: musicmetadata.h:379
MusicMetadata::Year
int Year() const
Definition: musicmetadata.h:196
MusicMetadata::DiscCount
int DiscCount() const
Definition: musicmetadata.h:212
MusicMetadata::m_country
QString m_country
Definition: musicmetadata.h:375
find
static pid_list_t::iterator find(const PIDInfoMap &map, pid_list_t &list, pid_list_t::iterator begin, pid_list_t::iterator end, bool find_open)
Definition: dvbstreamhandler.cpp:363
MusicMetadata::setGenreId
void setGenreId(int lgenreid)
Definition: musicmetadata.h:193
MusicMetadata::setLogoUrl
void setLogoUrl(const QString &logourl)
Definition: musicmetadata.h:274
MusicMetadata::s_formatNormalCdArtist
static QString s_formatNormalCdArtist
Definition: musicmetadata.h:381
MusicMetadata::s_formatNormalCdTrack
static QString s_formatNormalCdTrack
Definition: musicmetadata.h:382
AlbumArtImage::m_filename
QString m_filename
Definition: musicmetadata.h:49
MusicMetadata::DiscNumber
int DiscNumber() const
Definition: musicmetadata.h:209