summaryrefslogtreecommitdiffstats
path: root/src/server/internals/Controller.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-31 15:12:38 +0000
committerDavid Robillard <d@drobilla.net>2012-07-31 15:12:38 +0000
commit8d559e4991a491b612e63d5a4deff0ab48a3d3dd (patch)
tree06da8b1d71f8068f12bc3f476b90734b67d9120c /src/server/internals/Controller.cpp
parenta41af6e41d60f8724809486b94ce1e6281c3bc31 (diff)
downloadingen-8d559e4991a491b612e63d5a4deff0ab48a3d3dd.tar.gz
ingen-8d559e4991a491b612e63d5a4deff0ab48a3d3dd.tar.bz2
ingen-8d559e4991a491b612e63d5a4deff0ab48a3d3dd.zip
Merge AudioBuffer into Buffer and avoid all the casting.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4584 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/internals/Controller.cpp')
-rw-r--r--src/server/internals/Controller.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/server/internals/Controller.cpp b/src/server/internals/Controller.cpp
index 571918fe..6c0e6858 100644
--- a/src/server/internals/Controller.cpp
+++ b/src/server/internals/Controller.cpp
@@ -23,7 +23,6 @@
#include "lv2/lv2plug.in/ns/ext/atom/util.h"
#include "raul/midi_events.h"
-#include "AudioBuffer.hpp"
#include "Engine.hpp"
#include "InputPort.hpp"
#include "InternalPlugin.hpp"
@@ -122,9 +121,9 @@ ControllerNode::control(ProcessContext& context, uint8_t control_num, uint8_t va
_learning = false;
}
- const Sample min_port_val = ((AudioBuffer*)_min_port->buffer(0).get())->value_at(0);
- const Sample max_port_val = ((AudioBuffer*)_max_port->buffer(0).get())->value_at(0);
- const Sample log_port_val = ((AudioBuffer*)_log_port->buffer(0).get())->value_at(0);
+ const Sample min_port_val = _min_port->buffer(0)->value_at(0);
+ const Sample max_port_val = _max_port->buffer(0)->value_at(0);
+ const Sample log_port_val = _log_port->buffer(0)->value_at(0);
if (log_port_val > 0.0f) {
// haaaaack, stupid negatives and logarithms
@@ -138,7 +137,7 @@ ControllerNode::control(ProcessContext& context, uint8_t control_num, uint8_t va
scaled_value = ((nval) * (max_port_val - min_port_val)) + min_port_val;
}
- if (control_num == ((AudioBuffer*)_param_port->buffer(0).get())->value_at(0)) {
+ if (control_num == _param_port->buffer(0)->value_at(0)) {
_audio_port->set_control_value(context, time, scaled_value);
}
}