Sayonara Player
SoundcloudData.h
1 /* SoundcloudData.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 SOUNDCLOUDDATA_H
22 #define SOUNDCLOUDDATA_H
23 
24 #include "Database/LibraryDatabase.h"
25 #include <QObject>
26 
27 /* this is the database interface
28  * TODO: make database connector my parent
29  * TODO: create real (new) database
30  */
31 class MetaData;
32 class MetaDataList;
33 class Artist;
34 class AlbumList;
35 
36 
37 namespace SC
38 {
39  class SearchInformationList;
40 
41  class Database :
42  public DB::LibraryDatabase
43  {
44  public:
45  Database();
46  ~Database();
47 
48  bool db_fetch_tracks(::DB::Query& q, MetaDataList& result) override;
49  bool db_fetch_albums(::DB::Query& q, AlbumList& result) override;
50  bool db_fetch_artists(::DB::Query& q, ArtistList& result) override;
51 
52  int updateArtist(const Artist& artist) override;
53  int insertArtistIntoDatabase (const Artist& artist) override;
54  int insertArtistIntoDatabase (const QString& artist) override;
55 
56  int updateAlbum(const Album& album) override;
57  int insertAlbumIntoDatabase (const Album& album) override;
58  int insertAlbumIntoDatabase (const QString& album) override;
59 
60  bool updateTrack(const MetaData& md) override;
61  bool store_metadata(const MetaDataList& v_md) override;
62  bool insertTrackIntoDatabase(const MetaData& md, int artist_id, int album_id, int album_artist_id) override;
63  bool insertTrackIntoDatabase(const MetaData& md, int artist_id, int album_id) override;
64 
65  bool apply_fixes() override;
66 
67  QString load_setting(const QString& key);
68  bool save_setting(const QString& key, const QString& value);
69  bool insert_setting(const QString& key, const QString& value);
70 
71  bool getSearchInformation(SC::SearchInformationList& list);
72 
73  QString fetch_query_albums(bool also_empty=false) const override;
74  QString fetch_query_artists(bool also_empty=false) const override;
75  QString fetch_query_tracks() const override;
76  };
77 }
78 
79 #endif // SOUNDCLOUDDATA_H
Definition: SoundcloudData.h:41
Definition: SayonaraQuery.h:36
The MetaData class.
Definition: MetaData.h:48
The MetaDataList class.
Definition: MetaDataList.h:38
Definition: LibraryDatabase.h:33
The AlbumList class.
Definition: Album.h:85
ArtistList.
Definition: Artist.h:69
The Album class.
Definition: Album.h:38
Definition: SearchInformation.h:44
Definition: SoundcloudLibraryContainer.h:30
The Artist class.
Definition: Artist.h:35