35 #if defined(__cplusplus)
36 #define EXTERNC extern "C"
38 #define EXTERNC extern
49 #define SOUND_VERSION 0x039999
50 #define OPEN_SOUND_SYSTEM
52 #if defined(__hpux) && !defined(_HPUX_SOURCE)
53 # error "-D_HPUX_SOURCE must be used when compiling OSS applications"
57 #include <sys/ioctl.h>
62 #include <linux/ioctl.h>
65 # include <sys/ioccom.h>
67 # include <sys/ioctl.h>
75 #define SNDCARD_ADLIB 1
79 #define SNDCARD_MPU401 5
80 #define SNDCARD_SB16 6
81 #define SNDCARD_SB16MIDI 7
82 #define SNDCARD_UART6850 8
83 #define SNDCARD_GUS16 9
84 #define SNDCARD_MSS 10
85 #define SNDCARD_PSS 11
86 #define SNDCARD_SSCAPE 12
87 #define SNDCARD_PSS_MPU 13
88 #define SNDCARD_PSS_MSS 14
89 #define SNDCARD_SSCAPE_MSS 15
90 #define SNDCARD_TRXPRO 16
91 #define SNDCARD_TRXPRO_SB 17
92 #define SNDCARD_TRXPRO_MPU 18
93 #define SNDCARD_MAD16 19
94 #define SNDCARD_MAD16_MPU 20
95 #define SNDCARD_CS4232 21
96 #define SNDCARD_CS4232_MPU 22
97 #define SNDCARD_MAUI 23
98 #define SNDCARD_PSEUDO_MSS 24
99 #define SNDCARD_GUSPNP 25
100 #define SNDCARD_UART401 26
108 #if defined(__hpux) || (defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__INCioctlh) && !defined(__Lynx__))))
114 #define SIOCPARM_MASK IOCPARM_MASK
115 #define SIOC_VOID IOC_VOID
116 #define SIOC_OUT IOC_OUT
117 #define SIOC_IN IOC_IN
118 #define SIOC_INOUT IOC_INOUT
119 #define __SIOC_SIZE _IOC_SIZE
120 #define __SIOC_DIR _IOC_DIR
121 #define __SIOC_NONE _IOC_NONE
122 #define __SIOC_READ _IOC_READ
123 #define __SIOC_WRITE _IOC_WRITE
127 #define __SIOWR _IOWR
137 #define SIOCPARM_MASK 0x1fff
138 #define SIOC_VOID 0x00000000
139 #define SIOC_OUT 0x20000000
140 #define SIOC_IN 0x40000000
141 #define SIOC_INOUT (SIOC_IN|SIOC_OUT)
144 #define __SIO(x,y) ((int)(SIOC_VOID|(x<<8)|y))
145 #define __SIOR(x,y,t) ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
146 #define __SIOW(x,y,t) ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
147 #define __SIOWR(x,y,t) ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
148 #define __SIOC_SIZE(x) ((x>>16)&SIOCPARM_MASK)
149 #define __SIOC_DIR(x) (x & 0xf0000000)
150 #define __SIOC_NONE SIOC_VOID
151 #define __SIOC_READ SIOC_OUT
152 #define __SIOC_WRITE SIOC_IN
156 #define SNDCTL_SEQ_RESET __SIO ('Q', 0)
157 #define SNDCTL_SEQ_SYNC __SIO ('Q', 1)
158 #define SNDCTL_SYNTH_INFO __SIOWR('Q', 2, struct synth_info)
159 #define SNDCTL_SEQ_CTRLRATE __SIOWR('Q', 3, int)
160 #define SNDCTL_SEQ_GETOUTCOUNT __SIOR ('Q', 4, int)
161 #define SNDCTL_SEQ_GETINCOUNT __SIOR ('Q', 5, int)
162 #define SNDCTL_SEQ_PERCMODE __SIOW ('Q', 6, int)
163 #define SNDCTL_FM_LOAD_INSTR __SIOW ('Q', 7, struct sbi_instrument)
164 #define SNDCTL_SEQ_TESTMIDI __SIOW ('Q', 8, int)
165 #define SNDCTL_SEQ_RESETSAMPLES __SIOW ('Q', 9, int)
166 #define SNDCTL_SEQ_NRSYNTHS __SIOR ('Q',10, int)
167 #define SNDCTL_SEQ_NRMIDIS __SIOR ('Q',11, int)
168 #define SNDCTL_MIDI_INFO __SIOWR('Q',12, struct midi_info)
169 #define SNDCTL_SEQ_THRESHOLD __SIOW ('Q',13, int)
170 #define SNDCTL_SYNTH_MEMAVL __SIOWR('Q',14, int)
171 #define SNDCTL_FM_4OP_ENABLE __SIOW ('Q',15, int)
172 #define SNDCTL_SEQ_PANIC __SIO ('Q',17)
173 #define SNDCTL_SEQ_OUTOFBAND __SIOW ('Q',18, struct seq_event_rec)
174 #define SNDCTL_SEQ_GETTIME __SIOR ('Q',19, int)
175 #define SNDCTL_SYNTH_ID __SIOWR('Q',20, struct synth_info)
176 #define SNDCTL_SYNTH_CONTROL __SIOWR('Q',21, struct synth_control)
177 #define SNDCTL_SYNTH_REMOVESAMPLE __SIOWR('Q',22, struct remove_sample)
178 #define SNDCTL_SEQ_TIMING_ENABLE __SIO ('Q', 23)
179 #define SNDCTL_SEQ_ACTSENSE_ENABLE __SIO ('Q', 24)
180 #define SNDCTL_SEQ_RT_ENABLE __SIO ('Q', 25)
200 #define SNDCTL_TMR_TIMEBASE __SIOWR('T', 1, int)
201 #define SNDCTL_TMR_START __SIO ('T', 2)
202 #define SNDCTL_TMR_STOP __SIO ('T', 3)
203 #define SNDCTL_TMR_CONTINUE __SIO ('T', 4)
204 #define SNDCTL_TMR_TEMPO __SIOWR('T', 5, int)
205 #define SNDCTL_TMR_SOURCE __SIOWR('T', 6, int)
206 # define TMR_INTERNAL 0x00000001
207 # define TMR_EXTERNAL 0x00000002
208 # define TMR_MODE_MIDI 0x00000010
209 # define TMR_MODE_FSK 0x00000020
210 # define TMR_MODE_CLS 0x00000040
211 # define TMR_MODE_SMPTE 0x00000080
212 #define SNDCTL_TMR_METRONOME __SIOW ('T', 7, int)
213 #define SNDCTL_TMR_SELECT __SIOW ('T', 8, int)
220 #if defined(_AIX) || defined(AIX) || defined(sparc) || defined(__hppa) || defined(PPC) || defined(__powerpc__) && !defined(i386) && !defined(__i386) && !defined(__i386__)
223 # define _PATCHKEY(id) (0xfd00|id)
224 # define AFMT_S16_NE AFMT_S16_BE
225 # define AFMT_U16_NE AFMT_U16_BE
226 # define AFMT_S32_NE AFMT_S32_BE
227 # define AFMT_S24_NE AFMT_S24_BE
228 # define AFMT_S16_OE AFMT_S16_LE
229 # define AFMT_S32_OE AFMT_S32_LE
230 # define AFMT_S24_OE AFMT_S24_LE
232 # define _PATCHKEY(id) ((id<<8)|0xfd)
233 # define AFMT_S16_NE AFMT_S16_LE
234 # define AFMT_U16_NE AFMT_U16_LE
235 # define AFMT_S32_NE AFMT_S32_LE
236 # define AFMT_S24_NE AFMT_S24_LE
237 # define AFMT_S16_OE AFMT_S16_BE
238 # define AFMT_S32_OE AFMT_S32_BE
239 # define AFMT_S24_OE AFMT_S24_BE
252 #define WAVE_PATCH _PATCHKEY(0x04)
253 #define GUS_PATCH WAVE_PATCH
254 #define WAVEFRONT_PATCH _PATCHKEY(0x06)
264 #define WAVE_16_BITS 0x01
265 #define WAVE_UNSIGNED 0x02
266 #define WAVE_LOOPING 0x04
267 #define WAVE_BIDIR_LOOP 0x08
268 #define WAVE_LOOP_BACK 0x10
269 #define WAVE_SUSTAIN_ON 0x20
270 #define WAVE_ENVELOPES 0x40
271 #define WAVE_FAST_RELEASE 0x80
274 #define WAVE_VIBRATO 0x00010000
275 #define WAVE_TREMOLO 0x00020000
276 #define WAVE_SCALE 0x00040000
277 #define WAVE_FRACTIONS 0x00080000
279 #define WAVE_ROM 0x40000000
280 #define WAVE_MULAW 0x20000000
342 #define SYSEX_PATCH _PATCHKEY(0x05)
343 #define MAUI_PATCH _PATCHKEY(0x06)
373 #define SEQ_NOTEOFF 0
374 #define SEQ_FMNOTEOFF SEQ_NOTEOFF
376 #define SEQ_FMNOTEON SEQ_NOTEON
377 #define SEQ_WAIT TMR_WAIT_ABS
378 #define SEQ_PGMCHANGE 3
379 #define SEQ_FMPGMCHANGE SEQ_PGMCHANGE
380 #define SEQ_SYNCTIMER TMR_START
381 #define SEQ_MIDIPUTC 5
383 #define SEQ_DRUMOFF 7
384 #define SEQ_ECHO TMR_ECHO
385 #define SEQ_AFTERTOUCH 9
386 #define SEQ_CONTROLLER 10
387 #define SEQ_BALANCE 11
388 #define SEQ_VOLMODE 12
403 #define CTL_BANK_SELECT 0x00
404 #define CTL_MODWHEEL 0x01
405 #define CTL_BREATH 0x02
407 #define CTL_FOOT 0x04
408 #define CTL_PORTAMENTO_TIME 0x05
409 #define CTL_DATA_ENTRY 0x06
410 #define CTL_MAIN_VOLUME 0x07
411 #define CTL_BALANCE 0x08
414 #define CTL_EXPRESSION 0x0b
419 #define CTL_GENERAL_PURPOSE1 0x10
420 #define CTL_GENERAL_PURPOSE2 0x11
421 #define CTL_GENERAL_PURPOSE3 0x12
422 #define CTL_GENERAL_PURPOSE4 0x13
432 #define CTL_DAMPER_PEDAL 0x40
433 #define CTL_SUSTAIN 0x40
434 #define CTL_HOLD 0x40
435 #define CTL_PORTAMENTO 0x41
436 #define CTL_SOSTENUTO 0x42
437 #define CTL_SOFT_PEDAL 0x43
439 #define CTL_HOLD2 0x45
442 #define CTL_GENERAL_PURPOSE5 0x50
443 #define CTL_GENERAL_PURPOSE6 0x51
444 #define CTL_GENERAL_PURPOSE7 0x52
445 #define CTL_GENERAL_PURPOSE8 0x53
447 #define CTL_EXT_EFF_DEPTH 0x5b
448 #define CTL_TREMOLO_DEPTH 0x5c
449 #define CTL_CHORUS_DEPTH 0x5d
450 #define CTL_DETUNE_DEPTH 0x5e
451 #define CTL_CELESTE_DEPTH 0x5e
452 #define CTL_PHASER_DEPTH 0x5f
453 #define CTL_DATA_INCREMENT 0x60
454 #define CTL_DATA_DECREMENT 0x61
455 #define CTL_NONREG_PARM_NUM_LSB 0x62
456 #define CTL_NONREG_PARM_NUM_MSB 0x63
457 #define CTL_REGIST_PARM_NUM_LSB 0x64
458 #define CTL_REGIST_PARM_NUM_MSB 0x65
463 #define CTRL_PITCH_BENDER 255
464 #define CTRL_PITCH_BENDER_RANGE 254
465 #define CTRL_EXPRESSION 253
466 #define CTRL_MAIN_VOLUME 252
472 #define VOL_METHOD_ADAGIO 1
473 #define VOL_METHOD_LINEAR 2
484 #define SEQ_FULLSIZE 0xfd
505 #define SEQ_PRIVATE 0xfe
506 #define SEQ_EXTENDED 0xff
517 #define FM_PATCH _PATCHKEY(0x01)
518 #define OPL3_PATCH _PATCHKEY(0x03)
529 #define SYNTH_TYPE_FM 0
530 #define SYNTH_TYPE_SAMPLE 1
531 #define SYNTH_TYPE_MIDI 2
534 #define FM_TYPE_ADLIB 0x00
535 #define FM_TYPE_OPL3 0x01
536 #define MIDI_TYPE_MPU401 0x401
538 #define SAMPLE_TYPE_BASIC 0x10
539 #define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC
540 #define SAMPLE_TYPE_WAVEFRONT 0x11
547 #define SYNTH_CAP_PERCMODE 0x00000001
548 #define SYNTH_CAP_OPL3 0x00000002
549 #define SYNTH_CAP_INPUT 0x00000004
559 #define MIDI_CAP_MPU401 1
580 #define SNDCTL_MIDI_PRETIME __SIOWR('m', 0, int)
581 #define SNDCTL_MIDI_MPUMODE __SIOWR('m', 1, int)
582 #define SNDCTL_MIDI_MPUCMD __SIOWR('m', 2, mpu_command_rec)
588 #define SNDCTL_DSP_RESET __SIO ('P', 0)
589 #define SNDCTL_DSP_SYNC __SIO ('P', 1)
590 #define SNDCTL_DSP_SPEED __SIOWR('P', 2, int)
591 #define SNDCTL_DSP_STEREO __SIOWR('P', 3, int)
592 #define SNDCTL_DSP_GETBLKSIZE __SIOWR('P', 4, int)
593 #define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT
594 #define SNDCTL_DSP_CHANNELS __SIOWR('P', 6, int)
595 #define SNDCTL_DSP_POST __SIO ('P', 8)
596 #define SNDCTL_DSP_SUBDIVIDE __SIOWR('P', 9, int)
597 #define SNDCTL_DSP_SETFRAGMENT __SIOWR('P',10, int)
600 #define SNDCTL_DSP_GETFMTS __SIOR ('P',11, int)
601 #define SNDCTL_DSP_SETFMT __SIOWR('P',5, int)
602 # define AFMT_QUERY 0x00000000
603 # define AFMT_MU_LAW 0x00000001
604 # define AFMT_A_LAW 0x00000002
605 # define AFMT_IMA_ADPCM 0x00000004
606 # define AFMT_U8 0x00000008
607 # define AFMT_S16_LE 0x00000010
608 # define AFMT_S16_BE 0x00000020
609 # define AFMT_S8 0x00000040
610 # define AFMT_U16_LE 0x00000080
611 # define AFMT_U16_BE 0x00000100
612 # define AFMT_MPEG 0x00000200
615 # define AFMT_AC3 0x00000400
617 # define AFMT_VORBIS 0x00000800
620 # define AFMT_S32_LE 0x00001000
621 # define AFMT_S32_BE 0x00002000
624 # define AFMT_FLOAT 0x00004000
627 # define AFMT_S24_LE 0x00008000
628 # define AFMT_S24_BE 0x00010000
637 # define AFMT_SPDIF_RAW 0x00020000
640 # define AFMT_S24_PACKED 0x00040000
654 #define SNDCTL_DSP_GETOSPACE __SIOR ('P',12, audio_buf_info)
655 #define SNDCTL_DSP_GETISPACE __SIOR ('P',13, audio_buf_info)
656 #define SNDCTL_DSP_NONBLOCK __SIO ('P',14)
657 #define SNDCTL_DSP_GETCAPS __SIOR ('P',15, int)
658 # define DSP_CAP_REVISION 0x000000ff
659 # define DSP_CAP_DUPLEX 0x00000100
660 # define DSP_CAP_REALTIME 0x00000200
661 # define DSP_CAP_BATCH 0x00000400
665 # define DSP_CAP_COPROC 0x00000800
668 # define DSP_CAP_TRIGGER 0x00001000
669 # define DSP_CAP_MMAP 0x00002000
670 # define DSP_CAP_MULTI 0x00004000
671 # define DSP_CAP_BIND 0x00008000
672 # define DSP_CAP_INPUT 0x00010000
673 # define DSP_CAP_OUTPUT 0x00020000
674 # define DSP_CAP_VIRTUAL 0x00040000
678 # define DSP_CAP_ANALOGOUT 0x00100000
679 # define DSP_CAP_ANALOGIN 0x00200000
680 # define DSP_CAP_DIGITALOUT 0x00400000
681 # define DSP_CAP_DIGITALIN 0x00800000
682 # define DSP_CAP_ADMASK 0x00f00000
690 # define DSP_CAP_SHADOW 0x01000000
705 # define DSP_CH_MASK 0x06000000
706 # define DSP_CH_ANY 0x00000000
707 # define DSP_CH_MONO 0x02000000
708 # define DSP_CH_STEREO 0x04000000
709 # define DSP_CH_MULTI 0x06000000
711 # define DSP_CAP_SLAVE 0x08000000
712 # define DSP_CAP_FREERATE 0x10000000
714 #define SNDCTL_DSP_GETTRIGGER __SIOR ('P',16, int)
715 #define SNDCTL_DSP_SETTRIGGER __SIOW ('P',16, int)
716 # define PCM_ENABLE_INPUT 0x00000001
717 # define PCM_ENABLE_OUTPUT 0x00000002
726 #define SNDCTL_DSP_GETIPTR __SIOR ('P',17, count_info)
727 #define SNDCTL_DSP_GETOPTR __SIOR ('P',18, count_info)
734 #define SNDCTL_DSP_MAPINBUF __SIOR ('P', 19, buffmem_desc)
735 #define SNDCTL_DSP_MAPOUTBUF __SIOR ('P', 20, buffmem_desc)
736 #define SNDCTL_DSP_SETSYNCRO __SIO ('P', 21)
737 #define SNDCTL_DSP_SETDUPLEX __SIO ('P', 22)
751 #define SNDCTL_DSP_PROFILE __SIOW ('P', 23, int)
753 #define APF_NETWORK 1
754 #define APF_CPUINTENS 2
756 #define SNDCTL_DSP_GETODELAY __SIOR ('P', 23, int)
757 #define SNDCTL_DSP_GETOUTVOL __SIOR ('P', 24, int)
758 #define SNDCTL_DSP_SETOUTVOL __SIOWR('P', 24, int)
775 #define SNDCTL_DSP_GETERROR __SIOR ('P', 25, audio_errinfo)
780 #define DIG_CBITIN_NONE 0x00000000
781 #define DIG_CBITIN_LIMITED 0x00000001
782 #define DIG_CBITIN_DATA 0x00000002
783 #define DIG_CBITIN_BYTE0 0x00000004
784 #define DIG_CBITIN_FULL 0x00000008
785 #define DIG_CBITIN_MASK 0x0000000f
786 #define DIG_CBITOUT_NONE 0x00000000
787 #define DIG_CBITOUT_LIMITED 0x00000010
788 #define DIG_CBITOUT_BYTE0 0x00000020
789 #define DIG_CBITOUT_FULL 0x00000040
790 #define DIG_CBITOUT_DATA 0x00000080
791 #define DIG_CBITOUT_MASK 0x000000f0
792 #define DIG_UBITIN 0x00000100
793 #define DIG_UBITOUT 0x00000200
794 #define DIG_VBITOUT 0x00000400
795 #define DIG_OUTRATE 0x00000800
796 #define DIG_INRATE 0x00001000
797 #define DIG_INBITS 0x00002000
798 #define DIG_OUTBITS 0x00004000
799 #define DIG_EXACT 0x00010000
800 #define DIG_PRO 0x00020000
801 #define DIG_CONSUMER 0x00040000
802 #define DIG_PASSTHROUGH 0x00080000
803 #define DIG_OUTSEL 0x00100000
806 #define VAL_CBITIN 0x00000001
807 #define VAL_UBITIN 0x00000002
808 #define VAL_CBITOUT 0x00000004
809 #define VAL_UBITOUT 0x00000008
810 #define VAL_ISTATUS 0x00000010
811 #define VAL_IRATE 0x00000020
812 #define VAL_ORATE 0x00000040
813 #define VAL_INBITS 0x00000080
814 #define VAL_OUTBITS 0x00000100
815 #define VAL_REQUEST 0x00000200
816 #define VAL_OUTSEL 0x00000400
818 #define VAL_OUTMASK (VAL_CBITOUT|VAL_UBITOUT|VAL_ORATE|VAL_OUTBITS|VAL_OUTSEL)
821 #define SPD_RQ_PASSTHROUGH 1
829 #define OUTSEL_DIGITAL 1
830 #define OUTSEL_ANALOG 2
831 #define OUTSEL_BOTH (OUTSEL_DIGITAL|OUTSEL_ANALOG)
834 #define IND_UNKNOWN 0
839 #define LOCK_NOT_INDICATED 0
840 #define LOCK_UNLOCKED 1
841 #define LOCK_LOCKED 2
844 #define IN_QUAL_NOT_INDICATED 0
845 #define IN_QUAL_POOR 1
846 #define IN_QUAL_GOOD 2
849 #define VBIT_NOT_INDICATED 0
854 #define INERR_CRC 0x0001
855 #define INERR_QCODE_CRC 0x0002
856 #define INERR_PARITY 0x0004
857 #define INERR_BIPHASE 0x0008
865 #define SNDCTL_DSP_READCTL __SIOWR('P', 26, oss_digital_control)
866 #define SNDCTL_DSP_WRITECTL __SIOWR('P', 27, oss_digital_control)
875 #define SNDCTL_DSP_SYNCGROUP __SIOWR('P', 28, oss_syncgroup)
876 #define SNDCTL_DSP_SYNCSTART __SIOW ('P', 29, int)
891 #define SNDCTL_DSP_COOKEDMODE __SIOW ('P', 30, int)
898 #define SNDCTL_DSP_SILENCE __SIO ('P', 31)
899 #define SNDCTL_DSP_SKIP __SIO ('P', 32)
900 #define SNDCTL_DSP_RESET_INPUT __SIO ('P', 33)
901 #define SNDCTL_DSP_RESET_OUTPUT __SIO ('P', 34)
902 #define SNDCTL_DSP_LOW_WATER __SIOW ('P', 34, int)
904 #ifndef OSS_NO_LONG_LONG
912 #define SNDCTL_DSP_CURRENT_IPTR __SIOR ('P', 35, oss_count_t)
913 #define SNDCTL_DSP_CURRENT_OPTR __SIOR ('P', 36, oss_count_t)
916 #define SNDCTL_DSP_GET_RECSRC_NAMES __SIOR ('P', 37, oss_mixer_enuminfo)
917 #define SNDCTL_DSP_GET_RECSRC __SIOR ('P', 38, int)
918 #define SNDCTL_DSP_SET_RECSRC __SIOWR('P', 38, int)
920 #define SNDCTL_DSP_GET_PLAYTGT_NAMES __SIOR ('P', 39, oss_mixer_enuminfo)
921 #define SNDCTL_DSP_GET_PLAYTGT __SIOR ('P', 40, int)
922 #define SNDCTL_DSP_SET_PLAYTGT __SIOWR('P', 40, int)
924 #define SNDCTL_DSP_GETCHANNELMASK __SIOWR('P', 64, int)
925 #define SNDCTL_DSP_BIND_CHANNEL __SIOWR('P', 65, int)
926 # define DSP_BIND_QUERY 0x00000000
927 # define DSP_BIND_FRONT 0x00000001
928 # define DSP_BIND_SURR 0x00000002
929 # define DSP_BIND_CENTER_LFE 0x00000004
930 # define DSP_BIND_HANDSET 0x00000008
931 # define DSP_BIND_MIC 0x00000010
932 # define DSP_BIND_MODEM1 0x00000020
933 # define DSP_BIND_MODEM2 0x00000040
934 # define DSP_BIND_I2S 0x00000080
935 # define DSP_BIND_SPDIF 0x00000100
936 # define DSP_BIND_REAR 0x00000200
951 #define SOUND_MIXER_NRDEVICES 28
952 #define SOUND_MIXER_VOLUME 0
953 #define SOUND_MIXER_BASS 1
954 #define SOUND_MIXER_TREBLE 2
955 #define SOUND_MIXER_SYNTH 3
956 #define SOUND_MIXER_PCM 4
957 #define SOUND_MIXER_SPEAKER 5
958 #define SOUND_MIXER_LINE 6
959 #define SOUND_MIXER_MIC 7
960 #define SOUND_MIXER_CD 8
961 #define SOUND_MIXER_IMIX 9
962 #define SOUND_MIXER_ALTPCM 10
963 #define SOUND_MIXER_RECLEV 11
964 #define SOUND_MIXER_IGAIN 12
965 #define SOUND_MIXER_OGAIN 13
972 #define SOUND_MIXER_LINE1 14
973 #define SOUND_MIXER_LINE2 15
974 #define SOUND_MIXER_LINE3 16
975 #define SOUND_MIXER_DIGITAL1 17
976 #define SOUND_MIXER_DIGITAL2 18
977 #define SOUND_MIXER_DIGITAL3 19
978 #define SOUND_MIXER_PHONE 20
979 #define SOUND_MIXER_MONO 21
980 #define SOUND_MIXER_VIDEO 22
981 #define SOUND_MIXER_RADIO 23
982 #define SOUND_MIXER_DEPTH 24
983 #define SOUND_MIXER_REARVOL 25
984 #define SOUND_MIXER_CENTERVOL 26
985 #define SOUND_MIXER_SURRVOL 27
989 #define SOUND_ONOFF_MIN 28
990 #define SOUND_ONOFF_MAX 30
993 #define SOUND_MIXER_NONE 31
999 #define SOUND_MIXER_ENHANCE SOUND_MIXER_NONE
1000 #define SOUND_MIXER_MUTE SOUND_MIXER_NONE
1001 #define SOUND_MIXER_LOUD SOUND_MIXER_NONE
1003 #define SOUND_DEVICE_LABELS \
1004 {"Vol ", "Bass ", "Treble", "Synth", "Pcm ", "Speaker ", "Line ", \
1005 "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \
1006 "Aux1", "Aux2", "Aux3", "Digital1", "Digital2", "Digital3", \
1007 "Phone", "Mono", "Video", "Radio", "Depth", \
1008 "Rear", "Center", "Surround"}
1010 #define SOUND_DEVICE_NAMES \
1011 {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
1012 "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
1013 "aux1", "aux2", "aux3", "dig1", "dig2", "dig3", \
1014 "phone", "mono", "video", "radio", "depth", \
1015 "rear", "center", "surround"}
1019 #define SOUND_MIXER_RECSRC 0xff
1020 #define SOUND_MIXER_DEVMASK 0xfe
1021 #define SOUND_MIXER_RECMASK 0xfd
1022 #define SOUND_MIXER_CAPS 0xfc
1023 # define SOUND_CAP_EXCL_INPUT 0x00000001
1024 # define SOUND_CAP_LAYOUT_B 0x00000002
1025 # define SOUND_CAP_NOLEGACY 0x00000004
1026 # define SOUND_CAP_NORECSRC 0x00000008
1027 #define SOUND_MIXER_STEREODEVS 0xfb
1030 #define SOUND_MIXER_OUTSRC 0xfa
1031 #define SOUND_MIXER_OUTMASK 0xf9
1036 #define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME)
1037 #define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS)
1038 #define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE)
1039 #define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH)
1040 #define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM)
1041 #define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER)
1042 #define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE)
1043 #define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC)
1044 #define SOUND_MASK_CD (1 << SOUND_MIXER_CD)
1045 #define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX)
1046 #define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM)
1047 #define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV)
1048 #define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN)
1049 #define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN)
1050 #define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1)
1051 #define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2)
1052 #define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3)
1053 #define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1)
1054 #define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2)
1055 #define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3)
1056 #define SOUND_MASK_MONO (1 << SOUND_MIXER_MONO)
1057 #define SOUND_MASK_PHONE (1 << SOUND_MIXER_PHONE)
1058 #define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO)
1059 #define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO)
1060 #define SOUND_MASK_DEPTH (1 << SOUND_MIXER_DEPTH)
1061 #define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR)
1062 #define SOUND_MASK_REARVOL (1 << SOUND_MIXER_REARVOL)
1063 #define SOUND_MASK_CENTERVOL (1 << SOUND_MIXER_CENTERVOL)
1064 #define SOUND_MASK_SURRVOL (1 << SOUND_MIXER_SURRVOL)
1067 #define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE)
1068 #define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE)
1069 #define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD)
1071 #define MIXER_READ(dev) __SIOR('M', dev, int)
1072 #define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
1073 #define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS)
1074 #define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE)
1075 #define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH)
1076 #define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM)
1077 #define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER)
1078 #define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE)
1079 #define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC)
1080 #define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD)
1081 #define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX)
1082 #define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM)
1083 #define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV)
1084 #define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN)
1085 #define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN)
1086 #define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1)
1087 #define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2)
1088 #define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3)
1091 #define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE)
1092 #define SOUND_MIXER_READ_ENHANCE MIXER_READ(SOUND_MIXER_ENHANCE)
1093 #define SOUND_MIXER_READ_LOUD MIXER_READ(SOUND_MIXER_LOUD)
1095 #define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC)
1096 #define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK)
1097 #define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK)
1098 #define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS)
1099 #define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS)
1101 #define MIXER_WRITE(dev) __SIOWR('M', dev, int)
1102 #define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME)
1103 #define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS)
1104 #define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE)
1105 #define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH)
1106 #define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM)
1107 #define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER)
1108 #define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE)
1109 #define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC)
1110 #define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD)
1111 #define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX)
1112 #define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM)
1113 #define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV)
1114 #define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN)
1115 #define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN)
1116 #define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1)
1117 #define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2)
1118 #define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3)
1121 #define SOUND_MIXER_WRITE_MUTE MIXER_WRITE(SOUND_MIXER_MUTE)
1122 #define SOUND_MIXER_WRITE_ENHANCE MIXER_WRITE(SOUND_MIXER_ENHANCE)
1123 #define SOUND_MIXER_WRITE_LOUD MIXER_WRITE(SOUND_MIXER_LOUD)
1125 #define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC)
1141 #define SOUND_MIXER_INFO __SIOR ('M', 101, mixer_info)
1142 #define SOUND_OLD_MIXER_INFO __SIOR ('M', 101, _old_mixer_info)
1152 #define SOUND_MIXER_ACCESS __SIOWR('M', 102, mixer_record)
1157 #define SOUND_MIXER_AGC _SIOWR('M', 103, int)
1158 #define SOUND_MIXER_3DSE _SIOWR('M', 104, int)
1163 #define SOUND_MIXER_PRIVATE1 __SIOWR('M', 111, int)
1164 #define SOUND_MIXER_PRIVATE2 __SIOWR('M', 112, int)
1165 #define SOUND_MIXER_PRIVATE3 __SIOWR('M', 113, int)
1166 #define SOUND_MIXER_PRIVATE4 __SIOWR('M', 114, int)
1167 #define SOUND_MIXER_PRIVATE5 __SIOWR('M', 115, int)
1184 #define SOUND_MIXER_GETLEVELS __SIOWR('M', 116, mixer_vol_table)
1185 #define SOUND_MIXER_SETLEVELS __SIOWR('M', 117, mixer_vol_table)
1193 #define OSS_GETVERSION __SIOR ('M', 118, int)
1203 #define SOUND_MIXER_READ_RECGAIN __SIOR ('M', 119, int)
1204 #define SOUND_MIXER_WRITE_RECGAIN __SIOWR('M', 119, int)
1205 #define SOUND_MIXER_READ_MONGAIN __SIOR ('M', 120, int)
1206 #define SOUND_MIXER_WRITE_MONGAIN __SIOWR('M', 120, int)
1212 #define SOUND_MIXER_RESERVED __SIOWR('M', 121, oss_reserved_t)
1217 #define SYSINFO_FILL_SIZE 256
1242 # define MIXT_DEVROOT 0
1243 # define MIXT_GROUP 1
1244 # define MIXT_ONOFF 2
1245 # define MIXT_ENUM 3
1246 # define MIXT_MONOSLIDER 4
1247 # define MIXT_STEREOSLIDER 5
1248 # define MIXT_MESSAGE 6
1249 # define MIXT_MONOVU 7
1250 # define MIXT_STEREOVU 8
1251 # define MIXT_MONOPEAK 9
1252 # define MIXT_STEREOPEAK 10
1253 # define MIXT_RADIOGROUP 11
1254 # define MIXT_MARKER 12
1255 # define MIXT_VALUE 13
1256 # define MIXT_HEXVALUE 14
1257 # define MIXT_MONODB 15
1258 # define MIXT_STEREODB 16
1259 # define MIXT_SLIDER 17
1268 # define MIXF_READABLE 0x00000001
1269 # define MIXF_WRITEABLE 0x00000002
1270 # define MIXF_POLL 0x00000004
1271 # define MIXF_HZ 0x00000008
1272 # define MIXF_STRING 0x00000010
1273 # define MIXF_DYNAMIC 0x00000010
1306 #define OSS_ENUM_MAXVALUE 255
1316 #define OPEN_READ PCM_ENABLE_INPUT
1317 #define OPEN_WRITE PCM_ENABLE_OUTPUT
1318 #define OPEN_READWRITE (OPEN_READ|OPEN_WRITE)
1345 #define OSS_SYSINFO __SIOR ('X', 1, oss_sysinfo)
1347 #define SNDCTL_MIX_NRMIX __SIOR ('X', 2, int)
1348 #define SNDCTL_MIX_NREXT __SIOWR('X', 3, int)
1349 #define SNDCTL_MIX_EXTINFO __SIOWR('X', 4, oss_mixext)
1350 #define SNDCTL_MIX_READ __SIOWR('X', 5, oss_mixer_value)
1351 #define SNDCTL_MIX_WRITE __SIOWR('X', 6, oss_mixer_value)
1353 #define SNDCTL_AUDIOINFO __SIOWR('X', 7, oss_audioinfo)
1354 #define SNDCTL_MIX_ENUMINFO __SIOWR('X', 8, oss_mixer_enuminfo)
1376 #define EV_SEQ_LOCAL 0x80
1377 #define EV_TIMING 0x81
1378 #define EV_CHN_COMMON 0x92
1379 #define EV_CHN_VOICE 0x93
1380 #define EV_SYSEX 0x94
1381 #define EV_SYSTEM 0x95
1391 #define MIDI_NOTEOFF 0x80
1392 #define MIDI_NOTEON 0x90
1393 #define MIDI_KEY_PRESSURE 0xA0
1399 #define MIDI_CTL_CHANGE 0xB0
1400 #define MIDI_PGM_CHANGE 0xC0
1401 #define MIDI_CHN_PRESSURE 0xD0
1402 #define MIDI_PITCH_BEND 0xE0
1404 #define MIDI_SYSTEM_PREFIX 0xF0
1409 #define TMR_WAIT_REL 1
1410 #define TMR_WAIT_ABS 2
1413 #define TMR_CONTINUE 5
1418 #define TMR_TIMESIG 11
1423 #define LOCL_STARTAUDIO 1
1424 #define LOCL_STARTAUDIO2 2
1425 #define LOCL_STARTAUDIO3 3
1426 #define LOCL_STARTAUDIO4 4
1428 #if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS)
1435 #define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
1445 unsigned char *buf,
int buflen);
1447 unsigned char *buf,
int buflen);
1451 #define SEQ_PM_DEFINES int __foo_bar___
1453 # define SEQ_USE_EXTBUF() \
1454 EXTERNC unsigned char *_seqbuf; \
1455 EXTERNC int _seqbuflen;EXTERNC int _seqbufptr
1456 # define SEQ_DEFINEBUF(len) SEQ_USE_EXTBUF();static int _requested_seqbuflen=len
1457 # define _SEQ_ADVBUF(len) OSS_seq_advbuf(len, seqfd, _seqbuf, _seqbuflen)
1458 # define _SEQ_NEEDBUF(len) OSS_seq_needbuf(len, seqfd, _seqbuf, _seqbuflen)
1459 # define SEQ_DUMPBUF() OSS_seqbuf_dump(seqfd, _seqbuf, _seqbuflen)
1461 # define SEQ_LOAD_GMINSTR(dev, instr) \
1462 OSS_patch_caching(dev, -1, instr, seqfd, _seqbuf, _seqbuflen)
1463 # define SEQ_LOAD_GMDRUM(dev, drum) \
1464 OSS_drum_caching(dev, -1, drum, seqfd, _seqbuf, _seqbuflen)
1467 # define SEQ_LOAD_GMINSTR(dev, instr)
1468 # define SEQ_LOAD_GMDRUM(dev, drum)
1470 # define SEQ_USE_EXTBUF() \
1471 EXTERNC unsigned char _seqbuf[]; \
1472 EXTERNC int _seqbuflen;EXTERNC int _seqbufptr
1474 #ifndef USE_SIMPLE_MACROS
1494 #define SEQ_DEFINEBUF(len) \
1495 unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
1496 #define _SEQ_NEEDBUF(len) \
1497 if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
1498 #define _SEQ_ADVBUF(len) _seqbufptr += len
1499 #define SEQ_DUMPBUF seqbuf_dump
1515 #define _SEQ_NEEDBUF(len)
1519 #define SEQ_VOLUME_MODE(dev, mode) \
1521 _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
1522 _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
1523 _seqbuf[_seqbufptr+2] = (dev);\
1524 _seqbuf[_seqbufptr+3] = (mode);\
1525 _seqbuf[_seqbufptr+4] = 0;\
1526 _seqbuf[_seqbufptr+5] = 0;\
1527 _seqbuf[_seqbufptr+6] = 0;\
1528 _seqbuf[_seqbufptr+7] = 0;\
1535 #define _CHN_VOICE(dev, event, chn, note, parm) \
1537 _seqbuf[_seqbufptr] = EV_CHN_VOICE;\
1538 _seqbuf[_seqbufptr+1] = (dev);\
1539 _seqbuf[_seqbufptr+2] = (event);\
1540 _seqbuf[_seqbufptr+3] = (chn);\
1541 _seqbuf[_seqbufptr+4] = (note);\
1542 _seqbuf[_seqbufptr+5] = (parm);\
1543 _seqbuf[_seqbufptr+6] = (0);\
1544 _seqbuf[_seqbufptr+7] = 0;\
1547 #define SEQ_START_NOTE(dev, chn, note, vol) \
1548 _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
1550 #define SEQ_STOP_NOTE(dev, chn, note, vol) \
1551 _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
1553 #define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \
1554 _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
1560 #define _CHN_COMMON(dev, event, chn, p1, p2, w14) \
1562 _seqbuf[_seqbufptr] = EV_CHN_COMMON;\
1563 _seqbuf[_seqbufptr+1] = (dev);\
1564 _seqbuf[_seqbufptr+2] = (event);\
1565 _seqbuf[_seqbufptr+3] = (chn);\
1566 _seqbuf[_seqbufptr+4] = (p1);\
1567 _seqbuf[_seqbufptr+5] = (p2);\
1568 *(short *)&_seqbuf[_seqbufptr+6] = (w14);\
1585 #define SEQ_SYSEX(dev, buf, len) \
1586 {int ii, ll=(len); \
1587 unsigned char *bufp=buf;\
1590 _seqbuf[_seqbufptr] = EV_SYSEX;\
1591 _seqbuf[_seqbufptr+1] = (dev);\
1592 for(ii=0;ii<ll;ii++)\
1593 _seqbuf[_seqbufptr+ii+2] = bufp[ii];\
1594 for(ii=ll;ii<6;ii++)\
1595 _seqbuf[_seqbufptr+ii+2] = 0xff;\
1598 #define SEQ_CHN_PRESSURE(dev, chn, pressure) \
1599 _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
1601 #define SEQ_SET_PATCH SEQ_PGM_CHANGE
1603 # define SEQ_PGM_CHANGE(dev, chn, patch) \
1604 {OSS_patch_caching(dev, chn, patch, seqfd, _seqbuf, _seqbuflen); \
1605 _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0);}
1607 # define SEQ_PGM_CHANGE(dev, chn, patch) \
1608 _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
1611 #define SEQ_CONTROL(dev, chn, controller, value) \
1612 _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
1614 #define SEQ_BENDER(dev, chn, value) \
1615 _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
1617 #define SEQ_V2_X_CONTROL(dev, voice, controller, value) \
1619 _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
1620 _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\
1621 _seqbuf[_seqbufptr+2] = (dev);\
1622 _seqbuf[_seqbufptr+3] = (voice);\
1623 _seqbuf[_seqbufptr+4] = (controller);\
1624 _seqbuf[_seqbufptr+5] = ((value)&0xff);\
1625 _seqbuf[_seqbufptr+6] = ((value>>8)&0xff);\
1626 _seqbuf[_seqbufptr+7] = 0;\
1632 #define SEQ_PITCHBEND(dev, voice, value) \
1633 SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
1634 #define SEQ_BENDER_RANGE(dev, voice, value) \
1635 SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
1636 #define SEQ_EXPRESSION(dev, voice, value) \
1637 SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
1638 #define SEQ_MAIN_VOLUME(dev, voice, value) \
1639 SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
1640 #define SEQ_PANNING(dev, voice, pos) \
1641 SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
1647 #define _TIMER_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
1648 _seqbuf[_seqbufptr+0] = EV_TIMING; \
1649 _seqbuf[_seqbufptr+1] = (ev); \
1650 _seqbuf[_seqbufptr+2] = 0;\
1651 _seqbuf[_seqbufptr+3] = 0;\
1652 *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
1655 #define SEQ_START_TIMER() _TIMER_EVENT(TMR_START, 0)
1656 #define SEQ_STOP_TIMER() _TIMER_EVENT(TMR_STOP, 0)
1657 #define SEQ_CONTINUE_TIMER() _TIMER_EVENT(TMR_CONTINUE, 0)
1658 #define SEQ_WAIT_TIME(ticks) _TIMER_EVENT(TMR_WAIT_ABS, ticks)
1659 #define SEQ_DELTA_TIME(ticks) _TIMER_EVENT(TMR_WAIT_REL, ticks)
1660 #define SEQ_ECHO_BACK(key) _TIMER_EVENT(TMR_ECHO, key)
1661 #define SEQ_SET_TEMPO(value) _TIMER_EVENT(TMR_TEMPO, value)
1662 #define SEQ_SONGPOS(pos) _TIMER_EVENT(TMR_SPP, pos)
1663 #define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig)
1669 #define _LOCAL_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
1670 _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \
1671 _seqbuf[_seqbufptr+1] = (ev); \
1672 _seqbuf[_seqbufptr+2] = 0;\
1673 _seqbuf[_seqbufptr+3] = 0;\
1674 *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
1677 #define SEQ_PLAYAUDIO(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
1678 #define SEQ_PLAYAUDIO2(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO2, devmask)
1679 #define SEQ_PLAYAUDIO3(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO3, devmask)
1680 #define SEQ_PLAYAUDIO4(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO4, devmask)
1685 #define SEQ_MIDIOUT(device, byte) {_SEQ_NEEDBUF(4);\
1686 _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\
1687 _seqbuf[_seqbufptr+1] = (byte);\
1688 _seqbuf[_seqbufptr+2] = (device);\
1689 _seqbuf[_seqbufptr+3] = 0;\
1696 # define SEQ_WRPATCH(patchx, len) \
1697 OSS_write_patch(seqfd, (char*)(patchx), len)
1698 # define SEQ_WRPATCH2(patchx, len) \
1699 OSS_write_patch2(seqfd, (char*)(patchx), len)
1701 # define SEQ_WRPATCH(patchx, len) \
1702 {if (_seqbufptr) SEQ_DUMPBUF();\
1703 if (write(seqfd, (char*)(patchx), len)==-1) \
1704 perror("Write patch: /dev/sequencer");}
1705 # define SEQ_WRPATCH2(patchx, len) \
1706 (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
1713 extern void ossclose (
int fd);
1716 extern int osslib_ioctl (
int fd,
unsigned int request,
void *arg);
1718 # define osslib_open open
1719 # define osslib_close close
1720 # define osslib_write write
1721 # define osslib_read read
1722 # define osslib_ioctl ioctl
unsigned char env_offset[6]
unsigned int play_ptradjust
struct oss_mixer_enuminfo oss_mixer_enuminfo
int filler[SYSINFO_FILL_SIZE]
unsigned char enum_present[32]
unsigned char ubitout[24]
unsigned char vibrato_depth
unsigned char cbitout[24]
EXTERNC void OSS_seqbuf_dump(int fd, unsigned char *buf, int buflen)
unsigned int capabilities
struct oss_mixext oss_mixext
#define SYSINFO_FILL_SIZE
struct synth_control synth_control
unsigned int capabilities
EXTERNC void OSS_seq_needbuf(int len, int fd, unsigned char *buf, int buflen)
struct remove_sample remove_sample
GLuint GLuint GLsizei count
EXTERNC void OSS_drum_caching(int dev, int chn, int patch, int fd, unsigned char *buf, int buflen)
struct audio_errinfo audio_errinfo
EXTERNC int OSS_write_patch2(int fd, unsigned char *buf, int len)
unsigned char tremolo_rate
#define OSS_ENUM_MAXVALUE
struct audio_buf_info audio_buf_info
EXTERNC void OSS_seq_advbuf(int len, int fd, unsigned char *buf, int buflen)
unsigned char vibrato_sweep
unsigned char mixer_record[128]
GLsizei GLsizei GLenum GLenum const GLvoid * data
struct buffmem_desc buffmem_desc
struct oss_sysinfo oss_sysinfo
struct oss_audioinfo oss_audioinfo
unsigned char sbi_instr_data[32]
unsigned char oss_reserved_t[512]
EXTERNC void OSS_patch_caching(int dev, int chn, int patch, int fd, unsigned char *buf, int buflen)
struct mixer_vol_table mixer_vol_table
struct oss_digital_control oss_digital_control
unsigned char tremolo_depth
struct seq_event_rec seq_event_rec
struct _old_mixer_info _old_mixer_info
struct oss_mixext_root oss_mixext_root
EXTERNC int OSS_init(int seqfd, int buflen)
unsigned int rec_ptradjust
short strindex[OSS_ENUM_MAXVALUE]
EXTERNC void OSS_write_patch(int fd, unsigned char *buf, int len)
struct oss_syncgroup oss_syncgroup
struct oss_mixer_value oss_mixer_value
unsigned int scale_factor
struct count_info count_info
struct mixer_info mixer_info
unsigned char env_rate[6]
unsigned char tremolo_sweep
unsigned char vibrato_rate