Sayonara Player
PlaylistChooser.h
1 /* PlaylistChooser.h */
2 
3 /* Copyright (C) 2011-2016 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 
23 #ifndef PLAYLISTCHOOSER_H_
24 #define PLAYLISTCHOOSER_H_
25 
26 #define STATE_WAIT 0
27 #define STATE_IMPORT_SUCCESS 1
28 #define STATE_IMPORT_FAIL 2
29 
30 #include "Helper/MetaData/MetaData.h"
31 #include "Helper/Playlist/CustomPlaylist.h"
32 
33 #include <QMap>
34 
35 class CustomPlaylist;
37 class PlaylistDBWrapper;
38 class PlaylistHandler;
39 
44 class PlaylistChooser : public QObject {
45  Q_OBJECT
46 
47 public:
49  ~PlaylistChooser();
50 
51  void delete_playlist(int id);
52 
53  void load_single_playlist(int id);
54 
55  void save_playlist(int id);
56  void save_playlist(QString playlist_name);
57  void save_playlist_file(QString filename, bool);
58  void clear_playlist();
59  void playlist_files_selected(const QStringList& lst);
60  int find_playlist(const QString& name) const;
61 
62 signals:
63  void sig_all_playlists_loaded(const CustomPlaylistSkeletons&);
64 
65 
66 public slots:
67  void load_all_playlists();
68 
69 
70 private:
71  CustomPlaylistSkeletons _skeletons;
72  int _import_state;
73 
74  PlaylistHandler* _playlist_handler=nullptr;
75  PlaylistDBWrapper* _playlist_db_connector=nullptr;
76  CustomPlaylist find_custom_playlist(int id);
77 
78 
79 };
80 
81 #endif /* PLAYLISTS_H_ */
PlaylistDBWrapper is responsible for fetching playlist data from database, especially the handling be...
Definition: PlaylistDBWrapper.h:37
The PlaylistChooser class.
Definition: PlaylistChooser.h:44
Global handler for playlists.
Definition: PlaylistHandler.h:47
The CustomPlaylist class.
Definition: CustomPlaylist.h:50
The CustomPlaylistSkeleton class.
Definition: CustomPlaylist.h:34