home *** CD-ROM | disk | FTP | other *** search
/ CD-X 1 / cdx_01.iso / demodisc / basq / dualmodp / mcp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-11  |  4.4 KB  |  165 lines

  1. // ************************************************************************
  2. // *
  3. // *    File        : MCP.H
  4. // *
  5. // *    Description : Multi Channel Player- header file
  6. // *
  7. // *    Copyright ( C) 1992 Otto Chrons
  8. // *
  9. // ************************************************************************
  10.  
  11. #ifndef __DEF_MCP
  12. #define __DEF_MCP
  13.  
  14. #ifndef __DSMIDEF_H
  15. #include "dsmidef.h"
  16. #endif
  17.  
  18. #include "cdi.h"
  19.  
  20. typedef struct {
  21.     void        *sample;
  22.     ulong       length;
  23.     ulong       loopstart,loopend;
  24.     uchar       mode;
  25.     ushort      sampleID;
  26. } SAMPLEINFO;
  27.  
  28. typedef struct {
  29.     char        ID;
  30.     ushort      version;
  31.     char        name[32];
  32.     ushort      ioPort;
  33.     char        dmaIRQ;
  34.     char        dmaChannel;
  35.     ushort      minRate;
  36.     ushort      maxRate;
  37.     char        stereo;
  38.     char        mixer;
  39.     char        sampleSize;
  40.     uchar       extraField[8];
  41. } SOUNDCARD;
  42.  
  43. typedef struct {
  44.     void     *initDevice;
  45.     void     *initOutput;
  46.     void     *initRate;
  47.     void     *closeDevice;
  48.     void     *closeOutput;
  49.     void     *startOutput;
  50.     void     *stopOutput;
  51.     void     *pauseOutput;
  52.     void     *resumeOutput;
  53.     void     *getBufferPos;
  54.     void     *speakerOn;
  55.     void     *speakerOff;
  56. } SOUNDDEVICE;
  57.  
  58. typedef struct {
  59.     ushort      samplingRate;
  60.     ushort      options;
  61.     ushort      bufferSeg;
  62. #ifdef __C32__
  63.     ulong       bufferBase;
  64. #endif
  65.     ulong       bufferPhysical;
  66.     ushort      bufferSize;
  67.     ushort      reqSize;
  68. } MCPSTRUCT;
  69.  
  70. typedef struct {
  71.     ushort      position;
  72.     void        *start;
  73.     ushort      length;
  74. } MCPOUTPUT;
  75.  
  76. extern SOUNDCARD SoundCard;
  77. extern CDIDEVICE CDI_MCP;
  78.  
  79. typedef void cdecl (*SDI_INIT)(void);
  80.  
  81. #define ID_SB 1
  82. #define ID_SBPRO 2
  83. #define ID_PAS 3
  84. #define ID_PASPLUS 4
  85. #define ID_PAS16 5
  86. #define ID_SB16 6
  87. #define ID_DAC 7
  88. #define ID_ARIA 8
  89. #define ID_WSS 9
  90. #define ID_GUS 10
  91.  
  92. #define MCP_QUALITY 1
  93. #define MCP_486 2
  94. #define MCP_MONO 4
  95.  
  96. #define MCP_TABLESIZE (33*256*2+32)
  97. #define MCP_QUALITYSIZE (2048*2+4096)
  98. #define VOLUME_LINEAR 1
  99. #define VOLUME_ANY 255
  100.  
  101. #define SAMPLE_CONTINUE 1
  102.  
  103. #define CH_PLAYING      1
  104. #define CH_LOOPING      2
  105. #define CH_PAUSED       4
  106. #define CH_VALID        8
  107.  
  108. #define PAN_LEFT -63
  109. #define PAN_RIGHT 63
  110. #define PAN_MIDDLE 0
  111. #define PAN_SURROUND 100
  112.  
  113. #ifdef __cplusplus
  114. extern "C" {
  115. #endif
  116.  
  117. int cdecl       mcpInit( MCPSTRUCT  *mcpstruc );
  118. int cdecl       mcpInitSoundDevice( SDI_INIT sdi, SOUNDCARD  *sCard );
  119. void cdecl      mcpClose( void );
  120. void cdecl      mcpOpenSpeaker( void );
  121. void cdecl      mcpCloseSpeaker( void );
  122. int cdecl       mcpSetupChannels( long channels, ushort *volTable );
  123. int cdecl       mcpStartVoice( void );
  124. int cdecl       mcpStopVoice( void );
  125. int cdecl       mcpPauseVoice( void );
  126. int cdecl       mcpResumeVoice( void );
  127. ulong cdecl     mcpGetDelta(void);
  128. void cdecl      mcpPoll(ulong time);
  129. void cdecl      mcpClearBuffer( void );
  130. void * cdecl    mcpSampleRealAddress( ulong sampleID, ulong pos );
  131. void cdecl      mcpEnableVirtualSamples( void );
  132. void cdecl      mcpDisableVirtualSamples( void );
  133. int cdecl       mcpMuteChannel( long channel );
  134. int cdecl       mcpUnmuteChannel( long channel );
  135. int cdecl       mcpStopChannel( long channel );
  136. int cdecl       mcpMuteAll( void );
  137. int cdecl       mcpUnmuteAll( void );
  138. int cdecl       mcpGetChannelStatus( long channel );
  139. int cdecl       mcpGetChannelCount( void );
  140. int cdecl       mcpSetSample( long channel, SAMPLEINFO  *s );
  141. int cdecl       mcpPlaySample( long channel, ulong rate, ulong volume );
  142. int cdecl       mcpSetVolume( long channel,long volume );
  143. int cdecl       mcpGetVolume( long channel );
  144. ulong cdecl     mcpGetPosition( long channel );
  145. void *  cdecl   mcpGetSample( long channel );
  146. ulong cdecl     mcpGetRate( long channel );
  147. int cdecl       mcpSetRate( long channel, long rate );
  148. int cdecl       mcpSetPosition( long channel, ulong position );
  149. int cdecl       mcpSetPanning( long channel, long panning );
  150. int cdecl       mcpSetSamplingRate( ulong sampling_rate );
  151. ulong cdecl     mcpGetSamplingRate( void );
  152. int cdecl       mcpSetMasterVolume( long volume );
  153. void cdecl      mcpConvertSample( void  *sample, ulong length );
  154. MCPOUTPUT * cdecl mcpGetOutput( void );
  155.  
  156. void cdecl mcpCalibrate( void );
  157. int cdecl       mcpCalibrateInit( long delta, long accuracy );
  158. void cdecl      mcpCalibrateClose( void );
  159.  
  160. #ifdef __cplusplus
  161. }
  162. #endif
  163.  
  164. #endif
  165.