| 209 | } |
| 210 | |
| 211 | void VolumeControl::deinit() |
| 212 | { |
| 213 | //deinitialize audio mixer interface |
| 214 | #if defined (__APPLE__) |
| 215 | #error TODO: Not implemented for MacOS yet!!! |
| 216 | #elif defined(__linux__) |
| 217 | if (mixerHandle != nullptr) { |
| 218 | snd_mixer_detach(mixerHandle, mixerCard); |
| 219 | snd_mixer_free(mixerHandle); |
| 220 | snd_mixer_close(mixerHandle); |
| 221 | mixerHandle = nullptr; |
| 222 | mixerElem = nullptr; |
| 223 | } |
| 224 | #elif defined(WIN32) || defined(_WIN32) |
| 225 | if (mixerHandle != nullptr) { |
| 226 | mixerClose(mixerHandle); |
| 227 | mixerHandle = nullptr; |
| 228 | } |
| 229 | else if (endpointVolume != nullptr) { |
| 230 | endpointVolume->Release(); |
| 231 | endpointVolume = nullptr; |
| 232 | CoUninitialize(); |
| 233 | } |
| 234 | #endif |
| 235 | } |
| 236 | |
| 237 | int VolumeControl::getVolume() const |
| 238 | { |
nothing calls this directly
no outgoing calls
no test coverage detected