diff options
author | David Robillard <d@drobilla.net> | 2012-04-16 21:49:29 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-16 21:49:29 +0000 |
commit | fe62744e9e714272d94a737e11d98a75584a781b (patch) | |
tree | 45f6f58e8b959fb56e35445bd8c0f763a2939549 | |
parent | 99e701a8247c3e26251b045a93d826decd55e831 (diff) | |
download | ingen-fe62744e9e714272d94a737e11d98a75584a781b.tar.gz ingen-fe62744e9e714272d94a737e11d98a75584a781b.tar.bz2 ingen-fe62744e9e714272d94a737e11d98a75584a781b.zip |
Update for latest LV2 resize-port extension.
Update URIs.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4185 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/server/LV2Node.cpp | 18 | ||||
-rw-r--r-- | src/server/LV2ResizeFeature.hpp | 19 |
2 files changed, 18 insertions, 19 deletions
diff --git a/src/server/LV2Node.cpp b/src/server/LV2Node.cpp index 06f03eb0..bdbb858c 100644 --- a/src/server/LV2Node.cpp +++ b/src/server/LV2Node.cpp @@ -21,6 +21,8 @@ #include <cmath> #include <string> +#include "lv2/lv2plug.in/ns/ext/resize-port/resize-port.h" + #include "raul/log.hpp" #include "raul/Maid.hpp" #include "raul/Array.hpp" @@ -186,26 +188,23 @@ LV2Node::instantiate(BufferFactory& bufs) float* def_values = new float[num_ports]; lilv_plugin_get_port_ranges_float(plug, min_values, max_values, def_values); - LilvNode* context_pred = lilv_new_uri(info->lv2_world(), - "http://lv2plug.in/ns/ext/contexts#context"); - LilvNode* default_pred = lilv_new_uri(info->lv2_world(), - "http://lv2plug.in/ns/lv2core#default"); + LV2_CORE__default); LilvNode* min_size_pred = lilv_new_uri(info->lv2_world(), - "http://lv2plug.in/ns/ext/resize-port#minimumSize"); + LV2_RESIZE_PORT__minimumSize); LilvNode* port_property_pred = lilv_new_uri(info->lv2_world(), - "http://lv2plug.in/ns/lv2core#portProperty"); + LV2_CORE__portProperty); LilvNode* supports_pred = lilv_new_uri(info->lv2_world(), - "http://lv2plug.in/ns/ext/atom#supports"); + LV2_ATOM__supports); LilvNode* bufferType_pred = lilv_new_uri(info->lv2_world(), - "http://lv2plug.in/ns/ext/atom#bufferType"); + LV2_ATOM__bufferType); //LilvNode as_large_as_pred = lilv_new_uri(info->lv2_world(), - // "http://lv2plug.in/ns/ext/resize-port#asLargeAs"); + // LV2_RESIZE_PORT__asLargeAs); for (uint32_t j = 0; j < num_ports; ++j) { const LilvPort* id = lilv_plugin_get_port_by_index(plug, j); @@ -348,7 +347,6 @@ LV2Node::instantiate(BufferFactory& bufs) delete[] min_values; delete[] max_values; delete[] def_values; - lilv_node_free(context_pred); lilv_node_free(default_pred); lilv_node_free(min_size_pred); lilv_node_free(port_property_pred); diff --git a/src/server/LV2ResizeFeature.hpp b/src/server/LV2ResizeFeature.hpp index 1dac59f1..e560bf13 100644 --- a/src/server/LV2ResizeFeature.hpp +++ b/src/server/LV2ResizeFeature.hpp @@ -30,17 +30,18 @@ namespace Ingen { namespace Server { struct ResizeFeature : public Ingen::Shared::LV2Features::Feature { - static bool resize_port(LV2_Resize_Port_Feature_Data data, - uint32_t index, - size_t size) { + static LV2_Resize_Port_Status resize_port( + LV2_Resize_Port_Feature_Data data, + uint32_t index, + size_t size) { NodeImpl* node = (NodeImpl*)data; PortImpl* port = node->port_impl(index); if (node->context() == Context::MESSAGE) { port->buffer(0)->resize(size); port->connect_buffers(); - return true; + return LV2_RESIZE_PORT_SUCCESS; } - return false; + return LV2_RESIZE_PORT_ERR_UNKNOWN; } static void delete_feature(LV2_Feature* feature) { @@ -52,10 +53,10 @@ struct ResizeFeature : public Ingen::Shared::LV2Features::Feature { NodeImpl* node = dynamic_cast<NodeImpl*>(n); if (!node) return SharedPtr<LV2_Feature>(); - LV2_Resize_Port_Feature* data - = (LV2_Resize_Port_Feature*)malloc(sizeof(LV2_Resize_Port_Feature)); - data->data = node; - data->resize_port = &resize_port; + LV2_Resize_Port_Resize* data + = (LV2_Resize_Port_Resize*)malloc(sizeof(LV2_Resize_Port_Resize)); + data->data = node; + data->resize = &resize_port; LV2_Feature* f = (LV2_Feature*)malloc(sizeof(LV2_Feature)); f->URI = LV2_RESIZE_PORT_URI; f->data = data; |