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

Method setupSplitMerge

test/_audio/AudioTests/src/NodeBasicTest.cpp:198–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void NodeBasicTest::setupSplitMerge()
199{
200 auto ctx = audio::master();
201 ctx->disconnectAllNodes();
202
203 auto upmixStereo = ctx->makeNode( new audio::Node( audio::Node::Format().channels( 2 ) ) );
204
205 auto splitRouter0 = ctx->makeNode( new audio::ChannelRouterNode( audio::Node::Format().channels( 1 ) ) );
206 auto splitRouter1 = ctx->makeNode( new audio::ChannelRouterNode( audio::Node::Format().channels( 1 ) ) );
207 auto stereoRouter = ctx->makeNode( new audio::ChannelRouterNode( audio::Node::Format().channels( 2 ) ) );
208
209 // up-mix to stereo, then split the channels into two separate Node's
210 mGen >> upmixStereo;
211 upmixStereo >> splitRouter0->route( 0, 0 );
212 upmixStereo >> splitRouter1->route( 1, 0 );
213
214 // merge the two split Nodes back into one stereo output
215 splitRouter0 >> stereoRouter->route( 0, 0 );
216 splitRouter1 >> stereoRouter->route( 0, 1 );
217
218 stereoRouter >> mGain >> mMonitor >> ctx->getOutput();
219
220 mGen->enable();
221}
222
223void NodeBasicTest::draw()
224{

Callers

nothing calls this directly

Calls 7

masterFunction · 0.85
disconnectAllNodesMethod · 0.80
makeNodeMethod · 0.80
routeMethod · 0.80
getOutputMethod · 0.80
FormatClass · 0.50
enableMethod · 0.45

Tested by

no test coverage detected