mal_device_config initConfig; // The configuration passed in to mal_device_init(). Mainly used for reinitializing the backend device.
mal_device_config initConfig; // TODO: Get rid of this. The configuration passed in to mal_device_init(). Mainly used for reinitializing the backend device.
SetEvent(pThis->pDevice->wasapi.hBreakEvent); // <-- The main loop will be waiting on some events. We want to break from this wait ASAP so we can change the device as quickly as possible.
SetEvent(pThis->pDevice->wasapi.hBreakEvent); // <-- The main loop will be waiting on some events. We want to break from this wait ASAP so we can change the device as quickly as possible.
if (mal_device_is_reroute_required__wasapi(pDevice)) {
if (mal_device_is_reroute_required__wasapi(pDevice, mal_device_type_capture)) {
result = mal_device_reroute__wasapi(pDevice);
result = mal_device_reroute__wasapi(pDevice, mal_device_type_capture);
if (result != MAL_SUCCESS) {
if (result != MAL_SUCCESS) {
break;
break;
}
}
}
}
/* The device buffer has become available, so now we need to get a pointer to it. */
/* The device buffer has become available, so now we need to get a pointer to it. */
result = mal_device__get_available_frames__wasapi(pDevice, &pDevice->wasapi.deviceBufferFramesCapacityPlayback);
result = mal_device__get_available_frames__wasapi(pDevice, (mal_IAudioClient*)pDevice->wasapi.pAudioClientPlayback, &pDevice->wasapi.deviceBufferFramesCapacityPlayback);
if (mal_device_is_reroute_required__wasapi(pDevice)) {
if (mal_device_is_reroute_required__wasapi(pDevice, mal_device_type_capture)) {
result = mal_device_reroute__wasapi(pDevice);
result = mal_device_reroute__wasapi(pDevice, mal_device_type_capture);
if (result != MAL_SUCCESS) {
if (result != MAL_SUCCESS) {
break;
break;
}
}
}
}
/* The device buffer has become available, so now we need to get a pointer to it. */
/* The device buffer has become available, so now we need to get a pointer to it. */
result = mal_device__get_available_frames__wasapi(pDevice, &pDevice->wasapi.deviceBufferFramesCapacityCapture);
result = mal_device__get_available_frames__wasapi(pDevice, (mal_IAudioClient*)pDevice->wasapi.pAudioClientCapture, &pDevice->wasapi.deviceBufferFramesCapacityCapture);