diff options
author | cbdev <cb@cbcdn.com> | 2019-12-07 20:22:03 +0100 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2019-12-07 20:22:03 +0100 |
commit | f95dae04478b32fccaf7c6ebe1ecfd4e2fef1358 (patch) | |
tree | 6f545dc81166ee1a0f1b21b5245a70bcbf05751d /backends/lua.h | |
parent | 534207d16314a4f6a69d36cf2305a3fe435a769b (diff) | |
parent | 1bb3b9a3eaf94af045c39a1ff1ee8bf9b8e5b8ec (diff) | |
download | midimonster-f95dae04478b32fccaf7c6ebe1ecfd4e2fef1358.tar.gz midimonster-f95dae04478b32fccaf7c6ebe1ecfd4e2fef1358.tar.bz2 midimonster-f95dae04478b32fccaf7c6ebe1ecfd4e2fef1358.zip |
Merge current master
Diffstat (limited to 'backends/lua.h')
-rw-r--r-- | backends/lua.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/backends/lua.h b/backends/lua.h new file mode 100644 index 0000000..4ea5b0a --- /dev/null +++ b/backends/lua.h @@ -0,0 +1,39 @@ +#include "midimonster.h" + +#include <lua.h> +#include <lualib.h> +#include <lauxlib.h> + +//OSX and Windows don't have the cool new toys... +#ifdef __linux__ + #define MMBACKEND_LUA_TIMERFD +#endif + +MM_PLUGIN_API int init(); +static int lua_configure(char* option, char* value); +static int lua_configure_instance(instance* inst, char* option, char* value); +static instance* lua_instance(); +static channel* lua_channel(instance* inst, char* spec, uint8_t flags); +static int lua_set(instance* inst, size_t num, channel** c, channel_value* v); +static int lua_handle(size_t num, managed_fd* fds); +static int lua_start(); +static int lua_shutdown(); +#ifndef MMBACKEND_LUA_TIMERFD +static uint32_t lua_interval(); +#endif + +typedef struct /*_lua_instance_data*/ { + size_t channels; + char** channel_name; + int* reference; + double* input; + double* output; + lua_State* interpreter; +} lua_instance_data; + +typedef struct /*_lua_interval_callback*/ { + uint64_t interval; + uint64_t delta; + lua_State* interpreter; + int reference; +} lua_timer; |