src/audio/SDL_sysaudio.h
changeset 9393 ed79a66e57e5
parent 9391 3a54985e999e
child 9394 bb28e5281770
     1.1 --- a/src/audio/SDL_sysaudio.h	Wed Mar 18 10:09:39 2015 -0400
     1.2 +++ b/src/audio/SDL_sysaudio.h	Mon Mar 16 02:11:39 2015 -0400
     1.3 @@ -31,7 +31,16 @@
     1.4  #define _THIS   SDL_AudioDevice *_this
     1.5  
     1.6  /* Used by audio targets during DetectDevices() */
     1.7 -typedef void (*SDL_AddAudioDevice)(const char *name);
     1.8 +typedef int (*SDL_AddAudioDevice)(const char *name);
     1.9 +
    1.10 +/* Audio targets should call this as devices are hotplugged. Don't call
    1.11 +   during DetectDevices(), this is for hotplugging a device later. */
    1.12 +extern void SDL_AudioDeviceConnected(const int iscapture, const char *name);
    1.13 +
    1.14 +/* Audio targets should call this as devices are unplugged.
    1.15 +  (device) can be NULL if an unopened device is lost. */
    1.16 +extern void SDL_AudioDeviceDisconnected(const int iscapture, SDL_AudioDevice *device);
    1.17 +
    1.18  
    1.19  /* This is the size of a packet when using SDL_QueueAudio(). We allocate
    1.20     these as necessary and pool them, under the assumption that we'll
    1.21 @@ -92,6 +101,12 @@
    1.22  
    1.23      SDL_AudioDriverImpl impl;
    1.24  
    1.25 +    /* A mutex for device detection */
    1.26 +    SDL_mutex *detection_lock;
    1.27 +
    1.28 +    SDL_bool need_capture_device_redetect;
    1.29 +    SDL_bool need_output_device_redetect;
    1.30 +
    1.31      char **outputDevices;
    1.32      int outputDeviceCount;
    1.33  
    1.34 @@ -114,6 +129,7 @@
    1.35  {
    1.36      /* * * */
    1.37      /* Data common to all devices */
    1.38 +    SDL_AudioDeviceID id;
    1.39  
    1.40      /* The current audio specification (shared with audio thread) */
    1.41      SDL_AudioSpec spec;