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 
34 #include <QMap>
35 
36 class CustomPlaylist;
39 class PlaylistHandler;
40 
45 class PlaylistChooser : public QObject {
46  Q_OBJECT
47 
48 public:
50  ~PlaylistChooser();
51 
52  void delete_playlist(int id);
53 
54  void load_single_playlist(int id);
55 
56  void save_playlist(int id);
57  void save_playlist(QString playlist_name);
58  void save_playlist_file(QString filename, bool);
59  void clear_playlist();
60  void playlist_files_selected(const QStringList& lst);
61  int find_playlist(const QString& name) const;
62 
63 signals:
64  void sig_all_playlists_loaded(const CustomPlaylistSkeletons&);
65 
66 
67 public slots:
68  void load_all_playlists();
69 
70 
71 private:
72  CustomPlaylistSkeletons _skeletons;
73  int _import_state;
74 
75  PlaylistHandler* _playlist_handler=nullptr;
76  PlaylistDBConnector* _playlist_db_connector=nullptr;
77  CustomPlaylist find_custom_playlist(int id);
78 
79 
80 };
81 
82 #endif /* PLAYLISTS_H_ */
The PlaylistChooser class.
Definition: PlaylistChooser.h:45
PlaylistDBConnector is responsible for fetching playlist data from database, especially the handling ...
Definition: PlaylistDBConnector.h:37
Global handler for playlists.
Definition: PlaylistHandler.h:48
The CustomPlaylist class.
Definition: CustomPlaylist.h:50
The CustomPlaylistSkeleton class.
Definition: CustomPlaylist.h:34