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,
26 /*** AHI include files ***/
28 #include <exec/semaphores.h>
29 #include <exec/devices.h>
30 #include <devices/ahi.h>
31 #include <devices/timer.h>
33 #include <libraries/ahi_sub.h>
34 #include <utility/hooks.h>
42 extern struct AHIBase
*AHIBase
;
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)
63 struct Library ahib_Library
;
65 UBYTE ahib_DebugLevel
;
66 struct ExecBase
*ahib_SysLib
;
69 struct AHIDevUnit
*ahib_DevUnits
[AHI_UNITS
];
70 struct SignalSemaphore ahib_Lock
;
73 SIPTR ahib_MonitorVolume
; // Fixed
74 SIPTR ahib_InputGain
; // Fixed
75 SIPTR ahib_OutputVolume
; // Fixed
78 SIPTR ahib_MaxCPU
; // Fixed
79 SIPTR ahib_AntiClickTime
; // Fixed
83 struct AHIIFace
* ahib_IAHI
;
88 #define IAHI (AHIBase->ahib_IAHI)
94 struct EClockVal EntryTime
;
95 struct EClockVal ExitTime
;
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. */
117 Fixed64 cd_LastOffset
;
121 Fixed cd_VolumeRight
;
128 UBYTE cd_NextSoundOK
;
129 APTR cd_NextDataStart
;
130 Fixed64 cd_NextOffset
;
132 Fixed64 cd_NextLastOffset
;
133 Fixed cd_NextScaleLeft
;
134 Fixed cd_NextScaleRight
;
135 Fixed cd_NextVolumeLeft
;
136 Fixed cd_NextVolumeRight
;
137 APTR cd_NextAddRoutine
;
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
;
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 */
194 struct AHIChannelData
*cd_Succ
; /* For the wet and dry lists */
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 */
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
;
234 UWORD ahiac_Channels2
; /* Max virtual channels/hw channel */
235 struct Timer ahiac_Timer
;
238 struct PowerPCContext
* ahiac_PowerPCContext
;
239 char ahiac_DriverName
[ 256 ];
241 struct AHIsubIFace
* ahiac_IAHIsub
;
245 #endif /* ahi_ahi_def_h */