comparison transform/RealTimePluginTransform.cpp @ 61:749b5521e082

* adjust for latency if the plugin reports it
author Chris Cannam
date Mon, 27 Mar 2006 16:15:19 +0000
parents 3086ff194ea0
children ba405e5e69d3
comparison
equal deleted inserted replaced
60:3086ff194ea0 61:749b5521e082
112 112
113 int i = 0; 113 int i = 0;
114 114
115 while (blockFrame < endFrame) { 115 while (blockFrame < endFrame) {
116 116
117 std::cout << "RealTimePluginTransform::run: blockFrame "
118 << blockFrame;
119
120 size_t completion = 117 size_t completion =
121 (((blockFrame - startFrame) / blockSize) * 99) / 118 (((blockFrame - startFrame) / blockSize) * 99) /
122 ( (endFrame - startFrame) / blockSize); 119 ( (endFrame - startFrame) / blockSize);
123 120
124 size_t got = 0; 121 size_t got = 0;
141 138
142 m_plugin->run(RealTime::frame2RealTime(blockFrame, sampleRate)); 139 m_plugin->run(RealTime::frame2RealTime(blockFrame, sampleRate));
143 140
144 float value = m_plugin->getControlOutputValue(m_outputNo); 141 float value = m_plugin->getControlOutputValue(m_outputNo);
145 142
146 std::cout << " value " << value << std::endl; 143 model->addPoint(SparseTimeValueModel::Point
147 144 (blockFrame - m_plugin->getLatency(), value, ""));
148 model->addPoint(SparseTimeValueModel::Point(blockFrame, value, ""));
149 145
150 if (blockFrame == startFrame || completion > prevCompletion) { 146 if (blockFrame == startFrame || completion > prevCompletion) {
151 model->setCompletion(completion); 147 model->setCompletion(completion);
152 prevCompletion = completion; 148 prevCompletion = completion;
153 } 149 }