Sayonara Player
EngineHandler.h
1 /* EngineHandler.h */
2 
3 /* Copyright (C) 2011-2019 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 ENGINEHANDLER_H_
22 #define ENGINEHANDLER_H_
23 
24 #include "Components/PlayManager/PlayState.h"
25 #include "Utils/Singleton.h"
26 #include "Utils/Pimpl.h"
27 
28 #include <QObject>
29 
30 #define EngineHandler_change_track_md static_cast<void (EngineHandler::*) (const MetaData& md)>(&EngineHandler::change_track)
31 
33 class LevelReceiver;
34 class SpectrumReceiver;
35 
36 namespace Engine
37 {
42  class Handler :
43  public QObject
44  {
45  Q_OBJECT
46  SINGLETON_QOBJECT(Handler)
47  PIMPL(Handler)
48 
49  signals:
50  void sig_cover_data(const QByteArray& data, const QString& mimetype);
51 
52  public:
53  void shutdown();
54  bool is_valid() const;
55 
56  void register_raw_sound_receiver(RawSoundReceiverInterface* receiver);
57  void unregister_raw_sound_receiver(RawSoundReceiverInterface* receiver);
58 
59  void add_level_receiver(LevelReceiver* receiver);
60  void add_spectrum_receiver(SpectrumReceiver* receiver);
61 
62  void set_equalizer(int band, int value);
63 
64  private slots:
65  void playstate_changed(PlayState state);
66 
67  void new_data(const uchar* data, uint64_t n_bytes);
68  void spectrum_changed();
69  void level_changed();
70  };
71 }
72 
73 #endif
74 
75 
The LevelReceiver class.
Definition: SoundOutReceiver.h:32
PlayState
The PlayState enum.
Definition: PlayState.h:28
Definition: Callbacks.h:34
The EngineHandler class.
Definition: EngineHandler.h:42
The RawSoundReceiver interface.
Definition: RawSoundReceiverInterface.h:30
The SpectrumReceiver class.
Definition: SoundOutReceiver.h:46