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 #include <QDateTime>
36 #include <QTabBar>
37 
38 class GUI_TagEdit;
39 class LyricLookupThread;
41 
47  public SayonaraDialog,
48  private Ui::InfoDialog
49 {
50 
51  Q_OBJECT
52 
53 public:
54 
55  enum class Tab : quint8 {
56  Info=0,
57  Lyrics=1,
58  Edit=2
59  };
60 
61  GUI_InfoDialog(InfoDialogContainer* container, QWidget* parent=nullptr);
62  virtual ~GUI_InfoDialog();
63 
64  void set_metadata(const MetaDataList& vd, MetaDataList::Interpretation interpretation);
65  bool has_metadata() const;
66  void show(GUI_InfoDialog::Tab tab);
67 
68 
69 private slots:
70  void lyrics_fetched();
71  void lyric_server_changed(int idx);
72 
73  void tab_index_changed_int(int idx);
74  void tab_index_changed(GUI_InfoDialog::Tab idx);
75 
76  void skin_changed() override;
77  void language_changed() override;
78 
79 
80 private:
81 
82  InfoDialogContainer* _info_dialog_container=nullptr;
83  GUI_TagEdit* _ui_tag_edit=nullptr;
84  LyricLookupThread* _lyric_thread=nullptr;
85 
86  MetaDataList::Interpretation _md_interpretation;
87 
88  QString _cover_artist;
89  QString _cover_album;
90  CoverLocation _cl;
91 
92  MetaDataList _v_md;
93  bool _is_initialized;
94 
95 
96 private:
97 
98  void init();
99 
100  void prepare_cover(const CoverLocation& cover_path);
101  void prepare_lyrics();
102  void prepare_info(MetaDataList::Interpretation mode);
103 
104  void closeEvent(QCloseEvent *e) override;
105  void showEvent(QShowEvent *e) override;
106 
107 };
108 
109 #endif /* GUI_INFODIALOG_H_ */
The GUI_InfoDialog class.
Definition: GUI_InfoDialog.h:46
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