Allow to cancel LuaAPI::Vamp::analyze
authorRobin Gareus <robin@gareus.org>
Mon, 2 Sep 2019 03:18:17 +0000 (05:18 +0200)
committerRobin Gareus <robin@gareus.org>
Mon, 2 Sep 2019 03:18:17 +0000 (05:18 +0200)
libs/ardour/lua_api.cc

index c6e5a1c2287885a0319200960cb9c051fff26bbc..6f85656fc4196d8ae4c4cad50eeed9c460a842e7 100644 (file)
@@ -830,7 +830,9 @@ LuaAPI::Vamp::analyze (boost::shared_ptr<ARDOUR::Readable> r, uint32_t channel,
                features = _plugin->process (bufs, ::Vamp::RealTime::fromSeconds ((double) pos / _sample_rate));
 
                if (cb.type () == LUA_TFUNCTION) {
-                       cb (&features, pos);
+                       if (cb (&features, pos)) {
+                               break;
+                       }
                }
 
                pos += std::min (_stepsize, to_read);