Mercurial > hg > vamp-plugin-sdk
comparison vamp-sdk/hostext/PluginInputDomainAdapter.cpp @ 68:47d6e670a810
* avoid warning about float-to-int conversion on frame2RealTime
* define pi if it isn't already for some reason
author | cannam |
---|---|
date | Mon, 04 Jun 2007 13:31:04 +0000 |
parents | a712ed15d158 |
children | fd58037b4a7b |
comparison
equal
deleted
inserted
replaced
67:4017e21c12dd | 68:47d6e670a810 |
---|---|
167 blockSize = nearest; | 167 blockSize = nearest; |
168 } | 168 } |
169 | 169 |
170 return blockSize; | 170 return blockSize; |
171 } | 171 } |
172 | |
173 // for some visual studii apparently | |
174 #ifndef M_PI | |
175 #define M_PI 3.14159265358979232846 | |
176 #endif | |
172 | 177 |
173 Plugin::FeatureSet | 178 Plugin::FeatureSet |
174 PluginInputDomainAdapter::process(const float *const *inputBuffers, RealTime timestamp) | 179 PluginInputDomainAdapter::process(const float *const *inputBuffers, RealTime timestamp) |
175 { | 180 { |
176 if (m_plugin->getInputDomain() == TimeDomain) { | 181 if (m_plugin->getInputDomain() == TimeDomain) { |
219 // particular that this means some results can differ from those | 224 // particular that this means some results can differ from those |
220 // produced by SV. | 225 // produced by SV. |
221 | 226 |
222 // std::cerr << "PluginInputDomainAdapter: sampleRate " << m_inputSampleRate << ", blocksize " << m_blockSize << ", adjusting time from " << timestamp; | 227 // std::cerr << "PluginInputDomainAdapter: sampleRate " << m_inputSampleRate << ", blocksize " << m_blockSize << ", adjusting time from " << timestamp; |
223 | 228 |
224 timestamp = timestamp + RealTime::frame2RealTime(m_blockSize/2, | 229 timestamp = timestamp + RealTime::frame2RealTime |
225 m_inputSampleRate); | 230 (m_blockSize/2, int(m_inputSampleRate + 0.5)); |
226 | 231 |
227 // std::cerr << " to " << timestamp << std::endl; | 232 // std::cerr << " to " << timestamp << std::endl; |
228 | 233 |
229 for (size_t c = 0; c < m_channels; ++c) { | 234 for (size_t c = 0; c < m_channels; ++c) { |
230 | 235 |