本文整理汇总了C++中fmod::System::getNumPlugins方法的典型用法代码示例。如果您正苦于以下问题:C++ System::getNumPlugins方法的具体用法?C++ System::getNumPlugins怎么用?C++ System::getNumPlugins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fmod::System
的用法示例。
在下文中一共展示了System::getNumPlugins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FMOD_Main
int FMOD_Main()
{
FMOD::System *system = 0;
FMOD_RESULT result;
unsigned int version;
void *extradriverdata = 0;
unsigned int pluginhandle;
InspectorState state = PLUGIN_SELECTOR;
PluginSelectorState pluginselector = { 0 };
ParameterViewerState parameterviewer = { 0 };
Common_Init(&extradriverdata);
/*
Create a System object and initialize
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);
result = system->getVersion(&version);
ERRCHECK(result);
if (version < FMOD_VERSION)
{
Common_Fatal("FMOD lib version %08x doesn't match header version %08x", version, FMOD_VERSION);
}
result = system->init(32, FMOD_INIT_NORMAL, extradriverdata);
ERRCHECK(result);
result = system->getNumPlugins(FMOD_PLUGINTYPE_DSP, &pluginselector.numplugins);
ERRCHECK(result);
pluginselector.system = system;
do
{
Common_Update();
if (state == PLUGIN_SELECTOR)
{
state = pluginSelectorDo(&pluginselector);
if (state == PARAMETER_VIEWER)
{
result = pluginselector.system->getPluginHandle(FMOD_PLUGINTYPE_DSP, pluginselector.cursor, &pluginhandle);
ERRCHECK(result);
result = pluginselector.system->createDSPByPlugin(pluginhandle, ¶meterviewer.dsp);
ERRCHECK(result);
FMOD_RESULT result = parameterviewer.dsp->getNumParameters(¶meterviewer.numparams);
ERRCHECK(result);
parameterviewer.scroll = 0;
}
}
else if (state == PARAMETER_VIEWER)
{
state = parameterViewerDo(¶meterviewer);
if (state == PLUGIN_SELECTOR)
{
result = parameterviewer.dsp->release();
ERRCHECK(result);
parameterviewer.dsp = 0;
}
}
result = system->update();
ERRCHECK(result);
Common_Sleep(INTERFACE_UPDATETIME - 1);
} while (!Common_BtnPress(BTN_QUIT));
if (parameterviewer.dsp)
{
result = parameterviewer.dsp->release();
ERRCHECK(result);
}
result = system->close();
ERRCHECK(result);
result = system->release();
ERRCHECK(result);
Common_Close();
return 0;
}
示例2: main
int main(int argc, char *argv[])
{
FMOD::System *system = 0;
FMOD::Sound *sound = 0;
FMOD::Channel *channel = 0;
FMOD_RESULT result;
int count;
bool playing = false;
int key, numoutputplugins;
unsigned int version;
unsigned int handle;
/*
Create a System object and initialize.
*/
result = FMOD::System_Create(&system);
ERRCHECK(result);
result = system->getVersion(&version);
ERRCHECK(result);
if (version < FMOD_VERSION)
{
printf("Error! You are using an old version of FMOD %08x. This program requires %08x\n", version, FMOD_VERSION);
return 0;
}
/*
Set the source directory for all of the FMOD plugins.
*/
#ifdef _WIN64
result = system->setPluginPath("../../api/plugins/64bit");
#else
result = system->setPluginPath("../../api/plugins");
#endif
ERRCHECK(result);
/*
Load up an extra plugin that is not normally used by FMOD.
*/
#ifdef _WIN64
result = system->loadPlugin("output_mp364.dll", 0, 0);
#else
result = system->loadPlugin("output_mp3.dll", 0, 0);
#endif
if (result == FMOD_ERR_FILE_NOTFOUND)
{
/*
If it isn't in the same directory, try for the plugin directory.
*/
#ifdef _WIN64
result = system->loadPlugin("../plugin_dev/output_mp3/output_mp364.dll", 0, 0);
#else
result = system->loadPlugin("../plugin_dev/output_mp3/output_mp3.dll", 0, 0);
#endif
ERRCHECK(result);
}
/*
Display plugins
*/
{
int num;
char name[256];
printf("Codec plugins\n");
printf("--------------\n");
result = system->getNumPlugins(FMOD_PLUGINTYPE_CODEC, &num);
ERRCHECK(result);
for (count = 0; count < num; count++)
{
result = system->getPluginHandle(FMOD_PLUGINTYPE_CODEC, count, &handle);
ERRCHECK(result);
result = system->getPluginInfo(handle, 0, name, 256, 0);
ERRCHECK(result);
printf("%2d - %-30s", count + 1, name);
if (count % 2)
{
printf("\n");
}
}
printf("\n");
if (count % 2)
{
printf("\n");
}
printf("DSP plugins\n");
printf("--------------\n");
result = system->getNumPlugins(FMOD_PLUGINTYPE_DSP, &num);
ERRCHECK(result);
for (count = 0; count < num; count++)
{
result = system->getPluginHandle(FMOD_PLUGINTYPE_DSP, count, &handle);
ERRCHECK(result);
//.........这里部分代码省略.........