clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit fbec6f84bda9eac1cb4e908898f5962ceb78ced9
parent 5d7484ebf93835755041a8f000bd32a1ddb914b5
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date:   Mon,  7 Mar 2022 17:03:51 +0100

Draft a transport control extension

Diffstat:
Ainclude/clap/ext/draft/transport-control.h | 42++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+), 0 deletions(-)

diff --git a/include/clap/ext/draft/transport-control.h b/include/clap/ext/draft/transport-control.h @@ -0,0 +1,42 @@ +#pragma once + +#include "../../plugin.h" + +// This extension let the plugin submit transport requests to the host + +static CLAP_CONSTEXPR const char CLAP_EXT_CV[] = "clap.transport-control.draft/0"; + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct clap_host_transport_control { + // Jumps back to the start point and starts the transport + // [main-thread] + void (*request_start)(const clap_host_t *host); + + // If not playing, starts the transport from its current position + // [main-thread] + void (*request_continue)(const clap_host_t *host); + + // If playing, stops the transport at the current position + // [main-thread] + void (*request_pause)(const clap_host_t *host); + + // Stops the transport, and jumps to the start point + // [main-thread] + void (*request_stop)(const clap_host_t *host); + + // Jumps the transport to the given position. + // Does not start the transport. + // [main-thread] + void (*request_jump)(const clap_host_t *host, clap_beattime position); + + // Equivalent to what "space bar" does with most DAW + // [main-thread] + void (*request_toggle_play)(const clap_host_t *host); +} clap_host_transport_control_t; + +#ifdef __cplusplus +} +#endif