summaryrefslogtreecommitdiff
path: root/src/mossrose.c
blob: 4babfd7b7a2f6e1e344e4cfe358a99242d0b6f00 (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
32
33
34
35
36
37
38
#include <stdio.h>
#include <stdlib.h>
#include <plibsys.h>
#include <portaudio.h>
#include <mossrose.h>
#include "channel.h"


struct mossrose_global_t {
	PaStream *stream;
	struct channel_t *channels;
	int n_channels;
} mossrose_global;


int mossrose_init(double sample_rate, int n_channels, bool init_plibsys)
{
	/* initialize channels */
	mossrose_global.n_channels = n_channels;
	mossrose_global.channels = malloc(n_channels * sizeof(struct channel_t));
	if (mossrose_global.channels == NULL) {
		fprintf("failed to allocate memory for %d channels\n", n_channels);
		return 1;
	}
	for (int i=0; i<n_channels; i++)
		channel_init(mossrose_global.channels + i);

};


int mossrose_play(struct mossrose_sound_t *sound, int channel)
{
}


int mossrose_terminate()
{
}