4 #include <intuition/intuition.h>
5 #include <intuition/intuitionbase.h>
6 #include <libraries/mui.h>
7 #include <libraries/gadtools.h>
8 #include <devices/ahi.h>
10 #define ID_ABOUT 0x55555555
11 #define ID_STORE_CONFIG 0xaaaaaaaa
13 #define AHI_SUB_LIB_VERSION 4
14 #define AHI_USB_MODE_BASE 0x003b0000
16 #define AHIDB_NepAudioMode (AHIDB_UserBase+0)
18 #define UAF_MASTER_VOLUME 0x0001
19 #define UAF_INPUT_GAIN 0x0002
20 #define UAF_MONITOR_VOLUME 0x0004
21 #define UAF_SELECT_INPUT 0x0100
22 #define UAF_SELECT_OUTPUT 0x0200
32 struct Node nau_Node
; /* Node linkage */
33 UWORD nau_Type
; /* Type as in USB audio spec */
34 UWORD nau_UnitID
; /* ID of this unit / input / output / feature */
35 UWORD nau_NumInputs
; /* Number of inputs */
36 UWORD nau_NumOutputs
; /* Number of outputs */
37 struct NepAudioUnit
*nau_InputUnit
[8];/* Sourcing Units (or NULL for input terminals) */
38 struct NepAudioUnit
*nau_OutputUnit
[8]; /* Outputting Units */
39 UWORD nau_OutChannels
; /* Number of outgoing channels */
40 UWORD nau_ChannelCfg
; /* Spacial location */
41 UWORD nau_TermType
; /* Terminal Type */
42 UBYTE
*nau_Descriptor
; /* Raw descriptor */
43 STRPTR nau_Name
; /* Name of unit */
44 struct NepAudioUnit
*nau_RootUnit
; /* Top of the chain */
45 struct NepAudioUnit
*nau_SinkUnit
; /* USB Streaming unit this goes to */
46 struct NepAudioUnit
*nau_SourceUnit
; /* USB Streaming unit this comes from */
49 struct NepAudioUnit
*nau_VolumeUnit
; /* Volume control unit */
50 struct NepAudioUnit
*nau_MonitorUnit
; /* Monitor Volume unit */
51 struct NepAudioUnit
*nau_SelectorUnit
; /* Input and output select unit */
52 BOOL nau_VolumeControl
; /* Master volume control */
53 BOOL nau_Monitor
; /* Monitor volume control */
54 BOOL nau_Balance
; /* Balance Panning support */
56 UWORD nau_VolCtrlMask
; /* Feature Mask (master, left, right) */
57 UWORD nau_VolCtrlCount
; /* Number of channels */
59 WORD nau_MinVolDb
; /* Min Volume in 8.8 DB */
60 WORD nau_MaxVolDb
; /* Max Volume in 8.8 DB */
62 Fixed nau_MinVolume
; /* Minimum volume for this unit */
63 Fixed nau_MaxVolume
; /* Maximum volume for this unit */
68 struct Node nam_Node
; /* Node linkage */
69 struct NepAudioSubLibBase
*nam_SubLibBase
; /* usbaudio.audio AHI driver library */
70 struct NepClassAudio
*nam_Unit
; /* Up linkage */
71 struct Library
*nam_PsdBase
; /* Poseidon base */
72 struct NepAudioMode
*nam_Sibling
; /* Associated Record/Playback node */
73 struct PsdInterface
*nam_Interface
; /* Interface for mode */
74 struct PsdInterface
*nam_ZeroBWIF
; /* Interface for without bandwidth use */
75 struct PsdEndpoint
*nam_EP
; /* Iso Endpoint */
76 struct PsdRTIsoHandler
*nam_RTIso
; /* Iso Pipe */
77 struct PsdPipe
*nam_EP0Pipe
; /* Endpoint 0 pipe */
78 struct MsgPort
*nam_TaskMsgPort
; /* Message Port of Subtask */
80 ULONG nam_IfNum
; /* Interface number */
81 IPTR nam_EPNum
; /* Endpoint number */
83 struct NepAudioUnit
*nam_RootUnit
; /* Root unit containing control information */
84 ULONG nam_AHIModeID
; /* AHI Mode ID */
85 ULONG nam_SampleType
; /* AHI Sample Type */
86 UWORD nam_AHIFrameSize
; /* Number of bytes per AHI Frame */
87 UWORD nam_NumChannels
; /* Number of channels */
88 UWORD nam_FrameSize
; /* Number of bytes per Frame */
89 UWORD nam_Resolution
; /* Number of bits per Sample */
90 UWORD nam_SampleSize
; /* Number of bytes per Sample */
91 UWORD nam_TerminalID
; /* ID of the terminal */
92 BOOL nam_IsInput
; /* Is Input (recording) */
93 BOOL nam_HasVolume
; /* Has Volume control */
94 BOOL nam_HasPanning
; /* Supports panning */
95 BOOL nam_HasFreqCtrl
; /* Has Frequency control */
96 BOOL nam_HasPitchCtrl
; /* Has Pitch control */
97 UWORD nam_CurrInput
; /* Current input */
98 UWORD nam_CurrOutput
; /* Current output */
100 IPTR nam_MaxPktSize
; /* Max Pkt Size of Endpoint */
101 ULONG nam_Interval
; /* Interval in frames */
102 ULONG nam_MinFreq
; /* Minimum Frequency */
103 ULONG nam_MaxFreq
; /* Maximum Frequency */
104 ULONG nam_NumFrequencies
; /* Number of supported frequencies */
105 ULONG nam_FreqArray
[64]; /* Array of supported frequencies */
106 ULONG nam_NumInputs
; /* Number of Inputs */
107 STRPTR nam_InputNames
[8]; /* Names for the inputs */
108 ULONG nam_NumOutputs
; /* Number of Outputs */
109 STRPTR nam_OutputNames
[8]; /* Names for the outputs */
110 struct TagItem nam_Tags
[12]; /* AudioDB Tags */
111 struct AHIAudioCtrlDrv
*nam_AudioCtrl
; /* AHI Audio Ctrl */
113 LONG nam_PlayerTimer
; /* Descending Timer when to call next player */
114 Fixed nam_PlayerInterval
; /* Player interval (upper word is holds ms) */
115 Fixed nam_PlayerFrac
; /* Player increment */
116 ULONG nam_PlayerMS
; /* Number of milliseconds to mix before player gets called next time */
117 struct Interrupt nam_PlayerInt
; /* Interrupt to cause when Player needs to be called */
119 BOOL nam_FallbackTimer
; /* Timer active? */
120 struct MsgPort nam_TimerMsgPort
; /* Msg port for Timer device on device removal */
121 struct timerequest
*nam_TimerIOReq
; /* Timer Request */
123 Fixed nam_SampleFrac
; /* Number of samples per interval */
124 Fixed nam_BufferCount
; /* Increasing sample per interval counter */
125 UWORD nam_NextBufW
; /* 0/1 Next buffer to overwrite */
126 UWORD nam_NextBufR
; /* 0/1 Next buffer to read from */
127 WORD
*nam_AHIBuffer
; /* AHI buffer */
128 ULONG nam_USBBufLen
[2]; /* Length of each buffer */
129 UBYTE
*nam_USBBuffer
[2]; /* USB converted buffer (double buffered) */
130 Fixed nam_USBBufCnt
[2]; /* Reloading of buffer count */
131 LONG nam_USBCount
; /* Decreasing buffer count -- if negative, start next buffer */
132 struct AHIRecordMessage nam_RecMsg
; /* Record message */
133 struct Hook nam_SamConvHook
; /* Sample conversion hook */
134 struct Hook nam_ReleaseHook
; /* Device Release hook */
136 Fixed nam_MasterVol
; /* Master volume for the unit */
137 Fixed nam_ChannelVol
[2]; /* Left and right channel */
138 Fixed nam_ChannelPan
[2]; /* Channel panning */
140 Fixed nam_InputGain
; /* Input gain */
141 Fixed nam_MonitorVol
; /* Monitor volume */
146 struct Library nh_Library
; /* standard */
147 UWORD nh_Flags
; /* various flags */
148 struct Library
*nh_UtilityBase
; /* utility base */
149 struct NepAudioSubLibBase
*nh_SubLibBase
; /* usbaudio.audio AHI driver library */
150 struct List nh_Units
; /* List of bindings created */
152 struct Library
*nh_MUIBase
; /* MUI master base */
153 struct Library
*nh_PsdBase
; /* Poseidon base */
154 struct Library
*nh_IntBase
; /* Intuition base */
155 struct Task
*nh_GUITask
; /* GUI Task */
157 struct ClsGlobalCfg nh_CurrentCGC
;
158 BOOL nh_UsingDefaultCfg
;
161 Object
*nh_MainWindow
;
167 Object
*nh_MUIPrefsMI
;
172 struct Node nch_Node
; /* Node linkage */
173 ULONG nch_UnitNo
; /* Unit number */
174 struct NepAudioBase
*nch_ClsBase
; /* Up linkage */
175 struct Library
*nch_Base
; /* Poseidon base */
176 struct Library
*nch_AHIBase
; /* AHI Device base */
177 struct PsdDevice
*nch_Device
; /* Up linkage */
178 struct PsdConfig
*nch_Config
; /* Up linkage */
179 struct PsdInterface
*nch_Interface
; /* Up linkage */
180 struct PsdPipe
*nch_EP0Pipe
; /* Endpoint 0 pipe */
181 struct Task
*nch_ReadySigTask
; /* Task to send ready signal to */
182 LONG nch_ReadySignal
; /* Signal to send when ready */
183 struct Task
*nch_Task
; /* Subtask */
184 struct MsgPort
*nch_TaskMsgPort
; /* Message Port of Subtask */
185 IPTR nch_IfNum
; /* Interface Number */
186 struct NepAudioMode
*nch_CurrentMode
; /* Currently selected mode */
188 ULONG nch_UpdateFlags
; /* Update Flags for Ctrl */
190 struct List nch_AudioModes
; /* List of audio modes */
191 struct List nch_AudioUnits
; /* List of audio units */
193 struct Hook nch_OutReqHook
; /* Hook for output */
194 struct Hook nch_InReqHook
; /* Hook for input */
195 struct Hook nch_InDoneHook
; /* Hook for input */
197 UWORD nch_UnitProdID
; /* ProductID of unit */
198 UWORD nch_UnitVendorID
; /* VendorID of unit */
199 UWORD nch_UnitCfgNum
; /* Config of unit */
200 UWORD nch_UnitIfNum
; /* Interface number */
201 UWORD nch_UnitAltIfNum
; /* Alternate interface number */
202 BOOL nch_DenyRequests
; /* Do not accept further IO requests */
204 struct MsgPort
*nch_AHIMsgPort
; /* AHI Device msg Port */
205 struct AHIRequest
*nch_AHIReq
; /* AHI IO Request */
208 struct NepAudioSubLibBase
210 struct Library nas_Library
; /* standard */
211 UWORD nas_Flags
; /* various flags */
212 struct NepAudioBase
*nas_ClsBase
; /* Up linkage */
213 struct Library
*nas_UtilityBase
; /* utility base */
214 BPTR nas_SegList
; /* device seglist */
217 #endif /* USBAUDIO_H */