diff options
author | David Robillard <d@drobilla.net> | 2017-03-20 03:04:15 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-03-20 03:19:33 +0100 |
commit | 59f579df71e52207bcdda15d4abb3562fdc1d6f2 (patch) | |
tree | 0b0749c2b7da1debffebca882bc46cb30ba1bacd /src/server/LV2Block.cpp | |
parent | 8bf529bb24c03ebdce884cf9a4288812bb9b2cd5 (diff) | |
download | ingen-59f579df71e52207bcdda15d4abb3562fdc1d6f2.tar.gz ingen-59f579df71e52207bcdda15d4abb3562fdc1d6f2.tar.bz2 ingen-59f579df71e52207bcdda15d4abb3562fdc1d6f2.zip |
Remove dubious Buffer::nframes() method
Diffstat (limited to 'src/server/LV2Block.cpp')
-rw-r--r-- | src/server/LV2Block.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/server/LV2Block.cpp b/src/server/LV2Block.cpp index 82e5f229..77835b67 100644 --- a/src/server/LV2Block.cpp +++ b/src/server/LV2Block.cpp @@ -81,14 +81,14 @@ LV2Block::make_instance(URIs& uris, uint32_t voice, bool preparing) { + const Engine& engine = parent_graph()->engine(); const LilvPlugin* lplug = _lv2_plugin->lilv_plugin(); LilvInstance* inst = lilv_plugin_instantiate( lplug, rate, _features->array()); if (!inst) { - parent_graph()->engine().log().error( - fmt("Failed to instantiate <%1%>\n") - % _lv2_plugin->uri().c_str()); + engine.log().error(fmt("Failed to instantiate <%1%>\n") + % _lv2_plugin->uri().c_str()); return SPtr<Instance>(); } @@ -116,8 +116,10 @@ LV2Block::make_instance(URIs& uris, } if (buffer) { - if (port->is_a(PortType::CV) || port->is_a(PortType::CONTROL)) { - buffer->set_block(port->value().get<float>(), 0, buffer->nframes()); + if (port->is_a(PortType::CONTROL)) { + buffer->samples()[0] = port->value().get<float>(); + } else if (port->is_a(PortType::CV)) { + buffer->set_block(port->value().get<float>(), 0, engine.block_length()); } else { buffer->clear(); } |