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