-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimpleaudioNET.cpp
More file actions
167 lines (137 loc) · 7.34 KB
/
Copy pathsimpleaudioNET.cpp
File metadata and controls
167 lines (137 loc) · 7.34 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#include "stdafx.h"
#include "simpleaudioNET.h"
/* Interface */
simpleaudioNET::Interface::Interface()
{
this->pInterface = new simpleaudio::Interface();
}
simpleaudioNET::Interface::~Interface()
{
this->!Interface();
}
simpleaudioNET::Interface::!Interface()
{
delete pInterface;
}
simpleaudioNET::Device ^ simpleaudioNET::Interface::getDefaultDevice()
{
simpleaudio::Device *pNativeDevice;
pInterface->getDefaultDevice(&pNativeDevice);
return gcnew Device(pNativeDevice);
}
iteratorNET::Iterator<simpleaudioNET::Device ^> ^ simpleaudioNET::Interface::deviceIterator()
{
simpleaudio::DeviceIteratorProfile *pNativeItProf;
pNativeItProf = new simpleaudio::DeviceIteratorProfile(pInterface);
DeviceIteratorProfile ^pItProf = gcnew DeviceIteratorProfile(pNativeItProf);
return gcnew iteratorNET::Iterator<Device ^>(pItProf);
}
/* Device */
simpleaudioNET::Device::Device(simpleaudio::Device *pDevice)
{
this->pDevice = pDevice;
}
simpleaudioNET::Device::~Device()
{
this->!Device();
}
simpleaudioNET::Device::!Device()
{
delete pDevice;
}
void simpleaudioNET::Device::Volume::set(float v)
{
pDevice->setVolume(v);
}
float simpleaudioNET::Device::Volume::get()
{
return pDevice->getVolume();
}
String ^simpleaudioNET::Device::FriendlyName::get()
{
const int len = 200;
wchar_t friendlyName[len];
pDevice->getFriendlyName(friendlyName, len);
return gcnew String(friendlyName);
}
iteratorNET::Iterator<simpleaudioNET::Session ^> ^simpleaudioNET::Device::sessionIterator()
{
simpleaudio::SessionIteratorProfile *pNativeItProf;
pNativeItProf = new simpleaudio::SessionIteratorProfile(pDevice);
SessionIteratorProfile ^pItProf = gcnew SessionIteratorProfile(pNativeItProf);
return gcnew iteratorNET::Iterator<Session ^>(pItProf);
}
/* Session */
simpleaudioNET::Session::Session(simpleaudio::Session *pSession)
{
this->pSession = pSession;
}
simpleaudioNET::Session::~Session()
{
this->!Session();
}
simpleaudioNET::Session::!Session()
{
delete pSession;
}
void simpleaudioNET::Session::Volume::set(float v)
{
pSession->setVolume(v);
}
float simpleaudioNET::Session::Volume::get()
{
return pSession->getVolume();
}
String ^simpleaudioNET::Session::DisplayName::get()
{
const int len = 200;
wchar_t displayName[len];
pSession->getDisplayName(displayName, len);
return gcnew String(displayName);
}
/* DeviceIteratorProfile */
simpleaudioNET::DeviceIteratorProfile::DeviceIteratorProfile(simpleaudio::DeviceIteratorProfile *pItProf)
{
this->pItProf = pItProf;
}
simpleaudioNET::DeviceIteratorProfile::~DeviceIteratorProfile()
{
this->!DeviceIteratorProfile();
}
simpleaudioNET::DeviceIteratorProfile::!DeviceIteratorProfile()
{
delete pItProf;
}
simpleaudioNET::Device ^simpleaudioNET::DeviceIteratorProfile::get(UInt32 index)
{
simpleaudio::Device *pDevice;
pItProf->get(index, &pDevice);
return gcnew Device(pDevice);
}
UInt32 simpleaudioNET::DeviceIteratorProfile::count()
{
return pItProf->count();
}
/* SessionIteratorProfile */
simpleaudioNET::SessionIteratorProfile::SessionIteratorProfile(simpleaudio::SessionIteratorProfile *pItProf)
{
this->pItProf = pItProf;
}
simpleaudioNET::SessionIteratorProfile::~SessionIteratorProfile()
{
this->!SessionIteratorProfile();
}
simpleaudioNET::SessionIteratorProfile::!SessionIteratorProfile()
{
delete pItProf;
}
simpleaudioNET::Session ^simpleaudioNET::SessionIteratorProfile::get(UInt32 index)
{
simpleaudio::Session *pSession;
pItProf->get(index, &pSession);
return gcnew Session(pSession);
}
UInt32 simpleaudioNET::SessionIteratorProfile::count()
{
return pItProf->count();
}