Sayonara Player
Connector.h
1 /* Connector.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 DatabaseConnector_H
22 #define DatabaseConnector_H
23 
24 #include "Database/Base.h"
25 
26 #include "Utils/Singleton.h"
27 #include "Utils/Pimpl.h"
28 
29 #include <QList>
30 
31 #define INDEX_SIZE 3
32 
33 namespace DB
34 {
35  class LibraryDatabase;
36  class Bookmarks;
37  class Playlist;
38  class LibraryDatabase;
39  class Podcasts;
40  class Streams;
41  class VisualStyles;
42  class Settings;
43  class Library;
44  class Shortcuts;
45  class Covers;
46 
47  using LibraryDatabases=QList<LibraryDatabase*>;
48 
49  class Connector :
50  public Base
51  {
52  SINGLETON(Connector)
53  PIMPL(Connector)
54 
55  protected:
56  bool updateAlbumCissearchFix();
57  bool updateArtistCissearchFix();
58  bool updateTrackCissearchFix();
59  bool updateLostArtists();
60  bool updateLostAlbums();
61 
62  virtual bool apply_fixes();
63 
64  public:
65  virtual void clean_up();
66 
67  LibraryDatabases library_dbs() const;
68  DB::LibraryDatabase* library_db(LibraryId library_id, DbId db_id);
69  DB::LibraryDatabase* register_library_db(LibraryId library_id);
70  void delete_library_db(LibraryId library_id);
71 
72  DB::Bookmarks* bookmark_connector();
73  DB::Playlist* playlist_connector();
74  DB::Podcasts* podcast_connector();
75  DB::Streams* stream_connector();
76  DB::VisualStyles* visual_style_connector();
77  DB::Settings* settings_connector();
78  DB::Shortcuts* shortcut_connector();
79  DB::Covers* cover_connector();
80  DB::Library* library_connector();
81  };
82 }
83 #endif // DatabaseConnector_H
Definition: Streams.h:29
Definition: Playlist.h:43
Definition: Shortcuts.h:32
Definition: CoverConnector.h:35
Definition: LibraryDatabase.h:33
Definition: Settings.h:30
Definition: Base.h:33
Definition: Podcasts.h:29
Definition: Connector.h:49
The Settings class.
Definition: Settings.h:37
Definition: Bookmarks.h:29
Definition: VisStyles.h:31
An interface class needed when implementing a library plugin.
Definition: CachingThread.h:31
Definition: Library.h:38
The Bookmarks logic class.
Definition: Bookmarks.h:36
Definition: org_mpris_media_player2_adaptor.h:20