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