Sayonara Player
GUI_Player.h
1/* GUI_Simpleplayer.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 GUI_SIMPLEPLAYER_H
22#define GUI_SIMPLEPLAYER_H
23
24#include "Gui/Utils/GuiClass.h"
25#include "Gui/Utils/Widgets/Widget.h"
26#include "Utils/Message/MessageReceiverInterface.h"
27#include "Utils/Pimpl.h"
28
29#include <QSystemTrayIcon>
30
31class GUI_TrayIcon;
32class GUI_Logger;
33class QAction;
34class QMessageBox;
35class QTranslator;
36
37UI_FWD(GUI_Player)
38
41
42namespace PlayerPlugin
43{
44 class Base;
45}
46
47namespace Playlist
48{
49 class Handler;
50}
51
52class PlayManager;
53
55 public Gui::MainWindow,
57{
58 Q_OBJECT
59 PIMPL(GUI_Player)
60 UI_CLASS_SHARED_PTR(GUI_Player)
61
62 public:
63 GUI_Player(PlayManager* playManager, Playlist::Handler* playlistHandler, CoverDataProvider* coverProvider,
64 DynamicPlaybackChecker* dynamicPlaybackChecker, QWidget* parent = nullptr);
65 ~GUI_Player() override;
66
67 void registerPreferenceDialog(QAction* dialog_action);
68 void shutdown() override;
69
70 protected:
71 void closeEvent(QCloseEvent* e) override;
72 void resizeEvent(QResizeEvent* e) override;
73 bool event(QEvent* e) override;
74
75 // NOLINTNEXTLINE(google-default-arguments)
76 Message::Answer errorReceived(const QString& error, const QString& senderName = QString()) override;
77 // NOLINTNEXTLINE(google-default-arguments)
78 Message::Answer warningReceived(const QString& error, const QString& senderName = QString()) override;
79 // NOLINTNEXTLINE(google-default-arguments)
80 Message::Answer infoReceived(const QString& error, const QString& senderName = QString()) override;
81 // NOLINTNEXTLINE(google-default-arguments)
82 Message::Answer questionReceived(const QString& info, const QString& senderName = QString(),
83 Message::QuestionType type = Message::QuestionType::YesNo) override;
84
85 void languageChanged() override;
86
87 private slots:
88 void playError(const QString& message);
89
90 void splitterMainMoved(int pos, int idx);
91 void splitterControlsMoved(int pos, int idx);
92
93 void currentLibraryChanged();
94
95 void minimize();
96
97 void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
98
99 void pluginAdded(PlayerPlugin::Base* plugin);
100 void pluginActionTriggered(bool b);
101
102 private: // NOLINT(readability-redundant-access-specifiers)
103 void initLanguage();
104 void initTrayActions();
105 void initConnections();
106 void initLibrary();
107 void initControlSplitter();
108 void initMainSplitter();
109 void initFontChangeFix();
110 void initGeometry();
111
112 void checkControlSplitter();
113
114 void fullscreenChanged();
115 void initControls();
116 void controlstyleChanged();
117
118 void showLibraryChanged();
119 void addCurrentLibrary();
120 void removeCurrentLibrary();
121
122};
123
124#endif // GUI_SIMPLEPLAYER_H
Definition: CoverDataProvider.h:28
Definition: DynamicPlayback.h:24
Definition: GUI_Logger.h:53
Definition: GUI_Player.h:57
Definition: GUI_TrayIcon.h:67
The SayonaraMainWindow class.
Definition: Widget.h:65
The GlobalMessageReceiverInterface class implement this class in order to have the possibility to sho...
Definition: MessageReceiverInterface.h:34
Global handler for current playback state (Singleton)
Definition: PlayManager.h:36
Definition: PlayerPluginBase.h:40
Global handler for playlists.
Definition: PlaylistHandler.h:56
Answer
The GlobalMessage class.
Definition: Message.h:35
QuestionType
The GlobalMessage class.
Definition: Message.h:48
Interface for PlayerPlugin classes. get_name() and language_changed() must be overwritten.
Definition: GUI_Player.h:43