Sayonara Player
GUI_TagEdit.h
1 /* GUI_TagEdit.h */
2 
3 /* Copyright (C) 2011-2020 Michael Lugmair (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 GUI_TAGEDIT_H_
22 #define GUI_TAGEDIT_H_
23 
24 #include "Gui/Utils/Widgets/Widget.h"
25 #include "Components/Tagging/Expression.h"
26 #include "Utils/Pimpl.h"
27 
32 namespace Tagging
33 {
34  class Editor;
35 }
36 
37 class MetaDataList;
38 class MetaData;
39 
40 UI_FWD(GUI_TagEdit)
41 
42 class GUI_TagEdit :
43  public Gui::Widget
44 {
45  Q_OBJECT
46  UI_CLASS(GUI_TagEdit)
47  PIMPL(GUI_TagEdit)
48 
49  signals:
50  void sigOkClicked(const MetaDataList&);
51  void sigUndoClicked(int idx);
52  void sigUndoAllClicked();
53  void sigCancelled();
54 
55  public:
56  explicit GUI_TagEdit(QWidget* parent=nullptr);
57  ~GUI_TagEdit() override;
58 
62  void commit();
63 
67  void cancel();
68 
74  void showCloseButton(bool show);
75 
76  void showDefaultTab();
80  void showCoverTab();
81 
82 
83  void setMetadata(const MetaDataList& v_md);
84  int count() const;
85 
86  Tagging::Editor* editor() const;
87 
88  private:
89  void setCurrentIndex(int index);
90  void initCompleter();
91 
95  void refreshCurrentTrack();
96 
100  void reset();
101 
106  void writeChanges(int idx);
107 
113  bool checkIndex(int idx) const;
114 
115  Tagging::Editor* createEditor();
116  void runEditor(Tagging::Editor* editor);
117 
118  private slots:
122  void nextButtonClicked();
123 
127  void prevButtonClicked();
128 
132  void undoClicked();
133 
137  void undoAllClicked();
138 
143  void progressChanged(int val);
144 
148  void metadataChanged(const MetaDataList&);
149 
150  void applyTagFromPath();
151 
152  void applyAllTagFromPath();
153 
157  void commitStarted();
158 
162  void commitFinished();
163 
167  void loadEntireAlbum();
168 
169  protected:
170  void showEvent(QShowEvent* e) override;
171  void languageChanged() override;
172 };
173 
174 #endif
Definition: GUI_TagEdit.h:42
The MetaData class.
Definition: MetaData.h:45
The MetaDataList class.
Definition: MetaDataList.h:35
The GUI_TagEdit class.
Definition: GenreFetcher.h:33
The TagEdit class Metadata has to be added using the set_metadata(const MetaDataList&) method....
Definition: Editor.h:41