MythTV  master
musicdata.h
Go to the documentation of this file.
1 #ifndef MUSICDATA_H_
2 #define MUSICDATA_H_
3 
4 #include <utility>
5 
6 // qt
7 #include <QRunnable>
8 
9 // myth
10 #include <mythexp.h>
11 #include <mythcorecontext.h>
12 
13 // mythmusic
14 #include "playlistcontainer.h"
15 
16 class PlaylistContainer;
17 class AllMusic;
18 class AllStream;
19 
21 class SendStringListThread : public QRunnable
22 {
23  public:
24  explicit SendStringListThread(QStringList strList)
25  : m_strList(std::move(strList)) {}
26 
27  void run() override // QRunnable
28  {
30  }
31 
32  private:
33  QStringList m_strList;
34 };
35 
36 //----------------------------------------------------------------------------
37 
38 class MusicData : public QObject
39 {
40  Q_OBJECT
41 
42  public:
43 
44  MusicData() = default;
45  ~MusicData() override;
46 
47  static void scanMusic(void);
48  void loadMusic(void) const;
49 
50  public slots:
51  void reloadMusic(void) const;
52 
53  public:
55  AllMusic *m_all_music {nullptr};
57  bool m_initialized {false};
58 };
59 
60 // This global variable contains the MusicData instance for the application
62 
63 #endif
playlistcontainer.h
MPUBLIC
#define MPUBLIC
Definition: mythexp.h:10
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:1379
AllMusic
Definition: musicmetadata.h:418
SendStringListThread::SendStringListThread
SendStringListThread(QStringList strList)
Definition: musicdata.h:24
mythexp.h
MusicData::~MusicData
~MusicData() override
Definition: musicdata.cpp:26
MusicData::m_initialized
bool m_initialized
Definition: musicdata.h:57
slots
unsigned int slots[4]
Definition: element.cpp:38
MusicData::reloadMusic
void reloadMusic(void) const
reload music after a scan, rip or import
Definition: musicdata.cpp:57
MusicData::m_all_streams
AllStream * m_all_streams
Definition: musicdata.h:56
AllStream
Definition: musicmetadata.h:476
SendStringListThread
send a message to the master BE without blocking the UI thread
Definition: musicdata.h:22
MusicData
Definition: musicdata.h:39
gCoreContext
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
Definition: mythcorecontext.cpp:57
MusicData::m_all_playlists
PlaylistContainer * m_all_playlists
Definition: musicdata.h:54
SendStringListThread::m_strList
QStringList m_strList
Definition: musicdata.h:33
MusicData::loadMusic
void loadMusic(void) const
Definition: musicdata.cpp:98
gMusicData
MPUBLIC MusicData * gMusicData
Definition: musicdata.cpp:20
mythcorecontext.h
MusicData::m_all_music
AllMusic * m_all_music
Definition: musicdata.h:55
MusicData::MusicData
MusicData()=default
MusicData::scanMusic
static void scanMusic(void)
Definition: musicdata.cpp:47
PlaylistContainer
Definition: playlistcontainer.h:34
SendStringListThread::run
void run() override
Definition: musicdata.h:27