source: sbliveos2/trunk/include/ossidc.h@ 151

Last change on this file since 151 was 151, checked in by sandervl, 25 years ago

update

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 8.4 KB
Line 
1/* $Id: ossidc.h 151 2000-05-28 16:50:46Z sandervl $ */
2
3//******************************************************************************
4// Header for idc definitions & declarations
5//
6// Copyright 2000 Sander van Leeuwen (sandervl@xs4all.nl)
7//
8// This program is free software; you can redistribute it and/or
9// modify it under the terms of the GNU General Public License as
10// published by the Free Software Foundation; either version 2 of
11// the License, or (at your option) any later version.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public
19// License along with this program; if not, write to the Free
20// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
21// USA.
22//
23//******************************************************************************
24#ifndef __OSSIDC_H__
25#define __OSSIDC_H__
26
27#include <ossdefos2.h>
28#include <osssound.h>
29
30typedef BOOL (FAR48 __cdecl *IDC16_HANDLER)(ULONG cmd, ULONG param);
31
32extern IDC16_HANDLER idc16_PddHandler;
33
34//IDC communication packet
35typedef struct
36{
37 union {
38 struct {
39 ULONG handler16; //16:16 address of pdd idc handler
40 } init;
41 struct {
42 ULONG irqnr;
43 } irq;
44 struct {
45 ULONG streamtype;
46 } open;
47 struct {
48 ULONG streamtype;
49 ULONG streamid;
50 } close;
51 struct {
52 ULONG streamtype;
53 ULONG streamid;
54 ULONG cmd;
55 ULONG ioctl_param;
56 } ioctl;
57 struct {
58 ULONG streamtype;
59 ULONG streamid;
60 } startstop;
61 struct {
62 ULONG streamtype;
63 ULONG streamid;
64 ULONG buffer; //0:32 address of mmpm/2 buffer
65 ULONG size;
66 } buffer;
67 struct {
68 ULONG streamtype;
69 ULONG streamid;
70 ULONG cmd;
71 ULONG volume;
72 } mixer;
73 struct {
74 ULONG streamtype;
75 ULONG streamid;
76 ULONG midiByte;
77 } midiwrite;
78 struct {
79 ULONG streamtype;
80 ULONG streamid;
81 ULONG buffer;
82 ULONG bufsize;
83 } midiread;
84 struct {
85 ULONG param1;
86 ULONG param2;
87 ULONG param3;
88 ULONG param4;
89 ULONG fileid;
90 };
91 };
92} IDC32_PACKET, NEAR *PIDC32_PACKET;
93
94typedef struct
95{
96 union {
97 struct {
98 ULONG devid;
99 ULONG pResource; //16:16 resource structure pointer
100 } finddev;
101 struct {
102 ULONG irqnr;
103 } irq;
104 struct {
105 ULONG size;
106 } malloc;
107 struct {
108 ULONG addr; //16:16 address returned by malloc at start of memory block
109 } free;
110 struct {
111 ULONG type;
112 ULONG streamid;
113 } process;
114 struct {
115 ULONG param1;
116 ULONG param2;
117 };
118 };
119} IDC16_PACKET;
120
121//IDC commands (16->32 bits)
122#define IDC32_INIT 0
123#define IDC32_EXIT 1
124#define IDC32_IRQ 2
125#define IDC32_STREAM_OPEN 3
126#define IDC32_STREAM_CLOSE 4
127#define IDC32_STREAM_ADDBUFFER 5
128#define IDC32_STREAM_START 6
129#define IDC32_STREAM_STOP 7
130#define IDC32_STREAM_RESET 8
131#define IDC32_STREAM_PAUSE 9
132#define IDC32_STREAM_IOCTL 10
133#define IDC32_STREAM_MIXER 11
134#define IDC32_MIDI_WRITE 12
135#define IDC32_MIDI_READ 13
136
137#define MIX_SETMASTERVOL 0
138#define MIX_SETWAVEVOL 1
139#define MIX_SETMIDIVOL 2
140#define MIX_SETINPUTSRC 3
141#define MIX_SETINPUTGAIN 4
142#define MIX_SETLINEINVOL 5
143#define MIX_SETLINEINMUTE 6
144#define MIX_SETMICVOL 7
145#define MIX_SETMICMUTE 8
146#define MIX_SETCDVOL 9
147#define MIX_SETCDMUTE 10
148#define MIX_SETSPDIFVOL 11
149#define MIX_SETSPDIFMUTE 12
150#define MIX_SETBASS 13
151#define MIX_SETTREBLE 14
152#define MIX_SETVIDEOVOL 15
153#define MIX_SETVIDEOMUTE 16
154#define MIX_SETAUXVOL 17
155#define MIX_SETAUXMUTE 18
156
157#define MAKE_VOLUME_LR(l, r) ((r << 8) | l)
158
159#define MIX_RECSRC_MIC 0
160#define MIX_RECSRC_CD 1
161#define MIX_RECSRC_LINE 2
162#define MIX_RECSRC_VIDEO 3
163#define MIX_RECSRC_MIXER 4
164#define MIX_RECSRC_AUX 5
165
166#define IDC16_INIT 0
167#define IDC16_EXIT 1
168#define IDC16_SETIRQ 2
169#define IDC16_FREEIRQ 3
170#define IDC16_WAVEOUT_BUFFER_DONE 4
171#define IDC16_WAVEIN_BUFFER_DONE 5
172#define IDC16_FIND_PCIDEVICE 6
173#define IDC16_FIND_PNPDEVICE 7
174#define IDC16_MALLOC 8
175#define IDC16_FREE 9
176#define IDC16_VMALLOC 10
177#define IDC16_VMFREE 11
178#define IDC16_PROCESS 12
179
180#define IDC16_WAVEIN_IRQ 0
181#define IDC16_WAVEOUT_IRQ 1
182#define IDC16_MIDI_IRQ 2
183
184#define MAX_RES_IRQ 2
185#define MAX_RES_DMA 2
186#define MAX_RES_IO 8
187#define MAX_RES_MEM 4
188
189#define SOUND_MIXER_VOLUME 0
190#define SOUND_MIXER_BASS 1
191#define SOUND_MIXER_TREBLE 2
192#define SOUND_MIXER_SYNTH 3
193#define SOUND_MIXER_PCM 4
194#define SOUND_MIXER_SPEAKER 5
195#define SOUND_MIXER_LINE 6
196#define SOUND_MIXER_MIC 7
197#define SOUND_MIXER_CD 8
198#define SOUND_MIXER_IMIX 9 /* Recording monitor */
199#define SOUND_MIXER_ALTPCM 10
200#define SOUND_MIXER_RECLEV 11 /* Recording level */
201#define SOUND_MIXER_IGAIN 12 /* Input gain */
202#define SOUND_MIXER_OGAIN 13 /* Output gain */
203#define SOUND_MIXER_LINE1 14 /* Input source 1 (aux1) */
204#define SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */
205#define SOUND_MIXER_LINE3 16 /* Input source 3 (line) */
206#define SOUND_MIXER_DIGITAL1 17 /* Digital (input) 1 */
207#define SOUND_MIXER_DIGITAL2 18 /* Digital (input) 2 */
208#define SOUND_MIXER_DIGITAL3 19 /* Digital (input) 3 */
209#define SOUND_MIXER_PHONEIN 20 /* Phone input */
210#define SOUND_MIXER_PHONEOUT 21 /* Phone output */
211#define SOUND_MIXER_VIDEO 22 /* Video/TV (audio) in */
212#define SOUND_MIXER_RADIO 23 /* Radio in */
213#define SOUND_MIXER_MONITOR 24 /* Monitor (usually mic) volume */
214#define SOUND_MIXER_NRDEVICES 25
215
216typedef struct
217{
218 USHORT irq[MAX_RES_IRQ];
219 USHORT dma[MAX_RES_DMA];
220 USHORT io[MAX_RES_IO];
221 USHORT iolength[MAX_RES_IO];
222 ULONG mem[MAX_RES_MEM];
223 ULONG memlength[MAX_RES_MEM];
224} IDC_RESOURCE;
225
226typedef struct {
227 ULONG ulSampleRate;
228 ULONG ulBitsPerSample;
229 ULONG ulNumChannels;
230 ULONG ulDataType;
231} FORMAT_INFO;
232
233#define IOCTL_SETFORMAT 0
234#define IOCTL_GETPOS 1
235#define IOCTL_SETFRAGMENT 2
236
237#ifdef __cplusplus
238extern "C" {
239#endif
240
241//32 bits IDC procedures
242//16 bits pdd calls this during init. OSS_InitDriver calls init_module
243BOOL OSS32_InitDriver();
244void OSS32_RemoveDriver();
245BOOL OSS32_SetIrq(int irq, ULONG handler);
246BOOL OSS32_FreeIrq(int irq);
247
248ULONG OSS32_StreamOpen(ULONG streamtype);
249ULONG OSS32_StreamClose(ULONG streamtype, ULONG streamid);
250ULONG OSS32_StreamTrigger(ULONG streamtype, ULONG streamid, ULONG __near *fStart);
251ULONG OSS32_StreamReset(ULONG streamtype, ULONG streamid);
252ULONG OSS32_StreamIOCtl(ULONG streamtype, ULONG streamid, ULONG cmd, char __near *buffer);
253ULONG OSS32_StreamSetFormat(ULONG streamtype, ULONG streamid, ULONG cmd, FORMAT_INFO __near *pFormatInfo);
254ULONG OSS32_StreamAddBuffer(ULONG streamtype, ULONG streamid, ULONG buffer, ULONG size);
255ULONG OSS32_SetVolume(ULONG streamtype, ULONG streamid, ULONG cmd, ULONG volume);
256ULONG OSS32_StreamMidiWrite(ULONG streamid, ULONG midiByte);
257ULONG OSS32_StreamMidiRead(ULONG streamid, char NEAR *buffer, ULONG bufsize);
258
259//Sets file id in current task structure
260ULONG OSS32_SetFileId(ULONG fileid);
261
262#ifdef TARGET_OS216
263BOOL OSS16_StartStream(STREAM *stream);
264BOOL OSS16_PauseStream(STREAM *stream);
265BOOL OSS16_StopStream(STREAM *stream);
266BOOL OSS16_StreamReset(STREAM *stream);
267BOOL OSS16_StreamSetFormat(STREAM *stream, ULONG param1);
268ULONG OSS16_StreamAddBuffer(STREAM *stream, ULONG buffer, ULONG size);
269BOOL OSS16_StreamGetPos(STREAM *stream, ULONG FAR *pos);
270BOOL OSS16_SetMasterVol(STREAM *stream, ULONG volume);
271BOOL OSS16_SetWaveOutVol(STREAM *stream, ULONG volume);
272BOOL OSS16_SetVolume(STREAM *stream, USHORT line, ULONG volume);
273BOOL OSS16_SetGlobalVol(ULONG ulSysFileNum, USHORT line, ULONG volume);
274BOOL OSS16_StreamSetFragment(STREAM *stream, ULONG fragsize);
275BOOL OSS16_AttachToPdd();
276void OSS16_DetachFromPdd();
277ULONG OSS16_OpenStream(STREAM *stream);
278void OSS16_CloseStream(STREAM *stream);
279typedef enum {
280 MIDI_RECEIVE = 0,
281 MIDI_SEND
282} MIDITYPE;
283ULONG OSS16_OpenMidiStream(MIDITYPE midiType);
284void OSS16_CloseMidiStream(MIDITYPE midiType, ULONG streamid);
285BOOL OSS16_WriteMidiByte(ULONG streamid, BYTE midiByte);
286int OSS16_ReadMidiBytes(ULONG streamid, char far *buffer, int bufsize);
287
288#endif //TARGET_OS216
289
290//16 bits IDC procedures
291BOOL CallOSS16(ULONG cmd, ULONG param1, ULONG param2);
292
293//Used to call into the 32 bits OSS driver
294ULONG CallOSS32(USHORT cmd, ULONG fileid, ULONG param1, ULONG param2, ULONG param3, ULONG param4);
295
296#ifdef __cplusplus
297}
298#endif
299
300#endif
Note: See TracBrowser for help on using the repository browser.