home *** CD-ROM | disk | FTP | other *** search
/ Sound, Music & MIDI Collection 2 / SMMVOL2.bin / MIDI_PAT / MTOOLS.ZIP / PLAYRDEV.EXE / MLIB.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-07  |  2.4 KB  |  86 lines

  1. typedef unsigned char  byte;
  2. typedef unsigned int  word;
  3. typedef char  channels[15];
  4.  
  5. typedef enum {  noteoff, noteon, polyat, ctrlchange, progchange, chanat,
  6.                  pitchwheel,
  7.                 sysex, quarter, songpos, songsel, tune, eox, undefsc,
  8.         clock, startc, cont, stopc, actsens, mreset, undefrt,
  9.                 sxfrag, none } messages;
  10.  
  11. typedef int (far pascal *ftype1) (int a);
  12. typedef void (far pascal *ftype2) (int a, int b);
  13. typedef long (far pascal *ftype3) ();
  14. typedef char (far pascal *ftype4) (int a);
  15. typedef void (far pascal *ftype5) (int a, int far *b);
  16. typedef void (far pascal *ftype6) (int dev, messages far *msg, byte far *chan,
  17.                    byte far *data1, byte far *data2);
  18. typedef void (far pascal *ftype7) (int a);
  19. typedef void (far pascal *ftype8) (int dev, messages msg, byte chan,
  20.                    byte data1, byte data2);
  21.  
  22.  
  23. #define NULL 0
  24.  
  25. #define chan_map  0
  26. #define chan_ena  1
  27. #define chan_xpos 2
  28.  
  29. #if !defined(LOCAL)
  30.  
  31. extern char MidiDriverLoaded;
  32. extern int MID;
  33.  
  34. extern ftype2 midiPutByte;
  35. extern ftype4 midiInputReady;
  36. extern ftype5 midiGetByte;
  37. extern ftype1 midiClearInput;
  38. extern ftype3 msTimer;
  39. extern ftype6 midiGetMessage;
  40. extern ftype7 midiResend;
  41. extern ftype8 midiPutMessage;
  42.  
  43. #endif
  44.  
  45. char midiInit();
  46. int midiDevName(int dev, char *devname, char *devdesc);
  47. void midiPutBuffer(int dev, char far *buf, unsigned int len);
  48. void midiPutBuffer1(int dev, char *buf, unsigned int len);
  49. word midiGetBuffer(int dev, char *buf, word max);
  50. void midiReset(int dev);
  51. void midiRemove();
  52. void mfPause();
  53. void mfContinue();
  54. void mfPopup();
  55. void mfRewind();
  56. byte mfPlay(char *name);
  57. void mfSongStat(char *playing, char *done, long *position,
  58.         byte *songcount, byte *cursong);
  59. void mfFileStat(byte *stat, char *name);
  60. byte mfLoad(char *name);
  61. void mfQuiet();
  62. void mfPopEnable(char stat);
  63. void mfVolume(int adjust);
  64. void mfTimeMode(byte mode);
  65. void mfGetChan(int datatype, channels *chan);
  66. void mfSetChan(int datatype, channels *chan);
  67. void mfSetPos(long time);
  68. void mfSkipSong(byte n);
  69. void mfLoopMode(byte n);
  70.  
  71. #if !defined(LOCAL)
  72.  
  73. static int msglen[23]  =
  74.        { 3, 3, 3, 3, 2, 2, 3,
  75.        2, 2, 3, 2, 1, 1, 0,
  76.        1, 1, 1, 1, 1, 1, 0,
  77.        0, 0 };
  78.  
  79. static char msgvalues[23] =
  80.         { 0x80, 0x90, 0xa0, 0xb0, 0xc0, 0xd0, 0xe0,
  81.           0xf0, 0xf1, 0xf2, 0xf3, 0xf6, 0xf7, 0xf4, 0xf8,
  82.           0xfa, 0xfb, 0xfc, 0xfe, 0xff, 0xf9, 0x00, 0x00 };
  83.  
  84. #endif
  85.  
  86.