comparison plugin/LADSPAPluginInstance.cpp @ 259:dc46851837d6

* Fix many compile warnings, remove some debug output
author Chris Cannam
date Mon, 30 Apr 2007 13:36:23 +0000
parents 2f7d27648806
children ca3b91119482
comparison
equal deleted inserted replaced
258:96a6dd889c68 259:dc46851837d6
27 #ifdef HAVE_LRDF 27 #ifdef HAVE_LRDF
28 #include "lrdf.h" 28 #include "lrdf.h"
29 #endif // HAVE_LRDF 29 #endif // HAVE_LRDF
30 30
31 //#define DEBUG_LADSPA 1 31 //#define DEBUG_LADSPA 1
32
33 #include <cmath>
32 34
33 35
34 LADSPAPluginInstance::LADSPAPluginInstance(RealTimePluginFactory *factory, 36 LADSPAPluginInstance::LADSPAPluginInstance(RealTimePluginFactory *factory,
35 int clientId, 37 int clientId,
36 QString identifier, 38 QString identifier,
151 lrdf_get_scale_values(m_descriptor->UniqueID, pn); 153 lrdf_get_scale_values(m_descriptor->UniqueID, pn);
152 154
153 if (defaults) { 155 if (defaults) {
154 if (defaults->count > 0) { 156 if (defaults->count > 0) {
155 std::map<int, std::string> values; 157 std::map<int, std::string> values;
156 int v = 0; 158 size_t v = 0;
157 for (size_t i = 0; i < defaults->count; ++i) { 159 for (size_t i = 0; i < defaults->count; ++i) {
158 v = defaults->items[i].value; 160 v = size_t(lrintf(fabsf(defaults->items[i].value)));
159 values[v] = defaults->items[i].label; 161 values[v] = defaults->items[i].label;
160 } 162 }
161 for (size_t i = 0; i <= v; ++i) { 163 for (size_t i = 0; i <= v; ++i) {
162 pd.valueNames.push_back(values[i]); 164 pd.valueNames.push_back(values[i]);
163 } 165 }
289 size_t 291 size_t
290 LADSPAPluginInstance::getLatency() 292 LADSPAPluginInstance::getLatency()
291 { 293 {
292 if (m_latencyPort) { 294 if (m_latencyPort) {
293 if (!m_run) { 295 if (!m_run) {
294 for (int i = 0; i < getAudioInputCount(); ++i) { 296 for (size_t i = 0; i < getAudioInputCount(); ++i) {
295 for (int j = 0; j < m_blockSize; ++j) { 297 for (size_t j = 0; j < m_blockSize; ++j) {
296 m_inputBuffers[i][j] = 0.f; 298 m_inputBuffers[i][j] = 0.f;
297 } 299 }
298 } 300 }
299 run(Vamp::RealTime::zeroTime); 301 run(Vamp::RealTime::zeroTime);
300 } 302 }
516 void 518 void
517 LADSPAPluginInstance::run(const Vamp::RealTime &) 519 LADSPAPluginInstance::run(const Vamp::RealTime &)
518 { 520 {
519 if (!m_descriptor || !m_descriptor->run) return; 521 if (!m_descriptor || !m_descriptor->run) return;
520 522
521 int inbuf = 0, outbuf = 0;
522
523 for (std::vector<LADSPA_Handle>::iterator hi = m_instanceHandles.begin(); 523 for (std::vector<LADSPA_Handle>::iterator hi = m_instanceHandles.begin();
524 hi != m_instanceHandles.end(); ++hi) { 524 hi != m_instanceHandles.end(); ++hi) {
525 525
526 m_descriptor->run(*hi, m_blockSize); 526 m_descriptor->run(*hi, m_blockSize);
527 } 527 }