13
0

Fix crash introduced in r11877 (oops). Add LV2Plugin::port_index().

git-svn-id: svn://localhost/ardour2/branches/3.0@11885 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2012-04-11 04:00:27 +00:00
parent dbd6ae23d0
commit 722defe41a
2 changed files with 27 additions and 12 deletions

View File

@ -69,6 +69,7 @@ class LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
bool ui_is_resizable () const;
const char* port_symbol (uint32_t port) const;
uint32_t port_index (const char* symbol) const;
const LV2_Feature* const* features () { return _features; }

View File

@ -216,6 +216,8 @@ LV2Plugin::init(void* c_plugin, framecnt_t rate)
_control_data = 0;
_shadow_data = 0;
_ev_buffers = 0;
_bpm_control_port = 0;
_freewheel_control_port = 0;
_latency_control_port = 0;
_state_version = 0;
_was_activated = false;
@ -548,6 +550,18 @@ LV2Plugin::port_symbol(uint32_t index) const
return lilv_node_as_string(sym);
}
uint32_t
LV2Plugin::port_index (const char* symbol) const
{
const map<string, uint32_t>::const_iterator i = _port_indices.find(symbol);
if (i != _port_indices.end()) {
return i->second;
} else {
warning << string_compose(_("LV2: Unknown port %1"), symbol) << endmsg;
return (uint32_t)-1;
}
}
void
LV2Plugin::set_parameter(uint32_t which, float val)
{