MythTV master
playlistcontainer.h
Go to the documentation of this file.
1#ifndef PLAYLIST_CONTAINER_H
2#define PLAYLIST_CONTAINER_H
3
4// qt
5#include <QCoreApplication>
6
7// MythTV
9
10
11static constexpr const char* DEFAULT_PLAYLIST_NAME { "default_playlist_storage" };
12static constexpr const char* DEFAULT_STREAMLIST_NAME { "stream_playlist" };
13
15class Playlist;
16class AllMusic;
17
19{
20 public:
22 AllMusic *all_music_ptr)
23 : MThread("PlaylistLoading"), m_parent(parent_ptr),
24 m_allMusic(all_music_ptr) {}
25
26 void run() override; // MThread
27
28 private:
30 AllMusic *m_allMusic {nullptr};
31};
32
34{
36
37 public:
38 explicit PlaylistContainer(AllMusic *all_music);
42
43 void load();
44 void resync(void);
45 void describeYourself(void) const; // debugging
46
48 Playlist* getPlaylist(int id);
49 Playlist* getPlaylist(const QString &name);
51
52 void save();
53
54 void createNewPlaylist(const QString &name);
55 void copyNewPlaylist(const QString &name);
56 void copyToActive(int index);
57
58 QString getPlaylistName(int index, bool &reference);
59
60 void deletePlaylist(int kill_me);
61 void renamePlaylist(int index, const QString& new_name);
62
63 bool nameIsUnique(const QString& a_name, int which_id);
64
65 void clearActive();
66
67 bool doneLoading() const{return m_doneLoading;}
68
69 bool cleanOutThreads();
70
71 void FillIntelliWeights(int &rating, int &playcount,
72 int &lastplay, int &random) const;
73 QList<Playlist*> *getPlaylists(void) { return m_allPlaylists; }
74 QStringList getPlaylistNames(void);
75
76 private:
79 QList<Playlist*> *m_allPlaylists {nullptr};
80
82 bool m_doneLoading {false};
83 QString m_myHost;
84
89};
90
91#endif // PLAYLIST_CONTAINER_H
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:49
void describeYourself(void) const
bool doneLoading() const
Playlist * getPlaylist(int id)
PlaylistLoadingThread * m_playlistsLoader
void renamePlaylist(int index, const QString &new_name)
PlaylistContainer(AllMusic *all_music)
PlaylistContainer & operator=(const PlaylistContainer &rhs)=delete
PlaylistContainer(const PlaylistContainer &rhs)=delete
void FillIntelliWeights(int &rating, int &playcount, int &lastplay, int &random) const
void copyToActive(int index)
Playlist * getStreamPlaylist(void)
void createNewPlaylist(const QString &name)
QList< Playlist * > * getPlaylists(void)
QString getPlaylistName(int index, bool &reference)
bool nameIsUnique(const QString &a_name, int which_id)
void deletePlaylist(int kill_me)
Playlist * m_streamPlaylist
QList< Playlist * > * m_allPlaylists
Playlist * getActive(void)
Q_DECLARE_TR_FUNCTIONS(PlaylistContainer)
void copyNewPlaylist(const QString &name)
Playlist * m_activePlaylist
QStringList getPlaylistNames(void)
PlaylistContainer * m_parent
void run() override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
PlaylistLoadingThread(PlaylistContainer *parent_ptr, AllMusic *all_music_ptr)
def rating(profile, smoonURL, gate)
Definition: scan.py:36
static constexpr const char * DEFAULT_STREAMLIST_NAME
static constexpr const char * DEFAULT_PLAYLIST_NAME