Mercurial > hg > svcore
comparison plugin/DSSIPluginFactory.cpp @ 689:573d45e9487b
Merge from debug-output branch
author | Chris Cannam |
---|---|
date | Tue, 14 Jun 2011 14:47:59 +0100 |
parents | 06f13a3b9e9e |
children | 1424aa29ae95 |
comparison
equal
deleted
inserted
replaced
688:be43b2fe68e8 | 689:573d45e9487b |
---|---|
67 if (!ddesc) continue; | 67 if (!ddesc) continue; |
68 | 68 |
69 const LADSPA_Descriptor *descriptor = ddesc->LADSPA_Plugin; | 69 const LADSPA_Descriptor *descriptor = ddesc->LADSPA_Plugin; |
70 if (!descriptor) continue; | 70 if (!descriptor) continue; |
71 | 71 |
72 // std::cerr << "DSSIPluginFactory::enumeratePlugins: Name " << (descriptor->Name ? descriptor->Name : "NONE" ) << std::endl; | 72 // DEBUG << "DSSIPluginFactory::enumeratePlugins: Name " << (descriptor->Name ? descriptor->Name : "NONE" ) << endl; |
73 | 73 |
74 list.push_back(*i); | 74 list.push_back(*i); |
75 list.push_back(descriptor->Name); | 75 list.push_back(descriptor->Name); |
76 list.push_back(QString("%1").arg(descriptor->UniqueID)); | 76 list.push_back(QString("%1").arg(descriptor->UniqueID)); |
77 list.push_back(descriptor->Label); | 77 list.push_back(descriptor->Label); |
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.toStdString() << std::endl; | 162 std::cerr << "WARNING: DSSIPluginFactory::getDSSIDescriptor: loadLibrary failed for " << soname << std::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.toStdString() << std::endl; | 174 std::cerr << "WARNING: DSSIPluginFactory::getDSSIDescriptor: No descriptor function in library " << soname << std::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.toStdString() << " in library " << soname.toStdString() << std::endl; | 191 std::cerr << "WARNING: DSSIPluginFactory::getDSSIDescriptor: No such plugin as " << label << " in library " << soname << std::endl; |
192 | 192 |
193 return 0; | 193 return 0; |
194 } | 194 } |
195 | 195 |
196 const LADSPA_Descriptor * | 196 const LADSPA_Descriptor * |
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 std::cerr << "WARNING: DSSIPluginFactory::discoverPlugins: couldn't load plugin library " |
295 << soname.toStdString() << " - " << DLERROR() << std::endl; | 295 << soname << " - " << DLERROR() << std::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.toStdString() << std::endl; | 303 std::cerr << "WARNING: DSSIPluginFactory::discoverPlugins: No descriptor function in " << soname << std::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.toStdString() << std::endl; | 314 std::cerr << "WARNING: DSSIPluginFactory::discoverPlugins: No LADSPA descriptor for plugin " << index << " in " << soname << std::endl; |
315 ++index; | 315 ++index; |
316 continue; | 316 continue; |
317 } | 317 } |
318 | 318 |
319 RealTimePluginDescriptor *rtd = new RealTimePluginDescriptor; | 319 RealTimePluginDescriptor *rtd = new RealTimePluginDescriptor; |