Sayonara Player
Loading...
Searching...
No Matches
GUI_InfoDialog.h
1/* GUI_InfoDialog.h
2
3 * Copyright (C) 2011-2024 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 * created by Michael Lugmair (Lucio Carreras),
21 * Jul 19, 2012
22 *
23 */
24
25#ifndef GUI_INFODIALOG_H_
26#define GUI_INFODIALOG_H_
27
28#include "Gui/Utils/Widgets/Dialog.h"
29#include "Utils/Pimpl.h"
30
31namespace Cover
32{
33 class Location;
34}
35
36UI_FWD(InfoDialog)
37
39 public Gui::Dialog
40{
41 Q_OBJECT
42 PIMPL(GUI_InfoDialog)
43 UI_CLASS_SHARED_PTR(InfoDialog)
44
45 public:
46 enum class Tab :
47 uint8_t
48 {
49 Info = 0,
50 Lyrics = 1,
51 Edit = 2
52 };
53
54 explicit GUI_InfoDialog(QWidget* parent = nullptr);
55 ~GUI_InfoDialog() override;
56
57 void setMetadata(const MetaDataList& tracks, MD::Interpretation interpretation);
58 [[nodiscard]] bool hasMetadata() const;
59 void setBusy(bool b);
60
61 GUI_InfoDialog::Tab show(GUI_InfoDialog::Tab track);
62 void showCoverEditTab();
63
64 protected:
65 void skinChanged() override;
66 void languageChanged() override;
67 void closeEvent(QCloseEvent* e) override;
68 void resizeEvent(QResizeEvent* e) override;
69
70 private slots:
71 void tabIndexChanged(int idx);
72 void writeCoversToTracksClicked();
73 void coverChanged();
74 void metadataChanged();
75
76 private: // NOLINT(readability-redundant-access-specifiers)
77 void init();
78 void initTagEdit();
79 void initLyrics();
80
81 void showInfoTab();
82 void showLyricsTab();
83 void showTagEditTab();
84
85 void prepareCover(const Cover::Location& coverLocation);
86 void prepareInfo(MD::Interpretation mode);
87 void enableTabs();
88 void switchTab(Tab tab);
89 using Gui::Dialog::show;
90};
91
92#endif /* GUI_INFODIALOG_H_ */
Definition CoverLocation.h:39
Definition GUI_InfoDialog.h:40
Definition MetaDataList.h:34