MCPcopy Create free account
hub / github.com/audacity/audacity / FindModulePaths

Method FindModulePaths

src/effects/vamp/LoadVamp.cpp:129–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129PluginPaths VampEffectsModule::FindModulePaths(PluginManagerInterface &)
130{
131 PluginPaths names;
132
133 PluginLoader *loader = PluginLoader::getInstance();
134
135 PluginLoader::PluginKeyList keys = loader->listPlugins();
136
137 for (PluginLoader::PluginKeyList::iterator i = keys.begin(); i != keys.end(); ++i)
138 {
139 std::unique_ptr<Plugin> vp{ PluginLoader::getInstance()->loadPlugin(*i, 48000) }; // rate doesn't matter here
140 if (!vp)
141 {
142 continue;
143 }
144
145 // We limit the listed plugin outputs to those whose results can
146 // readily be displayed in an Audacity label track.
147 //
148 // - Any output whose features have no values (time instants only),
149 // with or without duration, is fine
150 //
151 // - Any output whose features have more than one value, or an
152 // unknown or variable number of values, is right out
153 //
154 // - Any output whose features have exactly one value, with
155 // variable sample rate or with duration, should be OK --
156 // this implies a sparse feature, of which the time and/or
157 // duration are significant aspects worth displaying
158 //
159 // - An output whose features have exactly one value, with
160 // fixed sample rate and no duration, cannot be usefully
161 // displayed -- the value is the only significant piece of
162 // data there and we have no good value plot
163
164 Plugin::OutputList outputs = vp->getOutputDescriptors();
165
166 int output = 0;
167
168 for (Plugin::OutputList::iterator j = outputs.begin(); j != outputs.end(); ++j)
169 {
170 if (j->sampleType == Plugin::OutputDescriptor::FixedSampleRate ||
171 j->sampleType == Plugin::OutputDescriptor::OneSamplePerStep ||
172 !j->hasFixedBinCount ||
173 j->binCount > 1)
174 {
175 // All of these qualities disqualify (see notes above)
176
177 ++output;
178 continue;
179 }
180
181 wxString name = wxString::FromUTF8(vp->getName().c_str());
182
183 if (outputs.size() > 1)
184 {
185 // This is not the plugin's only output.
186 // Use "plugin name: output name" as the effect name,

Callers

nothing calls this directly

Calls 9

listPluginsMethod · 0.80
loadPluginMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getOutputDescriptorsMethod · 0.45
c_strMethod · 0.45
getNameMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected