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