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/Covers/CoverLocation.h"
31 
32 #include "GUI/InfoDialog/ui_GUI_InfoDialog.h"
33 
34 #include <QCloseEvent>
35 
36 class GUI_TagEdit;
37 class LyricLookupThread;
39 
45  public SayonaraDialog,
46  private Ui::InfoDialog
47 {
48 
49  Q_OBJECT
50 
51 public:
52 
53  enum class Tab : quint8 {
54  Info=0,
55  Lyrics=1,
56  Edit=2
57  };
58 
59  GUI_InfoDialog(InfoDialogContainer* container, QWidget* parent=nullptr);
60  virtual ~GUI_InfoDialog();
61 
62  void set_metadata(const MetaDataList& vd, MetaDataList::Interpretation interpretation);
63  bool has_metadata() const;
64  void show(GUI_InfoDialog::Tab tab);
65 
66 
67 private slots:
68  void lyrics_fetched();
69  void lyric_server_changed(int idx);
70 
71  void tab_index_changed_int(int idx);
72  void tab_index_changed(GUI_InfoDialog::Tab idx);
73 
74  void skin_changed() override;
75  void language_changed() override;
76 
77 
78 private:
79 
80  InfoDialogContainer* _info_dialog_container=nullptr;
81  GUI_TagEdit* _ui_tag_edit=nullptr;
82  LyricLookupThread* _lyric_thread=nullptr;
83 
84  MetaDataList::Interpretation _md_interpretation;
85 
86  QString _cover_artist;
87  QString _cover_album;
88  CoverLocation _cl;
89 
90  MetaDataList _v_md;
91  bool _is_initialized;
92 
93 
94 private:
95 
96  void init();
97 
98  void prepare_cover(const CoverLocation& cover_path);
99  void prepare_lyrics();
100  void prepare_info(MetaDataList::Interpretation mode);
101 
102  void closeEvent(QCloseEvent *e) override;
103  void showEvent(QShowEvent *e) override;
104 
105 };
106 
107 #endif /* GUI_INFODIALOG_H_ */
The GUI_InfoDialog class.
Definition: GUI_InfoDialog.h:44
An interface used to abstract the usage of the info dialog. An implementing class has to return the i...
Definition: InfoDialogContainer.h:38
Definition: GUI_TagEdit.h:45
The LyricLookupThread class.
Definition: LyricLookup.h:48
Definition: MetaDataList.h:44
The CoverLocation class.
Definition: CoverLocation.h:38
Definition: ui_GUI_InfoDialog.h:345
Dialog with Settings connection. Also contains triggers for language_changed() and skin_changed()...
Definition: SayonaraDialog.h:38