diff options
author | David Robillard <d@drobilla.net> | 2009-11-22 03:06:25 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-11-22 03:06:25 +0000 |
commit | e479da3c26d41e977cf55b8e2355db45991be09f (patch) | |
tree | f6887a9b19eaee951dafd17fea8021556bff1169 /src/shared | |
parent | 58807f5840592959c31b415f7e2d64967594b5ee (diff) | |
download | ingen-e479da3c26d41e977cf55b8e2355db45991be09f.tar.gz ingen-e479da3c26d41e977cf55b8e2355db45991be09f.tar.bz2 ingen-e479da3c26d41e977cf55b8e2355db45991be09f.zip |
Partial support for message/value ports and the message context.
This use case now works:
- Add an event input and the "print" plugin from imum.lv2 to ingen
- Connect the event input to the input of "print"
- Hook Ingen up to JACK and play some MIDI events
(or get events to the print plugin from anywhere else)
- The "print" plugin will print the received events to the console
in the message context (i.e. the audio thread is realtime safe)
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2281 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/LV2Object.cpp | 9 | ||||
-rw-r--r-- | src/shared/ResourceImpl.cpp | 3 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/shared/LV2Object.cpp b/src/shared/LV2Object.cpp index 54c81429..657bee29 100644 --- a/src/shared/LV2Object.cpp +++ b/src/shared/LV2Object.cpp @@ -75,16 +75,17 @@ from_atom(World* world, const Raul::Atom& atom, LV2_Object* object) break; case Raul::Atom::STRING: object->type = map->object_class_string; - object->size = std::min(object->size, (uint32_t)strlen(atom.get_string()) + 1); + object->size = std::min((uint16_t)object->size, (uint16_t)(strlen(atom.get_string()) + 1)); str = ((char*)(object + 1)); str[object->size - 1] = '\0'; strncpy(str, atom.get_string(), object->size); break; case Raul::Atom::BLOB: - object->type = map->object_class_string; - *(uint32_t*)(object + 1) = map->uri_to_id(NULL, atom.get_blob_type()); + cerr << "TODO: Blob support" << endl; + /*object->type = map->object_class_string; + *(uint16_t*)(object + 1) = map->uri_to_id(NULL, atom.get_blob_type()); memcpy(((char*)(object + 1) + sizeof(uint32_t)), atom.get_blob(), - std::min(atom.data_size(), (size_t)object->size)); + std::min(atom.data_size(), (size_t)object->size));*/ default: cerr << "Unsupported value type for toggle control" << endl; return false; diff --git a/src/shared/ResourceImpl.cpp b/src/shared/ResourceImpl.cpp index 5f23caf3..6af25ef0 100644 --- a/src/shared/ResourceImpl.cpp +++ b/src/shared/ResourceImpl.cpp @@ -115,6 +115,9 @@ ResourceImpl::type( } else if (!strcmp(atom.get_uri(), "obj:ValuePort")) { data_type = PortType::VALUE; port = true; + } else if (!strcmp(atom.get_uri(), "obj:MessagePort")) { + data_type = PortType::MESSAGE; + port = true; } } } |