| 403 | } |
| 404 | |
| 405 | void AudioContext::synchronizeConnections(int timeOut_ms) |
| 406 | { |
| 407 | cv.notify_all(); |
| 408 | |
| 409 | // don't synch if the context is suspended as that will simply max out the timeout |
| 410 | if (!device_callback->isRunning()) |
| 411 | return; |
| 412 | |
| 413 | while (m_internal->pendingNodeConnections.size_approx() > 0 && timeOut_ms > 0) |
| 414 | { |
| 415 | std::this_thread::sleep_for(std::chrono::milliseconds(5)); |
| 416 | timeOut_ms -= 5; |
| 417 | } |
| 418 | } |
| 419 | |
| 420 | |
| 421 | void AudioContext::connect(std::shared_ptr<AudioNode> destination, std::shared_ptr<AudioNode> source, int destIdx, int srcIdx) |