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