shithub: neindaw

ref: 5cf2a66d5a71fad0128b2f9d0b088cea743c0d60
dir: neindaw/fs.h

View raw version
typedef struct Aux Aux;
typedef struct Auxdsp Auxdsp;
typedef struct Fs Fs;

typedef enum {
	Xclone,
	Xctl,
	Xmetadata,

	Xdsp,
	Xdspctl,
	Xdspdata,

	Xui,
	Xuictl,
	Xuimeta,
}Auxtype;

struct UI;

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

	Auxdsp *dsp;
	struct UI *ui;
};

struct Fs {
	Srv srv;
	char *metadata;

	struct {
		Auxdsp *(*new)(void);
		void (*free)(Auxdsp *dsp);
		void (*reset)(Auxdsp *dsp);

		/* optional, n is always modulo number of channels */
		int (*read)(Auxdsp *dsp, float *b, int n);

		/* optional, n is always modulo number of channels */
		int (*write)(Auxdsp *dsp, float *b, int n);
	}dsp;
};

void fsinit(void *fs);