| 214 | } |
| 215 | |
| 216 | std::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 | |
| 237 | std::vector<DirectSoundAPI::DeviceDescriptionPtr> DirectSoundAPI::GetInputDevices() |
| 238 | { |
nothing calls this directly
no test coverage detected