git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

SDL/audio/audio.h

      1 #pragma once
      2 
      3 #include <stdbool.h>
      4 #include <stddef.h>
      5 #include <Core/gb.h>
      6 
      7 bool GB_audio_is_playing(void);
      8 void GB_audio_set_paused(bool paused);
      9 void GB_audio_clear_queue(void);
     10 unsigned GB_audio_get_frequency(void);
     11 size_t GB_audio_get_queue_length(void);
     12 void GB_audio_queue_sample(GB_sample_t *sample);
     13 bool GB_audio_init(void);
     14 void GB_audio_deinit(void);
     15 const char *GB_audio_driver_name(void);
     16 const char *GB_audio_driver_name_at_index(unsigned index);
     17 
     18 typedef struct {
     19     typeof(GB_audio_is_playing) *audio_is_playing;
     20     typeof(GB_audio_set_paused) *audio_set_paused;
     21     typeof(GB_audio_clear_queue) *audio_clear_queue;
     22     typeof(GB_audio_get_frequency) *audio_get_frequency;
     23     typeof(GB_audio_get_queue_length) *audio_get_queue_length;
     24     typeof(GB_audio_queue_sample) *audio_queue_sample;
     25     typeof(GB_audio_init) *audio_init;
     26     typeof(GB_audio_deinit) *audio_deinit;
     27     const char *name;
     28 } GB_audio_driver_t;
     29 
     30 #define GB_AUDIO_DRIVER(_name) const GB_audio_driver_t _name##driver = { \
     31     .audio_is_playing = _audio_is_playing, \
     32     .audio_set_paused = _audio_set_paused, \
     33     .audio_clear_queue = _audio_clear_queue, \
     34     .audio_get_frequency = _audio_get_frequency, \
     35     .audio_get_queue_length = _audio_get_queue_length, \
     36     .audio_queue_sample = _audio_queue_sample, \
     37     .audio_init = _audio_init, \
     38     .audio_deinit = _audio_deinit, \
     39     .name = #_name, \
     40 }
     41 
     42 #define GB_AUDIO_DRIVER_REF(name) ({extern const GB_audio_driver_t name##driver; &name##driver;})

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.