home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / midas / sdevice.h < prev    next >
C/C++ Source or Header  |  1994-08-06  |  5KB  |  158 lines

  1. /*      SDEVICE.H
  2.  *
  3.  * Sound Device definitions
  4.  *
  5.  * Copyright 1994 Petteri Kangaslampi and Jarno Paananen
  6.  *
  7.  * This file is part of the MIDAS Sound System, and may only be
  8.  * used, modified and distributed under the terms of the MIDAS
  9.  * Sound System license, LICENSE.TXT. By continuing to use,
  10.  * modify or distribute this file you indicate that you have
  11.  * read the license and understand and accept it fully.
  12. */
  13.  
  14.  
  15. #ifndef __SDEVICE_H
  16. #define __SDEVICE_H
  17.  
  18.  
  19. #define SMPMAX 65519                    /* max sample length (65536-16 - 1) */
  20. #define MAXINSTS 256                    /* maximum number of instruments */
  21.  
  22.  
  23.  
  24.  
  25. /****************************************************************************\
  26. *       enum smpTypes
  27. *       -------------
  28. * Description:  Sample types
  29. \****************************************************************************/
  30.  
  31. enum smpTypes
  32. {
  33.     smpNone = 0,                        /* no sample */
  34.     smp8bit                             /* 8-bit unsigned sample */
  35. };
  36.  
  37.  
  38.  
  39. /****************************************************************************\
  40. *       enum sdPanning
  41. *       --------------
  42. * Description:  Sound Device panning values. Legal values range from
  43. *               panLeft to panRight, in steps of 1, plus panSurround.
  44. *               Surround sound is played from middle if surround is not
  45. *               enabled.
  46. \****************************************************************************/
  47.  
  48. enum sdPanning
  49. {
  50.     panLeft = -64,                      /* left speaker */
  51.     panMiddle = 0,                      /* middle (both speakers) */
  52.     panRight = 64,                      /* right speaker */
  53.     panSurround = 0x80                  /* surround sound */
  54. };
  55.  
  56.  
  57.  
  58. /****************************************************************************\
  59. *       enum sdSmpPos
  60. *       -------------
  61. * Description:  Sample positions in memory
  62. \****************************************************************************/
  63.  
  64. enum dsmSmpPos
  65. {
  66.     sdSmpNone = 0,                   /* no sample */
  67.     sdSmpConv,                       /* conventional memory */
  68.     sdSmpEMS                         /* EMS */
  69. };
  70.  
  71.  
  72.  
  73. /****************************************************************************\
  74. *       enum sdStatus
  75. *       -------------
  76. * Description:  SoundDevice status
  77. \****************************************************************************/
  78.  
  79. enum sdStatus
  80. {
  81.     sdUnInitialized = 0,
  82.     sdOK
  83. };
  84.  
  85.  
  86.  
  87. /****************************************************************************\
  88. *       enum sdMode
  89. *       -----------
  90. * Description:  Possible SoundDevice output modes
  91. \****************************************************************************/
  92.  
  93. enum sdMode
  94. {
  95.     sdMono = 1,                         /* mono */
  96.     sdStereo = 2,                       /* stereo */
  97.  
  98.     sd8bit = 4,                         /* 8-bit output */
  99.     sd16bit = 8,                        /* 16-bit output */
  100.  
  101.     sdLowQ = 16,                        /* low quality mixing */
  102.     sdNormalQ = 32,                     /* normal quality mixing */
  103.     sdHighQ = 64                        /* high quality mixing */
  104. };
  105.  
  106.  
  107.  
  108. /****************************************************************************\
  109. *       struct SoundDevice
  110. *       ------------------
  111. * Description:  SoundDevice structure. See SDEVICE.TXT for documentation
  112. \****************************************************************************/
  113.  
  114. typedef struct
  115. {
  116.     ushort      tempoPoll;
  117.     ushort      port;
  118.     uchar       IRQ;
  119.     uchar       DMA;
  120.     ushort      status;
  121.     ushort      modes;              /* Possible modes for this SD, see enum */
  122.  
  123.     char        *ID;                    /* SD ID string */
  124.  
  125.     int CALLING (far *Detect)(int *result);
  126.     int CALLING (far *Init)(ushort mixRate, ushort mode);
  127.     int CALLING (far *Close)(void);
  128.     int CALLING (far *GetMixRate)(ushort *mixRate);
  129.     int CALLING (far *GetMode)(ushort *mode);
  130.     int CALLING (far *OpenChannels)(unsigned channels);
  131.     int CALLING (far *CloseChannels)(void);
  132.     int CALLING (far *ClearChannels)(void);
  133.     int CALLING (far *Mute)(int mute);
  134.     int CALLING (far *Pause)(int pause);
  135.     int CALLING (far *SetMasterVolume)(uchar masterVolume);
  136.     int CALLING (far *PlaySound)(unsigned channel, ulong rate);
  137.     int CALLING (far *StopSound)(unsigned channel);
  138.     int CALLING (far *SetRate)(unsigned channel, ulong rate);
  139.     int CALLING (far *GetRate)(unsigned channel, ulong *rate);
  140.     int CALLING (far *SetVolume)(unsigned channel, uchar volume);
  141.     int CALLING (far *SetInstrument)(unsigned channel, ushort inst);
  142.     int CALLING (far *SetPosition)(unsigned channel, ushort pos);
  143.     int CALLING (far *GetPosition)(unsigned channel, ushort *pos);
  144.     int CALLING (far *SetPanning)(unsigned channel, short panning);
  145.     int CALLING (far *GetPanning)(unsigned channel, short *panning);
  146.     int CALLING (far *MuteChannel)(unsigned channel, int mute);
  147.     int CALLING (far *AddInstrument)(void far *sample, int smpType,
  148.         ushort length, ushort loopStart, ushort loopEnd, uchar volume,
  149.         int loop, ushort *instHandle);
  150.     int CALLING (far *RemInstrument)(ushort inst);
  151.     int CALLING (far *SetUpdRate)(ushort updRate);
  152.     int CALLING (far *Play)(int *callMP);
  153. } SoundDevice;
  154.  
  155.  
  156.  
  157. #endif
  158.