Sayonara Player
GenreFetcher.h
1 /* GenreFetcher.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 GENREFETCHER_H
24 #define GENREFETCHER_H
25 
26 #include <QObject>
27 #include "Utils/Pimpl.h"
28 #include "Utils/SetFwd.h"
29 
30 class QStringList;
31 class MetaDataList;
32 class LocalLibrary;
33 class Genre;
34 
35 namespace Tagging
36 {
37  class Editor;
38 }
39 
40 class GenreFetcher :
41  public QObject
42 {
43  Q_OBJECT
44  PIMPL(GenreFetcher)
45 
46 signals:
47  void sig_genres_fetched();
48  void sig_progress(int progress);
49  void sig_finished();
50 
51 private:
52  Tagging::Editor* tag_edit();
53 
54 public:
55  explicit GenreFetcher(QObject* parent=nullptr);
56  ~GenreFetcher();
57 
58  SP::Set<Genre> genres() const;
59 
60  void add_genre_to_md(const MetaDataList& v_md, const Genre& genre);
61 
62  void create_genre(const Genre& genre);
63  void delete_genre(const Genre& genre);
64  void rename_genre(const Genre& old_genre, const Genre& new_genre);
65 
66  void set_local_library(LocalLibrary* local_library);
67 
68 public slots:
69  void reload_genres();
70 
71 private slots:
72  void metadata_changed(const MetaDataList& v_md_old, const MetaDataList& v_md_new);
73  void metadata_deleted(const MetaDataList& v_md_deleted);
74 
75  void tag_edit_finished();
76 };
77 
78 
79 #endif // GENREFETCHER_H
Definition: LocalLibrary.h:35
The MetaDataList class.
Definition: MetaDataList.h:38
The GUI_TagEdit class.
Definition: AbstractLibrary.h:42
Definition: GenreFetcher.h:40
Definition: Genre.h:29
A set structure. Inherited from std::set with some useful methods. For integer and String this set is...
Definition: AbstractPlaylist.h:38
The TagEdit class Metadata has to be added using the set_metadata(const MetaDataList&) method....
Definition: Editor.h:44