aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/python.h
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-03-23 00:15:00 +0100
committercbdev <cb@cbcdn.com>2020-03-23 00:15:00 +0100
commit37e712edf23a49be5387f945ab9ea57cc0b57f22 (patch)
tree5037b14bdbd08baa8f104f7e4946aa5643281a94 /backends/python.h
parent666aec036f9bf0de82c435bd7eace271613cee1e (diff)
parentaa02ccf3abf183207b24fcbb9460cbd904a698e2 (diff)
downloadmidimonster-37e712edf23a49be5387f945ab9ea57cc0b57f22.tar.gz
midimonster-37e712edf23a49be5387f945ab9ea57cc0b57f22.tar.bz2
midimonster-37e712edf23a49be5387f945ab9ea57cc0b57f22.zip
Merge current master
Diffstat (limited to 'backends/python.h')
-rw-r--r--backends/python.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/backends/python.h b/backends/python.h
new file mode 100644
index 0000000..020aeac
--- /dev/null
+++ b/backends/python.h
@@ -0,0 +1,48 @@
+#include "midimonster.h"
+
+MM_PLUGIN_API int init();
+static uint32_t python_interval();
+static int python_configure(char* option, char* value);
+static int python_configure_instance(instance* inst, char* option, char* value);
+static int python_instance(instance* inst);
+static channel* python_channel(instance* inst, char* spec, uint8_t flags);
+static int python_set(instance* inst, size_t num, channel** c, channel_value* v);
+static int python_handle(size_t num, managed_fd* fds);
+static int python_start(size_t n, instance** inst);
+static int python_shutdown(size_t n, instance** inst);
+
+typedef struct /*_python_channel_data*/ {
+ char* name;
+ PyObject* handler;
+ double in;
+ double out;
+ uint8_t mark;
+} mmpython_channel;
+
+typedef struct /*_mmpy_registered_socket*/ {
+ int fd;
+ PyObject* handler;
+ PyObject* socket;
+} mmpy_socket;
+
+typedef struct /*_mmpy_interval*/ {
+ uint64_t interval;
+ uint64_t delta;
+ PyObject* reference;
+ PyThreadState* interpreter;
+} mmpy_timer;
+
+typedef struct /*_python_instance_data*/ {
+ PyThreadState* interpreter;
+ PyObject* config; //TODO
+
+ size_t sockets;
+ mmpy_socket* socket;
+
+ size_t channels;
+ mmpython_channel* channel;
+ mmpython_channel* current_channel;
+
+ char* default_handler;
+ PyObject* handler;
+} python_instance_data;