Mercurial > hg > svcore
comparison plugin/DSSIPluginFactory.cpp @ 1885:1adbeb52d761
Make some debug output less obvious
author | Chris Cannam |
---|---|
date | Fri, 14 Aug 2020 10:42:37 +0100 |
parents | 5f8fbbde08ff |
children |
comparison
equal
deleted
inserted
replaced
1884:bdab3a921d5d | 1885:1adbeb52d761 |
---|---|
159 bool firstInLibrary = false; | 159 bool firstInLibrary = false; |
160 | 160 |
161 if (m_libraryHandles.find(soname) == m_libraryHandles.end()) { | 161 if (m_libraryHandles.find(soname) == m_libraryHandles.end()) { |
162 loadLibrary(soname); | 162 loadLibrary(soname); |
163 if (m_libraryHandles.find(soname) == m_libraryHandles.end()) { | 163 if (m_libraryHandles.find(soname) == m_libraryHandles.end()) { |
164 cerr << "WARNING: DSSIPluginFactory::getDSSIDescriptor: loadLibrary failed for " << soname << endl; | 164 SVCERR << "WARNING: DSSIPluginFactory::getDSSIDescriptor: loadLibrary failed for " << soname << endl; |
165 return nullptr; | 165 return nullptr; |
166 } | 166 } |
167 firstInLibrary = true; | 167 firstInLibrary = true; |
168 } | 168 } |
169 | 169 |
171 | 171 |
172 DSSI_Descriptor_Function fn = (DSSI_Descriptor_Function) | 172 DSSI_Descriptor_Function fn = (DSSI_Descriptor_Function) |
173 DLSYM(libraryHandle, "dssi_descriptor"); | 173 DLSYM(libraryHandle, "dssi_descriptor"); |
174 | 174 |
175 if (!fn) { | 175 if (!fn) { |
176 cerr << "WARNING: DSSIPluginFactory::getDSSIDescriptor: No descriptor function in library " << soname << endl; | 176 SVCERR << "WARNING: DSSIPluginFactory::getDSSIDescriptor: No descriptor function in library " << soname << endl; |
177 return nullptr; | 177 return nullptr; |
178 } | 178 } |
179 | 179 |
180 const DSSI_Descriptor *descriptor = nullptr; | 180 const DSSI_Descriptor *descriptor = nullptr; |
181 | 181 |
188 return descriptor; | 188 return descriptor; |
189 } | 189 } |
190 ++index; | 190 ++index; |
191 } | 191 } |
192 | 192 |
193 cerr << "WARNING: DSSIPluginFactory::getDSSIDescriptor: No such plugin as " << label << " in library " << soname << endl; | 193 SVCERR << "WARNING: DSSIPluginFactory::getDSSIDescriptor: No such plugin as " << label << " in library " << soname << endl; |
194 | 194 |
195 return nullptr; | 195 return nullptr; |
196 } | 196 } |
197 | 197 |
198 const LADSPA_Descriptor * | 198 const LADSPA_Descriptor * |
294 // of a file that is known to exist | 294 // of a file that is known to exist |
295 | 295 |
296 void *libraryHandle = DLOPEN(soname, RTLD_LAZY); | 296 void *libraryHandle = DLOPEN(soname, RTLD_LAZY); |
297 | 297 |
298 if (!libraryHandle) { | 298 if (!libraryHandle) { |
299 cerr << "WARNING: DSSIPluginFactory::discoverPlugins: couldn't load plugin library " | 299 SVCERR << "WARNING: DSSIPluginFactory::discoverPlugins: couldn't load plugin library " |
300 << soname << " - " << DLERROR() << endl; | 300 << soname << " - " << DLERROR() << endl; |
301 return; | 301 return; |
302 } | 302 } |
303 | 303 |
304 DSSI_Descriptor_Function fn = (DSSI_Descriptor_Function) | 304 DSSI_Descriptor_Function fn = (DSSI_Descriptor_Function) |
305 DLSYM(libraryHandle, "dssi_descriptor"); | 305 DLSYM(libraryHandle, "dssi_descriptor"); |
306 | 306 |
307 if (!fn) { | 307 if (!fn) { |
308 cerr << "WARNING: DSSIPluginFactory::discoverPlugins: No descriptor function in " << soname << endl; | 308 SVCERR << "WARNING: DSSIPluginFactory::discoverPlugins: No descriptor function in " << soname << endl; |
309 return; | 309 return; |
310 } | 310 } |
311 | 311 |
312 const DSSI_Descriptor *descriptor = nullptr; | 312 const DSSI_Descriptor *descriptor = nullptr; |
313 | 313 |
314 int index = 0; | 314 int index = 0; |
315 while ((descriptor = fn(index))) { | 315 while ((descriptor = fn(index))) { |
316 | 316 |
317 const LADSPA_Descriptor *ladspaDescriptor = descriptor->LADSPA_Plugin; | 317 const LADSPA_Descriptor *ladspaDescriptor = descriptor->LADSPA_Plugin; |
318 if (!ladspaDescriptor) { | 318 if (!ladspaDescriptor) { |
319 cerr << "WARNING: DSSIPluginFactory::discoverPlugins: No LADSPA descriptor for plugin " << index << " in " << soname << endl; | 319 SVCERR << "WARNING: DSSIPluginFactory::discoverPlugins: No LADSPA descriptor for plugin " << index << " in " << soname << endl; |
320 ++index; | 320 ++index; |
321 continue; | 321 continue; |
322 } | 322 } |
323 | 323 |
324 RealTimePluginDescriptor rtd; | 324 RealTimePluginDescriptor rtd; |
361 } | 361 } |
362 } | 362 } |
363 | 363 |
364 rtd.category = category.toStdString(); | 364 rtd.category = category.toStdString(); |
365 | 365 |
366 // cerr << "Plugin id is " << ladspaDescriptor->UniqueID | 366 // SVCERR << "Plugin id is " << ladspaDescriptor->UniqueID |
367 // << ", identifier is \"" << identifier | 367 // << ", identifier is \"" << identifier |
368 // << "\", category is \"" << category | 368 // << "\", category is \"" << category |
369 // << "\", name is " << ladspaDescriptor->Name | 369 // << "\", name is " << ladspaDescriptor->Name |
370 // << ", label is " << ladspaDescriptor->Label | 370 // << ", label is " << ladspaDescriptor->Label |
371 // << endl; | 371 // << endl; |
383 | 383 |
384 if (def_uri && defs) { | 384 if (def_uri && defs) { |
385 | 385 |
386 for (int j = 0; j < (int)defs->count; j++) { | 386 for (int j = 0; j < (int)defs->count; j++) { |
387 if (defs->items[j].pid == controlPortNumber) { | 387 if (defs->items[j].pid == controlPortNumber) { |
388 // cerr << "Default for this port (" << defs->items[j].pid << ", " << defs->items[j].label << ") is " << defs->items[j].value << "; applying this to port number " << i << " with name " << ladspaDescriptor->PortNames[i] << endl; | 388 // SVCERR << "Default for this port (" << defs->items[j].pid << ", " << defs->items[j].label << ") is " << defs->items[j].value << "; applying this to port number " << i << " with name " << ladspaDescriptor->PortNames[i] << endl; |
389 m_portDefaults[ladspaDescriptor->UniqueID][i] = | 389 m_portDefaults[ladspaDescriptor->UniqueID][i] = |
390 defs->items[j].value; | 390 defs->items[j].value; |
391 } | 391 } |
392 } | 392 } |
393 } | 393 } |
426 | 426 |
427 ++index; | 427 ++index; |
428 } | 428 } |
429 | 429 |
430 if (DLCLOSE(libraryHandle) != 0) { | 430 if (DLCLOSE(libraryHandle) != 0) { |
431 cerr << "WARNING: DSSIPluginFactory::discoverPlugins - can't unload " << libraryHandle << endl; | 431 SVCERR << "WARNING: DSSIPluginFactory::discoverPlugins - can't unload " << libraryHandle << endl; |
432 return; | 432 return; |
433 } | 433 } |
434 } | 434 } |
435 | 435 |
436 | 436 |