MCPcopy Create free account
hub / github.com/cemu-project/Cemu / GetDevices

Method GetDevices

src/audio/DirectSoundAPI.cpp:216–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216std::vector<DirectSoundAPI::DeviceDescriptionPtr> DirectSoundAPI::GetDevices()
217{
218 std::vector<DeviceDescriptionPtr> result;
219
220 DirectSoundEnumerateW(
221 [](LPGUID lpGuid, LPCWSTR lpcstrDescription, LPCWSTR lpcstrModule, LPVOID lpContext) -> BOOL
222 {
223 auto results = (std::vector<DeviceDescriptionPtr>*)lpContext;
224 auto obj = std::make_shared<DirectSoundDeviceDescription>(lpcstrDescription, lpGuid);
225 results->emplace_back(obj);
226 return TRUE;
227 }, &result);
228
229 //Exclude default primary sound device if no other sound devices are available
230 if (result.size() == 1 && result.at(0).get()->GetIdentifier() == L"default") {
231 result.clear();
232 }
233
234 return result;
235}
236
237std::vector<DirectSoundAPI::DeviceDescriptionPtr> DirectSoundAPI::GetInputDevices()
238{

Callers

nothing calls this directly

Calls 5

atMethod · 0.80
sizeMethod · 0.45
GetIdentifierMethod · 0.45
getMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected