summaryrefslogtreecommitdiffstats
path: root/include/xas/synth.h
blob: 20446cd2edb1fda2e501ebaaee3d2876b75fca68 (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
#ifndef _XAS_SYNTH_H
#define _XAS_SYNTH_H

#include <stdint.h>
#include <sys/types.h>

#include <xas/audio.h>

typedef struct _xas_synth xas_synth;

typedef int16_t (*xas_synth_callback_sample)(xas_synth *synth, void *ctx);

typedef void (*xas_synth_callback_cleanup)(xas_synth *synth, void *ctx);

struct _xas_synth {
    xas_audio_format format;
    xas_synth_callback_sample  sample;
    xas_synth_callback_cleanup cleanup;
    void *ctx;
};

xas_audio_stream *xas_synth_new(xas_synth_callback_sample  sample,
                                    xas_synth_callback_cleanup cleanup,
                                    xas_audio_format format,
                                    size_t buffer_size,
                                    void *ctx);

#endif /* _XAS_SYNTH_H */