LMMS
Loading...
Searching...
No Matches
audio-ports.h
Go to the documentation of this file.
1#pragma once
2
3#include "../plugin.h"
4#include "../string-sizes.h"
5
15
16static CLAP_CONSTEXPR const char CLAP_EXT_AUDIO_PORTS[] = "clap.audio-ports";
17static CLAP_CONSTEXPR const char CLAP_PORT_MONO[] = "mono";
18static CLAP_CONSTEXPR const char CLAP_PORT_STEREO[] = "stereo";
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24enum {
25 // This port is the main audio input or output.
26 // There can be only one main input and main output.
27 // Main port must be at index 0.
29
30 // This port can be used with 64 bits audio
32
33 // 64 bits audio is preferred with this port
35
36 // This port must be used with the same sample size as all the other ports which have this flag.
37 // In other words if all ports have this flag then the plugin may either be used entirely with
38 // 64 bits audio or 32 bits audio, but it can't be mixed.
40};
41
42typedef struct clap_audio_port_info {
43 // id identifies a port and must be stable.
44 // id may overlap between input and output ports.
46 char name[CLAP_NAME_SIZE]; // displayable name
47
50
51 // If null or empty then it is unspecified (arbitrary audio).
52 // This filed can be compared against:
53 // - CLAP_PORT_MONO
54 // - CLAP_PORT_STEREO
55 // - CLAP_PORT_SURROUND (defined in the surround extension)
56 // - CLAP_PORT_AMBISONIC (defined in the ambisonic extension)
57 // - CLAP_PORT_CV (defined in the cv extension)
58 //
59 // An extension can provide its own port type and way to inspect the channels.
60 const char *port_type;
61
62 // in-place processing: allow the host to use the same buffer for input and output
63 // if supported set the pair port id.
64 // if not supported set to CLAP_INVALID_ID
67
68// The audio ports scan has to be done while the plugin is deactivated.
70 // number of ports, for either input or output
71 // [main-thread]
72 uint32_t (CLAP_ABI *count)(const clap_plugin_t *plugin, bool is_input);
73
74 // get info about about an audio port.
75 // [main-thread]
76 bool (CLAP_ABI *get)(const clap_plugin_t *plugin,
81
82enum {
83 // The ports name did change, the host can scan them right away.
85
86 // [!active] The flags did change
88
89 // [!active] The channel_count did change
91
92 // [!active] The port type did change
94
95 // [!active] The in-place pair did change, this requires.
97
98 // [!active] The list of ports have changed: entries have been removed/added.
100};
101
102typedef struct clap_host_audio_ports {
103 // Checks if the host allows a plugin to change a given aspect of the audio ports definition.
104 // [main-thread]
105 bool (CLAP_ABI *is_rescan_flag_supported)(const clap_host_t *host, uint32_t flag);
106
107 // Rescan the full list of audio ports according to the flags.
108 // It is illegal to ask the host to rescan with a flag that is not supported.
109 // Certain flags require the plugin to be de-activated.
110 // [main-thread]
111 void (CLAP_ABI *rescan)(const clap_host_t *host, uint32_t flags);
113
114#ifdef __cplusplus
115}
116#endif
static CLAP_CONSTEXPR const char CLAP_EXT_AUDIO_PORTS[]
Definition audio-ports.h:16
struct clap_host_audio_ports clap_host_audio_ports_t
struct clap_audio_port_info clap_audio_port_info_t
static CLAP_CONSTEXPR const char CLAP_PORT_MONO[]
Definition audio-ports.h:17
@ CLAP_AUDIO_PORTS_RESCAN_CHANNEL_COUNT
Definition audio-ports.h:90
@ CLAP_AUDIO_PORTS_RESCAN_PORT_TYPE
Definition audio-ports.h:93
@ CLAP_AUDIO_PORTS_RESCAN_LIST
Definition audio-ports.h:99
@ CLAP_AUDIO_PORTS_RESCAN_FLAGS
Definition audio-ports.h:87
@ CLAP_AUDIO_PORTS_RESCAN_IN_PLACE_PAIR
Definition audio-ports.h:96
@ CLAP_AUDIO_PORTS_RESCAN_NAMES
Definition audio-ports.h:84
@ CLAP_AUDIO_PORT_REQUIRES_COMMON_SAMPLE_SIZE
Definition audio-ports.h:39
@ CLAP_AUDIO_PORT_PREFERS_64BITS
Definition audio-ports.h:34
@ CLAP_AUDIO_PORT_SUPPORTS_64BITS
Definition audio-ports.h:31
@ CLAP_AUDIO_PORT_IS_MAIN
Definition audio-ports.h:28
struct clap_plugin_audio_ports clap_plugin_audio_ports_t
static CLAP_CONSTEXPR const char CLAP_PORT_STEREO[]
Definition audio-ports.h:18
struct clap_host clap_host_t
uint32_t clap_id
Definition id.h:6
#define CLAP_ABI
Definition macros.h:24
#define CLAP_CONSTEXPR
Definition macros.h:32
unsigned int uint32_t
Definition mid.cpp:100
struct clap_plugin clap_plugin_t
@ CLAP_NAME_SIZE
Definition string-sizes.h:9
Definition audio-ports.h:42
char name[CLAP_NAME_SIZE]
Definition audio-ports.h:46
clap_id in_place_pair
Definition audio-ports.h:65
uint32_t flags
Definition audio-ports.h:48
const char * port_type
Definition audio-ports.h:60
uint32_t channel_count
Definition audio-ports.h:49
clap_id id
Definition audio-ports.h:45
Definition audio-ports.h:102
uint32_t flag
Definition audio-ports.h:105
uint32_t flags
Definition audio-ports.h:111
bool(CLAP_ABI *is_rescan_flag_supported)(const clap_host_t *host
Definition audio-ports.h:69
bool(CLAP_ABI *get)(const clap_plugin_t *plugin
uint32_t bool clap_audio_port_info_t * info
Definition audio-ports.h:79
uint32_t index
Definition audio-ports.h:77
bool is_input
Definition audio-ports.h:72
uint32_t(CLAP_ABI *count)(const clap_plugin_t *plugin
#define void
Definition unzip.h:396
_WDL_CSTRING_PREFIX void INT_PTR count
Definition wdlcstring.h:263