From 971c02f3707c4872a2da9a3b946b6508290c5ab4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 7 Oct 2007 23:09:48 +0000 Subject: Added shared abstract interface for ports. Moved DataType to shared. Switch data type URIs to match LV2 type semantics (e.g. separate audio/control types). git-svn-id: http://svn.drobilla.net/lad/ingen@840 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/NodeModel.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/libs/client/NodeModel.cpp') diff --git a/src/libs/client/NodeModel.cpp b/src/libs/client/NodeModel.cpp index c3348f89..87b62dd9 100644 --- a/src/libs/client/NodeModel.cpp +++ b/src/libs/client/NodeModel.cpp @@ -17,9 +17,10 @@ #include CONFIG_H_PATH +#include +#include "interface/Port.hpp" #include "NodeModel.hpp" #include "PatchModel.hpp" -#include namespace Ingen { namespace Client { @@ -135,6 +136,13 @@ NodeModel::get_port(const string& port_name) const return (*i); return SharedPtr(); } + + +Shared::Port* +NodeModel::port(uint32_t index) const +{ + return dynamic_cast(_ports[index].get()); +} void @@ -148,14 +156,14 @@ NodeModel::port_value_range(SharedPtr port, float& min, float& max) // Plugin value first #ifdef HAVE_SLV2 - if (plugin() && plugin()->type() == PluginModel::LV2) { + if (_plugin && _plugin->type() == PluginModel::LV2) { min = slv2_port_get_minimum_value( - plugin()->slv2_plugin(), - slv2_plugin_get_port_by_symbol(plugin()->slv2_plugin(), + _plugin->slv2_plugin(), + slv2_plugin_get_port_by_symbol(_plugin->slv2_plugin(), port->path().name().c_str())); max = slv2_port_get_maximum_value( - plugin()->slv2_plugin(), - slv2_plugin_get_port_by_symbol(plugin()->slv2_plugin(), + _plugin->slv2_plugin(), + slv2_plugin_get_port_by_symbol(_plugin->slv2_plugin(), port->path().name().c_str())); //cerr << "SLV2: " << min << " .. " << max << endl; -- cgit v1.2.1