Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
2.0KB

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