This source file includes following definitions.
- m_renderingStateNeedUpdating
- changedOutputs
- updateRenderingState
#include "config.h"
#if ENABLE(WEB_AUDIO)
#include "modules/webaudio/AudioSummingJunction.h"
#include "modules/webaudio/AudioContext.h"
#include "modules/webaudio/AudioNodeOutput.h"
#include <algorithm>
using namespace std;
namespace WebCore {
AudioSummingJunction::AudioSummingJunction(AudioContext* context)
: m_context(context)
, m_renderingStateNeedUpdating(false)
{
}
AudioSummingJunction::~AudioSummingJunction()
{
if (m_renderingStateNeedUpdating && m_context.get())
m_context->removeMarkedSummingJunction(this);
}
void AudioSummingJunction::changedOutputs()
{
ASSERT(context()->isGraphOwner());
if (!m_renderingStateNeedUpdating && canUpdateState()) {
context()->markSummingJunctionDirty(this);
m_renderingStateNeedUpdating = true;
}
}
void AudioSummingJunction::updateRenderingState()
{
ASSERT(context()->isAudioThread() && context()->isGraphOwner());
if (m_renderingStateNeedUpdating && canUpdateState()) {
m_renderingOutputs.resize(m_outputs.size());
unsigned j = 0;
for (HashSet<AudioNodeOutput*>::iterator i = m_outputs.begin(); i != m_outputs.end(); ++i, ++j) {
AudioNodeOutput* output = *i;
m_renderingOutputs[j] = output;
output->updateRenderingState();
}
didUpdate();
m_renderingStateNeedUpdating = false;
}
}
}
#endif