本文整理汇总了C++中audio::GainNodeRef::disconnectAllInputs方法的典型用法代码示例。如果您正苦于以下问题:C++ GainNodeRef::disconnectAllInputs方法的具体用法?C++ GainNodeRef::disconnectAllInputs怎么用?C++ GainNodeRef::disconnectAllInputs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类audio::GainNodeRef
的用法示例。
在下文中一共展示了GainNodeRef::disconnectAllInputs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setupFilePlayerNode
void SamplePlayerNodeTestApp::setupFilePlayerNode()
{
mGain->disconnectAllInputs();
auto ctx = audio::master();
// mSourceFile->setMaxFramesPerRead( 8192 );
bool asyncRead = mAsyncButton.mEnabled;
CI_LOG_V( "async read: " << asyncRead );
mSamplePlayerNode = ctx->makeNode( new audio::FilePlayerNode( mSourceFile, asyncRead ) );
// TODO: it is pretty surprising when you recreate mMonitor here without checking if there has already been one added.
// - 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.
if( ! mMonitor )
mMonitor = ctx->makeNode( new audio::MonitorNode( audio::MonitorNode::Format().windowSize( 1024 ) ) );
// when these connections are called, some (GainNode and Pan) will already be connected, but this is okay, they should silently no-op.
// or connect in series (it is added to the Context's 'auto pulled list')
mSamplePlayerNode >> mGain >> mPan >> ctx->getOutput();
mPan >> mMonitor;
mSamplePlayerNode->setLoopEnabled( mLoopButton.mEnabled );
mSamplePlayerNode->setLoopBeginTime( mLoopBeginSlider.mValueScaled );
mSamplePlayerNode->setLoopEndTime( mLoopEndSlider.mValueScaled != 0 ? mLoopEndSlider.mValueScaled : mSamplePlayerNode->getNumSeconds() );
PRINT_GRAPH( audio::master() );
}
示例2: setupIOProcessed
void DeviceTestApp::setupIOProcessed()
{
auto ctx = audio::master();
auto mod = ctx->makeNode( new audio::GenSineNode( audio::Node::Format().autoEnable() ) );
mod->setFreq( 200 );
auto ringMod = audio::master()->makeNode( new audio::GainNode );
ringMod->setName( "RingModGain" );
ringMod->getParam()->setProcessor( mod );
mGain->disconnectAllInputs();
mInputDeviceNode >> ringMod >> mGain;
mInputDeviceNode->enable();
}
示例3: setupTest
void DeviceTestApp::setupTest( string test )
{
if( test.empty() )
test = "sinewave";
CI_LOG_V( "test: " << test );
// FIXME: Switching from 'noise' to 'i/o' on mac is causing a deadlock when initializing InputDeviceNodeAudioUnit.
// - it shouldn't have to be stopped, need to check why.
// - temp fix: stop / start context around reconfig
audio::master()->disable();
mGain->disconnectAllInputs();
if( test == "sinewave" )
setupSine();
else if( test == "noise" )
setupNoise();
else if( test == "input (pulled)" )
setupInputPulled();
else if( test == "I/O (clean)" )
setupIOClean();
else if( test == "I/O (processed)" )
setupIOProcessed();
else if( test == "I/O and sine" )
setupIOAndSine();
else if( test == "send" )
setupSend();
else if( test == "send stereo" )
setupSendStereo();
else
CI_ASSERT_NOT_REACHABLE();
if( mPlayButton.mEnabled )
audio::master()->enable();
PRINT_GRAPH( audio::master() );
}
示例4: setupBufferPlayerNode
void SamplePlayerNodeTestApp::setupBufferPlayerNode()
{
auto bufferPlayer = audio::master()->makeNode( new audio::BufferPlayerNode() );
auto loadFn = [bufferPlayer, this] {
bufferPlayer->loadBuffer( mSourceFile );
mWaveformPlot.load( bufferPlayer->getBuffer(), getWindowBounds() );
CI_LOG_V( "loaded source buffer, frames: " << bufferPlayer->getBuffer()->getNumFrames() );
};
auto connectFn = [bufferPlayer, this] {
mGain->disconnectAllInputs();
mSamplePlayerNode = bufferPlayer;
mSamplePlayerNode >> mGain >> mPan >> audio::master()->getOutput();
PRINT_GRAPH( audio::master() );
mSamplePlayerNode->setLoopEnabled( mLoopButton.mEnabled );
mSamplePlayerNode->setLoopBeginTime( mLoopBeginSlider.mValueScaled );
mSamplePlayerNode->setLoopEndTime( mLoopEndSlider.mValueScaled != 0 ? mLoopEndSlider.mValueScaled : mSamplePlayerNode->getNumSeconds() );
};
bool asyncLoad = mAsyncButton.mEnabled;
CI_LOG_V( "async load: " << boolalpha << asyncLoad << dec );
if( asyncLoad ) {
mWaveformPlot.clear();
mAsyncLoadFuture = std::async( [=] {
loadFn();
dispatchAsync( [=] {
connectFn();
} );
} );
}
else {
loadFn();
connectFn();
};
}