diff options
author | sanine <sanine.not@pm.me> | 2022-09-03 21:32:25 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2022-09-03 21:32:25 -0500 |
commit | 2cf000fb7cbe653c2e96e0b3b8f3c1425401d3fc (patch) | |
tree | e172ef67b253d1eaa0fb22186b5901edd4de793a /src/mossrose.c | |
parent | a416cfb6881b8ff99c29ba87c1d940d6143e44b1 (diff) |
add looping
Diffstat (limited to 'src/mossrose.c')
-rw-r--r-- | src/mossrose.c | 7 |
1 files changed, 3 insertions, 4 deletions
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<mossrose_global.n_channels; i++) { struct channel_t *chan = mossrose_global.channels + i; - if (channel_sound_load(chan, sound, false) == 0) return i; + if (channel_sound_load(chan, sound, false, loops) == 0) return i; } return -1; } |