src/audio/SDL_sysaudio.h
changeset 9393 ed79a66e57e5
parent 9391 3a54985e999e
child 9394 bb28e5281770
equal deleted inserted replaced
9392:92e23eff9b89 9393:ed79a66e57e5
    29 /* The SDL audio driver */
    29 /* The SDL audio driver */
    30 typedef struct SDL_AudioDevice SDL_AudioDevice;
    30 typedef struct SDL_AudioDevice SDL_AudioDevice;
    31 #define _THIS   SDL_AudioDevice *_this
    31 #define _THIS   SDL_AudioDevice *_this
    32 
    32 
    33 /* Used by audio targets during DetectDevices() */
    33 /* Used by audio targets during DetectDevices() */
    34 typedef void (*SDL_AddAudioDevice)(const char *name);
    34 typedef int (*SDL_AddAudioDevice)(const char *name);
       
    35 
       
    36 /* Audio targets should call this as devices are hotplugged. Don't call
       
    37    during DetectDevices(), this is for hotplugging a device later. */
       
    38 extern void SDL_AudioDeviceConnected(const int iscapture, const char *name);
       
    39 
       
    40 /* Audio targets should call this as devices are unplugged.
       
    41   (device) can be NULL if an unopened device is lost. */
       
    42 extern void SDL_AudioDeviceDisconnected(const int iscapture, SDL_AudioDevice *device);
       
    43 
    35 
    44 
    36 /* This is the size of a packet when using SDL_QueueAudio(). We allocate
    45 /* This is the size of a packet when using SDL_QueueAudio(). We allocate
    37    these as necessary and pool them, under the assumption that we'll
    46    these as necessary and pool them, under the assumption that we'll
    38    eventually end up with a handful that keep recycling, meeting whatever
    47    eventually end up with a handful that keep recycling, meeting whatever
    39    the app needs. We keep packing data tightly as more arrives to avoid
    48    the app needs. We keep packing data tightly as more arrives to avoid
    90     /* The description of this audio driver */
    99     /* The description of this audio driver */
    91     const char *desc;
   100     const char *desc;
    92 
   101 
    93     SDL_AudioDriverImpl impl;
   102     SDL_AudioDriverImpl impl;
    94 
   103 
       
   104     /* A mutex for device detection */
       
   105     SDL_mutex *detection_lock;
       
   106 
       
   107     SDL_bool need_capture_device_redetect;
       
   108     SDL_bool need_output_device_redetect;
       
   109 
    95     char **outputDevices;
   110     char **outputDevices;
    96     int outputDeviceCount;
   111     int outputDeviceCount;
    97 
   112 
    98     char **inputDevices;
   113     char **inputDevices;
    99     int inputDeviceCount;
   114     int inputDeviceCount;
   112 /* Define the SDL audio driver structure */
   127 /* Define the SDL audio driver structure */
   113 struct SDL_AudioDevice
   128 struct SDL_AudioDevice
   114 {
   129 {
   115     /* * * */
   130     /* * * */
   116     /* Data common to all devices */
   131     /* Data common to all devices */
       
   132     SDL_AudioDeviceID id;
   117 
   133 
   118     /* The current audio specification (shared with audio thread) */
   134     /* The current audio specification (shared with audio thread) */
   119     SDL_AudioSpec spec;
   135     SDL_AudioSpec spec;
   120 
   136 
   121     /* An audio conversion block for audio format emulation */
   137     /* An audio conversion block for audio format emulation */