当前位置: 首页>>代码示例>>C++>>正文


C++ AudioNodeOutput::node方法代码示例

本文整理汇总了C++中AudioNodeOutput::node方法的典型用法代码示例。如果您正苦于以下问题:C++ AudioNodeOutput::node方法的具体用法?C++ AudioNodeOutput::node怎么用?C++ AudioNodeOutput::node使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AudioNodeOutput的用法示例。


在下文中一共展示了AudioNodeOutput::node方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: notifyAudioSourcesConnectedToNode

void PannerNode::notifyAudioSourcesConnectedToNode(AudioNode* node, HashSet<AudioNode*>& visitedNodes)
{
    ASSERT(node);
    if (!node)
        return;
        
    // First check if this node is an AudioBufferSourceNode. If so, let it know about us so that doppler shift pitch can be taken into account.
    if (node->nodeType() == NodeTypeAudioBufferSource) {
        AudioBufferSourceNode* bufferSourceNode = reinterpret_cast<AudioBufferSourceNode*>(node);
        bufferSourceNode->setPannerNode(this);
    } else {    
        // Go through all inputs to this node.
        for (unsigned i = 0; i < node->numberOfInputs(); ++i) {
            AudioNodeInput* input = node->input(i);

            // For each input, go through all of its connections, looking for AudioBufferSourceNodes.
            for (unsigned j = 0; j < input->numberOfRenderingConnections(); ++j) {
                AudioNodeOutput* connectedOutput = input->renderingOutput(j);
                AudioNode* connectedNode = connectedOutput->node();
                if (visitedNodes.contains(connectedNode))
                    continue;

                visitedNodes.add(connectedNode);
                notifyAudioSourcesConnectedToNode(connectedNode, visitedNodes);
            }
        }
    }
}
开发者ID:biddyweb,项目名称:switch-oss,代码行数:28,代码来源:PannerNode.cpp

示例2: notifyAudioSourcesConnectedToNode

void PannerNode::notifyAudioSourcesConnectedToNode(AudioNode* node, HashMap<AudioNode*, bool>& visitedNodes)
{
    ASSERT(node);
    if (!node)
        return;

    // First check if this node is an AudioBufferSourceNode. If so, let it know about us so that doppler shift pitch can be taken into account.
    if (node->nodeType() == NodeTypeAudioBufferSource) {
        AudioBufferSourceNode* bufferSourceNode = static_cast<AudioBufferSourceNode*>(node);
        bufferSourceNode->setPannerNode(this);
    } else {
        // Go through all inputs to this node.
        for (unsigned i = 0; i < node->numberOfInputs(); ++i) {
            AudioNodeInput* input = node->input(i);

            // For each input, go through all of its connections, looking for AudioBufferSourceNodes.
            for (unsigned j = 0; j < input->numberOfRenderingConnections(); ++j) {
                AudioNodeOutput* connectedOutput = input->renderingOutput(j);
                AudioNode* connectedNode = connectedOutput->node();
                HashMap<AudioNode*, bool>::iterator iterator = visitedNodes.find(connectedNode);

                // If we've seen this node already, we don't need to process it again. Otherwise,
                // mark it as visited and recurse through the node looking for sources.
                if (iterator == visitedNodes.end()) {
                    visitedNodes.set(connectedNode, true);
                    notifyAudioSourcesConnectedToNode(connectedNode, visitedNodes); // recurse
                }
            }
        }
    }
}
开发者ID:smil-in-javascript,项目名称:blink,代码行数:31,代码来源:PannerNode.cpp


注:本文中的AudioNodeOutput::node方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。