Cleanup
[carla.git] / source / includes / clap / process.h
blobd5bf572a73f0554b5c7e5ae09e43ae23703cabdd
1 #pragma once
3 #include "events.h"
4 #include "audio-buffer.h"
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
10 enum {
11 // Processing failed. The output buffer must be discarded.
12 CLAP_PROCESS_ERROR = 0,
14 // Processing succeeded, keep processing.
15 CLAP_PROCESS_CONTINUE = 1,
17 // Processing succeeded, keep processing if the output is not quiet.
18 CLAP_PROCESS_CONTINUE_IF_NOT_QUIET = 2,
20 // Rely upon the plugin's tail to determine if the plugin should continue to process.
21 // see clap_plugin_tail
22 CLAP_PROCESS_TAIL = 3,
24 // Processing succeeded, but no more processing is required,
25 // until the next event or variation in audio input.
26 CLAP_PROCESS_SLEEP = 4,
28 typedef int32_t clap_process_status;
30 typedef struct clap_process {
31 // A steady sample time counter.
32 // This field can be used to calculate the sleep duration between two process calls.
33 // This value may be specific to this plugin instance and have no relation to what
34 // other plugin instances may receive.
36 // Set to -1 if not available, otherwise the value must be greater or equal to 0,
37 // and must be increased by at least `frames_count` for the next call to process.
38 int64_t steady_time;
40 // Number of frames to process
41 uint32_t frames_count;
43 // time info at sample 0
44 // If null, then this is a free running host, no transport events will be provided
45 const clap_event_transport_t *transport;
47 // Audio buffers, they must have the same count as specified
48 // by clap_plugin_audio_ports->get_count().
49 // The index maps to clap_plugin_audio_ports->get_info().
50 const clap_audio_buffer_t *audio_inputs;
51 clap_audio_buffer_t *audio_outputs;
52 uint32_t audio_inputs_count;
53 uint32_t audio_outputs_count;
55 // Input and output events.
57 // Events must be sorted by time.
58 // The input event list can't be modified.
59 const clap_input_events_t *in_events;
60 const clap_output_events_t *out_events;
61 } clap_process_t;
63 #ifdef __cplusplus
65 #endif