本文整理汇总了C++中Plugin::getId方法的典型用法代码示例。如果您正苦于以下问题:C++ Plugin::getId方法的具体用法?C++ Plugin::getId怎么用?C++ Plugin::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Plugin
的用法示例。
在下文中一共展示了Plugin::getId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addPlugin
int PluginHost::addPlugin(const char *fname, int stackType, Channel *ch) {
Plugin *p = new Plugin();
bool success = true;
gVector <Plugin *> *pStack;
pStack = getStack(stackType, ch);
if (!p->load(fname)) {
//delete p;
//return 0;
success = false;
}
/* if the load failed we add a 'dead' plugin into the stack. This is
* useful to report a missing plugin. */
if (!success) {
pStack->add(p);
return 0;
}
/* otherwise let's try to initialize it. */
else {
/* try to init the plugin. If fails, delete it and return error. */
if (!p->init(&PluginHost::HostCallback)) {
delete p;
return 0;
}
/* plugin setup */
p->setup(G_Conf.samplerate, kernelAudio::realBufsize);
/* try to add the new plugin until succeed */
int lockStatus;
while (true) {
lockStatus = pthread_mutex_trylock(&G_Mixer.mutex_plugins);
if (lockStatus == 0) {
pStack->add(p);
pthread_mutex_unlock(&G_Mixer.mutex_plugins);
break;
}
}
char name[256]; p->getName(name);
gLog("[pluginHost] plugin id=%d loaded (%s), stack type=%d, stack size=%d\n", p->getId(), name, stackType, pStack->size);
/* p->resume() is suggested. Who knows... */
p->resume();
return 1;
}
}