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