summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-10-07 14:37:09 +0200
committerRobin Gareus <robin@gareus.org>2016-10-07 14:37:09 +0200
commitd4229da4cfdb3c801cec291fd9a2c8531dee878c (patch)
tree67f30c90ab3152e5f9a330665fd6693c9af6a4d6 /libs/ardour
parent485e31f08215d6f311e6ae6221d8d7a7c31d599c (diff)
honor Vamp Plugin preferred step+block sizes.
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/lua_api.h4
-rw-r--r--libs/ardour/lua_api.cc10
2 files changed, 12 insertions, 2 deletions
diff --git a/libs/ardour/ardour/lua_api.h b/libs/ardour/ardour/lua_api.h
index dc6cec8d75..017246cf1d 100644
--- a/libs/ardour/ardour/lua_api.h
+++ b/libs/ardour/ardour/lua_api.h
@@ -205,8 +205,10 @@ namespace ARDOUR { namespace LuaAPI {
/** initialize the plugin for use with analyze().
*
- * This is equivalent to plugin():initialise (1, 512, 1024)
+ * This is equivalent to plugin():initialise (1, ssiz, bsiz)
* and prepares a plugin for analyze.
+ * (by preferred step and block sizes are used. if the plugin
+ * does not specify them or they're larger than 8K, both are set to 1024)
*
* Manual initialization is only required to set plugin-parameters
* which depend on prior initialization of the plugin.
diff --git a/libs/ardour/lua_api.cc b/libs/ardour/lua_api.cc
index 2078fd4aa7..6a2dbbe9f6 100644
--- a/libs/ardour/lua_api.cc
+++ b/libs/ardour/lua_api.cc
@@ -551,7 +551,7 @@ LuaAPI::Vamp::Vamp (const std::string& key, float sample_rate)
: _plugin (0)
, _sample_rate (sample_rate)
, _bufsize (1024)
- , _stepsize (512)
+ , _stepsize (1024)
, _initialized (false)
{
using namespace ::Vamp::HostExt;
@@ -563,6 +563,14 @@ LuaAPI::Vamp::Vamp (const std::string& key, float sample_rate)
PBD::error << string_compose (_("VAMP Plugin \"%1\" could not be loaded"), key) << endmsg;
throw failed_constructor ();
}
+
+ size_t bs = _plugin->getPreferredBlockSize ();
+ size_t ss = _plugin->getPreferredStepSize ();
+
+ if (bs > 0 && ss > 0 && bs <= 8192 && ss <= 8192) {
+ _bufsize = bs;
+ _stepsize = bs;
+ }
}
LuaAPI::Vamp::~Vamp ()