Sayonara Player
GUI_TagEdit.h
1 /* GUI_TagEdit.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 #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 public:
50  explicit GUI_TagEdit(QWidget* parent=nullptr);
51  ~GUI_TagEdit();
52 
56  void commit();
57 
61  void cancel();
62 
68  void show_close_button(bool show);
69 
73  void show_cover_tab();
74 
75  void set_metadata(const MetaDataList& v_md);
76  int count() const;
77 
78  Tagging::Editor* editor() const;
79 
80 
81 signals:
82  void sig_ok_clicked(const MetaDataList&);
83  void sig_undo_clicked(int idx);
84  void sig_undo_all_clicked();
85  void sig_cancelled();
86 
87 
88 private:
89  void set_current_index(int index);
90  void init_completer();
91 
92 
96  void refresh_current_track();
97 
98 
102  void reset();
103 
104 
109  void write_changes(int idx);
110 
111 
117  bool check_idx(int idx) const;
118 
119 
120 private slots:
124  void next_button_clicked();
125 
126 
130  void prev_button_clicked();
131 
132 
136  void undo_clicked();
137 
138 
142  void undo_all_clicked();
143 
144 
149  void progress_changed(int val);
150 
151 
155  void metadata_changed(const MetaDataList&);
156 
157  void apply_tag_from_path();
158 
159  void apply_all_tag_from_path();
160 
161 
165  void language_changed() override;
166 
170  void commit_started();
171 
175  void commit_finished();
176 
177 
181  void load_entire_album();
182 
183 
184 protected:
185  void showEvent(QShowEvent* e) override;
186 };
187 
188 #endif
Definition: GUI_TagEdit.h:42
The MetaData class.
Definition: MetaData.h:44
The MetaDataList class.
Definition: MetaDataList.h:37
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