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

Method setup

samples/_audio/MultichannelOutput/src/MultichannelOutputApp.cpp:40–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38};
39
40void MultichannelOutputApp::setup()
41{
42 mCurrentChannel = 0;
43
44 setupMultichannelDevice();
45
46 auto ctx = audio::Context::master();
47
48 // for information on creating Node's, see NodeBasic sample.
49 mGen = ctx->makeNode( new audio::GenSineNode( 440, audio::Node::Format().autoEnable() ) );
50 mGain = ctx->makeNode( new audio::GainNode( 0 ) );
51
52 // make a ChannelRouterNode with the same number of channels as the Context's output, which is the multichannel output device.
53 mChannelRouterNode = ctx->makeNode( new audio::ChannelRouterNode( audio::Node::Format().channels( ctx->getOutput()->getNumChannels() ) ) );
54
55 // make a Scope to visualize the channels. You don't need to specify the number of channels here because its default ChannelMode is MATCHES_INPUT.
56 mMonitor = ctx->makeNode( new audio::MonitorNode );
57
58 // connect up our Node's, routing mGain to the output channel specified by mCurrentChannel. Send the result through the Scope, onto the output.
59 mGen >> mGain >> mChannelRouterNode->route( 0, mCurrentChannel ) >> mMonitor >> ctx->getOutput();
60
61 ctx->enable();
62
63 // Start the gain ramping. When this finishes, the route channel will be shifted and a new gain ramp will be applied.
64 rampGain();
65}
66
67void MultichannelOutputApp::setupMultichannelDevice()
68{

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected