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

Method setup

samples/FallingGears/src/AudioController.cpp:37–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35} // anonymous namespace
36
37void AudioController::setup()
38{
39 auto ctx = audio::master();
40 mMasterGain = ctx->makeNode( new audio::GainNode( 0.1 ) );
41 mAltoLowpass = ctx->makeNode( new audio::FilterLowPassNode );
42
43 mSawtoothTable.reset( new audio::WaveTable2d( ctx->getSampleRate(), DEFAULT_TABLE_SIZE, DEFAULT_BANDLIMITED_TABLES ) );
44 mSawtoothTable->fillBandlimited( audio::WaveformType::SAWTOOTH );
45
46 for( size_t i = 0; i < ALTO_BANK_SIZE; i++ ) {
47 auto synth = make_shared<AltoSynth>( this );
48 synth->getOutput() >> mAltoLowpass;
49
50 mAltoSynthBank.push_back( synth );
51 mAllSynths.push_back( synth );
52 }
53
54 for( size_t i = 0; i < BASS_BANK_SIZE; i++ ) {
55 auto synth = make_shared<BassSynth>( this );
56 synth->getOutput() >> mMasterGain;
57
58 mBassSynthBank.push_back( synth );
59 mAllSynths.push_back( synth );
60 }
61
62 mAltoLowpass >> mMasterGain;
63 mMasterGain >> ctx->getOutput();
64 ctx->enable();
65
66// CI_LOG_V( "audio graph:\n" << ctx->printGraphToString() );
67}
68
69void AudioController::setMasterGain( float gainDb )
70{

Callers

nothing calls this directly

Calls 8

masterFunction · 0.85
makeNodeMethod · 0.80
fillBandlimitedMethod · 0.80
getOutputMethod · 0.80
resetMethod · 0.45
getSampleRateMethod · 0.45
push_backMethod · 0.45
enableMethod · 0.45

Tested by

no test coverage detected