src/audio/pulse/SDL_pulseaudio.h
branchSDL-1.2
changeset 4216 5b99971a27b4
parent 4159 a1b03ba2fcd0
child 4398 fe15c4e8efe6
equal deleted inserted replaced
4215:d83830711a5b 4216:5b99971a27b4
    30 
    30 
    31 /* Hidden "this" pointer for the video functions */
    31 /* Hidden "this" pointer for the video functions */
    32 #define _THIS	SDL_AudioDevice *this
    32 #define _THIS	SDL_AudioDevice *this
    33 
    33 
    34 struct SDL_PrivateAudioData {
    34 struct SDL_PrivateAudioData {
    35 	/* The audio stream handle */
    35 	pa_mainloop *mainloop;
    36 	pa_simple * stream;
    36 	pa_mainloop_api *mainloop_api;
    37 
    37 	pa_context *context;
    38 	/* The parent process id, to detect when application quits */
    38 	pa_stream *stream;
    39 	pid_t parent;
       
    40 
    39 
    41 	/* Raw mixing buffer */
    40 	/* Raw mixing buffer */
    42 	Uint8 *mixbuf;
    41 	Uint8 *mixbuf;
    43 	int    mixlen;
    42 	int    mixlen;
    44 };
    43 };
    45 
    44 
       
    45 #if (PA_API_VERSION < 12)
       
    46 /** Return non-zero if the passed state is one of the connected states */
       
    47 static inline int PA_CONTEXT_IS_GOOD(pa_context_state_t x) {
       
    48     return
       
    49         x == PA_CONTEXT_CONNECTING ||
       
    50         x == PA_CONTEXT_AUTHORIZING ||
       
    51         x == PA_CONTEXT_SETTING_NAME ||
       
    52         x == PA_CONTEXT_READY;
       
    53 }
       
    54 /** Return non-zero if the passed state is one of the connected states */
       
    55 static inline int PA_STREAM_IS_GOOD(pa_stream_state_t x) {
       
    56     return
       
    57         x == PA_STREAM_CREATING ||
       
    58         x == PA_STREAM_READY;
       
    59 }
       
    60 #endif	/* pulseaudio <= 0.9.10 */
       
    61 
    46 /* Old variable names */
    62 /* Old variable names */
       
    63 #define mainloop		(this->hidden->mainloop)
       
    64 #define mainloop_api		(this->hidden->mainloop_api)
       
    65 #define context			(this->hidden->context)
    47 #define stream			(this->hidden->stream)
    66 #define stream			(this->hidden->stream)
    48 #define parent			(this->hidden->parent)
       
    49 #define mixbuf			(this->hidden->mixbuf)
    67 #define mixbuf			(this->hidden->mixbuf)
    50 #define mixlen			(this->hidden->mixlen)
    68 #define mixlen			(this->hidden->mixlen)
    51 
    69 
    52 #endif /* _SDL_pulseaudio_h */
    70 #endif /* _SDL_pulseaudio_h */
    53 
    71