From dec2f0fe3ea9e3e95d6fc6abc421f1a81149c10c Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Sun, 27 Apr 2025 11:07:55 -0400 Subject: init compressor-select widget --- widget.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'widget.h') diff --git a/widget.h b/widget.h index 1237e29..34e6edf 100644 --- a/widget.h +++ b/widget.h @@ -1,6 +1,7 @@ enum { FIELD_SIZE = 64, NUMBER_SIZE = 128, + NAME_SIZE = 256, }; @@ -28,6 +29,26 @@ void w_init_select(w_Select *select, int nopts, const char *const opts[]); int w_select(mu_Context *ctx, w_Select *select); +typedef struct { + const Compressor *comps; + int n; /* len(comps) */ + + int *filtered; /* indices of compressors accepted by the filter. */ + int nfiltered; /* len(filtered) */ + + char **names; /* buffer to hold names of compressors. */ + + int idx; /* index of selected in filtered. */ + int oldidx; /* index of previously selected. */ + + int active; +} w_Select_Compressor; + +int w_init_select_compressor(w_Select_Compressor *select, int n, const Compressor *const comps); +void w_free_select_compressor(w_Select_Compressor *select); +int w_select_compressor(mu_Context *ctx, w_Select_Compressor *select); + + typedef char w_Number[NUMBER_SIZE]; void w_init_number(w_Number num); -- cgit v1.2.3