diff options
| author | XANTRONIX Development | 2022-01-31 20:47:58 -0500 | 
|---|---|---|
| committer | XANTRONIX Development | 2022-01-31 20:47:58 -0500 | 
| commit | 59d4694efd295217e15c90ca5636c4bdcfecf222 (patch) | |
| tree | 2a1c78bab9707b67877c0c133815e20355f00393 /include/xas | |
| parent | 09e1154a36f692e9ad2cee5f47fc66459f2568a2 (diff) | |
| download | xas-59d4694efd295217e15c90ca5636c4bdcfecf222.tar.gz xas-59d4694efd295217e15c90ca5636c4bdcfecf222.tar.bz2 xas-59d4694efd295217e15c90ca5636c4bdcfecf222.zip | |
This is getting annoyingly close to working...
Diffstat (limited to 'include/xas')
| -rw-r--r-- | include/xas/audio.h | 2 | ||||
| -rw-r--r-- | include/xas/mixer.h | 7 | ||||
| -rw-r--r-- | include/xas/synth.h | 23 | 
3 files changed, 18 insertions, 14 deletions
| diff --git a/include/xas/audio.h b/include/xas/audio.h index 76d1e68..9c40dd8 100644 --- a/include/xas/audio.h +++ b/include/xas/audio.h @@ -74,7 +74,7 @@ ssize_t xas_audio_stream_write(xas_audio_stream *stream,                                   size_t count);  ssize_t xas_audio_stream_read(xas_audio_stream *stream, -                                void *samples, +                                void **samples,                                  size_t count);  int xas_audio_stream_flush(xas_audio_stream *stream); diff --git a/include/xas/mixer.h b/include/xas/mixer.h index ca60976..9fd77cb 100644 --- a/include/xas/mixer.h +++ b/include/xas/mixer.h @@ -25,10 +25,15 @@ typedef struct _xas_mixer {      size_t buffer_size;  } xas_mixer; -xas_mixer *xas_mixer_new(xas_audio_stream *output); +xas_mixer *xas_mixer_new(size_t sample_size, +                             size_t sample_rate, +                             size_t channels, +                             size_t buffer_size);  void xas_mixer_destroy(xas_mixer *mixer); +xas_audio_stream *xas_mixer_output(xas_mixer *mixer); +  xas_mixer_input *xas_mixer_input_add(xas_mixer *mixer,                                           xas_audio_stream *stream,                                           float gain, diff --git a/include/xas/synth.h b/include/xas/synth.h index fe3ce9f..1d070aa 100644 --- a/include/xas/synth.h +++ b/include/xas/synth.h @@ -10,23 +10,22 @@ typedef struct _xas_synth xas_synth;  typedef int16_t (*xas_synth_callback_sample)(xas_synth *synth, void *ctx); -typedef void (*xas_synth_callback_destroy)(xas_synth *synth, void *ctx); +typedef void (*xas_synth_callback_cleanup)(xas_synth *synth, void *ctx);  struct _xas_synth { -    size_t sample_rate; +    size_t sample_size, +           sample_rate; -    xas_synth_callback_sample sample; -    xas_synth_callback_destroy destroy; +    xas_synth_callback_sample  sample; +    xas_synth_callback_cleanup cleanup;      void *ctx;  }; -xas_synth *xas_synth_new(size_t sample_rate, -                             xas_synth_callback_sample  sample, -                             xas_synth_callback_destroy destroy, -                             void *ctx); - -void xas_synth_destroy(xas_synth *synth); - -int16_t xas_synth_sample(xas_synth *synth); +xas_audio_stream *xas_synth_new(size_t sample_size, +                                    size_t sample_rate, +                                    size_t buffer_size, +                                    xas_synth_callback_sample  sample, +                                    xas_synth_callback_cleanup cleanup, +                                    void *ctx);  #endif /* _XAS_SYNTH_H */ | 
 
    