aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/python.md
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.md
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.md')
-rw-r--r--backends/python.md3
1 files changed, 3 insertions, 0 deletions
diff --git a/backends/python.md b/backends/python.md
index ab0fb38..a78d972 100644
--- a/backends/python.md
+++ b/backends/python.md
@@ -26,6 +26,9 @@ The `midimonster` module provides the following functions:
| `manage(function, socket)` | `midimonster.manage(handler, socket)` | Register a (connected/listening) socket to the MIDIMonster core. Calls `function(socket)` when the socket is ready to read. Calling this method with `None` as the function argument unregisters the socket. A socket may only have one associated handler |
| `cleanup_handler(function)` | `midimonster.cleanup_handler(save_all)`| Register a function to be called when the instance is destroyed (on MIDIMonster shutdown). One cleanup handler can be registered per instance. Calling this function when the instance already has a cleanup handler registered replaces the handler, returning the old one. |
+When a channel handler executes, calling `midimonster.inputvalue()` for that exact channel returns the previous value,
+while the argument to the handler is the current value. The stored value is updated after the handler finishes executing.
+
Example Python module:
```python
import socket