Sayonara Player
EnginePlugin.h
1 /* EnginePlugin.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 ENGINEPLUGIN_H
22 #define ENGINEPLUGIN_H
23 
24 #include "GUI_StyleSettings.h"
25 #include "Interfaces/PlayerPlugin/PlayerPlugin.h"
26 #include "Components/PlayManager/PlayState.h"
27 
28 #include <QTimer>
29 #include <QPushButton>
30 
32 class EngineHandler;
33 class PlayManager;
35 {
36  Q_OBJECT
37 
38 protected:
39 
40  QPushButton* _btn_config=nullptr;
41  QPushButton* _btn_prev=nullptr;
42  QPushButton* _btn_next=nullptr;
43  QPushButton* _btn_close=nullptr;
44 
45  PlayManager* _play_manager=nullptr;
46  EngineHandler* _engine=nullptr;
47  GUI_StyleSettings* _ui_style_settings=nullptr;
48  EngineColorStyleChooser* _ecsc=nullptr;
49  ColorStyle _cur_style;
50  int _cur_style_idx;
51 
52  QTimer* _timer=nullptr;
53  int _timer_stopped;
54 
55  void init_buttons(bool small);
56 
57  //virtual void showEvent(QShowEvent* e) override;
58  virtual void closeEvent(QCloseEvent* e) override;
59  virtual void resizeEvent(QResizeEvent* e) override;
60  virtual void mousePressEvent(QMouseEvent* e) override;
61  virtual void enterEvent(QEvent* e) override;
62  virtual void leaveEvent(QEvent* e) override;
63 
64 
65 protected slots:
66 
67  virtual void config_clicked();
68  virtual void next_clicked();
69  virtual void prev_clicked();
70 
71  virtual void timed_out()=0;
72 
73  virtual void playstate_changed(PlayState play_state);
74  virtual void played();
75  virtual void paused();
76  virtual void stopped();
77 
78 
79 public slots:
80  virtual void sl_update_style()=0;
81  virtual void update();
82  virtual void init_ui() override;
83 
84 
85 public:
86  explicit EnginePlugin(QWidget* parent=nullptr);
87  virtual ~EnginePlugin();
88 
89  virtual bool is_title_shown() const override;
90 };
91 
92 #endif // ENGINEPLUGIN_H
93 
94 
virtual bool is_title_shown() const override
indicates if title bar is shown or not
Global handler for current playback state (Singleton)
Definition: PlayManager.h:37
Definition: EngineColorStyleChooser.h:32
The EngineHandler class.
Definition: EngineHandler.h:41
Definition: StyleTypes.h:34
Definition: GUI_StyleSettings.h:32
Definition: EnginePlugin.h:34
Interface for PlayerPlugin classes. get_name() and language_changed() must be overwritten.
Definition: PlayerPlugin.h:38
PlayState
The PlayState enum.
Definition: PlayState.h:30