diff options
author | cbdev <cb@cbcdn.com> | 2018-03-02 03:20:11 +0100 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2018-03-02 03:20:11 +0100 |
commit | 2dfc564edc0c89c4a8de7e384806aae5d593426d (patch) | |
tree | b1636ec14d3f35ed88b3f079e0c3d168f77b17b9 /backends/osc.h | |
parent | be5df1c4e639ca6a7cd70a3122039a1de4588e28 (diff) | |
download | midimonster-2dfc564edc0c89c4a8de7e384806aae5d593426d.tar.gz midimonster-2dfc564edc0c89c4a8de7e384806aae5d593426d.tar.bz2 midimonster-2dfc564edc0c89c4a8de7e384806aae5d593426d.zip |
Move backend implementations to subdirectory
Diffstat (limited to 'backends/osc.h')
-rw-r--r-- | backends/osc.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/backends/osc.h b/backends/osc.h new file mode 100644 index 0000000..5938f12 --- /dev/null +++ b/backends/osc.h @@ -0,0 +1,55 @@ +#include "midimonster.h" +#include <sys/types.h> +#include <sys/socket.h> + +#define OSC_RECV_BUF 8192 +#define OSC_XMIT_BUF 8192 + +int init(); +static int backend_configure(char* option, char* value); +static int backend_configure_instance(instance* instance, char* option, char* value); +static instance* backend_instance(); +static channel* backend_channel(instance* instance, char* spec); +static int backend_set(instance* inst, size_t num, channel** c, channel_value* v); +static int backend_handle(size_t num, managed_fd* fds); +static int backend_start(); +static int backend_shutdown(); + +typedef enum { + not_set = 0, + int32 = 'i', + float32 = 'f', + /*s, b*/ //ignored + int64 = 'h', + double64 = 'd', +} osc_parameter_type; + +typedef union { + int32_t i32; + float f; + int64_t i64; + double d; +} osc_parameter_value; + +typedef struct /*_osc_channel*/ { + char* path; + size_t params; + size_t param_index; + uint8_t mark; + + osc_parameter_type type; + osc_parameter_value max; + osc_parameter_value min; + osc_parameter_value current; +} osc_channel; + +typedef struct /*_osc_instance_data*/ { + size_t channels; + osc_channel* channel; + char* root; + socklen_t dest_len; + struct sockaddr_storage dest; + int fd; + uint8_t learn; + uint16_t forced_rport; +} osc_instance; |