src/audio/pulse/SDL_pulseaudio.h
branchSDL-1.2
changeset 4216 5b99971a27b4
parent 4159 a1b03ba2fcd0
child 4398 fe15c4e8efe6
     1.1 --- a/src/audio/pulse/SDL_pulseaudio.h	Mon Sep 21 09:18:42 2009 +0000
     1.2 +++ b/src/audio/pulse/SDL_pulseaudio.h	Mon Sep 21 09:27:08 2009 +0000
     1.3 @@ -32,20 +32,38 @@
     1.4  #define _THIS	SDL_AudioDevice *this
     1.5  
     1.6  struct SDL_PrivateAudioData {
     1.7 -	/* The audio stream handle */
     1.8 -	pa_simple * stream;
     1.9 -
    1.10 -	/* The parent process id, to detect when application quits */
    1.11 -	pid_t parent;
    1.12 +	pa_mainloop *mainloop;
    1.13 +	pa_mainloop_api *mainloop_api;
    1.14 +	pa_context *context;
    1.15 +	pa_stream *stream;
    1.16  
    1.17  	/* Raw mixing buffer */
    1.18  	Uint8 *mixbuf;
    1.19  	int    mixlen;
    1.20  };
    1.21  
    1.22 +#if (PA_API_VERSION < 12)
    1.23 +/** Return non-zero if the passed state is one of the connected states */
    1.24 +static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x) {
    1.25 +    return
    1.26 +        x == PA_CONTEXT_CONNECTING ||
    1.27 +        x == PA_CONTEXT_AUTHORIZING ||
    1.28 +        x == PA_CONTEXT_SETTING_NAME ||
    1.29 +        x == PA_CONTEXT_READY;
    1.30 +}
    1.31 +/** Return non-zero if the passed state is one of the connected states */
    1.32 +static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) {
    1.33 +    return
    1.34 +        x == PA_STREAM_CREATING ||
    1.35 +        x == PA_STREAM_READY;
    1.36 +}
    1.37 +#endif	/* pulseaudio <= 0.9.10 */
    1.38 +
    1.39  /* Old variable names */
    1.40 +#define mainloop		(this->hidden->mainloop)
    1.41 +#define mainloop_api		(this->hidden->mainloop_api)
    1.42 +#define context			(this->hidden->context)
    1.43  #define stream			(this->hidden->stream)
    1.44 -#define parent			(this->hidden->parent)
    1.45  #define mixbuf			(this->hidden->mixbuf)
    1.46  #define mixlen			(this->hidden->mixlen)
    1.47