forked from free-audio/clap
/
note-ports.h
62 lines (49 loc) · 1.88 KB
/
note-ports.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once
#include "../plugin.h"
#include "../string-sizes.h"
/// @page Note Ports
///
/// This extension provides a way for the plugin to describe its current note ports.
///
/// If the plugin does not implement this extension, it will have a single note input and output.
///
/// The plugin is only allowed to change its note ports configuration while it is deactivated.
static CLAP_CONSTEXPR const char CLAP_EXT_NOTE_PORTS[] = "clap.note-ports";
#ifdef __cplusplus
extern "C" {
#endif
#pragma pack(push, CLAP_ALIGN)
typedef struct clap_note_port_info {
alignas(4) clap_id id; // stable identifier
alignas(1) char name[CLAP_NAME_SIZE]; // displayable name, i18n?
} clap_note_port_info_t;
// The audio ports scan has to be done while the plugin is deactivated.
typedef struct clap_plugin_note_ports {
// number of ports, for either input or output
// [main-thread]
uint32_t (*count)(const clap_plugin_t *plugin, bool is_input);
// get info about about a note port.
// [main-thread]
bool (*get)(const clap_plugin_t *plugin,
uint32_t index,
bool is_input,
clap_note_port_info_t *info);
} clap_plugin_note_ports_t;
enum {
// The ports have changed, the host shall perform a full scan of the ports.
// This flag can only be used if the plugin is not active.
// If the plugin active, call host->request_restart() and then call rescan()
// when the host calls deactivate()
CLAP_NOTE_PORTS_RESCAN_ALL = 1 << 0,
// The ports name did change, the host can scan them right away.
CLAP_NOTE_PORTS_RESCAN_NAMES = 1 << 1,
};
typedef struct clap_host_note_ports {
// Rescan the full list of audio ports according to the flags.
// [main-thread]
void (*rescan)(const clap_host_t *host, uint32_t flags);
} clap_host_note_ports_t;
#pragma pack(pop)
#ifdef __cplusplus
}
#endif