home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / mididll.h < prev    next >
Text File  |  1999-03-15  |  10KB  |  264 lines

  1. /***************************************************************************\
  2. *
  3. * Module Name: MIDIDLL.H
  4. *
  5. * OS/2 Warp. Multimedia Extensions - MIDI
  6. *
  7. * Copyright (c) International Business Machines Corporation 1995
  8. *                         All Rights Reserved
  9. *
  10. \***************************************************************************/
  11. #ifdef __cplusplus
  12.    extern "C" {
  13. #endif
  14.  
  15. #ifndef _MIDIDLL_H_
  16. #define _MIDIDLL_H_
  17. typedef ULONG        MINSTANCE;
  18. typedef MINSTANCE    *PMINSTANCE;
  19. typedef PVOID        TIMEHANDLE;
  20. typedef TIMEHANDLE   *PTIMEHANDLE;
  21. typedef PULONG       *PPULONG;
  22.  
  23. #define MIDI_NAME_LENGTH      32
  24. #define MIDI_SUCCESS          0L
  25. #define TIMER_SUCCESS         0L // return code of high-resolution timer
  26.  
  27. // used with MIDIEnableInstance and MIDIDisableInstance
  28.  
  29. #define MIDI_ENABLE_RECEIVE   1  // enables hdw to receive messages
  30. #define MIDI_ENABLE_SEND      2  // enables hdw to send messages
  31. #define MIDI_DISABLE_RECEIVE  1  // disables hdw from receiving messages
  32. #define MIDI_DISABLE_SEND     2  // disables hdw from sending messages
  33.  
  34. // used with MIDITimer
  35.  
  36. // MIDI_START_TIMER and MIDI_STOP_TIMER flag are mutually exclusive
  37.  
  38. #define MIDI_START_TIMER      1  // starts MIDI Timer
  39. #define MIDI_STOP_TIMER       2  // stops MIDI Timer
  40.  
  41. typedef struct {
  42.    ULONG ulSourceInstance; // inst # of the instance which generated the msg
  43.    ULONG ulTime;           // time the message is to be (or was) sent
  44.    ULONG ulTrack;
  45.    union {
  46.       ULONG ulMessage;
  47.       struct {
  48.          BYTE bStatus;     // The 1st byte of the message
  49.          BYTE abData[3];   // the rest of the message
  50.       } bytes;
  51.       BYTE abData[4];
  52.    } msg;
  53. } MESSAGE;
  54.  
  55. typedef MESSAGE   *PMESSAGE;
  56.  
  57. typedef struct _MIDICLASSINFO {
  58.    ULONG       ulStructLength;
  59.    ULONG       ulClassNumber;
  60.    CHAR        szmClassName[MIDI_NAME_LENGTH];
  61.    ULONG       ulNumSlots;
  62.    ULONG       ulAttributes;
  63. } MIDICLASSINFO;
  64.  
  65. typedef MIDICLASSINFO    *PMIDICLASSINFO;
  66.  
  67. typedef struct _MIDIINSTANCEINFO {
  68.    ULONG       ulStructLength;
  69.    MINSTANCE   minstance;
  70.    ULONG       ulClassNumber;
  71.    CHAR        szmInstanceName[MIDI_NAME_LENGTH];
  72.    ULONG       ulNumLinks;
  73.    ULONG       ulAttributes;
  74. } MIDIINSTANCEINFO;
  75.  
  76. typedef MIDIINSTANCEINFO    *PMIDIINSTANCEINFO;
  77.  
  78. // MIDIINSTANCEINFO ulAttributes values:
  79.  
  80. #define MIDI_INST_ATTR_CAN_RECV     1  // instance can accept messages
  81. #define MIDI_INST_ATTR_CAN_SEND     2  // instance can send messages
  82. #define MIDI_INST_ATTR_ENABLE_R     4  // receive is enabled
  83. #define MIDI_INST_ATTR_ENABLE_S     8  // send is enabled
  84.  
  85.  
  86. typedef (*PFNMIDI_NOTIFYCALLBACK) (ULONG ulNotification,
  87.                                    ULONG ulParam);
  88.  
  89. // typedef (VOID *PFNMIDI_NOTIFYCALLBACK) (ULONG ulNotification,
  90. //                                         ULONG ulParam);
  91.  
  92. typedef struct _MIDISETUP {
  93.    ULONG                      ulStructLength;
  94.    PULONG                     pulMaxRTSysexLength;
  95.    PPULONG                    ppulMIDICurrentTime;
  96.    ULONG                      ulFlags;
  97.    PFNMIDI_NOTIFYCALLBACK     pfnMIDI_NotifyCallback;
  98.    HWND                       hwndCallback;
  99.    HQUEUE                     hqueueCallback;
  100. } MIDISETUP;
  101.  
  102. typedef MIDISETUP    *PMIDISETUP;
  103.  
  104. // MIDISETUP ulFlags values:
  105.  
  106. #define  MIDICALLBACK_PFN     1
  107. #define  MIDICALLBACK_HWND    2
  108. #define  MIDICALLBACK_QUEUE   3
  109.  
  110.  
  111. typedef struct _MIDIDEVICEINFO {
  112.    ULONG       ulStructLength;
  113.    MINSTANCE   minstance;
  114.    CHAR        szmInstanceName[MIDI_NAME_LENGTH];
  115. //   PMIDIDEVICEINFO pParentDevice;
  116. //   PMIDIDEVICEINFO pSiblingDevice;
  117. //   PMIDIDEVICEINFO pChildDevice;
  118.    CHAR        szDeviceName[MIDI_NAME_LENGTH];
  119.    CHAR        szManufacturer[MIDI_NAME_LENGTH];
  120.    CHAR        szModelName[MIDI_NAME_LENGTH];
  121.    ULONG       ulFlags;
  122.    ULONG       ulChannels;
  123. } MIDIDEVICEINFO;
  124.  
  125. typedef MIDIDEVICEINFO      *PMIDIDEVICEINFO;
  126.  
  127.  
  128. // DEVICEINFO ulFlags values:
  129.  
  130. #define  MIDIDEV_IS_PATCHER         0x00000001
  131. #define  MIDIDEV_IS_CONTROLLER      0x00000002
  132. #define  MIDIDEV_IS_RECEIVER        0x00000004
  133. #define  MIDIDEV_IS_MULTITIMBRAL    0x00000008
  134. #define  MIDIDEV_SENDS_MTC          0x00000010
  135. #define  MIDIDEV_RECEIVES_MTC       0x00000020
  136. #define  MIDIDEV_SENDS_CLOCK        0x00000040
  137. #define  MIDIDEV_RECEIVES_CLOCK     0x00000080
  138. #define  MIDIDEV_SENDS_SYNC         0x00000100
  139. #define  MIDIDEV_RECEIVES_SYNC      0x00000200
  140. #define  MIDIDEV_SENDS_MMC          0x00000400
  141. #define  MIDIDEV_RECEIVES_MMC       0x00000800
  142.  
  143. typedef struct _MIDILINKINFO {
  144.    ULONG       ulStructLength;
  145.    ULONG       ulSlotNumber;
  146.    MINSTANCE   minstance;
  147. } MIDILINKINFO;
  148.  
  149. typedef MIDILINKINFO     *PMIDILINKINFO;
  150.  
  151.  
  152. // Function Prototypes
  153.  
  154. ULONG APIENTRY MIDICreateInstance ( ULONG      ulClassNumber,
  155.                                     PMINSTANCE pminstance,
  156.                                     PSZ        pszInstanceName,
  157.                                     ULONG      ulFlag );
  158.  
  159. ULONG APIENTRY MIDIDeleteInstance ( MINSTANCE minstance,
  160.                                     ULONG     ulFlag );
  161.  
  162. ULONG APIENTRY MIDIEnableInstance ( MINSTANCE minstance,
  163.                                     ULONG     ulFlag );
  164.  
  165. ULONG APIENTRY MIDIDisableInstance ( MINSTANCE minstance,
  166.                                      ULONG     ulFlag );
  167.  
  168. ULONG APIENTRY MIDIAddLink ( MINSTANCE minstanceSource,
  169.                              MINSTANCE minstanceTarget,
  170.                              ULONG     ulSlotNumber,
  171.                              ULONG     ulFlag );
  172.  
  173. ULONG APIENTRY MIDIRemoveLink ( MINSTANCE minstanceSource,
  174.                                 MINSTANCE minstanceTarget,
  175.                                 ULONG     ulSlotNumber,
  176.                                 ULONG     ulFlag );
  177.  
  178. ULONG APIENTRY MIDISetDefaultHardwareNode ( PSZ   pszmInstanceName,
  179.                                             ULONG ulFlag );
  180.  
  181. ULONG APIENTRY MIDISetInstanceConfiguration (MINSTANCE minstance,
  182.                                              PVOID     pBuffer,
  183.                                              ULONG     ulBufferLength,
  184.                                              ULONG     ulFlag );
  185.  
  186. ULONG APIENTRY MIDISimpleOpen ( PMINSTANCE pminstance,
  187.                                 ULONG      ulFlag );
  188.  
  189. ULONG APIENTRY MIDISimpleClose ( MINSTANCE minstance,
  190.                                  ULONG     ulFlag );
  191.  
  192. ULONG APIENTRY MIDIQueryClassList ( ULONG          ulNumClasses,
  193.                                     PMIDICLASSINFO paClassInfo,
  194.                                     ULONG          ulFlag );
  195.  
  196. ULONG APIENTRY MIDIQueryDeviceInformation ( ULONG           ulNumDevices,
  197.                                             PMIDIDEVICEINFO paDeviceInfo,
  198.                                             ULONG           ulFlag );
  199.  
  200. ULONG APIENTRY MIDIQueryInstanceConfiguration ( ULONG minstance,
  201.                                                 PVOID pBuffer,
  202.                                                 ULONG ulBufferLength,
  203.                                                 ULONG ulFlag );
  204.  
  205. ULONG APIENTRY MIDIQueryInstanceLinks ( MINSTANCE     minstance,
  206.                                         PMIDILINKINFO paLinkInfo,
  207.                                         ULONG         ulNumLinks,
  208.                                         ULONG         ulFlag );
  209.  
  210. ULONG APIENTRY MIDIQueryInstanceList ( ULONG             ulNumInstances,
  211.                                        PMIDIINSTANCEINFO paInstanceInfo,
  212.                                        ULONG             ulFlag );
  213.  
  214. ULONG APIENTRY MIDIQueryInstanceName ( MINSTANCE minstance,
  215.                                        PSZ       pszInstanceName,
  216.                                        ULONG     ulFlag );
  217.  
  218. ULONG APIENTRY MIDIQueryNumClasses ( PULONG pulNumClasses,
  219.                                      ULONG  ulFlag );
  220.  
  221. ULONG APIENTRY MIDIQueryNumDevices ( PULONG pulNumDevices,
  222.                                      ULONG  ulFlag );
  223.  
  224. ULONG APIENTRY MIDIQueryNumInstances ( PULONG pulNumInstances,
  225.                                        ULONG  ulFlag );
  226.  
  227. ULONG APIENTRY MIDIQueryVersion ( PULONG pulVersion);
  228.  
  229. ULONG APIENTRY MIDISetDeviceInformation ( MINSTANCE       minstance,
  230.                                           PMIDIDEVICEINFO pDeviceInfo,
  231.                                           ULONG           ulFlag );
  232.  
  233. ULONG APIENTRY MIDISendMessages ( PMESSAGE paMessage,
  234.                                   ULONG    ulNumMessages,
  235.                                   ULONG    ulFlag );
  236.  
  237. ULONG APIENTRY MIDISendSysexMessage ( PMESSAGE pMessage,
  238.                                       ULONG    ulBufferLength,
  239.                                       ULONG    ulFlag );
  240.  
  241. ULONG APIENTRY MIDIRetrieveMessages ( MINSTANCE minstance,
  242.                                       PVOID     pBuffer,
  243.                                       PULONG    pulBufferLength,
  244.                                       ULONG     ulFlag );
  245.  
  246. ULONG APIENTRY MIDISetup ( PMIDISETUP pMidiSetup,
  247.                            ULONG      ulFlag );
  248.  
  249. ULONG APIENTRY MIDITimer ( ULONG ulAction,
  250.                            ULONG ulFlag );
  251.  
  252. ULONG APIENTRY TimerSleep ( ULONG ulDuration,
  253.                             ULONG ulFlag );
  254.  
  255. ULONG APIENTRY TimerGetPointer ( PPULONG ppulHRTCurrentTime,
  256.                                  ULONG   ulFlag );
  257.  
  258. #endif /* _MIDIDLL_H_ */
  259.  
  260. #ifdef __cplusplus
  261. }
  262. #endif
  263.  
  264.