| 715 | } |
| 716 | |
| 717 | void AudioContext::debugTraverse(AudioNode * root) |
| 718 | { |
| 719 | ASSERT(root); |
| 720 | // bail if shutting down. |
| 721 | auto ac = audioContextInterface().lock(); |
| 722 | if (!ac) |
| 723 | return; |
| 724 | |
| 725 | auto ctx = this; |
| 726 | |
| 727 | ContextRenderLock renderLock(this, "lab::pull_graph"); |
| 728 | if (!renderLock.context()) |
| 729 | return; // return if couldn't acquire lock |
| 730 | |
| 731 | if (!ctx->isInitialized()) |
| 732 | { |
| 733 | return; |
| 734 | } |
| 735 | |
| 736 | synchronizeConnections(); |
| 737 | |
| 738 | // Let the context take care of any business at the start of each render quantum. |
| 739 | ctx->handlePreRenderTasks(renderLock); |
| 740 | |
| 741 | /* pass two, implement hardware input |
| 742 | // Prepare the local audio input provider for this render quantum. |
| 743 | if (optional_hardware_input && src) |
| 744 | { |
| 745 | optional_hardware_input->set(src); |
| 746 | } |
| 747 | */ |
| 748 | |
| 749 | // process the graph by pulling the inputs, which will recurse the |
| 750 | // entire processing graph. |
| 751 | |
| 752 | enum WorkType |
| 753 | { |
| 754 | processNode, |
| 755 | silenceOutputs, |
| 756 | unsilenceOutputs, |
| 757 | setOutputChannels, |
| 758 | sumInputs, |
| 759 | setZeroes, |
| 760 | manageEnvelope, |
| 761 | }; |
| 762 | |
| 763 | struct Work |
| 764 | { |
| 765 | AudioNode * node = nullptr; |
| 766 | WorkType type; |
| 767 | }; |
| 768 | |
| 769 | std::vector<Work> work; |
| 770 | |
| 771 | std::vector<AudioNode *> node_stack; |
| 772 | static int color = 1; |
| 773 | root->color = color; |
| 774 | ++color; |
no test coverage detected