From 871bc1568f94ee4026fd64df062572b91d45d462 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sat, 4 Jan 2020 18:39:04 +0100 Subject: Add input_channel call to Lua backend --- midimonster.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'midimonster.h') diff --git a/midimonster.h b/midimonster.h index 5844bb9..c5a6cf5 100644 --- a/midimonster.h +++ b/midimonster.h @@ -7,7 +7,7 @@ /* Core version unless set by the build process */ #ifndef MIDIMONSTER_VERSION - #define MIDIMONSTER_VERSION "v0.3-dist" + #define MIDIMONSTER_VERSION "v0.4-dist" #endif /* Set backend name if unset */ -- cgit v1.2.3 From e08b473d0eeb467ad358ba5314157753b4f37c18 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 5 Jan 2020 23:26:04 +0100 Subject: Implement commandline config override (Fixes #26) --- midimonster.h | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'midimonster.h') diff --git a/midimonster.h b/midimonster.h index c5a6cf5..d6f04e7 100644 --- a/midimonster.h +++ b/midimonster.h @@ -189,29 +189,6 @@ typedef struct _backend_instance { char* name; } instance; -/* - * Channel specification glob - */ -typedef struct /*_mm_channel_glob*/ { - size_t offset[2]; - union { - void* impl; - uint64_t u64[2]; - } limits; - uint64_t values; -} channel_glob; - -/* - * (Multi-)Channel specification - */ -typedef struct /*_mm_channel_spec*/ { - char* spec; - uint8_t internal; - size_t channels; - size_t globs; - channel_glob* glob; -} channel_spec; - /* * Instance channel structure * Backends may either manage their own channel registry @@ -283,7 +260,6 @@ MM_API instance* mm_instance_find(char* backend, uint64_t ident); * function. */ MM_API channel* mm_channel(instance* i, uint64_t ident, uint8_t create); -//TODO channel* mm_channel_find() /* * Register (manage = 1) or unregister (manage = 0) a file descriptor -- cgit v1.2.3 From 78b21a9ac3f975f35ec7b61108531e1495eb91c0 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 12 Jan 2020 17:34:14 +0100 Subject: Rework instance creation --- midimonster.h | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'midimonster.h') diff --git a/midimonster.h b/midimonster.h index d6f04e7..bb1eb24 100644 --- a/midimonster.h +++ b/midimonster.h @@ -93,8 +93,9 @@ struct _managed_fd; * Parse backend-global configuration options from the user-supplied * configuration file. Returning a non-zero value fails config parsing. * * mmbackend_instance - * Allocate space for a backend instance. Returning NULL signals an out-of-memory - * condition and terminates the program. + * Allocate the backend-specific data parts of the supplied instance + * structure. Returning non-zero signals an error condition and + * terminates the program. * * mmbackend_configure_instance * Parse instance configuration from the user-supplied configuration * file. Returning a non-zero value fails config parsing. @@ -135,7 +136,7 @@ struct _managed_fd; * Return value is currently ignored. */ typedef int (*mmbackend_handle_event)(struct _backend_instance* inst, size_t channels, struct _backend_channel** c, struct _channel_value* v); -typedef struct _backend_instance* (*mmbackend_create_instance)(); +typedef int (*mmbackend_create_instance)(struct _backend_instance* inst); typedef struct _backend_channel* (*mmbackend_parse_channel)(struct _backend_instance* instance, char* spec, uint8_t flags); typedef void (*mmbackend_free_channel)(struct _backend_channel* c); typedef int (*mmbackend_configure)(char* option, char* value); @@ -222,20 +223,6 @@ typedef struct /*_mm_channel_mapping*/ { */ MM_API int mm_backend_register(backend b); -/* - * Provides a pointer to a newly (zero-)allocated instance. - * All instance pointers need to be allocated via this API - * in order to be assignable from the configuration parser. - * This API should be called from the mmbackend_create_instance - * call of your backend. - * - * Instances returned from this call are freed by midimonster. - * The contents of the impl members should be freed in the - * mmbackend_shutdown procedure of the backend, eg. by querying - * all instances for the backend. - */ -MM_API instance* mm_instance(); - /* * Finds an instance matching the specified backend and identifier. * Since setting an identifier for an instance is optional, -- cgit v1.2.3 From 8c32598449895e506b4d0eab71be0abf219a62da Mon Sep 17 00:00:00 2001 From: cbdev Date: Mon, 13 Jan 2020 22:49:33 +0100 Subject: Hide core-internal structures --- midimonster.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'midimonster.h') diff --git a/midimonster.h b/midimonster.h index bb1eb24..2c29956 100644 --- a/midimonster.h +++ b/midimonster.h @@ -202,7 +202,7 @@ typedef struct _backend_channel { } channel; /* - * File descriptor management structure + * File descriptor structure passed for backend handling * Register for the core event loop using mm_manage_fd() */ typedef struct _managed_fd { @@ -211,13 +211,6 @@ typedef struct _managed_fd { void* impl; } managed_fd; -/* Internal channel mapping structure - Core use only */ -typedef struct /*_mm_channel_mapping*/ { - channel* from; - size_t destinations; - channel** to; -} channel_mapping; - /* * Register a new backend. */ -- cgit v1.2.3