comparison src/audio/SDL_sysaudio.h @ 1662:782fd950bd46 SDL-1.3

Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API. WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid. The code is now run through a consistent indent format: indent -i4 -nut -nsc -br -ce The headers are being converted to automatically generate doxygen documentation.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 28 May 2006 13:04:16 +0000
parents 12b6d331d82a
children 5f6550e5184f 37c9c4590689
comparison
equal deleted inserted replaced
1661:281d3f4870e5 1662:782fd950bd46
33 /* Define the SDL audio driver structure */ 33 /* Define the SDL audio driver structure */
34 #define _THIS SDL_AudioDevice *_this 34 #define _THIS SDL_AudioDevice *_this
35 #ifndef _STATUS 35 #ifndef _STATUS
36 #define _STATUS SDL_status *status 36 #define _STATUS SDL_status *status
37 #endif 37 #endif
38 struct SDL_AudioDevice { 38 struct SDL_AudioDevice
39 /* * * */ 39 {
40 /* The name of this audio driver */ 40 /* * * */
41 const char *name; 41 /* The name of this audio driver */
42 const char *name;
42 43
43 /* * * */ 44 /* * * */
44 /* The description of this audio driver */ 45 /* The description of this audio driver */
45 const char *desc; 46 const char *desc;
46 47
47 /* * * */ 48 /* * * */
48 /* Public driver functions */ 49 /* Public driver functions */
49 int (*OpenAudio)(_THIS, SDL_AudioSpec *spec); 50 int (*OpenAudio) (_THIS, SDL_AudioSpec * spec);
50 void (*ThreadInit)(_THIS); /* Called by audio thread at start */ 51 void (*ThreadInit) (_THIS); /* Called by audio thread at start */
51 void (*WaitAudio)(_THIS); 52 void (*WaitAudio) (_THIS);
52 void (*PlayAudio)(_THIS); 53 void (*PlayAudio) (_THIS);
53 Uint8 *(*GetAudioBuf)(_THIS); 54 Uint8 *(*GetAudioBuf) (_THIS);
54 void (*WaitDone)(_THIS); 55 void (*WaitDone) (_THIS);
55 void (*CloseAudio)(_THIS); 56 void (*CloseAudio) (_THIS);
56 57
57 /* * * */ 58 /* * * */
58 /* Lock / Unlock functions added for the Mac port */ 59 /* Lock / Unlock functions added for the Mac port */
59 void (*LockAudio)(_THIS); 60 void (*LockAudio) (_THIS);
60 void (*UnlockAudio)(_THIS); 61 void (*UnlockAudio) (_THIS);
61 62
62 /* * * */ 63 /* * * */
63 /* Data common to all devices */ 64 /* Data common to all devices */
64 65
65 /* The current audio specification (shared with audio thread) */ 66 /* The current audio specification (shared with audio thread) */
66 SDL_AudioSpec spec; 67 SDL_AudioSpec spec;
67 68
68 /* An audio conversion block for audio format emulation */ 69 /* An audio conversion block for audio format emulation */
69 SDL_AudioCVT convert; 70 SDL_AudioCVT convert;
70 71
71 /* Current state flags */ 72 /* Current state flags */
72 int enabled; 73 int enabled;
73 int paused; 74 int paused;
74 int opened; 75 int opened;
75 76
76 /* Fake audio buffer for when the audio hardware is busy */ 77 /* Fake audio buffer for when the audio hardware is busy */
77 Uint8 *fake_stream; 78 Uint8 *fake_stream;
78 79
79 /* A semaphore for locking the mixing buffers */ 80 /* A semaphore for locking the mixing buffers */
80 SDL_mutex *mixer_lock; 81 SDL_mutex *mixer_lock;
81 82
82 /* A thread to feed the audio device */ 83 /* A thread to feed the audio device */
83 SDL_Thread *thread; 84 SDL_Thread *thread;
84 Uint32 threadid; 85 Uint32 threadid;
85 86
86 /* * * */ 87 /* * * */
87 /* Data private to this driver */ 88 /* Data private to this driver */
88 struct SDL_PrivateAudioData *hidden; 89 struct SDL_PrivateAudioData *hidden;
89 90
90 /* * * */ 91 /* * * */
91 /* The function used to dispose of this structure */ 92 /* The function used to dispose of this structure */
92 void (*free)(_THIS); 93 void (*free) (_THIS);
93 }; 94 };
94 #undef _THIS 95 #undef _THIS
95 96
96 typedef struct AudioBootStrap { 97 typedef struct AudioBootStrap
97 const char *name; 98 {
98 const char *desc; 99 const char *name;
99 int (*available)(void); 100 const char *desc;
100 SDL_AudioDevice *(*create)(int devindex); 101 int (*available) (void);
102 SDL_AudioDevice *(*create) (int devindex);
101 } AudioBootStrap; 103 } AudioBootStrap;
102 104
103 #if SDL_AUDIO_DRIVER_BSD 105 #if SDL_AUDIO_DRIVER_BSD
104 extern AudioBootStrap BSD_AUDIO_bootstrap; 106 extern AudioBootStrap BSD_AUDIO_bootstrap;
105 #endif 107 #endif
174 176
175 /* This is the current audio device */ 177 /* This is the current audio device */
176 extern SDL_AudioDevice *current_audio; 178 extern SDL_AudioDevice *current_audio;
177 179
178 #endif /* _SDL_sysaudio_h */ 180 #endif /* _SDL_sysaudio_h */
181 /* vi: set ts=4 sw=4 expandtab: */