Sayonara Player
GUI_Lyrics.h
1 /* GUI_Lyrics.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 
22 
23 #ifndef GUI_LYRICS_H
24 #define GUI_LYRICS_H
25 
26 #include <QWidget>
27 #include "Utils/Pimpl.h"
28 #include "GUI/Utils/Widgets/Widget.h"
29 
30 
31 UI_FWD(GUI_Lyrics)
32 class MetaData;
33 
34 class GUI_Lyrics :
35  public Gui::Widget
36 {
37  Q_OBJECT
38  UI_CLASS(GUI_Lyrics)
39  PIMPL(GUI_Lyrics)
40 
41 signals:
42  void sig_closed();
43 
44 public:
45  explicit GUI_Lyrics(QWidget *parent = nullptr);
46  ~GUI_Lyrics();
47 
48  void set_metadata(const MetaData& md);
49 
50 private:
51  void init();
52 
53  void zoom(qreal font_size);
54  void setup_sources();
55  void choose_source();
56  void show_lyrics(const QString& lyrics, const QString& header, bool rich);
57  void show_local_lyrics();
58  void set_save_button_text();
59 
60 private slots:
61  void zoom_in();
62  void zoom_out();
63 
64  void lyrics_fetched();
65  void lyric_server_changed(int idx);
66 
67  void switch_pressed();
68  void prepare_lyrics();
69  void save_lyrics_clicked();
70 
71 protected:
72  void language_changed() override;
73 
74  void showEvent(QShowEvent* e) override;
75  void wheelEvent(QWheelEvent* e) override;
76  void keyPressEvent(QKeyEvent* e) override;
77 };
78 
79 
80 #endif // GUI_LYRICS_H
The MetaData class.
Definition: MetaData.h:48
Definition: GUI_Lyrics.h:34
Widget with Settings connection. Also contains triggers for language_changed() and skin_changed() wi...
Definition: Widget.h:38