-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathLibShoutWrapper.h
40 lines (32 loc) · 1.17 KB
/
LibShoutWrapper.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
#pragma once
#include <shout/shout.h>
#include <atomic>
#include <mutex>
#include <string>
using std::string;
using std::recursive_mutex;
using std::lock_guard;
class LibShoutWrapper {
private:
typedef std::lock_guard<std::recursive_mutex> guard;
recursive_mutex mtx;
shout_t *pShout = nullptr;
std::atomic<bool> isConnected;
bool abort = false;
public:
LibShoutWrapper();
~LibShoutWrapper();
bool InitializeICECasting(const string &hostname, const string &protocol,
unsigned short port, const string &streamname,
const string &streamurl, const string &streamgenre,
const string &streamdescription,
const string &bitrate,
const string &targetsamplerate,
const string &artist, const string &title,
const string &username, const string &password,
const string &mountpoint, const string &format);
void StopICECasting();
bool waitForConnect();
bool SendDataToICE(unsigned char *pData, size_t nLen);
void UpdateMetadata(const char *sz);
};