本文整理汇总了C++中PluginLoader::getPluginCategory方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginLoader::getPluginCategory方法的具体用法?C++ PluginLoader::getPluginCategory怎么用?C++ PluginLoader::getPluginCategory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginLoader
的用法示例。
在下文中一共展示了PluginLoader::getPluginCategory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
printPluginCategoryList()
{
PluginLoader *loader = PluginLoader::getInstance();
vector<PluginLoader::PluginKey> plugins = loader->listPlugins();
set<string> printedcats;
for (size_t i = 0; i < plugins.size(); ++i) {
PluginLoader::PluginKey key = plugins[i];
PluginLoader::PluginCategoryHierarchy category =
loader->getPluginCategory(key);
Plugin *plugin = loader->loadPlugin(key, 48000);
if (!plugin) continue;
string catstr = "";
if (category.empty()) catstr = '|';
else {
for (size_t j = 0; j < category.size(); ++j) {
catstr += category[j];
catstr += '|';
if (printedcats.find(catstr) == printedcats.end()) {
std::cout << catstr << std::endl;
printedcats.insert(catstr);
}
}
}
std::cout << catstr << key << ":::" << plugin->getName() << ":::" << plugin->getMaker() << ":::" << plugin->getDescription() << std::endl;
}
}
示例2: if
void
enumeratePlugins(Verbosity verbosity)
{
PluginLoader *loader = PluginLoader::getInstance();
if (verbosity == PluginInformation) {
cout << "\nVamp plugin libraries found in search path:" << endl;
}
vector<PluginLoader::PluginKey> plugins = loader->listPlugins();
typedef multimap<string, PluginLoader::PluginKey>
LibraryMap;
LibraryMap libraryMap;
for (size_t i = 0; i < plugins.size(); ++i) {
string path = loader->getLibraryPathForPlugin(plugins[i]);
libraryMap.insert(LibraryMap::value_type(path, plugins[i]));
}
string prevPath = "";
int index = 0;
for (LibraryMap::iterator i = libraryMap.begin();
i != libraryMap.end(); ++i) {
string path = i->first;
PluginLoader::PluginKey key = i->second;
if (path != prevPath) {
prevPath = path;
index = 0;
if (verbosity == PluginInformation) {
cout << "\n " << path << ":" << endl;
} else if (verbosity == PluginInformationDetailed) {
string::size_type ki = i->second.find(':');
string text = "Library \"" + i->second.substr(0, ki) + "\"";
cout << "\n" << header(text, 1);
}
}
Plugin *plugin = loader->loadPlugin(key, 48000);
if (plugin) {
char c = char('A' + index);
if (c > 'Z') c = char('a' + (index - 26));
PluginLoader::PluginCategoryHierarchy category =
loader->getPluginCategory(key);
string catstr;
if (!category.empty()) {
for (size_t ci = 0; ci < category.size(); ++ci) {
if (ci > 0) catstr += " > ";
catstr += category[ci];
}
}
if (verbosity == PluginInformation) {
cout << " [" << c << "] [v"
<< plugin->getVampApiVersion() << "] "
<< plugin->getName() << ", \""
<< plugin->getIdentifier() << "\"" << " ["
<< plugin->getMaker() << "]" << endl;
if (catstr != "") {
cout << " > " << catstr << endl;
}
if (plugin->getDescription() != "") {
cout << " - " << plugin->getDescription() << endl;
}
} else if (verbosity == PluginInformationDetailed) {
cout << header(plugin->getName(), 2);
cout << " - Identifier: "
<< key << endl;
cout << " - Plugin Version: "
<< plugin->getPluginVersion() << endl;
cout << " - Vamp API Version: "
<< plugin->getVampApiVersion() << endl;
cout << " - Maker: \""
<< plugin->getMaker() << "\"" << endl;
cout << " - Copyright: \""
<< plugin->getCopyright() << "\"" << endl;
cout << " - Description: \""
<< plugin->getDescription() << "\"" << endl;
cout << " - Input Domain: "
<< (plugin->getInputDomain() == Vamp::Plugin::TimeDomain ?
"Time Domain" : "Frequency Domain") << endl;
cout << " - Default Step Size: "
<< plugin->getPreferredStepSize() << endl;
cout << " - Default Block Size: "
<< plugin->getPreferredBlockSize() << endl;
cout << " - Minimum Channels: "
<< plugin->getMinChannelCount() << endl;
cout << " - Maximum Channels: "
<< plugin->getMaxChannelCount() << endl;
} else if (verbosity == PluginIds) {
//.........这里部分代码省略.........
示例3: AutoRegisterPlugins
bool VampEffectsModule::AutoRegisterPlugins(PluginManagerInterface & pm)
{
#ifdef EFFECT_CATEGORIES
InitCategoryMap();
#endif
PluginLoader *loader = PluginLoader::getInstance();
EffectManager& em = EffectManager::Get();
PluginLoader::PluginKeyList keys = loader->listPlugins();
for (PluginLoader::PluginKeyList::iterator i = keys.begin();
i != keys.end(); ++i) {
Plugin *vp = loader->loadPlugin(*i, 48000); // rate doesn't matter here
if (!vp) continue;
#ifdef EFFECT_CATEGORIES
PluginLoader::PluginCategoryHierarchy category =
loader->getPluginCategory(*i);
wxString vampCategory = VampHierarchyToUri(category);
#endif
// We limit the listed plugin outputs to those whose results can
// readily be displayed in an Audacity label track.
//
// - Any output whose features have no values (time instants only),
// with or without duration, is fine
//
// - Any output whose features have more than one value, or an
// unknown or variable number of values, is right out
//
// - Any output whose features have exactly one value, with
// variable sample rate or with duration, should be OK --
// this implies a sparse feature, of which the time and/or
// duration are significant aspects worth displaying
//
// - An output whose features have exactly one value, with
// fixed sample rate and no duration, cannot be usefully
// displayed -- the value is the only significant piece of
// data there and we have no good value plot
Plugin::OutputList outputs = vp->getOutputDescriptors();
int n = 0;
bool hasParameters = !vp->getParameterDescriptors().empty();
for (Plugin::OutputList::iterator j = outputs.begin();
j != outputs.end(); ++j) {
if (j->sampleType == Plugin::OutputDescriptor::FixedSampleRate ||
j->sampleType == Plugin::OutputDescriptor::OneSamplePerStep ||
!j->hasFixedBinCount ||
(j->hasFixedBinCount && j->binCount > 1)) {
// All of these qualities disqualify (see notes above)
++n;
continue;
}
wxString name = LAT1CTOWX(vp->getName().c_str());
if (outputs.size() > 1) {
// This is not the plugin's only output.
// Use "plugin name: output name" as the effect name,
// unless the output name is the same as the plugin name
wxString outputName = LAT1CTOWX(j->name.c_str());
if (outputName != name) {
name = wxString::Format(wxT("%s: %s"),
name.c_str(), outputName.c_str());
}
}
#ifdef EFFECT_CATEGORIES
VampEffect *effect = new VampEffect(*i, n, hasParameters, name,
vampCategory);
#else
VampEffect *effect = new VampEffect(*i, n, hasParameters, name);
#endif
em.RegisterEffect(this, effect);
++n;
}
delete vp;
}
return true;
}