From 53812b2fc4aa809bf8156faee88b59cc69d1b9ec Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 10 Aug 2022 14:26:06 -0400 Subject: Factor out jalv_write_event() --- src/jalv_internal.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src/jalv_internal.h') diff --git a/src/jalv_internal.h b/src/jalv_internal.h index df03379..8028bcc 100644 --- a/src/jalv_internal.h +++ b/src/jalv_internal.h @@ -175,12 +175,26 @@ jalv_ui_port_event(Jalv* jalv, uint32_t protocol, const void* buffer); -bool -jalv_send_to_ui(Jalv* jalv, - uint32_t port_index, - uint32_t type, - uint32_t size, - const void* body); +/** + Write a port event using the atom:eventTransfer protocol. + + This is used to transfer atoms between the plugin and UI via sequence ports. + + @param jalv Jalv instance. + @param target Communication ring (jalv->plugin_to_ui or jalv->ui_to_plugin). + @param port_index Index of the port this change is for. + @param size Size of body in bytes. + @param type Atom type URID. + @param body Atom body. + @return 0 on success, non-zero on failure (overflow). +*/ +int +jalv_write_event(Jalv* jalv, + ZixRing* target, + uint32_t port_index, + uint32_t size, + LV2_URID type, + const void* body); /** Write a control port change using the default (0) protocol. -- cgit v1.2.1