-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
61 lines (46 loc) · 1.24 KB
/
config.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
#ifndef CONFIG_H
#define CONFIG_H
#include <string>
#include <bitset>
#include <vector>
#include <QMutex>
enum
{
COMPOS_BIT_MIN = 0,
COMPOS_BIT_SPEAKER = 0,
COMPOS_BIT_DESKTOP = 1,
COMPOS_BIT_CAMERA = 2,
COMPOS_BIT_MICROPHONE = 3,
COMPOS_BIT_MAX
};
class Config
{
public:
Config();
~Config() {}
void SetVideoCaptureDevice(const std::string& device_name);
std::string GetVideoCaptureDevice();
void SetMicrophone(const std::string& device_name);
std::string GetMicrophone();
void SetSpeaker(const std::string& device_name);
std::string GetSpeaker();
bool IsValidComposSet();
void SetCompos(int bit, bool on);
bool TestCompos(int bit);
void SetFilePath(const std::string& file_path);
std::string GetFilePath();
void SetStarted(bool flag);
bool Started();
private:
QMutex mutex_;
std::string video_device_;
std::string microphone_;
std::string speaker_;
// 麦克风、摄像头、系统桌面,系统声音的合法组合,用4个bit位表示
typedef std::vector<std::bitset<COMPOS_BIT_MAX>> ComposVec;
ComposVec compos_vec_;
std::bitset<COMPOS_BIT_MAX> compos_;
std::string file_path_;
bool started_;
};
#endif // CONFIG_H