Sayonara Player
GUI_TagEdit.h
1 /* GUI_TagEdit.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 #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 
28 class QString;
33 namespace Tagging
34 {
35  class Editor;
36 }
37 
38 class MetaDataList;
39 class MetaData;
40 
41 UI_FWD(GUI_TagEdit)
42 
43 class GUI_TagEdit :
44  public Gui::Widget
45 {
46  Q_OBJECT
47  UI_CLASS(GUI_TagEdit)
48  PIMPL(GUI_TagEdit)
49 
50 public:
51  explicit GUI_TagEdit(QWidget* parent=nullptr);
52  ~GUI_TagEdit();
53 
57  void commit();
58 
62  void cancel();
63 
64  void show_close_button(bool show);
65 
66  void set_metadata(const MetaDataList& v_md);
67  int count() const;
68 
69 
70 signals:
71  void sig_ok_clicked(const MetaDataList&);
72  void sig_undo_clicked(int idx);
73  void sig_undo_all_clicked();
74  void sig_cancelled();
75 
76 
77 private:
78  bool is_cover_replacement_active() const;
79  void update_cover(int idx, const QString& cover_path);
80  void set_cover(const MetaData& md);
81  void show_replacement_field(bool b);
82  void init_completer();
83 
84 
88  void refresh_current_track();
89 
90 
94  void reset();
95 
96 
101  void write_changes(int idx);
102 
103 
109  bool check_idx(int idx) const;
110 
111 
112 private slots:
116  void next_button_clicked();
117 
118 
122  void prev_button_clicked();
123 
124 
125 
129  void cover_all_changed(bool b);
130 
131 
135  void undo_clicked();
136 
137 
141  void undo_all_clicked();
142 
143 
148  void progress_changed(int val);
149 
150 
154  void metadata_changed(const MetaDataList&);
155 
156  void apply_tag_from_path();
157 
158  void apply_all_tag_from_path();
159 
160 
164  void language_changed() override;
165 
169  void commit_finished();
170 
171 
172  void cb_replace_toggled(bool b);
173 
177  void load_entire_album();
178 
179 
180 protected:
181  void showEvent(QShowEvent* e) override;
182 };
183 
184 #endif
Definition: GUI_ControlsBase.h:43
Definition: GUI_TagEdit.h:43
The MetaData class.
Definition: MetaData.h:48
The MetaDataList class.
Definition: MetaDataList.h:38
The GUI_TagEdit class.
Definition: AbstractLibrary.h:42