comparison plugin/LADSPAPluginInstance.cpp @ 690:1424aa29ae95

Seems to be a bad idea to use plain DEBUG symbol on OS/X (system wants it)
author Chris Cannam
date Tue, 14 Jun 2011 15:26:52 +0100
parents 06f13a3b9e9e
children 7eb389da7976
comparison
equal deleted inserted replaced
689:573d45e9487b 690:1424aa29ae95
205 LADSPAPluginInstance::setParameter(std::string id, float value) 205 LADSPAPluginInstance::setParameter(std::string id, float value)
206 { 206 {
207 for (unsigned int i = 0; i < m_controlPortsIn.size(); ++i) { 207 for (unsigned int i = 0; i < m_controlPortsIn.size(); ++i) {
208 if (id == m_descriptor->PortNames[m_controlPortsIn[i].first]) { 208 if (id == m_descriptor->PortNames[m_controlPortsIn[i].first]) {
209 #ifdef DEBUG_LADSPA 209 #ifdef DEBUG_LADSPA
210 DEBUG << "LADSPAPluginInstance::setParameter: Found id " 210 SVDEBUG << "LADSPAPluginInstance::setParameter: Found id "
211 << id << " at control port " << i << endl; 211 << id << " at control port " << i << endl;
212 #endif 212 #endif
213 setParameterValue(i, value); 213 setParameterValue(i, value);
214 break; 214 break;
215 } 215 }
218 218
219 void 219 void
220 LADSPAPluginInstance::init(int idealChannelCount) 220 LADSPAPluginInstance::init(int idealChannelCount)
221 { 221 {
222 #ifdef DEBUG_LADSPA 222 #ifdef DEBUG_LADSPA
223 DEBUG << "LADSPAPluginInstance::init(" << idealChannelCount << "): plugin has " 223 SVDEBUG << "LADSPAPluginInstance::init(" << idealChannelCount << "): plugin has "
224 << m_descriptor->PortCount << " ports" << endl; 224 << m_descriptor->PortCount << " ports" << endl;
225 #endif 225 #endif
226 226
227 // Discover ports numbers and identities 227 // Discover ports numbers and identities
228 // 228 //
230 230
231 if (LADSPA_IS_PORT_AUDIO(m_descriptor->PortDescriptors[i])) { 231 if (LADSPA_IS_PORT_AUDIO(m_descriptor->PortDescriptors[i])) {
232 232
233 if (LADSPA_IS_PORT_INPUT(m_descriptor->PortDescriptors[i])) { 233 if (LADSPA_IS_PORT_INPUT(m_descriptor->PortDescriptors[i])) {
234 #ifdef DEBUG_LADSPA 234 #ifdef DEBUG_LADSPA
235 DEBUG << "LADSPAPluginInstance::init: port " << i << " is audio in" << endl; 235 SVDEBUG << "LADSPAPluginInstance::init: port " << i << " is audio in" << endl;
236 #endif 236 #endif
237 m_audioPortsIn.push_back(i); 237 m_audioPortsIn.push_back(i);
238 } else { 238 } else {
239 #ifdef DEBUG_LADSPA 239 #ifdef DEBUG_LADSPA
240 DEBUG << "LADSPAPluginInstance::init: port " << i << " is audio out" << endl; 240 SVDEBUG << "LADSPAPluginInstance::init: port " << i << " is audio out" << endl;
241 #endif 241 #endif
242 m_audioPortsOut.push_back(i); 242 m_audioPortsOut.push_back(i);
243 } 243 }
244 244
245 } else if (LADSPA_IS_PORT_CONTROL(m_descriptor->PortDescriptors[i])) { 245 } else if (LADSPA_IS_PORT_CONTROL(m_descriptor->PortDescriptors[i])) {
246 246
247 if (LADSPA_IS_PORT_INPUT(m_descriptor->PortDescriptors[i])) { 247 if (LADSPA_IS_PORT_INPUT(m_descriptor->PortDescriptors[i])) {
248 248
249 #ifdef DEBUG_LADSPA 249 #ifdef DEBUG_LADSPA
250 DEBUG << "LADSPAPluginInstance::init: port " << i << " is control in" << endl; 250 SVDEBUG << "LADSPAPluginInstance::init: port " << i << " is control in" << endl;
251 #endif 251 #endif
252 LADSPA_Data *data = new LADSPA_Data(0.0); 252 LADSPA_Data *data = new LADSPA_Data(0.0);
253 m_controlPortsIn.push_back( 253 m_controlPortsIn.push_back(
254 std::pair<unsigned long, LADSPA_Data*>(i, data)); 254 std::pair<unsigned long, LADSPA_Data*>(i, data));
255 255
256 } else { 256 } else {
257 257
258 #ifdef DEBUG_LADSPA 258 #ifdef DEBUG_LADSPA
259 DEBUG << "LADSPAPluginInstance::init: port " << i << " is control out" << endl; 259 SVDEBUG << "LADSPAPluginInstance::init: port " << i << " is control out" << endl;
260 #endif 260 #endif
261 LADSPA_Data *data = new LADSPA_Data(0.0); 261 LADSPA_Data *data = new LADSPA_Data(0.0);
262 m_controlPortsOut.push_back( 262 m_controlPortsOut.push_back(
263 std::pair<unsigned long, LADSPA_Data*>(i, data)); 263 std::pair<unsigned long, LADSPA_Data*>(i, data));
264 if (!strcmp(m_descriptor->PortNames[i], "latency") || 264 if (!strcmp(m_descriptor->PortNames[i], "latency") ||
271 271
272 } 272 }
273 } 273 }
274 #ifdef DEBUG_LADSPA 274 #ifdef DEBUG_LADSPA
275 else 275 else
276 DEBUG << "LADSPAPluginInstance::init - " 276 SVDEBUG << "LADSPAPluginInstance::init - "
277 << "unrecognised port type" << endl; 277 << "unrecognised port type" << endl;
278 #endif 278 #endif
279 } 279 }
280 280
281 m_instanceCount = 1; 281 m_instanceCount = 1;
339 339
340 340
341 LADSPAPluginInstance::~LADSPAPluginInstance() 341 LADSPAPluginInstance::~LADSPAPluginInstance()
342 { 342 {
343 #ifdef DEBUG_LADSPA 343 #ifdef DEBUG_LADSPA
344 DEBUG << "LADSPAPluginInstance::~LADSPAPluginInstance" << endl; 344 SVDEBUG << "LADSPAPluginInstance::~LADSPAPluginInstance" << endl;
345 #endif 345 #endif
346 346
347 if (m_instanceHandles.size() != 0) { // "isOK()" 347 if (m_instanceHandles.size() != 0) { // "isOK()"
348 deactivate(); 348 deactivate();
349 } 349 }