Sayonara Player
Loading...
Searching...
No Matches
GUI_Player.h
1/* GUI_Simpleplayer.h */
2
3/* Copyright (C) 2011-2024 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
41namespace Library
42{
43 class InfoAccessor;
44 class PluginHandler;
45}
46class Shutdown;
47namespace PlayerPlugin
48{
49 class Base;
50}
51
52namespace Playlist
53{
54 class Handler;
55}
56
57class PlayManager;
59
61 public Gui::MainWindow,
63{
64 Q_OBJECT
65 PIMPL(GUI_Player)
66 UI_CLASS_SHARED_PTR(GUI_Player)
67
68 public:
69 GUI_Player(PlayManager* playManager, Playlist::Handler* playlistHandler,
70 Library::PluginHandler* libraryPluginHandler, CoverDataProvider* coverProvider,
71 Shutdown* shutdown, NotificationHandler* notificationHandler,
72 DynamicPlaybackChecker* dynamicPlaybackChecker, Library::InfoAccessor* libraryAccessor,
73 QWidget* parent);
74 ~GUI_Player() override;
75
76 void registerPreferenceDialog(QAction* dialog_action);
77 void shutdown() override;
78
79 protected:
80 void closeEvent(QCloseEvent* e) override;
81 void resizeEvent(QResizeEvent* e) override;
82 bool event(QEvent* e) override;
83
84 // NOLINTNEXTLINE(google-default-arguments)
85 Message::Answer errorReceived(const QString& error, const QString& senderName = QString()) override;
86 // NOLINTNEXTLINE(google-default-arguments)
87 Message::Answer warningReceived(const QString& error, const QString& senderName = QString()) override;
88 // NOLINTNEXTLINE(google-default-arguments)
89 Message::Answer infoReceived(const QString& error, const QString& senderName = QString()) override;
90 // NOLINTNEXTLINE(google-default-arguments)
91 Message::Answer questionReceived(const QString& info, const QString& senderName = QString(),
92 Message::QuestionType type = Message::QuestionType::YesNo) override;
93
94 void languageChanged() override;
95
96 private slots:
97 void playError(const QString& message);
98
99 void splitterMainMoved(int pos, int idx);
100 void splitterControlsMoved(int pos, int idx);
101
102 void currentLibraryChanged();
103
104 void minimize();
105
106 void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
107
108 void pluginAdded(PlayerPlugin::Base* plugin);
109 void pluginActionTriggered(bool b);
110
111 private: // NOLINT(readability-redundant-access-specifiers)
112 void initLanguage();
113 void initTrayActions();
114 void initConnections();
115 void initLibrary();
116 void initControlSplitter();
117 void initMainSplitter();
118 void initFontChangeFix();
119 void initGeometry();
120
121 void checkControlSplitter();
122
123 void fullscreenChanged();
124 void initControls();
125 void controlstyleChanged();
126
127 void showLibraryChanged();
128 void addCurrentLibrary();
129 void removeCurrentLibrary();
130
131};
132
133#endif // GUI_SIMPLEPLAYER_H
Definition CoverDataProvider.h:28
Definition DynamicPlaybackChecker.h:29
Definition GUI_Logger.h:53
Definition GUI_Player.h:63
Definition GUI_TrayIcon.h:68
The SayonaraMainWindow class.
Definition Widget.h:65
Definition LibraryManager.h:36
Definition LibraryPluginHandler.h:40
The GlobalMessageReceiverInterface class implement this class in order to have the possibility to sho...
Definition MessageReceiverInterface.h:34
Definition NotificationHandler.h:29
Definition PlayManager.h:34
Definition PlayerPluginBase.h:40
Definition PlaylistHandler.h:53
Definition Shutdown.h:33
Answer
The GlobalMessage class.
Definition Message.h:36
QuestionType
The GlobalMessage class.
Definition Message.h:50
Interface for PlayerPlugin classes. get_name() and language_changed() must be overwritten.
Definition GUI_Player.h:48