summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-06-18 18:13:51 +0000
committerDavid Robillard <d@drobilla.net>2006-06-18 18:13:51 +0000
commite43b05b410d8dddcacbcbbdf34c3679ae3bc983a (patch)
tree6a66f927c9ecd84b2911f1d7ee30e4a5ef72fe5d /src/libs
parent11e6d70077bd569dce5fda8faf5ebf8615be2cb0 (diff)
downloadingen-e43b05b410d8dddcacbcbbdf34c3679ae3bc983a.tar.gz
ingen-e43b05b410d8dddcacbcbbdf34c3679ae3bc983a.tar.bz2
ingen-e43b05b410d8dddcacbcbbdf34c3679ae3bc983a.zip
Commit to allow move (broken revision)
git-svn-id: http://svn.drobilla.net/lad/grauph@54 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/engine/LV2Plugin.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/libs/engine/LV2Plugin.cpp b/src/libs/engine/LV2Plugin.cpp
index 660bf962..411caa36 100644
--- a/src/libs/engine/LV2Plugin.cpp
+++ b/src/libs/engine/LV2Plugin.cpp
@@ -43,10 +43,6 @@ LV2Plugin::LV2Plugin(const string& name,
_instances(NULL)
{
assert(_lv2_plugin);
-
- // Note that this may be changed by an overriding DSSIPlugin
- // ie do not assume _ports is all LV2 plugin ports
- _num_ports = slv2_plugin_get_num_ports(_lv2_plugin);
}
@@ -61,7 +57,9 @@ LV2Plugin::LV2Plugin(const string& name,
bool
LV2Plugin::instantiate()
{
- _ports->alloc(_num_ports);
+ size_t num_ports = slv2_plugin_get_num_ports(_lv2_plugin);
+ assert(num_ports > 0);
+ _ports->alloc(num_ports);
_instances = new SLV2Instance*[_poly];
@@ -80,7 +78,7 @@ LV2Plugin::instantiate()
Port* port = NULL;
- for (size_t j=0; j < _num_ports; ++j) {
+ for (size_t j=0; j < num_ports; ++j) {
// LV2 shortnames are guaranteed to be unique, valid C identifiers
port_name = (char*)slv2_port_get_symbol(_lv2_plugin, j);
@@ -141,7 +139,7 @@ LV2Plugin::activate()
PortBase<sample>* port = NULL;
for (size_t i=0; i < _poly; ++i) {
- for (unsigned long j=0; j < _num_ports; ++j) {
+ for (unsigned long j=0; j < num_ports(); ++j) {
port = static_cast<PortBase<sample>*>(_ports->at(j));
set_port_buffer(i, j, ((PortBase<sample>*)_ports->at(j))->buffer(i)->data());
if (port->type() == DataType::FLOAT && port->buffer_size() == 1)
@@ -179,7 +177,7 @@ LV2Plugin::set_port_buffer(size_t voice, size_t port_num, void* buf)
assert(voice < _poly);
// Could be a MIDI port after this
- if (port_num < _num_ports) {
+ if (port_num < num_ports()) {
slv2_instance_connect_port(_instances[voice], port_num, buf);
}
}