本文整理汇总了C++中fmod::System::loadPlugin方法的典型用法代码示例。如果您正苦于以下问题:C++ System::loadPlugin方法的具体用法?C++ System::loadPlugin怎么用?C++ System::loadPlugin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fmod::System
的用法示例。
在下文中一共展示了System::loadPlugin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
//.........这里部分代码省略.........