本文整理汇总了C++中fmod::DSP::disconnectAll方法的典型用法代码示例。如果您正苦于以下问题:C++ DSP::disconnectAll方法的具体用法?C++ DSP::disconnectAll怎么用?C++ DSP::disconnectAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fmod::DSP
的用法示例。
在下文中一共展示了DSP::disconnectAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FMOD_Main
//.........这里部分代码省略.........
/*
Load up and play a sample clip recorded in an anechoic chamber
*/
FMOD::Sound* sound;
system->createSound(Common_MediaPath("singing.wav"), FMOD_3D | FMOD_LOOP_NORMAL, NULL, &sound);
ERRCHECK(result);
FMOD::Channel* channel;
system->playSound(sound, mainGroup, true, &channel);
ERRCHECK(result);
/*
Create a send connection between the channel head and the reverb unit
*/
FMOD::DSP* channelHead;
channel->getDSP(FMOD_CHANNELCONTROL_DSP_HEAD, &channelHead);
ERRCHECK(result);
FMOD::DSPConnection* reverbConnection;
result = reverbUnit->addInput(channelHead, &reverbConnection, FMOD_DSPCONNECTION_TYPE_SEND);
ERRCHECK(result);
result = channel->setPaused(false);
ERRCHECK(result);
float wetVolume = 1.0;
float dryVolume = 1.0;
/*
Main loop
*/
do
{
Common_Update();
if (Common_BtnPress(BTN_LEFT))
{
wetVolume = (wetVolume <= 0.0f) ? wetVolume : wetVolume - 0.05;
}
if (Common_BtnPress(BTN_RIGHT))
{
wetVolume = (wetVolume >= 1.0f) ? wetVolume : wetVolume + 0.05f;
}
if (Common_BtnPress(BTN_DOWN))
{
dryVolume = (dryVolume <= 0.0f) ? dryVolume : dryVolume - 0.05f;
}
if (Common_BtnPress(BTN_UP))
{
dryVolume = (dryVolume >= 1.0f) ? dryVolume : dryVolume + 0.05f;
}
result = system->update();
ERRCHECK(result);
result = reverbConnection->setMix(wetVolume);
ERRCHECK(result);
result = mainGroup->setVolume(dryVolume);
ERRCHECK(result);
Common_Draw("==================================================");
Common_Draw("Convolution Example.");
Common_Draw("Copyright (c) Firelight Technologies 2004-2015.");
Common_Draw("==================================================");
Common_Draw("Press %s and %s to change dry mix", Common_BtnStr(BTN_UP), Common_BtnStr(BTN_DOWN));
Common_Draw("Press %s and %s to change wet mix", Common_BtnStr(BTN_LEFT), Common_BtnStr(BTN_RIGHT));
Common_Draw("wet mix [%.2f] dry mix [%.2f]", wetVolume, dryVolume);
Common_Draw("Press %s to quit", Common_BtnStr(BTN_QUIT));
Common_Draw("");
Common_Sleep(50);
} while (!Common_BtnPress(BTN_QUIT));
/*
Shut down
*/
result = sound->release();
ERRCHECK(result);
result = mainGroup->release();
ERRCHECK(result);
result = reverbGroup->removeDSP(reverbUnit);
ERRCHECK(result);
result = reverbUnit->disconnectAll(true, true);
ERRCHECK(result);
result = reverbUnit->release();
ERRCHECK(result);
result = reverbGroup->release();
ERRCHECK(result);
result = system->close();
ERRCHECK(result);
result = system->release();
ERRCHECK(result);
Common_Close();
return 0;
}