-
Notifications
You must be signed in to change notification settings - Fork 0
/
Device.h
61 lines (48 loc) · 1.15 KB
/
Device.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
#pragma once
#include <map>
#include <vector>
#include <set>
#include <mmdeviceapi.h>
#include <endpointvolume.h>
#include <functiondiscoverykeys_devpkey.h>
#include <propvarutil.h>
#include <audiopolicy.h>
#include "Util.h"
#include "Debugger.h"
#include "Process.h"
#include "Config.h"
class Device {
private:
//CONSTANT
const IID IID_IAudioEndpointVolume = __uuidof(IAudioEndpointVolume);
const IID IID_IAudioSessionManager2 = __uuidof(IAudioSessionManager2);
const IID IID_IAudioSessionControl2 = __uuidof(IAudioSessionControl2);
//VARIABLE
IMMDevice* pDevice = NULL;
IAudioEndpointVolume* pVolume = NULL;
std::map<std::wstring, Process*> processes;
int processCount = 0;
HRESULT hr = NULL;
float adjustAmount = 0.02f;
//FUNCTION
PCWSTR getDeviceName();
LPWSTR getDeviceID();
void getAllProcess();
void clearProcess();
std::wstring nameDict(std::wstring);
public:
//VARIABLE
PCWSTR name = NULL;
LPWSTR id = NULL;
//FUNCTION
Device(IMMDevice*);
~Device();
void updateProcess();
float getVolume();
void setVolume(float);
void adjustVolume(float);
void increment();
void decrement();
int getProcessCount();
Process* getProcess(int);
};