home *** CD-ROM | disk | FTP | other *** search
/ PC Loisirs 18 / cd.iso / sharewar / mikm202 / source / include / mdriver.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-18  |  2.5 KB  |  80 lines

  1. #ifndef MDRIVER_H
  2. #define MDRIVER_H
  3.  
  4. #include <stdio.h>
  5. #include "mtypes.h"
  6.  
  7. #define DMODE_STEREO    1
  8. #define DMODE_16BITS    2
  9.  
  10. typedef struct GHOLD{
  11.     UBYTE kick;                             // =1 -> sample has to be restarted
  12.     UBYTE active;                   // =1 -> sample is playing
  13.     UWORD flags;                    // 16/8 bits looping/one-shot
  14.     WORD  handle;                   // identifies the sample
  15.     ULONG start;                    // start index
  16.     ULONG size;                             // samplesize
  17.     ULONG reppos;                   // loop start
  18.     ULONG repend;                   // loop end
  19.     ULONG frq;                              // current frequency
  20.     UBYTE vol;                              // current volume
  21.     UBYTE pan;                              // current panning position
  22.  
  23.     UWORD iter;                             // iteration variabele
  24.     ULONG current;                  // current index in the sample
  25.     ULONG increment;                // fixed-point increment value
  26.     void *lvoltab;              // left volume table
  27.     void *rvoltab;              // right volume table
  28. } GHOLD;
  29.  
  30. typedef struct DRIVER{
  31.     struct DRIVER *next;
  32.     char    *Name;
  33.     char    *Version;
  34.     BOOL    (*IsPresent)            (void);
  35.     WORD    (*SampleLoad)           (FILE *fp,ULONG size,ULONG reppos,ULONG repend,UWORD flags);
  36.     void    (*SampleUnLoad)         (WORD handle);
  37.     BOOL    (*Init)                 (void);
  38.     void    (*Exit)                 (void);
  39.     void    (*PlayStart)            (void);
  40.     void    (*PlayStop)             (void);
  41.     void    (*Update)                (void);
  42. } DRIVER;
  43.  
  44. extern DRIVER *md_driver;
  45. extern UWORD md_device;
  46. extern UWORD md_mixfreq;
  47. extern UWORD md_dmabufsize;
  48. extern UWORD md_mode;
  49. extern UBYTE md_bpm;
  50. extern UBYTE md_numchn;
  51.  
  52. extern GHOLD ghld[32];
  53.  
  54. #ifdef __cplusplus
  55. extern "C" {
  56. #endif
  57.  
  58. void MD_InfoDriver(void);
  59. void MD_RegisterDriver(DRIVER *drv);
  60. WORD MD_SampleLoad(FILE *fp,ULONG size,ULONG reppos,ULONG repend,UWORD flags);
  61. void MD_SampleUnLoad(WORD handle);
  62. BOOL MD_Init(void);
  63. void MD_Exit(void);
  64. void MD_PlayStart(void);
  65. void MD_PlayStop(void);
  66. void MD_VoiceSetVolume(UBYTE voice,UBYTE ivol);
  67. void MD_VoiceSetFrequency(UBYTE voice,ULONG frq);
  68. void MD_VoiceSetPanning(UBYTE voice,ULONG pan);
  69. void MD_VoicePlay(UBYTE voice,WORD handle,ULONG start,ULONG size,ULONG reppos,ULONG repend,UWORD flags);
  70. void MD_RegisterTickHandler(void (*tickhandler)(void));
  71.  
  72. void SL_Init(FILE *fp,UWORD infmt,UWORD outfmt);
  73. void SL_Load(void *buffer,ULONG length);
  74.  
  75. #ifdef __cplusplus
  76. }
  77. #endif
  78.  
  79. #endif
  80.