comparison src/vamp-hostsdk/PluginInputDomainAdapter.cpp @ 298:5940dd0a399f

* Add NoShift option to PluginInputDomainAdapter as well, for completeness * Minor & doc updates
author cannam
date Tue, 22 Sep 2009 13:01:56 +0000
parents c97e70ed5abc
children 5cb298435765
comparison
equal deleted inserted replaced
297:f3db7ba66fea 298:5940dd0a399f
404 RealTime 404 RealTime
405 PluginInputDomainAdapter::Impl::getTimestampAdjustment() const 405 PluginInputDomainAdapter::Impl::getTimestampAdjustment() const
406 { 406 {
407 if (m_plugin->getInputDomain() == TimeDomain) { 407 if (m_plugin->getInputDomain() == TimeDomain) {
408 return RealTime::zeroTime; 408 return RealTime::zeroTime;
409 } else if (m_method == ShiftData) { 409 } else if (m_method == ShiftData || m_method == NoShift) {
410 return RealTime::zeroTime; 410 return RealTime::zeroTime;
411 } else { 411 } else {
412 return RealTime::frame2RealTime 412 return RealTime::frame2RealTime
413 (m_blockSize/2, int(m_inputSampleRate + 0.5)); 413 (m_blockSize/2, int(m_inputSampleRate + 0.5));
414 } 414 }
432 { 432 {
433 if (m_plugin->getInputDomain() == TimeDomain) { 433 if (m_plugin->getInputDomain() == TimeDomain) {
434 return m_plugin->process(inputBuffers, timestamp); 434 return m_plugin->process(inputBuffers, timestamp);
435 } 435 }
436 436
437 if (m_method == ShiftTimestamp) { 437 if (m_method == ShiftTimestamp || m_method == NoShift) {
438 return processShiftingTimestamp(inputBuffers, timestamp); 438 return processShiftingTimestamp(inputBuffers, timestamp);
439 } else { 439 } else {
440 return processShiftingData(inputBuffers, timestamp); 440 return processShiftingData(inputBuffers, timestamp);
441 } 441 }
442 } 442 }
443 443
444 Plugin::FeatureSet 444 Plugin::FeatureSet
445 PluginInputDomainAdapter::Impl::processShiftingTimestamp(const float *const *inputBuffers, 445 PluginInputDomainAdapter::Impl::processShiftingTimestamp(const float *const *inputBuffers,
446 RealTime timestamp) 446 RealTime timestamp)
447 { 447 {
448 timestamp = timestamp + getTimestampAdjustment(); 448 if (m_method == ShiftTimestamp) {
449 timestamp = timestamp + getTimestampAdjustment();
450 }
449 451
450 for (int c = 0; c < m_channels; ++c) { 452 for (int c = 0; c < m_channels; ++c) {
451 453
452 for (int i = 0; i < m_blockSize; ++i) { 454 for (int i = 0; i < m_blockSize; ++i) {
453 m_ri[i] = double(inputBuffers[c][i]) * m_window[i]; 455 m_ri[i] = double(inputBuffers[c][i]) * m_window[i];