# HG changeset patch
# User cannam
# Date 1227616485 0
# Node ID 93c81a6c917a8c09590135eee9660152dc7526a0
# Parent 53b0e7557c525c43a245c1544fd551e0859cf04d
* Ensure PluginBufferingAdapter returns fresh output descriptors after
a call to initialise, setParameter or selectProgram
* Fix RDF document base prefix
diff -r 53b0e7557c52 -r 93c81a6c917a examples/vamp-example-plugins.n3
--- a/examples/vamp-example-plugins.n3 Thu Nov 20 21:51:37 2008 +0000
+++ b/examples/vamp-example-plugins.n3 Tue Nov 25 12:34:45 2008 +0000
@@ -7,7 +7,7 @@
@prefix af: .
@prefix foaf: .
@prefix cc: .
-@prefix : <> .
+@prefix : <#> .
<> a vamp:PluginDescription ;
foaf:maker ;
diff -r 53b0e7557c52 -r 93c81a6c917a rdf/generator/vamp-rdf-template-generator.cpp
--- a/rdf/generator/vamp-rdf-template-generator.cpp Thu Nov 20 21:51:37 2008 +0000
+++ b/rdf/generator/vamp-rdf-template-generator.cpp Tue Nov 25 12:34:45 2008 +0000
@@ -69,7 +69,7 @@
@prefix af: .\n\
@prefix foaf: .\n\
@prefix cc: .\n\
-@prefix : <> .\n\n";
+@prefix : <#> .\n\n";
return res;
}
diff -r 53b0e7557c52 -r 93c81a6c917a src/vamp-hostsdk/PluginBufferingAdapter.cpp
--- a/src/vamp-hostsdk/PluginBufferingAdapter.cpp Thu Nov 20 21:51:37 2008 +0000
+++ b/src/vamp-hostsdk/PluginBufferingAdapter.cpp Tue Nov 25 12:34:45 2008 +0000
@@ -64,6 +64,9 @@
OutputList getOutputDescriptors() const;
+ void setParameter(std::string, float);
+ void selectProgram(std::string);
+
void reset();
FeatureSet process(const float *const *inputBuffers, RealTime timestamp);
@@ -311,6 +314,18 @@
}
void
+PluginBufferingAdapter::setParameter(std::string name, float value)
+{
+ m_impl->setParameter(name, value);
+}
+
+void
+PluginBufferingAdapter::selectProgram(std::string name)
+{
+ m_impl->selectProgram(name);
+}
+
+void
PluginBufferingAdapter::reset()
{
m_impl->reset();
@@ -458,7 +473,16 @@
m_buffers[i] = new float[m_blockSize];
}
- return m_plugin->initialise(m_channels, m_stepSize, m_blockSize);
+ bool success = m_plugin->initialise(m_channels, m_stepSize, m_blockSize);
+
+ if (success) {
+ // Re-query outputs; properties such as bin count may have
+ // changed on initialise
+ m_outputs.clear();
+ (void)getOutputDescriptors();
+ }
+
+ return success;
}
PluginBufferingAdapter::OutputList
@@ -501,6 +525,26 @@
}
void
+PluginBufferingAdapter::Impl::setParameter(std::string name, float value)
+{
+ m_plugin->setParameter(name, value);
+
+ // Re-query outputs; properties such as bin count may have changed
+ m_outputs.clear();
+ (void)getOutputDescriptors();
+}
+
+void
+PluginBufferingAdapter::Impl::selectProgram(std::string name)
+{
+ m_plugin->selectProgram(name);
+
+ // Re-query outputs; properties such as bin count may have changed
+ m_outputs.clear();
+ (void)getOutputDescriptors();
+}
+
+void
PluginBufferingAdapter::Impl::reset()
{
m_frame = 0;
diff -r 53b0e7557c52 -r 93c81a6c917a vamp-hostsdk/PluginBufferingAdapter.h
--- a/vamp-hostsdk/PluginBufferingAdapter.h Thu Nov 20 21:51:37 2008 +0000
+++ b/vamp-hostsdk/PluginBufferingAdapter.h Tue Nov 25 12:34:45 2008 +0000
@@ -169,6 +169,9 @@
*/
void getActualStepAndBlockSizes(size_t &stepSize, size_t &blockSize);
+ void setParameter(std::string, float);
+ void selectProgram(std::string);
+
OutputList getOutputDescriptors() const;
void reset();