Sayonara Player
LibraryManager.h
1 /* LibraryManager.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 
22 
23 #ifndef LIBRARYMANAGER_H
24 #define LIBRARYMANAGER_H
25 
26 #include "Utils/Singleton.h"
27 #include "Utils/Pimpl.h"
28 #include "Utils/Settings/SayonaraClass.h"
29 
30 #include <QList>
31 #include <QObject>
32 
33 class LocalLibrary;
34 
35 namespace Library
36 {
37  class Info;
38  class Manager :
39  public QObject,
40  public SayonaraClass
41  {
42  Q_OBJECT
43  PIMPL(Manager)
44  SINGLETON(Manager)
45 
46  friend class LocalLibrary;
47 
48  signals:
49  void sig_path_changed(LibraryId id);
50  void sig_added(LibraryId id);
51  void sig_renamed(LibraryId id);
52  void sig_moved(LibraryId id, int from, int to);
53  void sig_removed(LibraryId id);
54 
55  private:
56  void reset();
57 
58  public:
59  LibraryId add_library(const QString& name, const QString& path);
60  bool rename_library(LibraryId id, const QString& name);
61  bool remove_library(LibraryId id);
62  bool move_library(int old_row, int new_row);
63  bool change_library_path(LibraryId id, const QString& path);
64 
65  QList<Info> all_libraries() const;
66 
67  Info library_info(LibraryId id) const;
68  Info library_info_by_path(const QString& path) const;
69  Info library_info_by_sympath(const QString& path) const;
70 
71  int count() const;
72 
73  LocalLibrary* library_instance(LibraryId id);
74 
75  static QString request_library_name(const QString& path);
76  };
77 }
78 
79 
80 #endif // LIBRARYMANAGER_H
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
Definition: LibraryManager.h:38
Definition: LocalLibrary.h:35
Definition: LibraryInfo.h:30
An interface class needed when implementing a library plugin.
Definition: CachingThread.h:31
Definition: org_mpris_media_player2_adaptor.h:20