Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / devs / AHI / Device / ahi_def.h
blob4b1ec57ef5ab5b08036e4c469b350159fe5bd161
1 /*
2 AHI - Hardware independent audio subsystem
3 Copyright (C) 1996-2005 Martin Blom <martin@blom.org>
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.
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.
15 You should have received a copy of the GNU Library General Public
16 License along with this library; if not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Cambridge,
18 MA 02139, USA.
21 #ifndef ahi_ahi_def_h
22 #define ahi_ahi_def_h
24 #include <config.h>
26 /*** AHI include files ***/
28 #include <exec/semaphores.h>
29 #include <exec/devices.h>
30 #include <devices/ahi.h>
31 #include <devices/timer.h>
32 #include <dos/dos.h>
33 #include <libraries/ahi_sub.h>
34 #include <utility/hooks.h>
36 struct Echo;
37 struct AHIDevUnit;
40 /*** Globals ***/
42 extern struct AHIBase *AHIBase;
45 /*** Definitions ***/
47 typedef long long int Fixed64;
49 #define AHI_UNITS 4 /* Normal units, excluding AHI_NO_UNIT */
51 #define AHIBB_NOSURROUND (0)
52 #define AHIBF_NOSURROUND (1L<<0)
53 #define AHIBB_NOECHO (1)
54 #define AHIBF_NOECHO (1L<<1)
55 #define AHIBB_FASTECHO (2)
56 #define AHIBF_FASTECHO (1L<<2)
57 #define AHIBB_CLIPPING (3)
58 #define AHIBF_CLIPPING (1L<<3)
60 /* AHIBase */
61 struct AHIBase
63 struct Library ahib_Library;
64 UBYTE ahib_Flags;
65 UBYTE ahib_DebugLevel;
66 struct ExecBase *ahib_SysLib;
67 BPTR ahib_SegList;
68 APTR ahib_AudioCtrl;
69 struct AHIDevUnit *ahib_DevUnits[AHI_UNITS];
70 struct SignalSemaphore ahib_Lock;
71 ULONG ahib_AudioMode;
72 ULONG ahib_Frequency;
73 Fixed ahib_MonitorVolume;
74 Fixed ahib_InputGain;
75 Fixed ahib_OutputVolume;
76 ULONG ahib_Input;
77 ULONG ahib_Output;
78 Fixed ahib_MaxCPU;
79 Fixed ahib_AntiClickTime;
80 UWORD ahib_ScaleMode;
82 #ifdef __AMIGAOS4__
83 struct AHIIFace* ahib_IAHI;
84 #endif
87 #ifdef __AMIGAOS4__
88 #define IAHI (AHIBase->ahib_IAHI)
89 #endif
92 struct Timer
94 struct EClockVal EntryTime;
95 struct EClockVal ExitTime;
99 struct AHISoundData
101 ULONG sd_Type;
102 APTR sd_Addr;
103 ULONG sd_Length;
106 /* Private AHIChannelData */
108 struct AHIChannelData
110 UWORD cd_EOS; /* $FFFF: Sample has reached end */
112 UBYTE cd_FreqOK; /* $00: Freq=0 ; $FF: Freq<>0 */
113 UBYTE cd_SoundOK; /* $00: No sound set ; $FF: S. OK. */
114 APTR cd_DataStart;
115 Fixed64 cd_Offset;
116 Fixed64 cd_Add;
117 Fixed64 cd_LastOffset;
118 Fixed cd_ScaleLeft;
119 Fixed cd_ScaleRight;
120 Fixed cd_VolumeLeft;
121 Fixed cd_VolumeRight;
122 APTR cd_AddRoutine;
123 ULONG cd_Type;
125 UWORD cd_Pad0;
127 UBYTE cd_NextFreqOK;
128 UBYTE cd_NextSoundOK;
129 APTR cd_NextDataStart;
130 Fixed64 cd_NextOffset;
131 Fixed64 cd_NextAdd;
132 Fixed64 cd_NextLastOffset;
133 Fixed cd_NextScaleLeft;
134 Fixed cd_NextScaleRight;
135 Fixed cd_NextVolumeLeft;
136 Fixed cd_NextVolumeRight;
137 APTR cd_NextAddRoutine;
138 ULONG cd_NextType;
140 UWORD cd_Pad1;
142 UBYTE cd_DelayedFreqOK;
143 UBYTE cd_DelayedSoundOK;
144 APTR cd_DelayedDataStart;
145 Fixed64 cd_DelayedOffset;
146 Fixed64 cd_DelayedAdd;
147 Fixed64 cd_DelayedLastOffset;
148 Fixed cd_DelayedScaleLeft;
149 Fixed cd_DelayedScaleRight;
150 Fixed cd_DelayedVolumeLeft;
151 Fixed cd_DelayedVolumeRight;
152 APTR cd_DelayedAddRoutine;
153 ULONG cd_DelayedType;
155 BOOL cd_SoundDelayed;
156 BOOL cd_FreqDelayed;
157 BOOL cd_VolDelayed;
158 UWORD cd_Pad2;
160 LONG cd_Samples; /* Samples left to store (down-counter) */
161 LONG cd_FirstOffsetI; /* for linear interpolation routines */
163 LONG cd_DelayedSamples;
164 LONG cd_DelayedFirstOffsetI;
166 LONG cd_StartPointL; /* for linear interpolation routines */
167 LONG cd_TempStartPointL; /* for linear interpolation routines */
168 LONG cd_StartPointR; /* for linear interpolation routines */
169 LONG cd_TempStartPointR; /* for linear interpolation routines */
171 // NOTE!! These must follow directly after cd_TempStartPointR ...
172 LONG cd_StartPointRL; /* for linear interpolation routines */
173 LONG cd_TempStartPointRL; /* for linear interpolation routines */
174 LONG cd_StartPointRR; /* for linear interpolation routines */
175 LONG cd_TempStartPointRR; /* for linear interpolation routines */
176 LONG cd_StartPointSL; /* for linear interpolation routines */
177 LONG cd_TempStartPointSL; /* for linear interpolation routines */
178 LONG cd_StartPointSR; /* for linear interpolation routines */
179 LONG cd_TempStartPointSR; /* for linear interpolation routines */
180 LONG cd_StartPointC; /* for linear interpolation routines */
181 LONG cd_TempStartPointC; /* for linear interpolation routines */
182 LONG cd_StartPointLFE; /* for linear interpolation routines */
183 LONG cd_TempStartPointLFE; /* for linear interpolation routines */
185 #define CD_L 0
186 #define CD_R 2
187 #define CD_RL 4
188 #define CD_RR 6
189 #define CD_SL 8
190 #define CD_SR 10
191 #define CD_C 12
192 #define CD_LFE 14
194 struct AHIChannelData *cd_Succ; /* For the wet and dry lists */
195 UWORD cd_ChannelNo;
196 UWORD cd_Pad3;
197 LONG cd_AntiClickCount;
200 #define AHIACB_NOMIXING 31 /* private ahiac_Flags flag */
201 #define AHIACF_NOMIXING (1L<<31) /* private ahiac_Flags flag */
202 #define AHIACB_NOTIMING 30 /* private ahiac_Flags flag */
203 #define AHIACF_NOTIMING (1L<<30) /* private ahiac_Flags flag */
204 #define AHIACB_POSTPROC 29 /* private ahiac_Flags flag */
205 #define AHIACF_POSTPROC (1L<<29) /* private ahiac_Flags flag */
206 #define AHIACB_CLIPPING 28 /* private ahiac_Flags flag */
207 #define AHIACF_CLIPPING (1L<<28) /* private ahiac_Flags flag */
209 /* Private AudioCtrl structure */
211 struct PowerPCContext;
213 struct AHIPrivAudioCtrl
215 struct AHIAudioCtrlDrv ac;
216 struct Library* ahiac_SubLib;
217 ULONG ahiac_SubAllocRC;
218 struct AHIChannelData* ahiac_ChannelDatas;
219 struct AHISoundData* ahiac_SoundDatas;
220 ULONG ahiac_BuffSizeNow; /* How many bytes of the buffer are used? */
222 struct Hook* ahiac_RecordFunc; /* AHIA_RecordFunc */
223 ULONG ahiac_AudioID;
224 Fixed ahiac_MasterVolume; /* Real */
225 Fixed ahiac_SetMasterVolume; /* Set by user */
226 Fixed ahiac_EchoMasterVolume;/* Set by dspecho */
227 struct AHIEffOutputBuffer* ahiac_EffOutputBufferStruct;
228 struct Echo* ahiac_EffDSPEchoStruct;
229 struct AHIEffChannelInfo* ahiac_EffChannelInfoStruct;
230 struct AHIChannelData* ahiac_WetList;
231 struct AHIChannelData* ahiac_DryList;
232 UBYTE ahiac_WetOrDry;
233 UBYTE ahiac_Pad;
234 UWORD ahiac_Channels2; /* Max virtual channels/hw channel */
235 struct Timer ahiac_Timer;
236 UWORD ahiac_UsedCPU;
237 UWORD ahiac_MaxCPU;
238 struct PowerPCContext* ahiac_PowerPCContext;
239 char ahiac_DriverName[ 256 ];
240 #ifdef __AMIGAOS4__
241 struct AHIsubIFace* ahiac_IAHIsub;
242 #endif
245 #endif /* ahi_ahi_def_h */