comparison plugin/DSSIPluginFactory.cpp @ 843:e802e550a1f2

Drop std:: from cout, cerr, endl -- pull these in through Debug.h
author Chris Cannam
date Tue, 26 Nov 2013 13:35:08 +0000
parents 1424aa29ae95
children f5cd33909744
comparison
equal deleted inserted replaced
842:23d3a6eca5c3 843:e802e550a1f2
157 bool firstInLibrary = false; 157 bool firstInLibrary = false;
158 158
159 if (m_libraryHandles.find(soname) == m_libraryHandles.end()) { 159 if (m_libraryHandles.find(soname) == m_libraryHandles.end()) {
160 loadLibrary(soname); 160 loadLibrary(soname);
161 if (m_libraryHandles.find(soname) == m_libraryHandles.end()) { 161 if (m_libraryHandles.find(soname) == m_libraryHandles.end()) {
162 std::cerr << "WARNING: DSSIPluginFactory::getDSSIDescriptor: loadLibrary failed for " << soname << std::endl; 162 cerr << "WARNING: DSSIPluginFactory::getDSSIDescriptor: loadLibrary failed for " << soname << endl;
163 return 0; 163 return 0;
164 } 164 }
165 firstInLibrary = true; 165 firstInLibrary = true;
166 } 166 }
167 167
169 169
170 DSSI_Descriptor_Function fn = (DSSI_Descriptor_Function) 170 DSSI_Descriptor_Function fn = (DSSI_Descriptor_Function)
171 DLSYM(libraryHandle, "dssi_descriptor"); 171 DLSYM(libraryHandle, "dssi_descriptor");
172 172
173 if (!fn) { 173 if (!fn) {
174 std::cerr << "WARNING: DSSIPluginFactory::getDSSIDescriptor: No descriptor function in library " << soname << std::endl; 174 cerr << "WARNING: DSSIPluginFactory::getDSSIDescriptor: No descriptor function in library " << soname << endl;
175 return 0; 175 return 0;
176 } 176 }
177 177
178 const DSSI_Descriptor *descriptor = 0; 178 const DSSI_Descriptor *descriptor = 0;
179 179
186 return descriptor; 186 return descriptor;
187 } 187 }
188 ++index; 188 ++index;
189 } 189 }
190 190
191 std::cerr << "WARNING: DSSIPluginFactory::getDSSIDescriptor: No such plugin as " << label << " in library " << soname << std::endl; 191 cerr << "WARNING: DSSIPluginFactory::getDSSIDescriptor: No such plugin as " << label << " in library " << soname << endl;
192 192
193 return 0; 193 return 0;
194 } 194 }
195 195
196 const LADSPA_Descriptor * 196 const LADSPA_Descriptor *
289 // of a file that is known to exist 289 // of a file that is known to exist
290 290
291 void *libraryHandle = DLOPEN(soname, RTLD_LAZY); 291 void *libraryHandle = DLOPEN(soname, RTLD_LAZY);
292 292
293 if (!libraryHandle) { 293 if (!libraryHandle) {
294 std::cerr << "WARNING: DSSIPluginFactory::discoverPlugins: couldn't load plugin library " 294 cerr << "WARNING: DSSIPluginFactory::discoverPlugins: couldn't load plugin library "
295 << soname << " - " << DLERROR() << std::endl; 295 << soname << " - " << DLERROR() << endl;
296 return; 296 return;
297 } 297 }
298 298
299 DSSI_Descriptor_Function fn = (DSSI_Descriptor_Function) 299 DSSI_Descriptor_Function fn = (DSSI_Descriptor_Function)
300 DLSYM(libraryHandle, "dssi_descriptor"); 300 DLSYM(libraryHandle, "dssi_descriptor");
301 301
302 if (!fn) { 302 if (!fn) {
303 std::cerr << "WARNING: DSSIPluginFactory::discoverPlugins: No descriptor function in " << soname << std::endl; 303 cerr << "WARNING: DSSIPluginFactory::discoverPlugins: No descriptor function in " << soname << endl;
304 return; 304 return;
305 } 305 }
306 306
307 const DSSI_Descriptor *descriptor = 0; 307 const DSSI_Descriptor *descriptor = 0;
308 308
309 int index = 0; 309 int index = 0;
310 while ((descriptor = fn(index))) { 310 while ((descriptor = fn(index))) {
311 311
312 const LADSPA_Descriptor *ladspaDescriptor = descriptor->LADSPA_Plugin; 312 const LADSPA_Descriptor *ladspaDescriptor = descriptor->LADSPA_Plugin;
313 if (!ladspaDescriptor) { 313 if (!ladspaDescriptor) {
314 std::cerr << "WARNING: DSSIPluginFactory::discoverPlugins: No LADSPA descriptor for plugin " << index << " in " << soname << std::endl; 314 cerr << "WARNING: DSSIPluginFactory::discoverPlugins: No LADSPA descriptor for plugin " << index << " in " << soname << endl;
315 ++index; 315 ++index;
316 continue; 316 continue;
317 } 317 }
318 318
319 RealTimePluginDescriptor *rtd = new RealTimePluginDescriptor; 319 RealTimePluginDescriptor *rtd = new RealTimePluginDescriptor;
356 } 356 }
357 } 357 }
358 358
359 rtd->category = category.toStdString(); 359 rtd->category = category.toStdString();
360 360
361 // std::cerr << "Plugin id is " << ladspaDescriptor->UniqueID 361 // cerr << "Plugin id is " << ladspaDescriptor->UniqueID
362 // << ", identifier is \"" << identifier.toStdString() 362 // << ", identifier is \"" << identifier.toStdString()
363 // << "\", category is \"" << category.toStdString() 363 // << "\", category is \"" << category.toStdString()
364 // << "\", name is " << ladspaDescriptor->Name 364 // << "\", name is " << ladspaDescriptor->Name
365 // << ", label is " << ladspaDescriptor->Label 365 // << ", label is " << ladspaDescriptor->Label
366 // << std::endl; 366 // << endl;
367 367
368 def_uri = lrdf_get_default_uri(ladspaDescriptor->UniqueID); 368 def_uri = lrdf_get_default_uri(ladspaDescriptor->UniqueID);
369 if (def_uri) { 369 if (def_uri) {
370 defs = lrdf_get_setting_values(def_uri); 370 defs = lrdf_get_setting_values(def_uri);
371 } 371 }
378 378
379 if (def_uri && defs) { 379 if (def_uri && defs) {
380 380
381 for (unsigned int j = 0; j < defs->count; j++) { 381 for (unsigned int j = 0; j < defs->count; j++) {
382 if (defs->items[j].pid == controlPortNumber) { 382 if (defs->items[j].pid == controlPortNumber) {
383 // std::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] << std::endl; 383 // 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;
384 m_portDefaults[ladspaDescriptor->UniqueID][i] = 384 m_portDefaults[ladspaDescriptor->UniqueID][i] =
385 defs->items[j].value; 385 defs->items[j].value;
386 } 386 }
387 } 387 }
388 } 388 }
419 419
420 ++index; 420 ++index;
421 } 421 }
422 422
423 if (DLCLOSE(libraryHandle) != 0) { 423 if (DLCLOSE(libraryHandle) != 0) {
424 std::cerr << "WARNING: DSSIPluginFactory::discoverPlugins - can't unload " << libraryHandle << std::endl; 424 cerr << "WARNING: DSSIPluginFactory::discoverPlugins - can't unload " << libraryHandle << endl;
425 return; 425 return;
426 } 426 }
427 } 427 }
428 428
429 429