-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathbroadcastmanager.h
More file actions
58 lines (46 loc) · 1.77 KB
/
broadcastmanager.h
File metadata and controls
58 lines (46 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include <QObject>
#include "engine/sidechain/shoutconnection.h"
#include "preferences/broadcastsettings.h"
#include "preferences/usersettings.h"
class SoundManager;
class ControlPushButton;
class EngineNetworkStream;
class SettingsManager;
class BroadcastManager : public QObject {
Q_OBJECT
public:
enum StatusCOStates {
STATUSCO_UNCONNECTED = 0, // IDLE state, no error
STATUSCO_CONNECTING = 1, // 30 s max
STATUSCO_CONNECTED = 2, // On Air
STATUSCO_FAILURE = 3, // Happens when all connection fail
STATUSCO_WARNING = 4 // Happens when at least one but not all fail
};
BroadcastManager(SettingsManager* pSettingsManager,
SoundManager* pSoundManager);
~BroadcastManager() override;
// Returns true if the broadcast connection is enabled. Note this only
// indicates whether the connection is enabled, not whether it is connected.
bool isEnabled();
public slots:
// Set whether or not the Broadcast connection is enabled.
void setEnabled(bool enabled);
signals:
void broadcastEnabled(bool);
private slots:
void slotControlEnabled(double v);
void slotProfileAdded(BroadcastProfilePtr profile);
void slotProfileRemoved(BroadcastProfilePtr profile);
void slotProfilesChanged();
void slotConnectionStatusChanged(int newState);
private:
bool addConnection(BroadcastProfilePtr profile);
bool removeConnection(BroadcastProfilePtr profile);
ShoutConnectionPtr findConnectionForProfile(BroadcastProfilePtr profile);
UserSettingsPointer m_pConfig;
BroadcastSettingsPointer m_pBroadcastSettings;
QSharedPointer<EngineNetworkStream> m_pNetworkStream;
ControlPushButton* m_pBroadcastEnabled;
ControlObject* m_pStatusCO;
};