commit f017662c0c363c55704395c619111e97347759bb
parent 5aae329e944fb6c854e01d98d60a49713c5f3db2
Author: Alexandre Bique <bique.alexandre@gmail.com>
Date: Mon, 12 Dec 2022 12:14:50 +0100
simplify track-info
Diffstat:
1 file changed, 18 insertions(+), 36 deletions(-)
diff --git a/include/clap/ext/draft/track-info.h b/include/clap/ext/draft/track-info.h
@@ -25,48 +25,30 @@ extern "C" {
#endif
enum {
- CLAP_TRACK_INFO_HAS_TRACK_ID = (1 << 0),
- CLAP_TRACK_INFO_HAS_TRACK_NAME = (1 << 1),
- CLAP_TRACK_INFO_HAS_TRACK_PATH = (1 << 2),
- CLAP_TRACK_INFO_HAS_TRACK_COLOR = (1 << 3),
- CLAP_TRACK_INFO_HAS_DEVICE_CHAIN_ID = (1 << 4),
- CLAP_TRACK_INFO_HAS_DEVICE_CHAIN_NAME = (1 << 5),
- CLAP_TRACK_INFO_HAS_DEVICE_CHAIN_PATH = (1 << 6),
- CLAP_TRACK_INFO_HAS_DEVICE_CHAIN_COLOR = (1 << 7),
- CLAP_TRACK_INFO_HAS_AUDIO_CHANNEL_COUNT = (1 << 8),
- CLAP_TRACK_INFO_HAS_AUDIO_PORT_TYPE = (1 << 9),
+ CLAP_TRACK_INFO_HAS_TRACK_NAME = (1 << 0),
+ CLAP_TRACK_INFO_HAS_TRACK_COLOR = (1 << 1),
+ CLAP_TRACK_INFO_HAS_AUDIO_CHANNEL = (1 << 2),
+
+ // This plugin is on a return track, initialize with wet 100%
+ CLAP_TRACK_INFO_IS_FOR_RETURN_TRACK = (1 << 3),
+
+ // This plugin is on a bus track, initialize with appropriate settings for bus processing
+ CLAP_TRACK_INFO_IS_FOR_BUS = (1 << 4),
+
+ // This plugin is on the master, initialize with appropriate settings for channel processing
+ CLAP_TRACK_INFO_IS_FOR_MASTER = (1 << 5),
};
typedef struct clap_track_info {
- uint32_t flags; // see the flags above
+ uint64_t flags; // see the flags above
- // Info relatives to the track to which the current channel belong
- // track_id: a host specific track identifier, can be a uuid for example
- // track_name: the track's name, eg: "808 Legend"
- // track_path: the path to the track, eg: "/group1/group2/808 Legend"
- // track_color: the track's color
- // is_return_track: true if the track is a return track, in which case you may want to initialize
- // your FX's 100% wet (no dry signal)
- char track_id[CLAP_CUSTOM_ID_SIZE];
- char track_name[CLAP_NAME_SIZE];
- char track_path[CLAP_PATH_SIZE];
- clap_color_t track_color;
- bool is_return_track;
+ // track name, available if flags contain CLAP_TRACK_INFO_HAS_TRACK_NAME
+ char name[CLAP_NAME_SIZE];
- // Info relatives to the device chain owning the plugin instance.
- //
- // device_chain_id: a host specific device_chain identifier, can be a uuid for example
- // device_chain_path: "/group1/group2/808 Legend/drum-machine/pads/808 Legend CLAP"
- // or "/group1/group2/808 Legend/drum-machine/returns/Delay"
- // device_chain_color: the device chain's color, in our example, that could be the drum pad color.
- // is_return_channel: true if the channel owning the plugin is a return channel, in which
- // case you may want to initialize your FX's 100% wet (no dry signal)
- char device_chain_id[CLAP_CUSTOM_ID_SIZE];
- char device_chain_name[CLAP_NAME_SIZE];
- char device_chain_path[CLAP_PATH_SIZE];
- clap_color_t device_chain_color;
- bool is_return_channel;
+ // track color, available if flags contain CLAP_TRACK_INFO_HAS_TRACK_COLOR
+ clap_color_t color;
+ // availabe if flags contain CLAP_TRACK_INFO_HAS_AUDIO_CHANNEL
// see audio-ports.h, struct clap_audio_port_info to learn how to use channel count and port type
int32_t audio_channel_count;
const char *audio_port_type;