home *** CD-ROM | disk | FTP | other *** search
/ Shareware 1 2 the Maxx / sw_1.zip / sw_1 / PROGRAM / SBDOS10.ZIP / SBLAST.H < prev    next >
Text File  |  1992-06-24  |  5KB  |  147 lines

  1. /*======================================================================
  2.  
  3.    Header file for Sound Blaster user programs.
  4.  
  5.    [ This file is part of the SBMSDOS v1.0 distibution ]
  6.  
  7.    Michael Fulbright (msf@as.arizona.edu)
  8.  
  9.    This file was originally distributed by the fellow below, I'm
  10.    just borrowing it.
  11.  
  12.    =====================================================================
  13.    ORIGINAL HEADER FOLLOWS (msf)
  14.    =====================================================================
  15.  
  16.    [ This file is a part of SBlast-BSD-1.4 ]
  17.  
  18.    Steve Haehnichen <shaehnic@ucsd.edu>
  19.  
  20.    $Id: sblast.h,v 1.5 1992/06/13 01:48:15 steve Exp steve $
  21.  
  22.  
  23.    Copyright (C) 1992 Steve Haehnichen.
  24.  
  25.    This program is free software; you can redistribute it and/or modify
  26.    it under the terms of the GNU General Public License as published by
  27.    the Free Software Foundation; either version 1, or (at your option)
  28.    any later version.
  29.  
  30.    This program is distributed in the hope that it will be useful,
  31.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  32.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  33.    GNU General Public License for more details.
  34.  
  35.    You should have received a copy of the GNU General Public License
  36.    along with this program; if not, write to the Free Software
  37.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  38.  
  39.  * $Log: sblast.h,v $
  40.  * Revision 1.5  1992/06/13  01:48:15  steve
  41.  * Released in SBlast-BSD-1.4
  42.  
  43. ======================================================================*/
  44.  
  45. #ifndef SBLAST_H
  46. #define SBLAST_H
  47.  
  48. typedef unsigned char BYTE;
  49. typedef unsigned char FLAG;
  50.  
  51. /*
  52.  * Available compression modes
  53.  * (These are actually DSP DMA-start commands, but you don't care)
  54.  */
  55. enum
  56. {
  57.   PCM_8     = 0x14,        /* Straight 8-bit PCM */
  58.   ADPCM_4     = 0x74,        /* 4-bit ADPCM compression */
  59.   ADPCM_2_6    = 0x76,        /* 2.5-bit ADPCM compression */
  60.   ADPCM_2     = 0x16,        /* 2-bit ADPCM compression */
  61. };
  62.  
  63. enum { LEFT, RIGHT, BOTH };    /* Stereo channel choices */
  64.  
  65. /* Mixer: Set mixer volume levels
  66.  *        Set mixer control parameters (non-volume stuff)
  67.  *      Read current mixer volume levels
  68.  *      Read current mixer parameters
  69.  *      Reset the mixer to a default state
  70.  */      
  71. #define MIXER_IOCTL_SET_LEVELS     _IOW('s', 20, struct sb_mixer_levels)
  72. #define MIXER_IOCTL_SET_PARAMS     _IOW('s', 21, struct sb_mixer_params)
  73. #define MIXER_IOCTL_READ_LEVELS    _IOR('s', 22, struct sb_mixer_levels)
  74. #define MIXER_IOCTL_READ_PARAMS _IOR('s', 23, struct sb_mixer_params)
  75. #define MIXER_IOCTL_RESET     _IO('s', 24)
  76.  
  77. /* DSP: Reset the DSP and terminate any transfers.
  78.  *      Set the speed (in Hz) of DSP playback/record.
  79.  *      (Note that the speed parameter is modified to be the actual speed.)
  80.  *      Turn the DSP voice output on (non-zero) or off (0)
  81.  *      Flush any pending written data.
  82.  *      Set the DSP decompression mode to one of the above modes.
  83.  *      Set Stereo playback/record on (non-zero) or off (0)
  84.  */
  85. #define DSP_IOCTL_RESET     _IO('s', 0)
  86. #define DSP_IOCTL_SPEED     _IOWR('s', 1, int)
  87. #define DSP_IOCTL_VOICE     _IOW('s', 2, FLAG)
  88. #define DSP_IOCTL_FLUSH     _IO('s', 3)
  89. #define DSP_IOCTL_COMPRESS    _IOW('s', 4, BYTE)
  90. #define DSP_IOCTL_STEREO    _IOW('s', 5, FLAG) /* Can go to mixer too */
  91.  
  92. /* DSP legal speed range (really!) */
  93. #define        DSP_MAX_SPEED    47619
  94. #define        DSP_MIN_SPEED    3906
  95.  
  96. struct stereo_vol
  97. {
  98.   BYTE l;            /* Left volume */
  99.   BYTE r;            /* Right volume */
  100. };
  101.  
  102.  
  103. /*
  104.  * Mixer volume levels for MIXER_IOCTL_SET_VOL & MIXER_IOCTL_READ_VOL
  105.  */
  106. struct sb_mixer_levels
  107. {
  108.   struct stereo_vol master;    /* Master volume */
  109.   struct stereo_vol voc;    /* DSP Voice volume */
  110.   struct stereo_vol fm;        /* FM volume */
  111.   struct stereo_vol line;    /* Line-in volume */
  112.   BYTE cd;            /* CD audio */
  113.   BYTE mic;            /* Microphone level */
  114. };
  115.  
  116. /*
  117.  * Mixer parameters for MIXER_IOCTL_SET_PARAMS & MIXER_IOCTL_READ_PARAMS
  118.  */
  119. struct sb_mixer_params
  120. {
  121.   BYTE record_source;        /* Recording source (See SRC_xxx below) */
  122.   FLAG hifreq_filter;        /* Filter frequency (hi/low) */
  123.   FLAG filter_input;        /* ANFI input filter */
  124.   FLAG filter_output;        /* DNFI output filter */
  125.   FLAG dsp_stereo;        /* 1 if DSP is in Stereo mode */
  126. };
  127. #define SRC_MIC         1    /* Select Microphone recording source */
  128. #define SRC_CD          3    /* Select CD recording source */
  129. #define SRC_LINE        7       /* Use Line-in for recording source */
  130.  
  131. /* Added by MSF for SBMSDOS v1.0 */
  132. struct sb_conf
  133. {
  134.    unsigned int   addr;         /* Address of sb (0x220 or 0x240) */
  135.    unsigned int   irq;          /* IRQ # (factory default=7) */
  136. };
  137.  
  138. #define ESUCCESS 0
  139. #define ERANGE   1
  140. #define EIO      2
  141. #define EINVAL   3
  142. #define ESRCH    4
  143.  
  144.  
  145.  
  146. #endif                /* !def SBLAST_H */
  147.