summaryrefslogtreecommitdiff
path: root/include/mossrose.h
blob: 04aef9493c6f1196ea24d764b35b8d08121caf6d (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
29
30
31
#ifndef MOSSROSE_H
#define MOSSROSE_H

#include <stddef.h>
#include <stdbool.h>

typedef void (*mossrose_channel_callback_t)(int, void*);

struct mossrose_sound_t {
	float *left;
	float *right;
	bool mono;
	size_t len;
};

int mossrose_init(double sample_rate, int n_channels, bool init_plibsys);

int mossrose_terminate();

int mossrose_play(struct mossrose_sound_t *sound, int channel, int loops);
void mossrose_channel_set_volume(int channel, float volume); 
void mossrose_channel_set_pan(int channel, float left, float right); 
void mossrose_channel_pause(int channel); 
void mossrose_channel_resume(int channel); 
void mossrose_channel_set_callback(int channel, mossrose_channel_callback_t callback, void *userdata);
void mossrose_poll_callbacks();

struct mossrose_sound_t * mossrose_load_mp3(const char *filename);
void mossrose_free_sound(struct mossrose_sound_t *sound);

#endif