Sayonara Player
Playlist.h
1 /* DatabasePlaylist.h */
2 
3 /* Copyright (C) 2011-2017 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 #ifndef DATABASEPLAYLIST_H
22 #define DATABASEPLAYLIST_H
23 
24 #include "Database/Module.h"
25 #include "Utils/Playlist/CustomPlaylistFwd.h"
26 #include "Utils/Playlist/Sorting.h"
27 
28 class MetaData;
29 class MetaDataList;
30 
31 namespace Playlist
32 {
33  enum class StoreType : uint8_t
34  {
35  OnlyTemporary=1,
36  OnlyPermanent=2,
37  TemporaryAndPermanent=3
38  };
39 }
40 
41 namespace DB
42 {
43  class Playlist :
44  private Module
45  {
46  public:
47  Playlist(const QString& connection_name, DbId db_id);
48  ~Playlist();
49 
50  bool getAllPlaylistSkeletons(CustomPlaylistSkeletons& skeletons, ::Playlist::StoreType type, ::Playlist::SortOrder sortorder=::Playlist::SortOrder::NameAsc);
51  bool getPlaylistSkeletonById(CustomPlaylistSkeleton& skeleton);
52 
53  int createPlaylist(QString playlist_name, bool temporary);
54  bool renamePlaylist(int id, const QString& new_name);
55 
56  int getPlaylistIdByName(const QString& name);
57  bool getPlaylistById(CustomPlaylist& pl);
58 
59  // checks if playlist is already there and inserts it, if necessary
60  bool storePlaylist(const MetaDataList& vec_md, QString playlist_name, bool temporary);
61  bool storePlaylist(const MetaDataList& vec_md, int playlist_id, bool temporary);
62 
63  bool deletePlaylist(int playlist_id);
64  bool emptyPlaylist(int playlist_id);
65 
66  bool insertTrackIntoPlaylist(const MetaData& md, int playlist_id, int pos);
67  };
68 }
69 
70 #endif // DATABASEPLAYLIST_H
Definition: Module.h:35
The MetaData class.
Definition: MetaData.h:48
The MetaDataList class.
Definition: MetaDataList.h:38
Definition: Albums.h:31
The CustomPlaylist class.
Definition: CustomPlaylist.h:31
The CustomPlaylistSkeleton class.
Definition: CustomPlaylistSkeleton.h:32
Definition: AbstractPlaylist.h:44
Definition: org_mpris_media_player2_adaptor.h:20