-
Notifications
You must be signed in to change notification settings - Fork 0
/
outputicecast.h
74 lines (62 loc) · 1.4 KB
/
outputicecast.h
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef OUTPUTICECAST_H
#define OUTPUTICECAST_H
#include "output.h"
#include <QTimer>
#include <shout/shout.h>
struct ConfigConnection {
QString protocol;
QString address;
QString user;
QString password;
QString mountpoint;
QString encoder;
int port;
};
struct ConfigStreamInfo {
QString name;
QString description;
QString agent;
QString genre;
QString url;
bool isPublic;
};
class OutputIceCast : public Output {
Q_OBJECT
public:
enum State {
INVALID,
READY,
CONNECTED,
DISCONNECTED
};
OutputIceCast();
~OutputIceCast();
bool init();
void disable();
void output(const char* buffer, uint32_t size);
void setConnection(const QString& name);
void setConnection(const ConfigConnection& config);
void setMetaData();
State getState() const { return _state; }
QString getVersion() const;
public slots:
void connectStream();
void disconnectStream();
void reconnectStream();
void setStreamInfo(const QString& name);
void setStreamInfo(const ConfigStreamInfo& config);
signals:
void stateChanged(State);
void stateChanged(QString);
void requestReconnect();
private:
void applyStreamInfo();
bool applyConnection();
shout_t* _shout;
State _state;
ConfigConnection _c;
ConfigStreamInfo _csi;
QTimer* _timer;
int _trial;
};
#endif