diff options
author | David Robillard <d@drobilla.net> | 2024-11-22 19:12:33 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-11-24 19:12:14 -0500 |
commit | 57006d3bf443f2ade18abe7021f8aa8a11b08bcb (patch) | |
tree | c61b54c1b8133e4b05f4250c1dac48a933815908 /src/process_setup.h | |
parent | acdbc427a6c6bb55e0073b6f6910543184f35177 (diff) | |
download | jalv-57006d3bf443f2ade18abe7021f8aa8a11b08bcb.tar.gz jalv-57006d3bf443f2ade18abe7021f8aa8a11b08bcb.tar.bz2 jalv-57006d3bf443f2ade18abe7021f8aa8a11b08bcb.zip |
Cleanly separate audio thread from the rest of the application
Diffstat (limited to 'src/process_setup.h')
-rw-r--r-- | src/process_setup.h | 70 |
1 files changed, 65 insertions, 5 deletions
diff --git a/src/process_setup.h b/src/process_setup.h index 07a76c2..8c99312 100644 --- a/src/process_setup.h +++ b/src/process_setup.h @@ -5,18 +5,78 @@ #define JALV_PROCESS_SETUP_H #include "attributes.h" -#include "types.h" +#include "mapper.h" +#include "nodes.h" +#include "process.h" +#include "settings.h" +#include "urids.h" + +#include <lilv/lilv.h> + +#include <stdint.h> // Code for setting up the realtime process thread (but that isn't used in it) JALV_BEGIN_DECLS -/// Allocate appropriately-sized port buffers and connect the plugin to them +/** + Initialize process thread and allocate necessary structures. + + This only initializes the state structure, it doesn't create any threads or + start plugin execution. +*/ +int +jalv_process_init(JalvProcess* proc, + const JalvURIDs* urids, + JalvMapper* mapper, + uint32_t update_frames); + +/** + Clean up process thread. + + This frees everything allocated by jalv_process_init() and + jalv_process_activate(). +*/ void -jalv_allocate_port_buffers(Jalv* jalv); +jalv_process_cleanup(JalvProcess* proc); + +/** + Allocate necessary buffers, connect the plugin to them, and prepare to run. + + @param proc Process thread state. + @param urids Application vocabulary. + @param instance Plugin instance to run. + @param settings Process thread settings. +*/ +void +jalv_process_activate(JalvProcess* proc, + const JalvURIDs* urids, + LilvInstance* instance, + const JalvSettings* settings); + +/** + Clean up after jalv_process_activate() and disconnect plugin. + + @param proc Process thread state. +*/ +void +jalv_process_deactivate(JalvProcess* proc); + +/** + Initialize the process thread state for a port. + + @return Zero on success. +*/ +int +jalv_process_port_init(JalvProcessPort* port, + const JalvNodes* nodes, + const LilvPlugin* lilv_plugin, + const LilvPort* lilv_port); -/// Clean up memory allocated by jalv_process_activate() and disconnect plugin +/** + Free memory allocated by jalv_setup_init_port(). +*/ void -jalv_free_port_buffers(Jalv* jalv); +jalv_process_port_cleanup(JalvProcessPort* port); JALV_END_DECLS |