From d9eadd5db2eeddea52dfd7884a11da11388f7707 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 28 Feb 2010 23:17:37 +0000 Subject: Automatically assign a port index if one isn't given on port creation. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2510 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/events/CreatePort.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/engine') diff --git a/src/engine/events/CreatePort.cpp b/src/engine/events/CreatePort.cpp index 4aebc0b2..33477400 100644 --- a/src/engine/events/CreatePort.cpp +++ b/src/engine/events/CreatePort.cpp @@ -96,7 +96,9 @@ CreatePort::pre_process() : 0; Shared::Resource::Properties::const_iterator index_i = _properties.find(uris.lv2_index); - if (index_i->second.type() != Atom::INT + if (index_i == _properties.end()) { + index_i = _properties.insert(make_pair(uris.lv2_index, (int)old_num_ports)); + } else if (index_i->second.type() != Atom::INT || index_i->second.get_int32() != static_cast(old_num_ports)) { QueuedEvent::pre_process(); _error = BAD_INDEX; -- cgit v1.2.1