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 
63  void show_close_button(bool show);
64 
65  void set_metadata(const MetaDataList& v_md);
66  int count() const;
67 
68 
69 signals:
70  void sig_ok_clicked(const MetaDataList&);
71  void sig_undo_clicked(int idx);
72  void sig_undo_all_clicked();
73  void sig_cancelled();
74 
75 
76 private:
77  bool is_cover_replacement_active() const;
78  void update_cover(int idx, const QString& cover_path);
79  void set_cover(const MetaData& md);
80  void show_replacement_field(bool b);
81  void init_completer();
82 
83 
87  void refresh_current_track();
88 
89 
93  void reset();
94 
95 
100  void write_changes(int idx);
101 
102 
108  bool check_idx(int idx) const;
109 
110 
111 private slots:
115  void next_button_clicked();
116 
117 
121  void prev_button_clicked();
122 
123 
124 
128  void cover_all_changed(bool b);
129 
130 
134  void undo_clicked();
135 
136 
140  void undo_all_clicked();
141 
142 
147  void progress_changed(int val);
148 
149 
153  void metadata_changed(const MetaDataList&);
154 
155  void apply_tag_from_path();
156 
157  void apply_all_tag_from_path();
158 
159 
163  void language_changed() override;
164 
168  void commit_finished();
169 
170 
171  void cb_replace_toggled(bool b);
172 
176  void load_entire_album();
177 
178 
179 protected:
180  void showEvent(QShowEvent* e) override;
181 };
182 
183 #endif
Definition: GUI_ControlsBase.h:43
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:32