summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-06-13 16:48:15 +0000
committerDavid Robillard <d@drobilla.net>2012-06-13 16:48:15 +0000
commit6eb584d3b0bc67fc8de36baba5e296d816ba080f (patch)
tree42cf27cf3c610b7988b8a35c37bb233ab0847308 /src
parent13389895cab38a75860988d27705d8f4e7b34309 (diff)
downloadingen-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')
-rw-r--r--src/server/ControlBindings.cpp20
-rw-r--r--src/server/events/Delta.cpp7
2 files changed, 16 insertions, 11 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) {
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp
index 891bebdc..c0750285 100644
--- a/src/server/events/Delta.cpp
+++ b/src/server/events/Delta.cpp
@@ -39,6 +39,9 @@
#define LOG(s) s << "[Delta] "
+// #define DUMP 1
+// #include "ingen/shared/URIMap.hpp"
+
namespace Ingen {
namespace Server {
namespace Events {
@@ -69,7 +72,7 @@ Delta::Delta(Engine& engine,
Resource::set_context(_properties, context);
}
- /*
+#ifdef DUMP
LOG(Raul::info) << "Delta " << subject << " : " << context << " {" << std::endl;
typedef Resource::Properties::const_iterator iterator;
for (iterator i = properties.begin(); i != properties.end(); ++i) {
@@ -84,7 +87,7 @@ Delta::Delta(Engine& engine,
<< " :: " << engine.world()->uri_map().unmap_uri(i->second.type()) << std::endl;
}
LOG(Raul::info) << "}" << std::endl;
- */
+#endif
}
Delta::~Delta()