#include #include #include #include #include #include "channel.h" struct mossrose_global_t { PaStream *stream; struct channel_t *channels; int n_channels; } mossrose_global; int mossrose_init(double sample_rate, int n_channels, bool init_plibsys) { /* initialize channels */ mossrose_global.n_channels = n_channels; mossrose_global.channels = malloc(n_channels * sizeof(struct channel_t)); if (mossrose_global.channels == NULL) { fprintf("failed to allocate memory for %d channels\n", n_channels); return 1; } for (int i=0; i