diff options
author | David Robillard <d@drobilla.net> | 2012-03-12 06:59:48 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-12 06:59:48 +0000 |
commit | 81e9fb3245bd461ebfee4cfa16d1792e48533f9e (patch) | |
tree | eb1b30d79cba70dda9d832100dd7c14b08085b03 /src/server/LV2Node.cpp | |
parent | e9d9569271ee962c09ab66c6babed1ca5655a6c6 (diff) | |
download | ingen-81e9fb3245bd461ebfee4cfa16d1792e48533f9e.tar.gz ingen-81e9fb3245bd461ebfee4cfa16d1792e48533f9e.tar.bz2 ingen-81e9fb3245bd461ebfee4cfa16d1792e48533f9e.zip |
Centralise atom creation in forge object.
Aside from being more greppable and making realtime violations more obvious, this is a step towards using LV2 atoms internally (which needs a factory since the type numbers are dynamic).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4054 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/LV2Node.cpp')
-rw-r--r-- | src/server/LV2Node.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/server/LV2Node.cpp b/src/server/LV2Node.cpp index 2ff24538..ff886166 100644 --- a/src/server/LV2Node.cpp +++ b/src/server/LV2Node.cpp @@ -138,9 +138,10 @@ LV2Node::apply_poly(Raul::Maid& maid, uint32_t poly) bool LV2Node::instantiate(BufferFactory& bufs) { - const Ingen::Shared::URIs& uris = bufs.uris(); - SharedPtr<LV2Info> info = _lv2_plugin->lv2_info(); - const LilvPlugin* plug = _lv2_plugin->lilv_plugin(); + const Ingen::Shared::URIs& uris = bufs.uris(); + SharedPtr<LV2Info> info = _lv2_plugin->lv2_info(); + const LilvPlugin* plug = _lv2_plugin->lilv_plugin(); + Raul::Forge& forge = bufs.forge(); uint32_t num_ports = lilv_plugin_get_num_ports(plug); assert(num_ports > 0); @@ -251,7 +252,7 @@ LV2Node::instantiate(BufferFactory& bufs) if (lilv_node_is_string(d)) { const char* str_val = lilv_node_as_string(d); const size_t str_val_len = strlen(str_val); - val = str_val; + val = forge.make(str_val); port_buffer_size = str_val_len; } } @@ -281,7 +282,7 @@ LV2Node::instantiate(BufferFactory& bufs) } if (val.type() == Atom::NIL) - val = isnan(def_values[j]) ? 0.0f : def_values[j]; + val = forge.make(isnan(def_values[j]) ? 0.0f : def_values[j]); // TODO: set buffer size when necessary if (direction == INPUT) @@ -293,12 +294,12 @@ LV2Node::instantiate(BufferFactory& bufs) || data_type == PortType::CV)) { port->set_value(val); if (!isnan(min_values[j])) { - port->set_property(uris.lv2_minimum, min_values[j]); - port->set_minimum(min_values[j]); + port->set_property(uris.lv2_minimum, forge.make(min_values[j])); + port->set_minimum(forge.make(min_values[j])); } if (!isnan(max_values[j])) { - port->set_property(uris.lv2_maximum, max_values[j]); - port->set_maximum(max_values[j]); + port->set_property(uris.lv2_maximum, forge.make(max_values[j])); + port->set_maximum(forge.make(max_values[j])); } } |