include/SDL_audio.h
branchSDL-ryan-multiple-audio-device
changeset 3791 be33495e4d97
parent 3790 8f8209f8da6d
child 3792 866c310e2cb5
     1.1 --- a/include/SDL_audio.h	Tue Oct 03 20:07:50 2006 +0000
     1.2 +++ b/include/SDL_audio.h	Tue Oct 03 20:48:42 2006 +0000
     1.3 @@ -228,6 +228,13 @@
     1.4  /*
     1.5   * Get the number of available devices exposed by the current driver.
     1.6   *  Only valid after a successfully initializing the audio subsystem.
     1.7 + *  Returns -1 if an explicit list of devices can't be determined; this is
     1.8 + *  not an error. For example, if SDL is set up to talk to a remote audio
     1.9 + *  server, it can't list every one available on the Internet, but it will
    1.10 + *  still allow a specific host to be specified to SDL_OpenAudioDevice().
    1.11 + * In many common cases, when this function returns a value <= 0, it can still
    1.12 + *  successfully open the default device (NULL for first argument of
    1.13 + *  SDL_OpenAudioDevice()).
    1.14   */
    1.15  extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture);
    1.16  
    1.17 @@ -238,16 +245,25 @@
    1.18   *  The values returned by this function reflect the latest call to
    1.19   *  SDL_GetNumAudioDevices(); recall that function to redetect available
    1.20   *  hardware.
    1.21 + *
    1.22 + * The string returned by this function is UTF-8 encoded, read-only, and
    1.23 + *  managed internally. You are not to free it. If you need to keep the
    1.24 + *  string for any length of time, you should make your own copy of it, as it
    1.25 + *  will be invalid next time any of several other SDL functions is called.
    1.26   */
    1.27  extern DECLSPEC const char *SDLCALL SDL_GetAudioDevice(int index,
    1.28                                                         int iscapture);
    1.29  
    1.30  
    1.31  /*
    1.32 - * Open a specific audio device. Passing in a device name of NULL is
    1.33 - *  equivalent to SDL_OpenAudio(). Returns 0 on error, a valid device ID
    1.34 - *  on success. SDL_OpenAudio(), unlike this function, always acts on device
    1.35 - *  ID 1.
    1.36 + * Open a specific audio device. Passing in a device name of NULL requests
    1.37 + *  the most reasonable default (and is equivalent to calling SDL_OpenAudio()).
    1.38 + * The device name is a UTF-8 string reported by SDL_GetAudioDevice(), but
    1.39 + *  some drivers allow arbitrary and driver-specific strings, such as a
    1.40 + *  hostname/IP address for a remote audio server, or a filename in the
    1.41 + *  diskaudio driver.
    1.42 + * Returns 0 on error, a valid device ID that is >= 2 on success.
    1.43 + *  SDL_OpenAudio(), unlike this function, always acts on device ID 1.
    1.44   */
    1.45  extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char
    1.46                                                                *device,