comparison plugin/LADSPAPluginInstance.cpp @ 57:7439f1696314

* Add editing for auralisation plugin parameters and programs * Rename and reorganise the sample plugin sample set
author Chris Cannam
date Thu, 23 Mar 2006 15:49:41 +0000
parents d397ea0a79f5
children 3086ff194ea0
comparison
equal deleted inserted replaced
56:2157fa46c1e7 57:7439f1696314
111 pd.name = m_descriptor->PortNames[pn]; 111 pd.name = m_descriptor->PortNames[pn];
112 pd.description = pd.name; 112 pd.description = pd.name;
113 pd.minValue = f->getPortMinimum(m_descriptor, pn); 113 pd.minValue = f->getPortMinimum(m_descriptor, pn);
114 pd.maxValue = f->getPortMaximum(m_descriptor, pn); 114 pd.maxValue = f->getPortMaximum(m_descriptor, pn);
115 pd.defaultValue = f->getPortDefault(m_descriptor, pn); 115 pd.defaultValue = f->getPortDefault(m_descriptor, pn);
116 pd.isQuantized = false; 116
117 float q = f->getPortQuantization(m_descriptor, pn);
118 if (q == 0.0) {
119 pd.isQuantized = false;
120 } else {
121 pd.isQuantized = true;
122 pd.quantizeStep = q;
123 }
117 124
118 list.push_back(pd); 125 list.push_back(pd);
119 } 126 }
120 127
121 return list; 128 return list;
333 if (!m_descriptor || !m_descriptor->connect_port) return; 340 if (!m_descriptor || !m_descriptor->connect_port) return;
334 341
335 assert(sizeof(LADSPA_Data) == sizeof(float)); 342 assert(sizeof(LADSPA_Data) == sizeof(float));
336 assert(sizeof(sample_t) == sizeof(float)); 343 assert(sizeof(sample_t) == sizeof(float));
337 344
345 LADSPAPluginFactory *f = dynamic_cast<LADSPAPluginFactory *>(m_factory);
338 int inbuf = 0, outbuf = 0; 346 int inbuf = 0, outbuf = 0;
339 347
340 for (std::vector<LADSPA_Handle>::iterator hi = m_instanceHandles.begin(); 348 for (std::vector<LADSPA_Handle>::iterator hi = m_instanceHandles.begin();
341 hi != m_instanceHandles.end(); ++hi) { 349 hi != m_instanceHandles.end(); ++hi) {
342 350
362 370
363 for (unsigned int i = 0; i < m_controlPortsIn.size(); ++i) { 371 for (unsigned int i = 0; i < m_controlPortsIn.size(); ++i) {
364 m_descriptor->connect_port(*hi, 372 m_descriptor->connect_port(*hi,
365 m_controlPortsIn[i].first, 373 m_controlPortsIn[i].first,
366 m_controlPortsIn[i].second); 374 m_controlPortsIn[i].second);
375 if (f) {
376 float defaultValue = f->getPortDefault
377 (m_descriptor, m_controlPortsIn[i].first);
378 *m_controlPortsIn[i].second = defaultValue;
379 }
367 } 380 }
368 381
369 for (unsigned int i = 0; i < m_controlPortsOut.size(); ++i) { 382 for (unsigned int i = 0; i < m_controlPortsOut.size(); ++i) {
370 m_descriptor->connect_port(*hi, 383 m_descriptor->connect_port(*hi,
371 m_controlPortsOut[i].first, 384 m_controlPortsOut[i].first,