source: cmedia/trunk/Vsd/AudioIF/audioif.h@ 577

Last change on this file since 577 was 354, checked in by stevenhl, 18 years ago

Import untested baseline cmedia sources, work products and binaries
Binaries and work products should be deleted from repository.
once new builds are verified to work.

File size: 7.1 KB
Line 
1/*static char *SCCSID = "@(#)audioif.h 13.13 92/04/13";*/
2/**************************START OF SPECIFICATIONS *************************
3*
4* SOURCE FILE NAME: AUDIOIF.H
5*
6* DESCRIPTIVE NAME: Header file for Audio Interface Driver
7*
8* COPYRIGHT: IBM Confidential
9* Copyright (c) IBM Corporation 1990, 1991
10* All Rights Reserved
11*
12* STATUS: OS/2 Release 2.0
13*
14* FUNCTION: Declares audio structures and definitions for ACPA Audio device
15*
16* NOTE: *
17* DEPENDENCIES:
18* RESTRICTIONS:
19*
20* 1/19/94 Pam Lee Made changes for merge with AMMC
21*
22************************** END OF SPECIFICATIONS **************************/
23#include <checkmem.h>
24
25#define INPUT_PORT 1
26#define OUTPUT_PORT 2
27
28
29// values for RC file -- should be in SHIP_H!!!!!!
30#define STATIC_RATE 0L
31#define BEGIN_CONTINUOUS 1L
32#define END_CONTINUOUS 2L
33
34#define AMP_MIX 1
35#define NON_AMP_MIX 0
36#define CT_ADPCM DATATYPE_CT_ADPCM
37
38
39
40#define NUMMODES 8
41#define KNOWN_AUDIODD_MAPS 8
42
43
44RIFFTABLE RiffTable[NUMMODES] =
45 {
46 {DATATYPE_WAVEFORM, PCM},
47 {DATATYPE_ADPCM_AVC, ADPCM},
48 {DATATYPE_MULAW, MU_LAW},
49 {DATATYPE_ALAW, A_LAW},
50 {DATATYPE_MIDI, MIDI},
51 {DATATYPE_SPV2, SPV2},
52 {DATATYPE_CDXA_AUDIO, ADPCMXA},
53 {DATATYPE_CT_ADPCM, CT_ADPCM}
54 };
55
56#define NUM_DATATYPES 54
57#define RIFF_PCM 1
58#define RIFF_ADPCM 103
59
60// Classes used for resource management
61#define PCM_CLASS 1
62#define MIDI_CLASS 2
63#define AVC_MUSIC_CLASS 3
64#define AVC_HQ_CLASS 4
65#define AVC_VOICE_CLASS 5
66#define AVC_STEREO_CLASS 6
67#define RECORD_CLASS 7
68#define PCM_STEREO_CLASS 8
69#define NO_CLASS_DETERMINED 100
70
71// known cards, others can be added via an .rc file
72
73#define MAUDIO 1
74#define SB 2
75#define SB_PRO 3
76#define SB_16 4
77#define PAS_16 5
78#define FOXGLOVE 6
79#define SPEAKER 7
80
81
82/******************************************************/
83 // Waveform Table DataStructure
84/******************************************************/
85typedef struct _mode_data_typ
86 {
87 ULONG ulDataType; /* PCM, ADPCM, etc.. */
88 ULONG ulDataSubType; /* Freq, bits/sam,.. */
89 short mode_num; /* Mode Constant */
90 int flags; /* Fixed or 2s Comp */
91 LONG srate; /* 11,22,44 Khz */
92 LONG bits_per_sample; /* 8 or 16 bits/sam */
93 SHORT channels; /* Mono or Stereo */
94 ULONG ulBytes; /* Scaled for Time Calcs */
95 ULONG ulMMTime; /* Scaled for Time Calcs */
96
97 }MODE_DATA;
98
99
100#pragma pack(1)
101typedef struct _class_data
102 {
103 ULONG ulDataType; /* PCM, ADPCM, etc.. */
104 ULONG ulSubType; /* Freq, bits/sam,.. */
105 USHORT sSRate; /* 11,22,44 Khz */
106 USHORT sBitsPerSRate; /* 8 or 16 bits/sam */
107 USHORT usChannels; /* Mono or Stereo */
108 ULONG ulSamplingDescription;
109 USHORT usPlayClass;
110 USHORT usPlayUnits;
111 USHORT usRecordClass;
112 USHORT usRecordUnits;
113 }CLASS_DATA;
114#pragma pack()
115
116
117
118#define FIX2C FIXED + TWOS_COMPLEMENT
119
120
121
122/*-------------------------------------------------------------------------*
123* Table to convert gain % to number
124*-------------------------------------------------------------------------*/
125typedef struct
126 {
127 ULONG ulGainValue;
128 } GAINTABLE;
129
130#define NUMGAINENTRIES 18
131
132GAINTABLE GainTable[ NUMGAINENTRIES ] =
133
134 { { 0 },
135 { 6 },
136 { 12 },
137 { 18 },
138 { 24 },
139 { 30 },
140 { 36 },
141 { 42 },
142 { 48 },
143 { 54 },
144 { 60 },
145 { 66 },
146 { 72 },
147 { 78 },
148 { 84 },
149 { 90 },
150 { 96 },
151 { 100 },
152 };
153
154
155typedef struct
156 {
157 ULONG ulGainValue;
158 } BOOSTGAINTABLE;
159
160GAINTABLE BoostGainTable[ 7 ] =
161
162 { { 102 },
163 { 104 },
164 { 106 },
165 { 108 },
166 { 112 },
167 { 114 },
168 { 116 }
169 };
170
171
172#define AUDIOIF_MULTIPLIER 0x147AE14 // 0x7FFFFFFF / 100
173#define AUDIOIF_DIVISOR 0x147 // 0x7fff / 100 -- get one word
174#define NOT_INITIALIZED -1
175
176
177
178
179/*-------------------------------------------------------------------------*
180* Function Prototypes
181*-------------------------------------------------------------------------*/
182
183LONG Open_Driver(PMCI_AMP_INSTANCE, ULONG);
184LONG Close_Driver(PMCI_AMP_INSTANCE );
185LONG MasterVol_Driver2(PMCI_AMP_INSTANCE, ULONG, ULONG);
186LONG Status_Driver2(PMCI_AMP_INSTANCE,ULONG, ULONG);
187LONG Set_Driver2(PMCI_AMP_INSTANCE, LONG);
188LONG DevCaps_Driver2(PMCI_AMP_INSTANCE, ULONG, ULONG *, ULONG );
189LONG Save_Driver(PMCI_AMP_INSTANCE);
190LONG Restore_Driver(PMCI_AMP_INSTANCE);
191LONG Info_Driver2(PMCI_AMP_INSTANCE, ULONG, ULONG);
192LONG Ports_Driver2(PMCI_AMP_INSTANCE, ULONG, ULONG);
193LONG Command_Driver(PMCI_AMP_INSTANCE, ULONG);
194LONG Wave_Driver(PMCI_AMP_INSTANCE, ULONG, ULONG );
195
196LONG LoadDSP(PMCI_AMP_INSTANCE, LPMCI_AUDIO_INIT);
197LONG MCI_Error(ULONG);
198LONG FindDevice(CHAR *, HFILE);
199PMCI_AMP_INSTANCE DevAlreadyOpen(CHAR *);
200LONG AddDevice(PMCI_AMP_INSTANCE);
201LONG AddTableDevice( CHAR * );
202struct ACPATrackTableList *FindTableDevice( CHAR * );
203LONG RemoveDevice(PMCI_AMP_INSTANCE );
204LONG Set_IO_Ports( LPMCI_AUDIO_CHANGE, PMCI_AMP_INSTANCE, LONG );
205LONG ChannelsUsedInDevice(CHAR *pDeviceName);
206ULONG CheckAUDIOIF (PMCI_AMP_INSTANCE lpAmpInstance);
207void CheckBounds( PLONG );
208ULONG StatusIOPort( ULONG, PMCI_AMP_INSTANCE, ULONG );
209ULONG RemoveIOPort( ULONG, PMCI_AMP_INSTANCE, ULONG );
210ULONG AddIOPort( ULONG, PMCI_AMP_INSTANCE, ULONG );
211LONG DoIOCTLLoad( PMCI_AMP_INSTANCE, SHORT sMode );
212void MapModes( PMCI_AMP_INSTANCE pInstance );
213ULONG GetClassInformation(PMCI_AMP_INSTANCE pInstance );
214ULONG SetupResourceTable ( PMCI_AMP_INSTANCE pInstance );
215ULONG ACPABestFit( PMCI_AMP_INSTANCE pInstance );
216
217//#pragma linkage(AUDIOIFDriverEntry, system )
218ULONG APIENTRY AUDIOIFDriverEntry(PMCI_AMP_INSTANCE prInstance,
219 ULONG sMessage,
220 ULONG lParam1,
221 ULONG lParam2,
222 ULONG lParam3);
223
224//4meg #pragma linkage( CheckMem, system )
225
226//4meg DWORD CheckMem( PVOID, ULONG, ULONG );
227
Note: See TracBrowser for help on using the repository browser.