Mercurial > sdl-ios-xcode
comparison src/audio/amigaos/SDL_sysaudio.h @ 0:74212992fb08
Initial revision
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Thu, 26 Apr 2001 16:45:43 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:74212992fb08 |
---|---|
1 /* | |
2 SDL - Simple DirectMedia Layer | |
3 Copyright (C) 1997, 1998, 1999, 2000, 2001 Sam Lantinga | |
4 | |
5 This library is free software; you can redistribute it and/or | |
6 modify it under the terms of the GNU Library General Public | |
7 License as published by the Free Software Foundation; either | |
8 version 2 of the License, or (at your option) any later version. | |
9 | |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 Library General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU Library General Public | |
16 License along with this library; if not, write to the Free | |
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
19 Sam Lantinga | |
20 slouken@devolution.com | |
21 */ | |
22 | |
23 #ifdef SAVE_RCSID | |
24 static char rcsid = | |
25 "@(#) $Id$"; | |
26 #endif | |
27 | |
28 #ifndef _SDL_sysaudio_h | |
29 #define _SDL_sysaudio_h | |
30 | |
31 #include "SDL_mutex.h" | |
32 #include "SDL_thread.h" | |
33 | |
34 #include <exec/exec.h> | |
35 #include <dos/dos.h> | |
36 #ifdef __SASC | |
37 #include <proto/exec.h> | |
38 #else | |
39 #include <inline/exec.h> | |
40 #endif | |
41 | |
42 #include <devices/ahi.h> | |
43 #include "mydebug.h" | |
44 | |
45 /* The SDL audio driver */ | |
46 typedef struct SDL_AudioDevice SDL_AudioDevice; | |
47 | |
48 /* Define the SDL audio driver structure */ | |
49 #define _THIS SDL_AudioDevice *_this | |
50 #ifndef _STATUS | |
51 #define _STATUS SDL_status *status | |
52 #endif | |
53 struct SDL_AudioDevice { | |
54 /* * * */ | |
55 /* The name of this audio driver */ | |
56 const char *name; | |
57 | |
58 /* * * */ | |
59 /* Public driver functions */ | |
60 int (*OpenAudio)(_THIS, SDL_AudioSpec *spec); | |
61 void (*ThreadInit)(_THIS); /* Called by audio thread at start */ | |
62 void (*WaitAudio)(_THIS); | |
63 void (*PlayAudio)(_THIS); | |
64 Uint8 *(*GetAudioBuf)(_THIS); | |
65 void (*WaitDone)(_THIS); | |
66 void (*CloseAudio)(_THIS); | |
67 | |
68 /* * * */ | |
69 /* Data common to all devices */ | |
70 | |
71 /* The current audio specification (shared with audio thread) */ | |
72 SDL_AudioSpec spec; | |
73 | |
74 /* An audio conversion block for audio format emulation */ | |
75 SDL_AudioCVT convert; | |
76 | |
77 /* Current state flags */ | |
78 int enabled; | |
79 int paused; | |
80 | |
81 /* Fake audio buffer for when the audio hardware is busy */ | |
82 Uint8 *fake_stream; | |
83 | |
84 /* A semaphore for locking the mixing buffers */ | |
85 struct SignalSemaphore mixer_lock; | |
86 | |
87 /* A thread to feed the audio device */ | |
88 SDL_Thread *thread; | |
89 Uint32 threadid; | |
90 | |
91 /* * * */ | |
92 /* Data private to this driver */ | |
93 struct SDL_PrivateAudioData *hidden; | |
94 | |
95 /* * * */ | |
96 /* The function used to dispose of this structure */ | |
97 void (*free)(_THIS); | |
98 }; | |
99 #undef _THIS | |
100 | |
101 typedef struct AudioBootStrap { | |
102 const char *name; | |
103 int (*available)(void); | |
104 SDL_AudioDevice *(*create)(int devindex); | |
105 } AudioBootStrap; | |
106 | |
107 #ifdef ESD_SUPPORT | |
108 extern AudioBootStrap ESD_bootstrap; | |
109 #endif | |
110 #ifdef linux | |
111 extern AudioBootStrap DMA_bootstrap; | |
112 #endif | |
113 #ifdef unix | |
114 extern AudioBootStrap AUDIO_bootstrap; | |
115 #endif | |
116 #ifdef ENABLE_WINDIB | |
117 extern AudioBootStrap WAVEOUT_bootstrap; | |
118 #endif | |
119 #ifdef ENABLE_DIRECTX | |
120 extern AudioBootStrap DSOUND_bootstrap; | |
121 #endif | |
122 #ifdef __BEOS__ | |
123 extern AudioBootStrap BAUDIO_bootstrap; | |
124 #endif | |
125 #ifdef macintosh | |
126 extern AudioBootStrap AUDIO_bootstrap; | |
127 #endif | |
128 #ifdef _AIX | |
129 extern AudioBootStrap Paud_bootstrap; | |
130 #endif | |
131 #ifdef ENABLE_CYBERGRAPHICS | |
132 extern AudioBootStrap AHI_bootstrap; | |
133 #endif | |
134 | |
135 /* This is the current audio device */ | |
136 extern SDL_AudioDevice *current_audio; | |
137 | |
138 #ifndef __SASC | |
139 extern struct ExecBase *SysBase; | |
140 #endif | |
141 | |
142 #endif /* _SDL_sysaudio_h */ |