#include #include #include #include #include #include "channel.h" #include "sound.h" struct mossrose_global_t { PaStream *stream; struct channel_t *channels; int n_channels; } mossrose_global; static int callback( const void *input, void *output, unsigned long frame_count, const PaStreamCallbackTimeInfo* time_info, PaStreamCallbackFlags status_flags, void *user_data) { float *out = output; float *left, *right; float l, r; for (int i=0; i= 0) { /* play on specified channel */ if (channel_sound_load(mossrose_global.channels + channel, sound, true, loops) == 0) return channel; else return -1; } else { /* play on first available channel */ for (int i=0; i