blob: e6e6c3f1a06f6b8209165128bd84af93b0ae8102 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include <stdlib.h>
#include <string.h>
#include <plibsys.h>
#include "channel.h"
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);
}
|