Sayonara Player
GUI_InfoDialog.h
1 /* GUI_InfoDialog.h
2 
3  * Copyright (C) 2012-2016 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 Lucio Carreras,
21  * Jul 19, 2012
22  *
23  */
24 
25 #ifndef GUI_INFODIALOG_H_
26 #define GUI_INFODIALOG_H_
27 
28 #include "GUI/Helper/SayonaraWidget/SayonaraDialog.h"
29 #include "Helper/MetaData/MetaDataList.h"
30 #include "Components/CoverLookup/CoverLocation.h"
31 
32 #include "GUI/InfoDialog/ui_GUI_InfoDialog.h"
33 
34 #include <QCloseEvent>
35 
36 class GUI_TagEdit;
38 class CoverLookup;
39 class LyricLookupThread;
40 
42  public SayonaraDialog,
43  private Ui::InfoDialog
44 {
45 
46  Q_OBJECT
47 
48 public:
49 
50  enum class Mode : quint8 {
51  Tracks=0,
52  Albums,
53  Artists,
54  Invalid
55 
56  };
57 
58  enum TabIndex {
59  TabInfo=0,
60  TabLyrics=1,
61  TabEdit=2
62  };
63 
64  GUI_InfoDialog(QWidget* parent=nullptr);
65  virtual ~GUI_InfoDialog();
66 
67  void set_metadata(const MetaDataList& vd, GUI_InfoDialog::Mode mode);
68  void show(GUI_InfoDialog::TabIndex tab);
69 
70 
71 private slots:
72  void lyrics_fetched();
73  void lyric_server_changed(int idx);
74 
75  void tab_index_changed_int(int idx);
76  void tab_index_changed(GUI_InfoDialog::TabIndex idx);
77 
78  void cover_clicked();
79  void cover_fetched(const CoverLocation&);
80 
81  void skin_changed() override;
82  void language_changed() override;
83 
84 
85 private:
86 
87  GUI_TagEdit* _ui_tag_edit=nullptr;
88  GUI_AlternativeCovers* _ui_alternative_covers=nullptr;
89 
90  CoverLookup* _cover_lookup=nullptr;
91 
92  LyricLookupThread* _lyric_thread=nullptr;
93 
94  GUI_InfoDialog::Mode _cur_mode;
95 
96  QString _cover_artist;
97  QString _cover_album;
98  CoverLocation _cl;
99 
100  MetaDataList _v_md;
101  bool _is_initialized;
102 
103 
104 private:
105 
106  void init();
107 
108  void prepare_cover(const CoverLocation& cover_path);
109  void prepare_lyrics();
110  void prepare_info(GUI_InfoDialog::Mode mode);
111 
112  void closeEvent(QCloseEvent *e) override;
113  void showEvent(QShowEvent *e) override;
114 
115 };
116 
117 #endif /* GUI_INFODIALOG_H_ */
Definition: GUI_InfoDialog.h:41
The GUI_TagEdit class.
Definition: GUI_TagEdit.h:42
The LyricLookupThread class.
Definition: LyricLookup.h:48
Definition: MetaDataList.h:46
The CoverLocation class.
Definition: CoverLocation.h:37
Definition: GUI_AlternativeCovers.h:46
Definition: ui_GUI_InfoDialog.h:339
Dialog with Settings connection. Also contains triggers for language_changed() and skin_changed()...
Definition: SayonaraDialog.h:38
The CoverLookup class.
Definition: CoverLookup.h:65