diff options
Diffstat (limited to 'src/channel.c')
-rw-r--r-- | src/channel.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/channel.c b/src/channel.c index fd6741b..e6e6c3f 100644 --- a/src/channel.c +++ b/src/channel.c @@ -4,5 +4,25 @@ #include "channel.h" -struct channel_t { -}; +void channel_init(struct channel_t *chan) +{ + chan->active = false; + chan->paused = false; + chan->volume = 255; + chan->pan = 0; + + chan->sound_mutex = p_mutex_new(); + chan->sound.left = NULL; + chan->sound.right = NULL; + chan->pos = 0; +} + + +void channel_reset(struct channel_t *chan) +{ + p_atomic_int_set(&(chan->paused), false); + p_atomic_int_set(&(chan->volume), 255); + p_atomic_int_set(&(chan->pan), 0); + chan->pos = 0; + p_atomic_int_set(&(chan->active), false); +} |