aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/python.c
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-04-27 20:54:02 +0200
committercbdev <cb@cbcdn.com>2020-04-27 20:54:02 +0200
commitf692715444c6ddeb47bf87b53acf46798785290a (patch)
tree02dcd5892498fda0be8ab0e19f93ba551c4b8e13 /backends/python.c
parent929026130c7866d9b70be7a6cc820f103ae241b4 (diff)
downloadmidimonster-f692715444c6ddeb47bf87b53acf46798785290a.tar.gz
midimonster-f692715444c6ddeb47bf87b53acf46798785290a.tar.bz2
midimonster-f692715444c6ddeb47bf87b53acf46798785290a.zip
Allow access to previous value in python handlers
Diffstat (limited to 'backends/python.c')
-rw-r--r--backends/python.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/backends/python.c b/backends/python.c
index 28b95a9..bd73a20 100644
--- a/backends/python.c
+++ b/backends/python.c
@@ -559,18 +559,19 @@ static int python_set(instance* inst, size_t num, channel** c, channel_value* v)
for(u = 0; u < num; u++){
chan = data->channel + c[u]->ident;
- //update input value buffer
- chan->in = v[u].normalised;
-
//call handler if present
if(chan->handler){
DBGPF("Calling handler for %s.%s", inst->name, chan->name);
data->current_channel = chan;
- result = PyObject_CallFunction(chan->handler, "d", chan->in);
+ result = PyObject_CallFunction(chan->handler, "d", v[u].normalised);
Py_XDECREF(result);
data->current_channel = NULL;
DBGPF("Done with handler for %s.%s", inst->name, chan->name);
}
+
+ //update input value buffer after finishing the handler
+ chan->in = v[u].normalised;
+
}
//release interpreter