diff options
author | David Robillard <d@drobilla.net> | 2012-06-13 16:48:15 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-06-13 16:48:15 +0000 |
commit | 6eb584d3b0bc67fc8de36baba5e296d816ba080f (patch) | |
tree | 42cf27cf3c610b7988b8a35c37bb233ab0847308 /src/server/ControlBindings.cpp | |
parent | 13389895cab38a75860988d27705d8f4e7b34309 (diff) | |
download | ingen-6eb584d3b0bc67fc8de36baba5e296d816ba080f.tar.gz ingen-6eb584d3b0bc67fc8de36baba5e296d816ba080f.tar.bz2 ingen-6eb584d3b0bc67fc8de36baba5e296d816ba080f.zip |
Fix control binding loading.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4501 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/ControlBindings.cpp')
-rw-r--r-- | src/server/ControlBindings.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index b224d30a..48ab1ceb 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -16,6 +16,8 @@ #include <math.h> +#include "ingen/shared/URIMap.hpp" + #include "ingen/shared/URIs.hpp" #include "ingen/shared/World.hpp" #include "lv2/lv2plug.in/ns/ext/atom/util.h" @@ -68,14 +70,14 @@ ControlBindings::binding_key(const Raul::Atom& binding) const Key key; LV2_Atom* num = NULL; if (binding.type() == uris.atom_Blank) { - LV2_Atom_Object* obj = (LV2_Atom_Object*)binding.get_body(); - if (obj->body.otype == uris.midi_Bender) { + LV2_Atom_Object_Body* obj = (LV2_Atom_Object_Body*)binding.get_body(); + if (obj->otype == uris.midi_Bender) { key = Key(MIDI_BENDER); - } else if (obj->body.otype == uris.midi_ChannelPressure) { + } else if (obj->otype == uris.midi_ChannelPressure) { key = Key(MIDI_CHANNEL_PRESSURE); - } else if (obj->body.otype == uris.midi_Controller) { - lv2_atom_object_get( - obj, (LV2_URID)uris.midi_controllerNumber, &num, NULL); + } else if (obj->otype == uris.midi_Controller) { + lv2_atom_object_body_get( + binding.size(), obj, (LV2_URID)uris.midi_controllerNumber, &num, NULL); if (!num) { Raul::error << "Controller binding missing number" << std::endl; } else if (num->type != uris.atom_Int) { @@ -83,9 +85,9 @@ ControlBindings::binding_key(const Raul::Atom& binding) const } else { key = Key(MIDI_CC, ((LV2_Atom_Int*)num)->body); } - } else if (obj->body.otype == uris.midi_NoteOn) { - lv2_atom_object_get( - obj, (LV2_URID)uris.midi_noteNumber, &num, NULL); + } else if (obj->otype == uris.midi_NoteOn) { + lv2_atom_object_body_get( + binding.size(), obj, (LV2_URID)uris.midi_noteNumber, &num, NULL); if (!num) { Raul::error << "Note binding missing number" << std::endl; } else if (num->type != uris.atom_Int) { |