MCPcopy Create free account
hub / github.com/LabSound/LabSound / NullDeviceNode

Method NullDeviceNode

src/core/NullDeviceNode.cpp:27–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27NullDeviceNode::NullDeviceNode(AudioContext & ac,
28 const AudioStreamConfig & outputConfig, double lengthSeconds)
29 : AudioNode(ac, *desc())
30 , m_lengthSeconds(lengthSeconds)
31 , m_context(&ac)
32 , outConfig(outputConfig)
33{
34 addInput(std::unique_ptr<AudioNodeInput>(new AudioNodeInput(this)));
35
36 m_numChannels = outputConfig.desired_channels;
37 m_renderBus = std::unique_ptr<AudioBus>(new AudioBus(m_numChannels, offlineRenderSizeQuantum));
38
39 m_channelCount = m_numChannels;
40 m_channelCountMode = ChannelCountMode::Explicit;
41 m_channelInterpretation = ChannelInterpretation::Discrete;
42
43 // We need to partially fill the the info struct here so that the context's graph thread
44 // has enough initial info to make connections/disconnections appropriately
45 info = {};
46 info.sampling_rate = outConfig.desired_samplerate;
47 info.epoch[0] = info.epoch[1] = std::chrono::high_resolution_clock::now();
48
49 ContextGraphLock glock(&ac, "NullDeviceNode");
50 AudioNode::setChannelCount(glock, m_numChannels);
51 initialize();
52}
53
54NullDeviceNode::~NullDeviceNode()
55{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected