MCPcopy Create free account
hub / github.com/cinder/Cinder / setupFilePlayerNode

Method setupFilePlayerNode

test/_audio/AudioTests/src/SamplePlayerTest.cpp:111–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111void SamplePlayerTest::setupFilePlayerNode()
112{
113 bool loopEnabled = mSamplePlayerNode ? mSamplePlayerNode->isLoopEnabled() : false;
114 double loopBegin = mSamplePlayerNode ? mSamplePlayerNode->getLoopBeginTime() : 0.0;
115 double loopEnd = mSamplePlayerNode ? mSamplePlayerNode->getLoopEndTime() : 0.0;
116
117 mGain->disconnectAllInputs();
118
119 auto ctx = audio::master();
120
121// mSourceFile->setMaxFramesPerRead( 8192 );
122 mSamplePlayerNode = ctx->makeNode( new audio::FilePlayerNode( mSourceFile->clone(), mLoadAsync ) );
123
124 // TODO: it is pretty surprising when you recreate mMonitor here without checking if there has already been one added.
125 // - user will no longer see the old mMonitor, but the context still owns a reference to it, so another gets added each time we call this method.
126 if( ! mMonitor )
127 mMonitor = ctx->makeNode( new audio::MonitorNode( audio::MonitorNode::Format().windowSize( 1024 ) ) );
128
129 // when these connections are called, some (GainNode and Pan) will already be connected, but this is okay, they should silently no-op.
130
131 // or connect in series (it is added to the Context's 'auto pulled list')
132 mSamplePlayerNode >> mGain >> mPan >> ctx->getOutput();
133 mPan >> mMonitor;
134
135 mSamplePlayerNode->setLoopEnabled( loopEnabled );
136 mSamplePlayerNode->setLoopBeginTime( loopBegin );
137 mSamplePlayerNode->setLoopEndTime( loopEnd );
138}
139
140void SamplePlayerTest::setupBufferRecorderNode()
141{

Callers

nothing calls this directly

Calls 10

masterFunction · 0.85
getLoopBeginTimeMethod · 0.80
getLoopEndTimeMethod · 0.80
makeNodeMethod · 0.80
getOutputMethod · 0.80
setLoopBeginTimeMethod · 0.80
setLoopEndTimeMethod · 0.80
FormatClass · 0.50
disconnectAllInputsMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected