From 2cf000fb7cbe653c2e96e0b3b8f3c1425401d3fc Mon Sep 17 00:00:00 2001 From: sanine Date: Sat, 3 Sep 2022 21:32:25 -0500 Subject: add looping --- src/mossrose.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mossrose.c') diff --git a/src/mossrose.c b/src/mossrose.c index 04770f5..cd1b98d 100644 --- a/src/mossrose.c +++ b/src/mossrose.c @@ -21,7 +21,6 @@ static int callback( PaStreamCallbackFlags status_flags, void *user_data) { - printf("frame count: %d\n", frame_count); float *out = output; float *left, *right; float l, r; @@ -88,11 +87,11 @@ int mossrose_init(double sample_rate, int n_channels, bool init_plibsys) }; -int mossrose_play(struct mossrose_sound_t *sound, int channel) +int mossrose_play(struct mossrose_sound_t *sound, int channel, int loops) { if (channel >= 0) { /* play on specified channel */ - if (channel_sound_load(mossrose_global.channels + channel, sound, true) == 0) + if (channel_sound_load(mossrose_global.channels + channel, sound, true, loops) == 0) return channel; else return -1; @@ -101,7 +100,7 @@ int mossrose_play(struct mossrose_sound_t *sound, int channel) /* play on first available channel */ for (int i=0; i