shithub: neindaw

ref: b67a151aecb558eeee40f34a6838ebce68b618bf
dir: /aux.h/

View raw version
typedef enum {
	Xclone,
	Xctl,
	Xmetadata,

	Xdsp,
	Xdspctl,
	Xdspdata,

	Xui,
	Xuictl,
	Xuimeta,
}Auxtype;

typedef enum {
	UITGroup,
	UIHGroup,
	UIVGroup,
	UIButton,
	UICheckBox,
	UIVSlider,
	UIHSlider,
	UINEntry,
	UIHBarGraph,
	UIVBarGraph,
}UItype;

typedef struct Aux Aux;
typedef struct Auxdsp Auxdsp;
typedef struct Meta Meta;
typedef struct UI UI;

struct Auxdsp {
	void *dsp;
	FAUSTFLOAT **in, **out;
	int numin, numout;
	int inmax, outmax;
};

struct Aux {
	Auxtype type;
	int id;
	int ctl;
	int data;
	int metadata;

	Auxdsp *dsp;
	UI *ui;
};

struct Meta {
	const char *k;
	const char *v;
};

struct UI {
	UItype type;
	const char *label;
	FAUSTFLOAT *zone;
	FAUSTFLOAT init;
	FAUSTFLOAT min;
	FAUSTFLOAT max;
	FAUSTFLOAT step;
	char *(*readstr)(UI *ui, int type, char *s, int sz);
	int (*write)(UI *ui, int type, char *s);

	Meta *meta;
	int nummeta;
};