Mercurial > hg > beatroot-vamp
diff BeatRootVampPlugin.cpp @ 10:1c1e98cd1b2e
Fixes so as to run and, in theory, return results without crashing -- still doesn't actually produce meaningful data though
author | Chris Cannam |
---|---|
date | Fri, 30 Sep 2011 23:08:42 +0100 |
parents | 4f6626f9ffac |
children | 0d4048bfadbb |
line wrap: on
line diff
--- a/BeatRootVampPlugin.cpp Fri Sep 30 15:39:17 2011 +0100 +++ b/BeatRootVampPlugin.cpp Fri Sep 30 23:08:42 2011 +0100 @@ -16,6 +16,9 @@ #include "BeatRootVampPlugin.h" #include "BeatRootProcessor.h" +#include "Event.h" + +#include <vamp-sdk/RealTime.h> #include <vamp-sdk/PluginAdapter.h> BeatRootVampPlugin::BeatRootVampPlugin(float inputSampleRate) : @@ -197,14 +200,29 @@ BeatRootVampPlugin::FeatureSet BeatRootVampPlugin::process(const float *const *inputBuffers, Vamp::RealTime timestamp) { - // Do actual work! + m_processor->processFrame(inputBuffers); return FeatureSet(); } BeatRootVampPlugin::FeatureSet BeatRootVampPlugin::getRemainingFeatures() { - return FeatureSet(); + EventList el = m_processor->beatTrack(); + + Feature f; + f.hasTimestamp = true; + f.hasDuration = false; + f.label = ""; + f.values.clear(); + + FeatureSet fs; + + for (int i = 0; i < el.size(); ++i) { + f.timestamp = Vamp::RealTime::frame2RealTime(el[i].time, m_inputSampleRate); + fs[0].push_back(f); + } + + return fs; }