Sayonara Player
VisualPlugin.h
1 /* VisualPlugin.h */
2 
3 /* Copyright (C) 2011-2020 Michael Lugmair (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 ENGINEPLUGIN_H
22 #define ENGINEPLUGIN_H
23 
24 #include "GUI_StyleSettings.h"
25 #include "VisualStyleTypes.h"
26 #include "Gui/Plugins/PlayerPluginBase.h"
27 
28 #include "Utils/Pimpl.h"
29 
30 #include <QTimer>
31 #include <QPushButton>
32 
33 class EngineHandler;
34 class PlayManager;
36 
38 {
39  Q_OBJECT
40  PIMPL(VisualPlugin)
41 private:
42  void set_button_sizes();
43  void set_buttons_visible(bool b);
44 
45 protected:
46  VisualColorStyleChooser* m_ecsc=nullptr;
47 
48  void init_buttons();
49 
50  virtual void showEvent(QShowEvent* e) override;
51  virtual void closeEvent(QCloseEvent* e) override;
52  virtual void resizeEvent(QResizeEvent* e) override;
53  virtual void mousePressEvent(QMouseEvent* e) override;
54  virtual void enterEvent(QEvent* e) override;
55  virtual void leaveEvent(QEvent* e) override;
56 
57  virtual QWidget* widget()=0;
58  virtual ColorStyle currentStyle() const=0;
59  virtual int currentStyleIndex() const=0;
60  virtual bool hasSmallButtons() const=0;
61 
62  void stop_fadeout_timer();
63 
64 private slots:
65  void style_changed();
66 
67 
68 protected slots:
69  virtual void config_clicked();
70  virtual void next_clicked();
71  virtual void prev_clicked();
72 
73  virtual void doFadeoutStep()=0;
74 
75  virtual void playstate_changed(PlayState play_state);
76  virtual void played();
77  virtual void paused();
78  virtual void stopped();
79 
80 
81 public slots:
82  virtual void update_style(int new_index)=0;
83  virtual void update();
84  virtual void initUi() override;
85 
86 
87 public:
88  explicit VisualPlugin(PlayManager* playManager, QWidget* parent=nullptr);
89  virtual ~VisualPlugin();
90 
91  virtual bool hasTitle() const override;
92 };
93 
94 #endif // ENGINEPLUGIN_H
95 
96 
PlayerPlugin::Base
Definition: PlayerPluginBase.h:40
PlayManager
Global handler for current playback state (Singleton)
Definition: PlayManager.h:36
VisualPlugin
Definition: VisualPlugin.h:38
VisualColorStyleChooser
Definition: VisualColorStyleChooser.h:33
ColorStyle
Definition: VisualStyleTypes.h:37
VisualPlugin::hasTitle
virtual bool hasTitle() const override
indicates if title bar is shown or not