diff options
author | David Robillard <d@drobilla.net> | 2010-02-28 23:17:37 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-28 23:17:37 +0000 |
commit | d9eadd5db2eeddea52dfd7884a11da11388f7707 (patch) | |
tree | 70cf54fa3447658ada24540c38021df58408a9dc | |
parent | f127386923bfef5b3fb01a0f929a86585752b387 (diff) | |
download | ingen-d9eadd5db2eeddea52dfd7884a11da11388f7707.tar.gz ingen-d9eadd5db2eeddea52dfd7884a11da11388f7707.tar.bz2 ingen-d9eadd5db2eeddea52dfd7884a11da11388f7707.zip |
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
-rw-r--r-- | src/engine/events/CreatePort.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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<int32_t>(old_num_ports)) { QueuedEvent::pre_process(); _error = BAD_INDEX; |