home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 May / CMCD0504.ISO / Software / Freeware / Programare / dspack / DSPACK231.exe / {app} / src / DirectX9 / DirectMusic.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2003-04-27  |  340.0 KB  |  8,103 lines

  1. {******************************************************************************}
  2. {*                                                                            *}
  3. {*  Copyright (C) Microsoft Corporation.  All Rights Reserved.                *}
  4. {*                                                                            *}
  5. {*  Files:      dls1.h dls2.h dmdls.h dmerror.h dmksctrl.h dmplugin.h         *}
  6. {*              dmusicc.h dmusici.h dmusicf.h dmusbuff.h                      *}
  7. {*  Content:    DirectMusic include files                                     *}
  8. {*                                                                            *}
  9. {*  DirectX 9.0 Delphi adaptation by Alexey Barkovoy                          *}
  10. {*  E-Mail: clootie@reactor.ru                                                *}
  11. {*                                                                            *}
  12. {*  Modified: 27-Apr-2003                                                     *}
  13. {*                                                                            *}
  14. {*  Based upon :                                                              *}
  15. {*    DirectX 7.0 Delphi adaptation by Erik Unger                             *}
  16. {*    DirectX 8.0 Delphi adaptation by Ivo Steinmann                          *}
  17. {*                                                                            *}
  18. {*  Latest version can be downloaded from:                                    *}
  19. {*     http://clootie.narod.ru/delphi                                         *}
  20. {*                                                                            *}
  21. {******************************************************************************}
  22. {                                                                              }
  23. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI)        }
  24. {                                                                              }
  25. { The contents of this file are used with permission, subject to the Mozilla   }
  26. { Public License Version 1.1 (the "License"); you may not use this file except }
  27. { in compliance with the License. You may obtain a copy of the License at      }
  28. { http://www.mozilla.org/MPL/MPL-1.1.html                                      }
  29. {                                                                              }
  30. { Software distributed under the License is distributed on an "AS IS" basis,   }
  31. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  32. { the specific language governing rights and limitations under the License.    }
  33. {                                                                              }
  34. { Alternatively, the contents of this file may be used under the terms of the  }
  35. { GNU Lesser General Public License (the  "LGPL License"), in which case the   }
  36. { provisions of the LGPL License are applicable instead of those above.        }
  37. { If you wish to allow use of your version of this file only under the terms   }
  38. { of the LGPL License and not to allow others to use your version of this file }
  39. { under the MPL, indicate your decision by deleting  the provisions above and  }
  40. { replace  them with the notice and other provisions required by the LGPL      }
  41. { License.  If you do not delete the provisions above, a recipient may use     }
  42. { your version of this file under either the MPL or the LGPL License.          }
  43. {                                                                              }
  44. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  45. {                                                                              }
  46. {******************************************************************************}
  47.  
  48. {$I DirectX.inc}
  49. {$MINENUMSIZE 1}
  50.  
  51. unit DirectMusic;
  52.  
  53. interface
  54.  
  55. (*$HPPEMIT '#include "ks.h"' *)
  56. (*$HPPEMIT '#include "dls1.h"' *)
  57. (*$HPPEMIT '#include "dls2.h"' *)
  58. (*$HPPEMIT '#include "dmdls.h"' *)
  59. (*$HPPEMIT '#include "dmerror.h"' *)
  60. (*$HPPEMIT '#include "dmplugin.h"' *)
  61. (*$HPPEMIT '#include "dmusicc.h"' *)
  62. (*$HPPEMIT '#include "dmusici.h"' *)
  63. (*$HPPEMIT '#include "dmusicf.h"' *)
  64. (*$HPPEMIT '#include "dmusbuff.h"' *)
  65.  
  66. {$NOINCLUDE ActiveX}
  67.  
  68. uses
  69.   Windows, MMSystem, ActiveX, DirectSound;
  70.  
  71. (*==========================================================================;
  72. //
  73. //  dls1.h
  74. //
  75. //
  76. //  Description:
  77. //
  78. //  Interface defines and structures for the Instrument Collection Form
  79. //  RIFF DLS.
  80. //
  81. //
  82. //  Written by Sonic Foundry 1996.  Released for public use.
  83. //
  84. //=========================================================================*)
  85.  
  86. (*)/////////////////////////////////////////////////////////////////////////
  87. //
  88. //
  89. // Layout of an instrument collection:
  90. //
  91. //
  92. // RIFF [] 'DLS ' [dlid,colh,INSTLIST,WAVEPOOL,INFOLIST]
  93. //
  94. // INSTLIST
  95. // LIST [] 'lins'
  96. //               LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
  97. //               LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
  98. //               LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
  99. //
  100. // RGNLIST
  101. // LIST [] 'lrgn'
  102. //               LIST [] 'rgn '  [rgnh,wsmp,wlnk,ARTLIST]
  103. //               LIST [] 'rgn '  [rgnh,wsmp,wlnk,ARTLIST]
  104. //               LIST [] 'rgn '  [rgnh,wsmp,wlnk,ARTLIST]
  105. //
  106. // ARTLIST
  107. // LIST [] 'lart'
  108. //         'art1' level 1 Articulation connection graph
  109. //         'art2' level 2 Articulation connection graph
  110. //         '3rd1' Possible 3rd party articulation structure 1
  111. //         '3rd2' Possible 3rd party articulation structure 2 .... and so on
  112. //
  113. // WAVEPOOL
  114. // ptbl [] [pool table]
  115. // LIST [] 'wvpl'
  116. //               [path],
  117. //               [path],
  118. //               LIST [] 'wave' [dlid,RIFFWAVE]
  119. //               LIST [] 'wave' [dlid,RIFFWAVE]
  120. //               LIST [] 'wave' [dlid,RIFFWAVE]
  121. //               LIST [] 'wave' [dlid,RIFFWAVE]
  122. //               LIST [] 'wave' [dlid,RIFFWAVE]
  123. //
  124. // INFOLIST
  125. // LIST [] 'INFO'
  126. //               'icmt' 'One of those crazy comments.'
  127. //               'icop' 'Copyright (C) 1996 Sonic Foundry'
  128. //
  129. ////////////////////////////////////////////////////////////////////////(*)
  130.  
  131.  
  132. (*)////////////////////////////////////////////////////////////////////////
  133. // FOURCC's used in the DLS file
  134. ////////////////////////////////////////////////////////////////////////(*)
  135.  
  136. const
  137.   FOURCC_DLS  = DWORD(Byte('D') or (Byte('L') shl 8) or (Byte('S') shl 16) or (Byte(' ') shl 24));
  138.   {$EXTERNALSYM FOURCC_DLS}
  139.   FOURCC_DLID = DWORD(Byte('d') or (Byte('l') shl 8) or (Byte('i') shl 16) or (Byte('d') shl 24));
  140.   {$EXTERNALSYM FOURCC_DLID}
  141.   FOURCC_COLH = DWORD(Byte('c') or (Byte('o') shl 8) or (Byte('l') shl 16) or (Byte('h') shl 24));
  142.   {$EXTERNALSYM FOURCC_COLH}
  143.   FOURCC_WVPL = DWORD(Byte('w') or (Byte('v') shl 8) or (Byte('p') shl 16) or (Byte('l') shl 24));
  144.   {$EXTERNALSYM FOURCC_WVPL}
  145.   FOURCC_PTBL = DWORD(Byte('p') or (Byte('t') shl 8) or (Byte('b') shl 16) or (Byte('l') shl 24));
  146.   {$EXTERNALSYM FOURCC_PTBL}
  147.   FOURCC_PATH = DWORD(Byte('p') or (Byte('a') shl 8) or (Byte('t') shl 16) or (Byte('h') shl 24));
  148.   {$EXTERNALSYM FOURCC_PATH}
  149.   FOURCC_wave = DWORD(Byte('w') or (Byte('a') shl 8) or (Byte('v') shl 16) or (Byte('e') shl 24));
  150.   {$EXTERNALSYM FOURCC_wave}
  151.   FOURCC_LINS = DWORD(Byte('l') or (Byte('i') shl 8) or (Byte('n') shl 16) or (Byte('s') shl 24));
  152.   {$EXTERNALSYM FOURCC_LINS}
  153.   FOURCC_INS  = DWORD(Byte('i') or (Byte('n') shl 8) or (Byte('s') shl 16) or (Byte(' ') shl 24));
  154.   {$EXTERNALSYM FOURCC_INS}
  155.   FOURCC_INSH = DWORD(Byte('i') or (Byte('n') shl 8) or (Byte('s') shl 16) or (Byte('h') shl 24));
  156.   {$EXTERNALSYM FOURCC_INSH}
  157.   FOURCC_LRGN = DWORD(Byte('l') or (Byte('r') shl 8) or (Byte('g') shl 16) or (Byte('n') shl 24));
  158.   {$EXTERNALSYM FOURCC_LRGN}
  159.   FOURCC_RGN  = DWORD(Byte('r') or (Byte('g') shl 8) or (Byte('n') shl 16) or (Byte(' ') shl 24));
  160.   {$EXTERNALSYM FOURCC_RGN}
  161.   FOURCC_RGNH = DWORD(Byte('r') or (Byte('g') shl 8) or (Byte('n') shl 16) or (Byte('h') shl 24));
  162.   {$EXTERNALSYM FOURCC_RGNH}
  163.   FOURCC_LART = DWORD(Byte('l') or (Byte('a') shl 8) or (Byte('r') shl 16) or (Byte('t') shl 24));
  164.   {$EXTERNALSYM FOURCC_LART}
  165.   FOURCC_ART1 = DWORD(Byte('a') or (Byte('r') shl 8) or (Byte('t') shl 16) or (Byte('1') shl 24));
  166.   {$EXTERNALSYM FOURCC_ART1}
  167.   FOURCC_WLNK = DWORD(Byte('w') or (Byte('l') shl 8) or (Byte('n') shl 16) or (Byte('k') shl 24));
  168.   {$EXTERNALSYM FOURCC_WLNK}
  169.   FOURCC_WSMP = DWORD(Byte('w') or (Byte('s') shl 8) or (Byte('m') shl 16) or (Byte('p') shl 24));
  170.   {$EXTERNALSYM FOURCC_WSMP}
  171.   FOURCC_VERS = DWORD(Byte('v') or (Byte('e') shl 8) or (Byte('r') shl 16) or (Byte('s') shl 24));
  172.   {$EXTERNALSYM FOURCC_VERS}
  173.  
  174. (*)////////////////////////////////////////////////////////////////////////
  175. // Articulation connection graph definitions
  176. ////////////////////////////////////////////////////////////////////////(*)
  177.  
  178.   // Generic Sources
  179.   CONN_SRC_NONE              = $0000;
  180.   {$EXTERNALSYM CONN_SRC_NONE}
  181.   CONN_SRC_LFO               = $0001;
  182.   {$EXTERNALSYM CONN_SRC_LFO}
  183.   CONN_SRC_KEYONVELOCITY     = $0002;
  184.   {$EXTERNALSYM CONN_SRC_KEYONVELOCITY}
  185.   CONN_SRC_KEYNUMBER         = $0003;
  186.   {$EXTERNALSYM CONN_SRC_KEYNUMBER}
  187.   CONN_SRC_EG1               = $0004;
  188.   {$EXTERNALSYM CONN_SRC_EG1}
  189.   CONN_SRC_EG2               = $0005;
  190.   {$EXTERNALSYM CONN_SRC_EG2}
  191.   CONN_SRC_PITCHWHEEL        = $0006;
  192.   {$EXTERNALSYM CONN_SRC_PITCHWHEEL}
  193.  
  194.   // Midi Controllers 0-127
  195.   CONN_SRC_CC1               = $0081;
  196.   {$EXTERNALSYM CONN_SRC_CC1}
  197.   CONN_SRC_CC7               = $0087;
  198.   {$EXTERNALSYM CONN_SRC_CC7}
  199.   CONN_SRC_CC10              = $008a;
  200.   {$EXTERNALSYM CONN_SRC_CC10}
  201.   CONN_SRC_CC11              = $008b;
  202.   {$EXTERNALSYM CONN_SRC_CC11}
  203.  
  204.   // Generic Destinations
  205.   CONN_DST_NONE              = $0000;
  206.   {$EXTERNALSYM CONN_DST_NONE}
  207.   CONN_DST_ATTENUATION       = $0001;
  208.   {$EXTERNALSYM CONN_DST_ATTENUATION}
  209.   CONN_DST_PITCH             = $0003;
  210.   {$EXTERNALSYM CONN_DST_PITCH}
  211.   CONN_DST_PAN               = $0004;
  212.   {$EXTERNALSYM CONN_DST_PAN}
  213.  
  214.   // LFO Destinations
  215.   CONN_DST_LFO_FREQUENCY     = $0104;
  216.   {$EXTERNALSYM CONN_DST_LFO_FREQUENCY}
  217.   CONN_DST_LFO_STARTDELAY    = $0105;
  218.   {$EXTERNALSYM CONN_DST_LFO_STARTDELAY}
  219.  
  220.   // EG1 Destinations
  221.   CONN_DST_EG1_ATTACKTIME    = $0206;
  222.   {$EXTERNALSYM CONN_DST_EG1_ATTACKTIME}
  223.   CONN_DST_EG1_DECAYTIME     = $0207;
  224.   {$EXTERNALSYM CONN_DST_EG1_DECAYTIME}
  225.   CONN_DST_EG1_RELEASETIME   = $0209;
  226.   {$EXTERNALSYM CONN_DST_EG1_RELEASETIME}
  227.   CONN_DST_EG1_SUSTAINLEVEL  = $020a;
  228.   {$EXTERNALSYM CONN_DST_EG1_SUSTAINLEVEL}
  229.  
  230.   // EG2 Destinations
  231.   CONN_DST_EG2_ATTACKTIME    = $030a;
  232.   {$EXTERNALSYM CONN_DST_EG2_ATTACKTIME}
  233.   CONN_DST_EG2_DECAYTIME     = $030b;
  234.   {$EXTERNALSYM CONN_DST_EG2_DECAYTIME}
  235.   CONN_DST_EG2_RELEASETIME   = $030d;
  236.   {$EXTERNALSYM CONN_DST_EG2_RELEASETIME}
  237.   CONN_DST_EG2_SUSTAINLEVEL  = $030e;
  238.   {$EXTERNALSYM CONN_DST_EG2_SUSTAINLEVEL}
  239.  
  240.   CONN_TRN_NONE              = $0000;
  241.   {$EXTERNALSYM CONN_TRN_NONE}
  242.   CONN_TRN_CONCAVE           = $0001;
  243.   {$EXTERNALSYM CONN_TRN_CONCAVE}
  244.  
  245. type
  246.   PDLSID = ^TDLSID;
  247.   _DLSID = packed record
  248.     ulData1: Cardinal;
  249.     usData2: Word;
  250.     usData3: Word;
  251.     abData4: array[0..7] of Byte;
  252.   end;
  253.   {$EXTERNALSYM _DLSID}
  254.   DLSID = _DLSID;
  255.   {$EXTERNALSYM DLSID}
  256.   TDLSID= _DLSID;
  257.  
  258.   PDLSVersion = ^TDLSVersion;
  259.   _DLSVERSION = packed record
  260.     dwVersionMS: DWORD;
  261.     dwVersionLS: DWORD;
  262.   end;
  263.   {$EXTERNALSYM _DLSVERSION}
  264.   DLSVERSION = _DLSVERSION;
  265.   {$EXTERNALSYM DLSVERSION}
  266.   TDLSVersion = _DLSVERSION;
  267.  
  268.   PConnection = ^TConnection;
  269.   _CONNECTION = packed record
  270.     usSource: Word;
  271.     usControl: Word;
  272.     usDestination: Word;
  273.     usTransform: Word;
  274.     lScale: Longint;
  275.   end;
  276.   {$EXTERNALSYM _CONNECTION}
  277.   CONNECTION = _CONNECTION;
  278.   {$EXTERNALSYM CONNECTION}
  279.   TConnection = _CONNECTION;
  280.  
  281.   // Level 1 Articulation Data
  282.  
  283.   PConnectionList = ^TConnectionList;
  284.   _CONNECTIONLIST = packed record
  285.     cbSize: Cardinal;            // size of the connection list structure
  286.     cConnections: Cardinal;      // count of connections in the list
  287.   end;
  288.   {$EXTERNALSYM _CONNECTIONLIST}
  289.   CONNECTIONLIST = _CONNECTIONLIST;
  290.   {$EXTERNALSYM CONNECTIONLIST}
  291.   TConnectionList = _CONNECTIONLIST;
  292.  
  293.  
  294. (*)////////////////////////////////////////////////////////////////////////
  295. // Generic type defines for regions and instruments
  296. ////////////////////////////////////////////////////////////////////////(*)
  297.  
  298.   PRGNRange = ^TRGNRange;
  299.   _RGNRANGE = packed record
  300.     usLow: Word;
  301.     usHigh: Word;
  302.   end;
  303.   {$EXTERNALSYM _RGNRANGE}
  304.   RGNRANGE = _RGNRANGE;
  305.   {$EXTERNALSYM RGNRANGE}
  306.   TRGNRange = _RGNRANGE;
  307.  
  308. const
  309.   F_INSTRUMENT_DRUMS      = $80000000;
  310.   {$EXTERNALSYM F_INSTRUMENT_DRUMS}
  311.  
  312. type
  313.   PMIDILocale = ^TMIDILocale;
  314.   _MIDILOCALE = packed record
  315.     ulBank: Cardinal;
  316.     ulInstrument: Cardinal;
  317.   end;
  318.   {$EXTERNALSYM _MIDILOCALE}
  319.   MIDILOCALE = _MIDILOCALE;
  320.   {$EXTERNALSYM MIDILOCALE}
  321.   TMIDILocale = _MIDILOCALE;
  322.  
  323. (*)////////////////////////////////////////////////////////////////////////
  324. // Header structures found in an DLS file for collection, instruments, and
  325. // regions.
  326. ////////////////////////////////////////////////////////////////////////(*)
  327.  
  328. const
  329.   F_RGN_OPTION_SELFNONEXCLUSIVE  = $0001;
  330.   {$EXTERNALSYM F_RGN_OPTION_SELFNONEXCLUSIVE}
  331.  
  332. type
  333.   PRGNHeader = ^TRGNHeader;
  334.   _RGNHEADER = packed record
  335.     RangeKey: TRGNRange;          // Key range
  336.     RangeVelocity: TRGNRange;     // Velocity Range
  337.     fusOptions: Word;             // Synthesis options for this range
  338.     usKeyGroup: Word;             // Key grouping for non simultaneous play
  339.                                   // 0 = no group, 1 up is group
  340.                                   // for Level 1 only groups 1-15 are allowed
  341.   end;
  342.   {$EXTERNALSYM _RGNHEADER}
  343.   RGNHEADER = _RGNHEADER;
  344.   {$EXTERNALSYM RGNHEADER}
  345.   TRGNHeader = _RGNHEADER;
  346.  
  347.   PInstHeader = ^TInstHeader;
  348.   _INSTHEADER = packed record
  349.     cRegions: Cardinal;          // Count of regions in this instrument
  350.     Locale: TMIDILocale;         // Intended MIDI locale of this instrument
  351.   end;
  352.   {$EXTERNALSYM _INSTHEADER}
  353.   INSTHEADER = _INSTHEADER;
  354.   {$EXTERNALSYM INSTHEADER}
  355.   TInstHeader = _INSTHEADER;
  356.  
  357.   PDLSHeader = ^TDLSHeader;
  358.   _DLSHEADER = packed record
  359.     cInstruments: Cardinal;      // Count of instruments in the collection
  360.   end;
  361.   {$EXTERNALSYM _DLSHEADER}
  362.   DLSHEADER = _DLSHEADER;
  363.   {$EXTERNALSYM DLSHEADER}
  364.   TDLSHeader = _DLSHEADER;
  365.  
  366. (*)///////////////////////////////////////////////////////////////////////////
  367. // definitions for the Wave link structure
  368. ///////////////////////////////////////////////////////////////////////////(*)
  369.  
  370. // ****  For level 1 only WAVELINK_CHANNEL_MONO is valid  ****
  371. // ulChannel allows for up to 32 channels of audio with each bit position
  372. // specifiying a channel of playback
  373.  
  374. const
  375.   WAVELINK_CHANNEL_LEFT    = $0001;
  376.   {$EXTERNALSYM WAVELINK_CHANNEL_LEFT}
  377.   WAVELINK_CHANNEL_RIGHT   = $0002;
  378.   {$EXTERNALSYM WAVELINK_CHANNEL_RIGHT}
  379.  
  380.   F_WAVELINK_PHASE_MASTER  = $0001;
  381.   {$EXTERNALSYM F_WAVELINK_PHASE_MASTER}
  382.  
  383. type
  384.   PWaveLink = ^TWaveLink;
  385.   _WAVELINK = packed record // any paths or links are stored right after struct
  386.     fusOptions: Word;       // options flags for this wave
  387.     usPhaseGroup: Word;     // Phase grouping for locking channels
  388.     ulChannel: Cardinal;    // channel placement
  389.     ulTableIndex: Cardinal; // index into the wave pool table, 0 based
  390.   end;
  391.   {$EXTERNALSYM _WAVELINK}
  392.   WAVELINK = _WAVELINK;
  393.   {$EXTERNALSYM WAVELINK}
  394.   TWaveLink = _WAVELINK;
  395.  
  396. const
  397.   POOL_CUE_NULL  = $ffffffff;
  398.   {$EXTERNALSYM POOL_CUE_NULL}
  399.  
  400. type
  401.   PPoolCUE = ^TPoolCUE;
  402.   _POOLCUE = packed record
  403.     ulOffset:    Cardinal;       // Offset to the entry in the list
  404.   end;
  405.   {$EXTERNALSYM _POOLCUE}
  406.   POOLCUE = _POOLCUE;
  407.   {$EXTERNALSYM POOLCUE}
  408.   TPoolCUE = _POOLCUE;
  409.  
  410.   PPoolTable = ^TPoolTable;
  411.   _POOLTABLE = packed record
  412.     cbSize: Cardinal;            // size of the pool table structure
  413.     cCues: Cardinal;             // count of cues in the list
  414.   end;
  415.   {$EXTERNALSYM _POOLTABLE}
  416.   POOLTABLE = _POOLTABLE;
  417.   {$EXTERNALSYM POOLTABLE}
  418.   TPoolTable = _POOLTABLE;
  419.  
  420. (*)///////////////////////////////////////////////////////////////////////////
  421. // Structures for the "wsmp" chunk
  422. ///////////////////////////////////////////////////////////////////////////(*)
  423.  
  424. const
  425.   F_WSMP_NO_TRUNCATION     = $0001;
  426.   {$EXTERNALSYM F_WSMP_NO_TRUNCATION}
  427.   F_WSMP_NO_COMPRESSION    = $0002;
  428.   {$EXTERNALSYM F_WSMP_NO_COMPRESSION}
  429.  
  430.  
  431. type
  432.   PWSMPL = ^TWSMPL;
  433.   _rwsmp = packed record
  434.     cbSize: Cardinal;
  435.     usUnityNote: Word;            // MIDI Unity Playback Note
  436.     sFineTune: SmallInt;          // Fine Tune in log tuning
  437.     lAttenuation: Longint;        // Overall Attenuation to be applied to data
  438.     fulOptions: Cardinal;         // Flag options
  439.     cSampleLoops: Cardinal;       // Count of Sample loops, 0 loops is one shot
  440.   end;
  441.   {$EXTERNALSYM _rwsmp}
  442.   WSMPL = _rwsmp;
  443.   {$EXTERNALSYM WSMPL}
  444.   TWSMPL = _rwsmp;
  445.  
  446.  
  447. // This loop type is a normal forward playing loop which is continually
  448. // played until the envelope reaches an off threshold in the release
  449. // portion of the volume envelope
  450.  
  451. const
  452.   WLOOP_TYPE_FORWARD   = 0;
  453.   {$EXTERNALSYM WLOOP_TYPE_FORWARD}
  454.  
  455. type
  456.   PWLoop = ^TWLoop;
  457.   _rloop = packed record
  458.     cbSize: Cardinal;
  459.     ulType: Cardinal;              // Loop Type
  460.     ulStart: Cardinal;             // Start of loop in samples
  461.     ulLength: Cardinal;            // Length of loop in samples
  462.   end;
  463.   {$EXTERNALSYM _rloop}
  464.   WLOOP = _rloop;
  465.   {$EXTERNALSYM WLOOP}
  466.   TWLoop = _rloop;
  467.  
  468.  
  469.  
  470.  
  471. (*
  472.  
  473.      dls2.h
  474.  
  475.      Description:
  476.  
  477.      Interface defines and structures for the DLS2 extensions of DLS.
  478.  
  479.  
  480.      Written by Microsoft 1998.  Released for public use.
  481.  
  482. *)
  483.  
  484.  
  485. (*
  486.      FOURCC's used in the DLS2 file, in addition to DLS1 chunks
  487. *)
  488.  
  489. const
  490.   FOURCC_RGN2 = DWORD(Byte('r') or (Byte('g') shl 8) or (Byte('n') shl 16) or (Byte('2') shl 24));
  491.   {$EXTERNALSYM FOURCC_RGN2}
  492.   FOURCC_LAR2 = DWORD(Byte('l') or (Byte('a') shl 8) or (Byte('r') shl 16) or (Byte('2') shl 24));
  493.   {$EXTERNALSYM FOURCC_LAR2}
  494.   FOURCC_ART2 = DWORD(Byte('a') or (Byte('r') shl 8) or (Byte('t') shl 16) or (Byte('2') shl 24));
  495.   {$EXTERNALSYM FOURCC_ART2}
  496.   FOURCC_CDL  = DWORD(Byte('c') or (Byte('d') shl 8) or (Byte('l') shl 16) or (Byte(' ') shl 24));
  497.   {$EXTERNALSYM FOURCC_CDL}
  498. //  FOURCC_DLID = DWORD(Byte('d') or (Byte('l') shl 8) or (Byte('i') shl 16) or (Byte('d') shl 24)); //Already defined above
  499.  
  500. (*
  501.      Articulation connection graph definitions. These are in addition to
  502.      the definitions in the DLS1 header.
  503. *)
  504.  
  505.   // Generic Sources (in addition to DLS1 sources.
  506.   CONN_SRC_POLYPRESSURE           = $0007; // Polyphonic Pressure
  507.   {$EXTERNALSYM CONN_SRC_POLYPRESSURE}
  508.   CONN_SRC_CHANNELPRESSURE        = $0008; // Channel Pressure
  509.   {$EXTERNALSYM CONN_SRC_CHANNELPRESSURE}
  510.   CONN_SRC_VIBRATO                = $0009; // Vibrato LFO
  511.   {$EXTERNALSYM CONN_SRC_VIBRATO}
  512.   CONN_SRC_MONOPRESSURE           = $000a; // MIDI Mono pressure
  513.   {$EXTERNALSYM CONN_SRC_MONOPRESSURE}
  514.  
  515.  
  516.   // Midi Controllers
  517.   CONN_SRC_CC91                   = $00db; // Reverb Send
  518.   {$EXTERNALSYM CONN_SRC_CC91}
  519.   CONN_SRC_CC93                   = $00dd; // Chorus Send
  520.   {$EXTERNALSYM CONN_SRC_CC93}
  521.  
  522.  
  523.   (* Generic Destinations *)
  524.   CONN_DST_GAIN           = $0001; // Same as CONN_DST_ ATTENUATION, but more appropriate terminology.
  525.   {$EXTERNALSYM CONN_DST_GAIN}
  526.   CONN_DST_KEYNUMBER      = $0005; // Key Number Generator
  527.   {$EXTERNALSYM CONN_DST_KEYNUMBER}
  528.  
  529.   // Audio Channel Output Destinations
  530.   CONN_DST_LEFT           = $0010; // Left Channel Send
  531.   {$EXTERNALSYM CONN_DST_LEFT}
  532.   CONN_DST_RIGHT          = $0011; // Right Channel Send
  533.   {$EXTERNALSYM CONN_DST_RIGHT}
  534.   CONN_DST_CENTER         = $0012; // Center Channel Send
  535.   {$EXTERNALSYM CONN_DST_CENTER}
  536.   CONN_DST_LEFTREAR       = $0013; // Left Rear Channel Send
  537.   {$EXTERNALSYM CONN_DST_LEFTREAR}
  538.   CONN_DST_RIGHTREAR      = $0014; // Right Rear Channel Send
  539.   {$EXTERNALSYM CONN_DST_RIGHTREAR}
  540.   CONN_DST_LFE_CHANNEL    = $0015; // LFE Channel Send
  541.   {$EXTERNALSYM CONN_DST_LFE_CHANNEL}
  542.   CONN_DST_CHORUS         = $0080; // Chorus Send
  543.   {$EXTERNALSYM CONN_DST_CHORUS}
  544.   CONN_DST_REVERB         = $0081; // Reverb Send
  545.   {$EXTERNALSYM CONN_DST_REVERB}
  546.  
  547.   // Vibrato LFO Destinations
  548.   CONN_DST_VIB_FREQUENCY  = $0114; // Vibrato Frequency
  549.   {$EXTERNALSYM CONN_DST_VIB_FREQUENCY}
  550.   CONN_DST_VIB_STARTDELAY = $0115; // Vibrato Start Delay
  551.   {$EXTERNALSYM CONN_DST_VIB_STARTDELAY}
  552.  
  553.   // EG1 Destinations
  554.   CONN_DST_EG1_DELAYTIME    = $020B; // EG1 Delay Time
  555.   {$EXTERNALSYM CONN_DST_EG1_DELAYTIME}
  556.   CONN_DST_EG1_HOLDTIME     = $020C; // EG1 Hold Time
  557.   {$EXTERNALSYM CONN_DST_EG1_HOLDTIME}
  558.   CONN_DST_EG1_SHUTDOWNTIME = $020D; // EG1 Shutdown Time
  559.   {$EXTERNALSYM CONN_DST_EG1_SHUTDOWNTIME}
  560.  
  561.  
  562.   //    EG2 Destinations
  563.   CONN_DST_EG2_DELAYTIME  = $030F; // EG2 Delay Time
  564.   {$EXTERNALSYM CONN_DST_EG2_DELAYTIME}
  565.   CONN_DST_EG2_HOLDTIME   = $0310; // EG2 Hold Time
  566.   {$EXTERNALSYM CONN_DST_EG2_HOLDTIME}
  567.  
  568.  
  569.   // Filter Destinations
  570.   CONN_DST_FILTER_CUTOFF  = $0500; // Filter Cutoff Frequency
  571.   {$EXTERNALSYM CONN_DST_FILTER_CUTOFF}
  572.   CONN_DST_FILTER_Q       = $0501; // Filter Resonance
  573.   {$EXTERNALSYM CONN_DST_FILTER_Q}
  574.  
  575.  
  576.   // Transforms
  577.   CONN_TRN_CONVEX         = $0002; // Convex Transform
  578.   {$EXTERNALSYM CONN_TRN_CONVEX}
  579.   CONN_TRN_SWITCH         = $0003; // Switch Transform
  580.   {$EXTERNALSYM CONN_TRN_SWITCH}
  581.  
  582.  
  583.   // Conditional chunk operators
  584.   DLS_CDL_AND             = $0001;// X = X & Y
  585.   {$EXTERNALSYM DLS_CDL_AND}
  586.   DLS_CDL_OR              = $0002;// X = X | Y
  587.   {$EXTERNALSYM DLS_CDL_OR}
  588.   DLS_CDL_XOR             = $0003;// X = X ^ Y
  589.   {$EXTERNALSYM DLS_CDL_XOR}
  590.   DLS_CDL_ADD             = $0004;// X = X + Y
  591.   {$EXTERNALSYM DLS_CDL_ADD}
  592.   DLS_CDL_SUBTRACT        = $0005;// X = X - Y
  593.   {$EXTERNALSYM DLS_CDL_SUBTRACT}
  594.   DLS_CDL_MULTIPLY        = $0006;// X = X * Y
  595.   {$EXTERNALSYM DLS_CDL_MULTIPLY}
  596.   DLS_CDL_DIVIDE          = $0007;// X = X / Y
  597.   {$EXTERNALSYM DLS_CDL_DIVIDE}
  598.   DLS_CDL_LOGICAL_AND     = $0008;// X = X && Y
  599.   {$EXTERNALSYM DLS_CDL_LOGICAL_AND}
  600.   DLS_CDL_LOGICAL_OR      = $0009;// X = X || Y
  601.   {$EXTERNALSYM DLS_CDL_LOGICAL_OR}
  602.   DLS_CDL_LT              = $000A;// X = (X < Y)
  603.   {$EXTERNALSYM DLS_CDL_LT}
  604.   DLS_CDL_LE              = $000B;// X = (X <= Y)
  605.   {$EXTERNALSYM DLS_CDL_LE}
  606.   DLS_CDL_GT              = $000C;// X = (X > Y)
  607.   {$EXTERNALSYM DLS_CDL_GT}
  608.   DLS_CDL_GE              = $000D;// X = (X >= Y)
  609.   {$EXTERNALSYM DLS_CDL_GE}
  610.   DLS_CDL_EQ              = $000E;// X = (X == Y)
  611.   {$EXTERNALSYM DLS_CDL_EQ}
  612.   DLS_CDL_NOT             = $000F;// X = !X
  613.   {$EXTERNALSYM DLS_CDL_NOT}
  614.   DLS_CDL_CONST           = $0010;// 32-bit constant
  615.   {$EXTERNALSYM DLS_CDL_CONST}
  616.   DLS_CDL_QUERY           = $0011;// 32-bit value returned from query
  617.   {$EXTERNALSYM DLS_CDL_QUERY}
  618.   DLS_CDL_QUERYSUPPORTED  = $0012;// Test to see if query is supported by synth
  619.   {$EXTERNALSYM DLS_CDL_QUERYSUPPORTED}
  620.  
  621.   (*
  622.     Loop and release
  623.   *)
  624.  
  625.   WLOOP_TYPE_RELEASE = 1;
  626.   {$EXTERNALSYM WLOOP_TYPE_RELEASE}
  627.  
  628.   (*
  629.     WaveLink chunk <wlnk-ck>
  630.   *)
  631.  
  632.   F_WAVELINK_MULTICHANNEL = $0002;
  633.   {$EXTERNALSYM F_WAVELINK_MULTICHANNEL}
  634.  
  635.  
  636. const
  637.   (*
  638.     DLSID queries for <cdl-ck>
  639.   *)
  640.  
  641.   DLSID_GMInHardware: TGUID = '{178f2f24-c364-11d1-a760-0000f875ac12}';
  642.   {$EXTERNALSYM DLSID_GMInHardware}
  643.   DLSID_GSInHardware: TGUID = '{178f2f25-c364-11d1-a760-0000f875ac12}';
  644.   {$EXTERNALSYM DLSID_GSInHardware}
  645.   DLSID_XGInHardware: TGUID = '{178f2f26-c364-11d1-a760-0000f875ac12}';
  646.   {$EXTERNALSYM DLSID_XGInHardware}
  647.   DLSID_SupportsDLS1: TGUID = '{178f2f27-c364-11d1-a760-0000f875ac12}';
  648.   {$EXTERNALSYM DLSID_SupportsDLS1}
  649.   DLSID_SupportsDLS2: TGUID = '{f14599e5-4689-11d2-afa6-00aa0024d8b6}';
  650.   {$EXTERNALSYM DLSID_SupportsDLS2}
  651.   DLSID_SampleMemorySize: TGUID = '{178f2f28-c364-11d1-a760-0000f875ac12}';
  652.   {$EXTERNALSYM DLSID_SampleMemorySize}
  653.   DLSID_ManufacturersID: TGUID = '{b03e1181-8095-11d2-a1ef-00600833dbd8}';
  654.   {$EXTERNALSYM DLSID_ManufacturersID}
  655.   DLSID_ProductID: TGUID = '{b03e1182-8095-11d2-a1ef-00600833dbd8}';
  656.   {$EXTERNALSYM DLSID_ProductID}
  657.   DLSID_SamplePlaybackRate: TGUID = '{2a91f713-a4bf-11d2-bbdf-00600833dbd8}';
  658.   {$EXTERNALSYM DLSID_SamplePlaybackRate}
  659.  
  660.  
  661.  
  662. (************************************************************************
  663. *                                                                       *
  664. *   dmdls.h -- DLS download definitions for DirectMusic API's           *
  665. *                                                                       *
  666. *   Copyright (c) Microsoft Corporation.  All rights reserved.          *
  667. *                                                                       *
  668. ************************************************************************)
  669.  
  670. type
  671.   PCENT = Longint;     (* Pitch cents *)
  672.   {$EXTERNALSYM PCENT}
  673.   GCENT = Longint;     (* Gain cents *)
  674.   {$EXTERNALSYM GCENT}
  675.   TCENT = Longint;     (* Time cents *)
  676.   {$EXTERNALSYM TCENT}
  677.   PERCENT = Longint;   (* Per.. cent! *)
  678.   {$EXTERNALSYM PERCENT}
  679.  
  680.  
  681.   PReferenceTime = ^TReferenceTime;
  682.   REFERENCE_TIME = LONGLONG;
  683.   {$EXTERNALSYM REFERENCE_TIME}
  684.   TReferenceTime = REFERENCE_TIME;
  685.   PReference_Time = PReferenceTime;
  686.   TReference_Time = TReferenceTime;
  687.  
  688.   PDMusDownloadInfo = ^TDMusDownloadInfo;
  689.   _DMUS_DOWNLOADINFO = packed record
  690.     dwDLType: DWORD;                     // Instrument or Wave
  691.     dwDLId: DWORD;                       // Unique identifier to tag this download.
  692.     dwNumOffsetTableEntries: DWORD;      // Number of index in the offset address table.
  693.     cbSize: DWORD;                       // Total size of this memory chunk.
  694.   end;
  695.   {$EXTERNALSYM _DMUS_DOWNLOADINFO}
  696.   DMUS_DOWNLOADINFO = _DMUS_DOWNLOADINFO;
  697.   {$EXTERNALSYM DMUS_DOWNLOADINFO}
  698.   TDMusDownloadInfo = _DMUS_DOWNLOADINFO;
  699.  
  700. const
  701.   DMUS_DOWNLOADINFO_INSTRUMENT        = 1;
  702.   {$EXTERNALSYM DMUS_DOWNLOADINFO_INSTRUMENT}
  703.   DMUS_DOWNLOADINFO_WAVE              = 2;
  704.   {$EXTERNALSYM DMUS_DOWNLOADINFO_WAVE}
  705.   DMUS_DOWNLOADINFO_INSTRUMENT2       = 3;   (* New version for better DLS2 support. *)
  706.   {$EXTERNALSYM DMUS_DOWNLOADINFO_INSTRUMENT2}
  707.  
  708. (* Support for oneshot and streaming wave data 
  709.  *)
  710.   DMUS_DOWNLOADINFO_WAVEARTICULATION  = 4;   (* Wave articulation data *)
  711.   {$EXTERNALSYM DMUS_DOWNLOADINFO_WAVEARTICULATION}
  712.   DMUS_DOWNLOADINFO_STREAMINGWAVE     = 5;   (* One chunk of a streaming *)
  713.   {$EXTERNALSYM DMUS_DOWNLOADINFO_STREAMINGWAVE}
  714.   DMUS_DOWNLOADINFO_ONESHOTWAVE       = 6;
  715.   {$EXTERNALSYM DMUS_DOWNLOADINFO_ONESHOTWAVE}
  716.  
  717.   DMUS_DEFAULT_SIZE_OFFSETTABLE   = 1;
  718.   {$EXTERNALSYM DMUS_DEFAULT_SIZE_OFFSETTABLE}
  719.  
  720. (* Flags for DMUS_INSTRUMENT's ulFlags member *)
  721.  
  722.   DMUS_INSTRUMENT_GM_INSTRUMENT   = (1 shr 0);
  723.   {$EXTERNALSYM DMUS_INSTRUMENT_GM_INSTRUMENT}
  724.  
  725. type
  726.   PDMusOffsetTable = ^TDMusOffsetTable;
  727.   _DMUS_OFFSETTABLE = packed record
  728.     ulOffsetTable: array[0..DMUS_DEFAULT_SIZE_OFFSETTABLE - 1] of Cardinal;
  729.   end;
  730.   {$EXTERNALSYM _DMUS_OFFSETTABLE}
  731.   DMUS_OFFSETTABLE = _DMUS_OFFSETTABLE;
  732.   {$EXTERNALSYM DMUS_OFFSETTABLE}
  733.   TDMusOffsetTable = _DMUS_OFFSETTABLE;
  734.  
  735.   PDMusInstrument = ^TDMusInstrument;
  736.   _DMUS_INSTRUMENT = packed record
  737.     ulPatch: Cardinal;
  738.     ulFirstRegionIdx: Cardinal;
  739.     ulGlobalArtIdx: Cardinal;         // If zero the instrument does not have an articulation
  740.     ulFirstExtCkIdx: Cardinal;        // If zero no 3rd party entenstion chunks associated with the instrument
  741.     ulCopyrightIdx: Cardinal;         // If zero no Copyright information associated with the instrument
  742.     ulFlags: Cardinal;
  743.   end;
  744.   {$EXTERNALSYM _DMUS_INSTRUMENT}
  745.   DMUS_INSTRUMENT = _DMUS_INSTRUMENT;
  746.   {$EXTERNALSYM DMUS_INSTRUMENT}
  747.   TDMusInstrument = _DMUS_INSTRUMENT;
  748.  
  749.   PDMusRegion = ^TDMusRegion;
  750.   _DMUS_REGION = packed record
  751.     RangeKey: TRGNRange;
  752.     RangeVelocity: TRGNRange;
  753.     fusOptions: Word;
  754.     usKeyGroup: Word;
  755.     ulRegionArtIdx: Cardinal;         // If zero the region does not have an articulation
  756.     ulNextRegionIdx: Cardinal;        // If zero no more regions
  757.     ulFirstExtCkIdx: Cardinal;        // If zero no 3rd party entenstion chunks associated with the region
  758.     WaveLink: TWaveLink;
  759.     WSMP: TWSMPL;                     //  If WSMP.cSampleLoops > 1 then a WLOOP is included
  760.     WLOOP: array [0..0] of TWLoop;
  761.   end;
  762.   {$EXTERNALSYM _DMUS_REGION}
  763.   DMUS_REGION = _DMUS_REGION;
  764.   {$EXTERNALSYM DMUS_REGION}
  765.   TDMusRegion = _DMUS_REGION;
  766.  
  767.   PDMusLFOParams = ^TDMusLFOParams;
  768.   _DMUS_LFOPARAMS = packed record
  769.     pcFrequency: PCENT;
  770.     tcDelay: TCENT;
  771.     gcVolumeScale: GCENT;
  772.     pcPitchScale: PCENT;
  773.     gcMWToVolume: GCENT;
  774.     pcMWToPitch: PCENT;
  775.   end;
  776.   {$EXTERNALSYM _DMUS_LFOPARAMS}
  777.   DMUS_LFOPARAMS = _DMUS_LFOPARAMS;
  778.   {$EXTERNALSYM DMUS_LFOPARAMS}
  779.   TDMusLFOParams = _DMUS_LFOPARAMS;
  780.  
  781.   PDMusVEGParams = ^TDMusVEGParams;
  782.   _DMUS_VEGPARAMS = packed record
  783.     tcAttack: TCENT;
  784.     tcDecay: TCENT;
  785.     ptSustain: PERCENT;
  786.     tcRelease: TCENT;
  787.     tcVel2Attack: TCENT;
  788.     tcKey2Decay: TCENT;
  789.   end;
  790.   {$EXTERNALSYM _DMUS_VEGPARAMS}
  791.   DMUS_VEGPARAMS = _DMUS_VEGPARAMS;
  792.   {$EXTERNALSYM DMUS_VEGPARAMS}
  793.   TDMusVEGParams = _DMUS_VEGPARAMS;
  794.  
  795.   PDMusPEGParams = ^TDMusPEGParams;
  796.   _DMUS_PEGPARAMS = packed record
  797.     tcAttack: TCENT;
  798.     tcDecay: TCENT;
  799.     ptSustain: PERCENT;
  800.     tcRelease: TCENT;
  801.     tcVel2Attack: TCENT;
  802.     tcKey2Decay: TCENT;
  803.     pcRange: PCENT;
  804.   end;
  805.   {$EXTERNALSYM _DMUS_PEGPARAMS}
  806.   DMUS_PEGPARAMS = _DMUS_PEGPARAMS;
  807.   {$EXTERNALSYM DMUS_PEGPARAMS}
  808.   TDMusPEGParams = _DMUS_PEGPARAMS;
  809.  
  810.   PDMusMSCParams = ^TDMusMSCParams;
  811.   _DMUS_MSCPARAMS = packed record
  812.     ptDefaultPan: PERCENT;
  813.   end;
  814.   {$EXTERNALSYM _DMUS_MSCPARAMS}
  815.   DMUS_MSCPARAMS = _DMUS_MSCPARAMS;
  816.   {$EXTERNALSYM DMUS_MSCPARAMS}
  817.   TDMusMSCParams = _DMUS_MSCPARAMS;
  818.  
  819.   PDMusArticParams = ^TDMusArticParams;
  820.   _DMUS_ARTICPARAMS = packed record
  821.     LFO: TDMusLFOParams;
  822.     VolEG: TDMusVEGParams;
  823.     PitchEG: TDMusPEGParams;
  824.     Misc: TDMusMSCParams;
  825.   end;
  826.   {$EXTERNALSYM _DMUS_ARTICPARAMS}
  827.   DMUS_ARTICPARAMS = _DMUS_ARTICPARAMS;
  828.   {$EXTERNALSYM DMUS_ARTICPARAMS}
  829.   TDMusArticParams = _DMUS_ARTICPARAMS;
  830.  
  831.   PDMusArticulation = ^TDMusArticulation;
  832.   _DMUS_ARTICULATION = packed record (* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT format. *)
  833.     ulArt1Idx: Cardinal;              // DLS Level 1 articulation chunk
  834.     ulFirstExtCkIdx: Cardinal;        // 3rd party extenstion chunks associated with the articulation
  835.   end;
  836.   {$EXTERNALSYM _DMUS_ARTICULATION}
  837.   DMUS_ARTICULATION = _DMUS_ARTICULATION;
  838.   {$EXTERNALSYM DMUS_ARTICULATION}
  839.   TDMusArticulation = _DMUS_ARTICULATION;
  840.  
  841.   PDMusArticulation2 = ^TDMusArticulation2;
  842.   _DMUS_ARTICULATION2 = packed record (* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT2 format. *)
  843.     ulArtIdx: Cardinal;               (* DLS Level 1/2 articulation chunk *)
  844.     ulFirstExtCkIdx: Cardinal;        (* 3rd party extenstion chunks associated with the articulation *)
  845.     ulNextArtIdx: Cardinal;           (* Additional articulation chunks *)
  846.   end;
  847.   {$EXTERNALSYM _DMUS_ARTICULATION2}
  848.   DMUS_ARTICULATION2 = _DMUS_ARTICULATION2;
  849.   {$EXTERNALSYM DMUS_ARTICULATION2}
  850.   TDMusArticulation2 = _DMUS_ARTICULATION2;
  851.  
  852. const
  853.   DMUS_MIN_DATA_SIZE = 4;
  854.   {$EXTERNALSYM DMUS_MIN_DATA_SIZE}
  855.  
  856. type
  857.   (*  The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK *)
  858.  
  859.   PDMusExtensionChunk = ^TDMusExtensionChunk;
  860.   _DMUS_EXTENSIONCHUNK = packed record
  861.     cbSize: Cardinal;                      (*  Size of extension chunk  *)
  862.     ulNextExtCkIdx: Cardinal;              (*  If zero no more 3rd party entenstion chunks *)
  863.     ExtCkID: FOURCC;
  864.     byExtCk: array[0..DMUS_MIN_DATA_SIZE-1] of Byte; (*  The actual number that follows is determined by cbSize *)
  865.   end;
  866.   {$EXTERNALSYM _DMUS_EXTENSIONCHUNK}
  867.   DMUS_EXTENSIONCHUNK = _DMUS_EXTENSIONCHUNK;
  868.   {$EXTERNALSYM DMUS_EXTENSIONCHUNK}
  869.   TDMusExtensionChunk = _DMUS_EXTENSIONCHUNK;
  870.  
  871.   (*  The actual number is determined by cbSize of struct _DMUS_COPYRIGHT *)
  872.  
  873.   PDMusCopyright = ^TDMusCopyright;
  874.   _DMUS_COPYRIGHT = packed record
  875.     cbSize: Cardinal;                             (*  Size of copyright information *)
  876.     byCopyright: array[0..DMUS_MIN_DATA_SIZE-1] of Byte;    (*  The actual number that follows is determined by cbSize *)
  877.   end;
  878.   {$EXTERNALSYM _DMUS_COPYRIGHT}
  879.   DMUS_COPYRIGHT = _DMUS_COPYRIGHT;
  880.   {$EXTERNALSYM DMUS_COPYRIGHT}
  881.   TDMusCopyright = _DMUS_COPYRIGHT;
  882.  
  883.   PDMusWaveData = ^TDMusWaveData;
  884.   _DMUS_WAVEDATA = packed record
  885.     cbSize:           Cardinal;
  886.     byData: array[0..DMUS_MIN_DATA_SIZE-1] of Byte;
  887.   end;
  888.   {$EXTERNALSYM _DMUS_WAVEDATA}
  889.   DMUS_WAVEDATA = _DMUS_WAVEDATA;
  890.   {$EXTERNALSYM DMUS_WAVEDATA}
  891.   TDMusWaveData = _DMUS_WAVEDATA;
  892.  
  893.   PDMusWave = ^TDMusWave;
  894.   _DMUS_WAVE = packed record
  895.     ulFirstExtCkIdx: Cardinal;    (* If zero no 3rd party entenstion chunks associated with the wave *)
  896.     ulCopyrightIdx: Cardinal;     (* If zero no Copyright information associated with the wave *)
  897.     ulWaveDataIdx: Cardinal;      (* Location of actual wave data. *)
  898.     WaveformatEx: tWAVEFORMATEX;
  899.   end;
  900.   {$EXTERNALSYM _DMUS_WAVE}
  901.   DMUS_WAVE = _DMUS_WAVE;
  902.   {$EXTERNALSYM DMUS_WAVE}
  903.   TDMusWave = _DMUS_WAVE;
  904.  
  905.   PDMusNoteRange = ^TDMusNoteRange;
  906.   _DMUS_NOTERANGE = packed record
  907.     dwLowNote: DWORD;  (* Sets the low note for the range of MIDI note events to which the instrument responds.*)
  908.     dwHighNote: DWORD; (* Sets the high note for the range of MIDI note events to which the instrument responds.*)
  909.   end;
  910.   {$EXTERNALSYM _DMUS_NOTERANGE}
  911.   DMUS_NOTERANGE = _DMUS_NOTERANGE;
  912.   {$EXTERNALSYM DMUS_NOTERANGE}
  913.   TDMusNoteRange = _DMUS_NOTERANGE;
  914.  
  915.   PDMusWaveArtDL = ^TDMusWaveArtDL;
  916.   _DMUS_WAVEARTDL = packed record
  917.     ulDownloadIdIdx: Cardinal;    (* Download ID's of each buffer *)
  918.     ulBus: Cardinal;              (* Playback bus *)
  919.     ulBuffers: Cardinal;          (* Buffers *)
  920.     ulMasterDLId: Cardinal;       (* Download ID of master voice of slave group *)
  921.     usOptions: Word;              (* Same as DLS2 region options *)
  922.   end;
  923.   {$EXTERNALSYM _DMUS_WAVEARTDL}
  924.   DMUS_WAVEARTDL = _DMUS_WAVEARTDL;
  925.   {$EXTERNALSYM DMUS_WAVEARTDL}
  926.   TDMusWaveArtDL = _DMUS_WAVEARTDL;
  927.  
  928.   PDMusWaveDL = ^TDMusWaveDL;
  929.   _DMUS_WAVEDL = packed record
  930.     cbWaveData: Cardinal;         (* Bytes of wave data *)
  931.   end;
  932.   {$EXTERNALSYM _DMUS_WAVEDL}
  933.   DMUS_WAVEDL = _DMUS_WAVEDL;
  934.   {$EXTERNALSYM DMUS_WAVEDL}
  935.   TDMusWaveDL = _DMUS_WAVEDL;
  936.  
  937.  
  938.  
  939.  
  940.  
  941. (************************************************************************
  942. *                                                                       *
  943. *   dmerror.h -- Error codes returned by DirectMusic API's              *
  944. *                                                                       *
  945. *   Copyright (c) Microsoft Corporation.  All rights reserved.          *
  946. *                                                                       *
  947. ************************************************************************)
  948.  
  949. const
  950.   FACILITY_DIRECTMUSIC      = $878;       (* Shared with DirectSound *)
  951.   {$EXTERNALSYM FACILITY_DIRECTMUSIC}
  952.   DMUS_ERRBASE              = $1000;      (* Make error codes human readable in hex *)
  953.   {$EXTERNALSYM DMUS_ERRBASE}
  954.  
  955. // #define MAKE_DMHRESULTSUCCESS(code)     MAKE_HRESULT(0, FACILITY_DIRECTMUSIC, (DMUS_ERRBASE + (code)))
  956. function MAKE_DMHRESULTSUCCESS(Code: DWord): DWord;
  957. {$EXTERNALSYM MAKE_DMHRESULTSUCCESS}
  958. // #define MAKE_DMHRESULTERROR(code)       MAKE_HRESULT(1, FACILITY_DIRECTMUSIC, (DMUS_ERRBASE + (code)))
  959. function MAKE_DMHRESULTERROR(Code: DWord): DWord;
  960. {$EXTERNALSYM MAKE_DMHRESULTERROR}
  961.  
  962.  
  963. const
  964.   MAKE_DMHRESULTSUCCESS_R = (0 shl 31) or (FACILITY_DIRECTMUSIC shl 16) or DMUS_ERRBASE;
  965.   MAKE_DMHRESULTERROR_R =   (1 shl 31) or (FACILITY_DIRECTMUSIC shl 16) or DMUS_ERRBASE;
  966.  
  967. (* DMUS_S_PARTIALLOAD
  968.  *
  969.  * The object could only load partially. This can happen if some components are
  970.  * not registered properly, such as embedded tracks and tools. This can also happen
  971.  * if some content is missing. For example, if a segment uses a DLS collection that
  972.  * is not in the loader's current search directory.
  973.  *)
  974.   DMUS_S_PARTIALLOAD               = (MAKE_DMHRESULTSUCCESS_R + $091);
  975.   {$EXTERNALSYM DMUS_S_PARTIALLOAD}
  976.  
  977. (* DMUS_S_PARTIALDOWNLOAD
  978.  *
  979.  * Return value from IDirectMusicBand::Download() which indicates that
  980.  * some of the instruments safely downloaded, but others failed. This usually
  981.  * occurs when some instruments are on PChannels not supported by the performance
  982.  * or port.
  983.  *)
  984.   DMUS_S_PARTIALDOWNLOAD           = (MAKE_DMHRESULTSUCCESS_R + $092);
  985.   {$EXTERNALSYM DMUS_S_PARTIALDOWNLOAD}
  986.  
  987. (* DMUS_S_REQUEUE
  988.  *
  989.  * Return value from IDirectMusicTool::ProcessPMsg() which indicates to the
  990.  * performance that it should cue the PMsg again automatically.
  991.  *)
  992.   DMUS_S_REQUEUE                   = (MAKE_DMHRESULTSUCCESS_R + $200);
  993.   {$EXTERNALSYM DMUS_S_REQUEUE}
  994.  
  995. (* DMUS_S_FREE
  996.  *
  997.  * Return value from IDirectMusicTool::ProcessPMsg() which indicates to the
  998.  * performance that it should free the PMsg automatically.
  999.  *)
  1000.   DMUS_S_FREE                      = (MAKE_DMHRESULTSUCCESS_R + $201);
  1001.   {$EXTERNALSYM DMUS_S_FREE}
  1002.  
  1003. (* DMUS_S_END
  1004.  *
  1005.  * Return value from IDirectMusicTrack::Play() which indicates to the
  1006.  * segment that the track has no more data after mtEnd.
  1007.  *)
  1008.   DMUS_S_END                       = (MAKE_DMHRESULTSUCCESS_R + $202);
  1009.   {$EXTERNALSYM DMUS_S_END}
  1010.  
  1011. (* DMUS_S_STRING_TRUNCATED
  1012.  *
  1013.  * Returned string has been truncated to fit the buffer size.
  1014.  *)
  1015.   DMUS_S_STRING_TRUNCATED          = (MAKE_DMHRESULTSUCCESS_R + $210);
  1016.   {$EXTERNALSYM DMUS_S_STRING_TRUNCATED}
  1017.  
  1018. (* DMUS_S_LAST_TOOL
  1019.  *
  1020.  * Returned from IDirectMusicGraph::StampPMsg(), this indicates that the PMsg
  1021.  * is already stamped with the last tool in the graph. The returned PMsg's
  1022.  * tool pointer is now NULL.
  1023.  *)
  1024.   DMUS_S_LAST_TOOL                 = (MAKE_DMHRESULTSUCCESS_R + $211);
  1025.   {$EXTERNALSYM DMUS_S_LAST_TOOL}
  1026.  
  1027. (* DMUS_S_OVER_CHORD
  1028.  *
  1029.  * Returned from IDirectMusicPerformance::MusicToMIDI(), this indicates
  1030.  * that no note has been calculated because the music value has the note
  1031.  * at a position higher than the top note of the chord. This applies only
  1032.  * to DMUS_PLAYMODE_NORMALCHORD play mode. This success code indicates
  1033.  * that the caller should not do anything with the note. It is not meant
  1034.  * to be played against this chord.
  1035.  *)
  1036.   DMUS_S_OVER_CHORD                = (MAKE_DMHRESULTSUCCESS_R + $212);
  1037.   {$EXTERNALSYM DMUS_S_OVER_CHORD}
  1038.  
  1039. (* DMUS_S_UP_OCTAVE
  1040.  *
  1041.  * Returned from IDirectMusicPerformance::MIDIToMusic(),  and
  1042.  * IDirectMusicPerformance::MusicToMIDI(), this indicates
  1043.  * that the note conversion generated a note value that is below 0,
  1044.  * so it has been bumped up one or more octaves to be in the proper
  1045.  * MIDI range of 0 through 127.
  1046.  * Note that this is valid for MIDIToMusic() when using play modes
  1047.  * DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of
  1048.  * which store MIDI values in wMusicValue. With MusicToMIDI(), it is
  1049.  * valid for all play modes.
  1050.  * Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.
  1051.  *)
  1052.   DMUS_S_UP_OCTAVE                 = (MAKE_DMHRESULTSUCCESS_R + $213);
  1053.   {$EXTERNALSYM DMUS_S_UP_OCTAVE}
  1054.  
  1055. (* DMUS_S_DOWN_OCTAVE
  1056.  *
  1057.  * Returned from IDirectMusicPerformance::MIDIToMusic(),  and
  1058.  * IDirectMusicPerformance::MusicToMIDI(), this indicates
  1059.  * that the note conversion generated a note value that is above 127,
  1060.  * so it has been bumped down one or more octaves to be in the proper
  1061.  * MIDI range of 0 through 127.
  1062.  * Note that this is valid for MIDIToMusic() when using play modes
  1063.  * DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of
  1064.  * which store MIDI values in wMusicValue. With MusicToMIDI(), it is
  1065.  * valid for all play modes.
  1066.  * Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.
  1067.  *)
  1068.   DMUS_S_DOWN_OCTAVE               = (MAKE_DMHRESULTSUCCESS_R + $214);
  1069.   {$EXTERNALSYM DMUS_S_DOWN_OCTAVE}
  1070.  
  1071. (* DMUS_S_NOBUFFERCONTROL
  1072.  *
  1073.  * Although the audio output from the port will be routed to the
  1074.  * same device as the given DirectSound buffer, buffer controls
  1075.  * such as pan and volume will not affect the output.
  1076.  *
  1077.  *)
  1078.   DMUS_S_NOBUFFERCONTROL           = (MAKE_DMHRESULTSUCCESS_R + $215);
  1079.   {$EXTERNALSYM DMUS_S_NOBUFFERCONTROL}
  1080.  
  1081. (* DMUS_S_GARBAGE_COLLECTED
  1082.  *
  1083.  * The requested operation was not performed because during CollectGarbage
  1084.  * the loader determined that the object had been released.
  1085.  *)
  1086.   DMUS_S_GARBAGE_COLLECTED         = (MAKE_DMHRESULTSUCCESS_R + $216);
  1087.   {$EXTERNALSYM DMUS_S_GARBAGE_COLLECTED}
  1088.  
  1089. (* DMUS_E_DRIVER_FAILED
  1090.  *
  1091.  * An unexpected error was returned from a device driver, indicating
  1092.  * possible failure of the driver or hardware.
  1093.  *)
  1094.   DMUS_E_DRIVER_FAILED            = (MAKE_DMHRESULTERROR_R + $0101);
  1095.   {$EXTERNALSYM DMUS_E_DRIVER_FAILED}
  1096.  
  1097. (* DMUS_E_PORTS_OPEN
  1098.  *
  1099.  * The requested operation cannot be performed while there are
  1100.  * instantiated ports in any process in the system.
  1101.  *)
  1102.   DMUS_E_PORTS_OPEN               = (MAKE_DMHRESULTERROR_R + $0102);
  1103.   {$EXTERNALSYM DMUS_E_PORTS_OPEN}
  1104.  
  1105. (* DMUS_E_DEVICE_IN_USE
  1106.  *
  1107.  * The requested device is already in use (possibly by a non-DirectMusic
  1108.  * client) and cannot be opened again.
  1109.  *)
  1110.   DMUS_E_DEVICE_IN_USE            = (MAKE_DMHRESULTERROR_R + $0103);
  1111.   {$EXTERNALSYM DMUS_E_DEVICE_IN_USE}
  1112.  
  1113. (* DMUS_E_INSUFFICIENTBUFFER
  1114.  *
  1115.  * Buffer is not large enough for requested operation.
  1116.  *)
  1117.   DMUS_E_INSUFFICIENTBUFFER       = (MAKE_DMHRESULTERROR_R + $0104);
  1118.   {$EXTERNALSYM DMUS_E_INSUFFICIENTBUFFER}
  1119.  
  1120. (* DMUS_E_BUFFERNOTSET
  1121.  *
  1122.  * No buffer was prepared for the download data.
  1123.  *)
  1124.   DMUS_E_BUFFERNOTSET             = (MAKE_DMHRESULTERROR_R + $0105);
  1125.   {$EXTERNALSYM DMUS_E_BUFFERNOTSET}
  1126.  
  1127. (* DMUS_E_BUFFERNOTAVAILABLE
  1128.  *
  1129.  * Download failed due to inability to access or create download buffer.
  1130.  *)
  1131.   DMUS_E_BUFFERNOTAVAILABLE       = (MAKE_DMHRESULTERROR_R + $0106);
  1132.   {$EXTERNALSYM DMUS_E_BUFFERNOTAVAILABLE}
  1133.  
  1134. (* DMUS_E_NOTADLSCOL
  1135.  *
  1136.  * Error parsing DLS collection. File is corrupt.
  1137.  *)
  1138.   DMUS_E_NOTADLSCOL               = (MAKE_DMHRESULTERROR_R + $0108);
  1139.   {$EXTERNALSYM DMUS_E_NOTADLSCOL}
  1140.  
  1141. (* DMUS_E_INVALIDOFFSET
  1142.  *
  1143.  * Wave chunks in DLS collection file are at incorrect offsets.
  1144.  *)
  1145.   DMUS_E_INVALIDOFFSET            = (MAKE_DMHRESULTERROR_R + $0109);
  1146.   {$EXTERNALSYM DMUS_E_INVALIDOFFSET}
  1147.  
  1148. (* DMUS_E_ALREADY_LOADED
  1149.  *
  1150.  * Second attempt to load a DLS collection that is currently open.
  1151.  *)
  1152.   DMUS_E_ALREADY_LOADED           = (MAKE_DMHRESULTERROR_R + $0111);
  1153.   {$EXTERNALSYM DMUS_E_ALREADY_LOADED}
  1154.  
  1155. (* DMUS_E_INVALIDPOS
  1156.  *
  1157.  * Error reading wave data from DLS collection. Indicates bad file.
  1158.  *)
  1159.   DMUS_E_INVALIDPOS               = (MAKE_DMHRESULTERROR_R + $0113);
  1160.   {$EXTERNALSYM DMUS_E_INVALIDPOS}
  1161.  
  1162. (* DMUS_E_INVALIDPATCH
  1163.  *
  1164.  * There is no instrument in the collection that matches patch number.
  1165.  *)
  1166.   DMUS_E_INVALIDPATCH             = (MAKE_DMHRESULTERROR_R + $0114);
  1167.   {$EXTERNALSYM DMUS_E_INVALIDPATCH}
  1168.  
  1169. (* DMUS_E_CANNOTSEEK
  1170.  *
  1171.  * The IStream* doesn't support Seek().
  1172.  *)
  1173.   DMUS_E_CANNOTSEEK               = (MAKE_DMHRESULTERROR_R + $0115);
  1174.   {$EXTERNALSYM DMUS_E_CANNOTSEEK}
  1175.  
  1176. (* DMUS_E_CANNOTWRITE
  1177.  *
  1178.  * The IStream* doesn't support Write().
  1179.  *)
  1180.   DMUS_E_CANNOTWRITE              = (MAKE_DMHRESULTERROR_R + $0116);
  1181.   {$EXTERNALSYM DMUS_E_CANNOTWRITE}
  1182.  
  1183. (* DMUS_E_CHUNKNOTFOUND
  1184.  *
  1185.  * The RIFF parser doesn't contain a required chunk while parsing file.
  1186.  *)
  1187.   DMUS_E_CHUNKNOTFOUND            = (MAKE_DMHRESULTERROR_R + $0117);
  1188.   {$EXTERNALSYM DMUS_E_CHUNKNOTFOUND}
  1189.  
  1190. (* DMUS_E_INVALID_DOWNLOADID
  1191.  *
  1192.  * Invalid download id was used in the process of creating a download buffer.
  1193.  *)
  1194.   DMUS_E_INVALID_DOWNLOADID       = (MAKE_DMHRESULTERROR_R + $0119);
  1195.   {$EXTERNALSYM DMUS_E_INVALID_DOWNLOADID}
  1196.  
  1197. (* DMUS_E_NOT_DOWNLOADED_TO_PORT
  1198.  *
  1199.  * Tried to unload an object that was not downloaded or previously unloaded.
  1200.  *)
  1201.   DMUS_E_NOT_DOWNLOADED_TO_PORT   = (MAKE_DMHRESULTERROR_R + $0120);
  1202.   {$EXTERNALSYM DMUS_E_NOT_DOWNLOADED_TO_PORT}
  1203.  
  1204. (* DMUS_E_ALREADY_DOWNLOADED
  1205.  *
  1206.  * Buffer was already downloaded to synth.
  1207.  *)
  1208.   DMUS_E_ALREADY_DOWNLOADED       = (MAKE_DMHRESULTERROR_R + $0121);
  1209.   {$EXTERNALSYM DMUS_E_ALREADY_DOWNLOADED}
  1210.  
  1211. (* DMUS_E_UNKNOWN_PROPERTY
  1212.  *
  1213.  * The specified property item was not recognized by the target object.
  1214.  *)
  1215.   DMUS_E_UNKNOWN_PROPERTY         = (MAKE_DMHRESULTERROR_R + $0122);
  1216.   {$EXTERNALSYM DMUS_E_UNKNOWN_PROPERTY}
  1217.  
  1218. (* DMUS_E_SET_UNSUPPORTED
  1219.  *
  1220.  * The specified property item may not be set on the target object.
  1221.  *)
  1222.   DMUS_E_SET_UNSUPPORTED          = (MAKE_DMHRESULTERROR_R + $0123);
  1223.   {$EXTERNALSYM DMUS_E_SET_UNSUPPORTED}
  1224.  
  1225. (* DMUS_E_GET_UNSUPPORTED
  1226.  *
  1227.  * The specified property item may not be retrieved from the target object.
  1228.  *)
  1229.   DMUS_E_GET_UNSUPPORTED          = (MAKE_DMHRESULTERROR_R + $0124);
  1230.   {$EXTERNALSYM DMUS_E_GET_UNSUPPORTED}
  1231.  
  1232. (* DMUS_E_NOTMONO
  1233.  *
  1234.  * Wave chunk has more than one interleaved channel. DLS format requires MONO.
  1235.  *)
  1236.   DMUS_E_NOTMONO                  = (MAKE_DMHRESULTERROR_R + $0125);
  1237.   {$EXTERNALSYM DMUS_E_NOTMONO}
  1238.  
  1239. (* DMUS_E_BADARTICULATION
  1240.  *
  1241.  * Invalid articulation chunk in DLS collection.
  1242.  *)
  1243.   DMUS_E_BADARTICULATION          = (MAKE_DMHRESULTERROR_R + $0126);
  1244.   {$EXTERNALSYM DMUS_E_BADARTICULATION}
  1245.  
  1246. (* DMUS_E_BADINSTRUMENT
  1247.  *
  1248.  * Invalid instrument chunk in DLS collection.
  1249.  *)
  1250.   DMUS_E_BADINSTRUMENT            = (MAKE_DMHRESULTERROR_R + $0127);
  1251.   {$EXTERNALSYM DMUS_E_BADINSTRUMENT}
  1252.  
  1253. (* DMUS_E_BADWAVELINK
  1254.  *
  1255.  * Wavelink chunk in DLS collection points to invalid wave.
  1256.  *)
  1257.   DMUS_E_BADWAVELINK              = (MAKE_DMHRESULTERROR_R + $0128);
  1258.   {$EXTERNALSYM DMUS_E_BADWAVELINK}
  1259.  
  1260. (* DMUS_E_NOARTICULATION
  1261.  *
  1262.  * Articulation missing from instrument in DLS collection.
  1263.  *)
  1264.   DMUS_E_NOARTICULATION           = (MAKE_DMHRESULTERROR_R + $0129);
  1265.   {$EXTERNALSYM DMUS_E_NOARTICULATION}
  1266.  
  1267. (* DMUS_E_NOTPCM
  1268.  *
  1269.  * Downoaded DLS wave is not in PCM format.
  1270. *)
  1271.   DMUS_E_NOTPCM                   = (MAKE_DMHRESULTERROR_R + $012A);
  1272.   {$EXTERNALSYM DMUS_E_NOTPCM}
  1273.  
  1274. (* DMUS_E_BADWAVE
  1275.  *
  1276.  * Bad wave chunk in DLS collection
  1277.  *)
  1278.   DMUS_E_BADWAVE                  = (MAKE_DMHRESULTERROR_R + $012B);
  1279.   {$EXTERNALSYM DMUS_E_BADWAVE}
  1280.  
  1281. (* DMUS_E_BADOFFSETTABLE
  1282.  *
  1283.  * Offset Table for download buffer has errors.
  1284.  *)
  1285.   DMUS_E_BADOFFSETTABLE           = (MAKE_DMHRESULTERROR_R + $012C);
  1286.   {$EXTERNALSYM DMUS_E_BADOFFSETTABLE}
  1287.  
  1288. (* DMUS_E_UNKNOWNDOWNLOAD
  1289.  *
  1290.  * Attempted to download unknown data type.
  1291.  *)
  1292.   DMUS_E_UNKNOWNDOWNLOAD          = (MAKE_DMHRESULTERROR_R + $012D);
  1293.   {$EXTERNALSYM DMUS_E_UNKNOWNDOWNLOAD}
  1294.  
  1295. (* DMUS_E_NOSYNTHSINK
  1296.  *
  1297.  * The operation could not be completed because no sink was connected to
  1298.  * the synthesizer.
  1299.  *)
  1300.   DMUS_E_NOSYNTHSINK              = (MAKE_DMHRESULTERROR_R + $012E);
  1301.   {$EXTERNALSYM DMUS_E_NOSYNTHSINK}
  1302.  
  1303. (* DMUS_E_ALREADYOPEN
  1304.  *
  1305.  * An attempt was made to open the software synthesizer while it was already
  1306.  * open.
  1307.  * ASSERT?
  1308.  *)
  1309.   DMUS_E_ALREADYOPEN              = (MAKE_DMHRESULTERROR_R + $012F);
  1310.   {$EXTERNALSYM DMUS_E_ALREADYOPEN}
  1311.  
  1312. (* DMUS_E_ALREADYCLOSE
  1313.  *
  1314.  * An attempt was made to close the software synthesizer while it was already
  1315.  * open.
  1316.  * ASSERT?
  1317.  *)
  1318.   DMUS_E_ALREADYCLOSED            = (MAKE_DMHRESULTERROR_R + $0130);
  1319.   {$EXTERNALSYM DMUS_E_ALREADYCLOSED}
  1320.  
  1321. (* DMUS_E_SYNTHNOTCONFIGURED
  1322.  *
  1323.  * The operation could not be completed because the software synth has not
  1324.  * yet been fully configured.
  1325.  * ASSERT?
  1326.  *)
  1327.   DMUS_E_SYNTHNOTCONFIGURED       = (MAKE_DMHRESULTERROR_R + $0131);
  1328.   {$EXTERNALSYM DMUS_E_SYNTHNOTCONFIGURED}
  1329.  
  1330. (* DMUS_E_SYNTHACTIVE
  1331.  *
  1332.  * The operation cannot be carried out while the synthesizer is active.
  1333.  *)
  1334.   DMUS_E_SYNTHACTIVE              = (MAKE_DMHRESULTERROR_R + $0132);
  1335.   {$EXTERNALSYM DMUS_E_SYNTHACTIVE}
  1336.  
  1337. (* DMUS_E_CANNOTREAD
  1338.  *
  1339.  * An error occurred while attempting to read from the IStream* object.
  1340.  *)
  1341.   DMUS_E_CANNOTREAD               = (MAKE_DMHRESULTERROR_R + $0133);
  1342.   {$EXTERNALSYM DMUS_E_CANNOTREAD}
  1343.  
  1344. (* DMUS_E_DMUSIC_RELEASED
  1345.  *
  1346.  * The operation cannot be performed because the final instance of the
  1347.  * DirectMusic object was released. Ports cannot be used after final
  1348.  * release of the DirectMusic object.
  1349.  *)
  1350.   DMUS_E_DMUSIC_RELEASED          = (MAKE_DMHRESULTERROR_R + $0134);
  1351.   {$EXTERNALSYM DMUS_E_DMUSIC_RELEASED}
  1352.  
  1353. (* DMUS_E_BUFFER_EMPTY
  1354.  *
  1355.  * There was no data in the referenced buffer.
  1356.  *)
  1357.   DMUS_E_BUFFER_EMPTY             = (MAKE_DMHRESULTERROR_R + $0135);
  1358.   {$EXTERNALSYM DMUS_E_BUFFER_EMPTY}
  1359.  
  1360. (* DMUS_E_BUFFER_FULL
  1361.  *
  1362.  * There is insufficient space to insert the given event into the buffer.
  1363.  *)
  1364.   DMUS_E_BUFFER_FULL              = (MAKE_DMHRESULTERROR_R + $0136);
  1365.   {$EXTERNALSYM DMUS_E_BUFFER_FULL}
  1366.  
  1367. (* DMUS_E_PORT_NOT_CAPTURE
  1368.  *
  1369.  * The given operation could not be carried out because the port is a
  1370.  * capture port.
  1371.  *)
  1372.   DMUS_E_PORT_NOT_CAPTURE         = (MAKE_DMHRESULTERROR_R + $0137);
  1373.   {$EXTERNALSYM DMUS_E_PORT_NOT_CAPTURE}
  1374.  
  1375. (* DMUS_E_PORT_NOT_RENDER
  1376.  *
  1377.  * The given operation could not be carried out because the port is a
  1378.  * render port.
  1379.  *)
  1380.   DMUS_E_PORT_NOT_RENDER          = (MAKE_DMHRESULTERROR_R + $0138);
  1381.   {$EXTERNALSYM DMUS_E_PORT_NOT_RENDER}
  1382.  
  1383. (* DMUS_E_DSOUND_NOT_SET
  1384.  *
  1385.  * The port could not be created because no DirectSound has been specified.
  1386.  * Specify a DirectSound interface via the IDirectMusic::SetDirectSound
  1387.  * method; pass NULL to have DirectMusic manage usage of DirectSound.
  1388.  *)
  1389.   DMUS_E_DSOUND_NOT_SET           = (MAKE_DMHRESULTERROR_R + $0139);
  1390.   {$EXTERNALSYM DMUS_E_DSOUND_NOT_SET}
  1391.  
  1392. (* DMUS_E_ALREADY_ACTIVATED
  1393.  *
  1394.  * The operation cannot be carried out while the port is active.
  1395.  *)
  1396.   DMUS_E_ALREADY_ACTIVATED        = (MAKE_DMHRESULTERROR_R + $013A);
  1397.   {$EXTERNALSYM DMUS_E_ALREADY_ACTIVATED}
  1398.  
  1399. (* DMUS_E_INVALIDBUFFER
  1400.  *
  1401.  * Invalid DirectSound buffer was handed to port.
  1402.  *)
  1403.   DMUS_E_INVALIDBUFFER            = (MAKE_DMHRESULTERROR_R + $013B);
  1404.   {$EXTERNALSYM DMUS_E_INVALIDBUFFER}
  1405.  
  1406. (* DMUS_E_WAVEFORMATNOTSUPPORTED
  1407.  *
  1408.  * Invalid buffer format was handed to the synth sink.
  1409.  *)
  1410.   DMUS_E_WAVEFORMATNOTSUPPORTED   = (MAKE_DMHRESULTERROR_R + $013C);
  1411.   {$EXTERNALSYM DMUS_E_WAVEFORMATNOTSUPPORTED}
  1412.  
  1413. (* DMUS_E_SYNTHINACTIVE
  1414.  *
  1415.  * The operation cannot be carried out while the synthesizer is inactive.
  1416.  *)
  1417.   DMUS_E_SYNTHINACTIVE            = (MAKE_DMHRESULTERROR_R + $013D);
  1418.   {$EXTERNALSYM DMUS_E_SYNTHINACTIVE}
  1419.  
  1420. (* DMUS_E_DSOUND_ALREADY_SET
  1421.  *
  1422.  * IDirectMusic::SetDirectSound has already been called. It may not be
  1423.  * changed while in use.
  1424.  *)
  1425.   DMUS_E_DSOUND_ALREADY_SET       = (MAKE_DMHRESULTERROR_R + $013E);
  1426.   {$EXTERNALSYM DMUS_E_DSOUND_ALREADY_SET}
  1427.  
  1428. (* DMUS_E_INVALID_EVENT
  1429.  *
  1430.  * The given event is invalid (either it is not a valid MIDI message
  1431.  * or it makes use of running status). The event cannot be packed
  1432.  * into the buffer.
  1433.  *)
  1434.   DMUS_E_INVALID_EVENT            = (MAKE_DMHRESULTERROR_R + $013F);
  1435.   {$EXTERNALSYM DMUS_E_INVALID_EVENT}
  1436.  
  1437. (* DMUS_E_UNSUPPORTED_STREAM
  1438.  *
  1439.  * The IStream* object does not contain data supported by the loading object.
  1440.  *)
  1441.   DMUS_E_UNSUPPORTED_STREAM       = (MAKE_DMHRESULTERROR_R + $0150);
  1442.   {$EXTERNALSYM DMUS_E_UNSUPPORTED_STREAM}
  1443.  
  1444. (* DMUS_E_ALREADY_INITED
  1445.  *
  1446.  * The object has already been initialized.
  1447.  *)
  1448.   DMUS_E_ALREADY_INITED           = (MAKE_DMHRESULTERROR_R + $0151);
  1449.   {$EXTERNALSYM DMUS_E_ALREADY_INITED}
  1450.  
  1451. (* DMUS_E_INVALID_BAND
  1452.  *
  1453.  * The file does not contain a valid band.
  1454.  *)
  1455.   DMUS_E_INVALID_BAND             = (MAKE_DMHRESULTERROR_R + $0152);
  1456.   {$EXTERNALSYM DMUS_E_INVALID_BAND}
  1457.  
  1458. (* DMUS_E_TRACK_HDR_NOT_FIRST_CK
  1459.  *
  1460.  * The IStream* object's data does not have a track header as the first chunk,
  1461.  * and therefore can not be read by the segment object.
  1462.  *)
  1463.   DMUS_E_TRACK_HDR_NOT_FIRST_CK   = (MAKE_DMHRESULTERROR_R + $0155);
  1464.   {$EXTERNALSYM DMUS_E_TRACK_HDR_NOT_FIRST_CK}
  1465.  
  1466. (* DMUS_E_TOOL_HDR_NOT_FIRST_CK
  1467.  *
  1468.  * The IStream* object's data does not have a tool header as the first chunk,
  1469.  * and therefore can not be read by the graph object.
  1470.  *)
  1471.   DMUS_E_TOOL_HDR_NOT_FIRST_CK    = (MAKE_DMHRESULTERROR_R + $0156);
  1472.   {$EXTERNALSYM DMUS_E_TOOL_HDR_NOT_FIRST_CK}
  1473.  
  1474. (* DMUS_E_INVALID_TRACK_HDR
  1475.  *
  1476.  * The IStream* object's data contains an invalid track header (ckid is 0 and
  1477.  * fccType is NULL,) and therefore can not be read by the segment object.
  1478.  *)
  1479.   DMUS_E_INVALID_TRACK_HDR        = (MAKE_DMHRESULTERROR_R + $0157);
  1480.   {$EXTERNALSYM DMUS_E_INVALID_TRACK_HDR}
  1481.  
  1482. (* DMUS_E_INVALID_TOOL_HDR
  1483.  *
  1484.  * The IStream* object's data contains an invalid tool header (ckid is 0 and
  1485.  * fccType is NULL,) and therefore can not be read by the graph object.
  1486.  *)
  1487.   DMUS_E_INVALID_TOOL_HDR         = (MAKE_DMHRESULTERROR_R + $0158);
  1488.   {$EXTERNALSYM DMUS_E_INVALID_TOOL_HDR}
  1489.  
  1490. (* DMUS_E_ALL_TOOLS_FAILED
  1491.  *
  1492.  * The graph object was unable to load all tools from the IStream* object data.
  1493.  * This may be due to errors in the stream, or the tools being incorrectly
  1494.  * registered on the client.
  1495.  *)
  1496.   DMUS_E_ALL_TOOLS_FAILED         = (MAKE_DMHRESULTERROR_R + $0159);
  1497.   {$EXTERNALSYM DMUS_E_ALL_TOOLS_FAILED}
  1498.  
  1499. (* DMUS_E_ALL_TRACKS_FAILED
  1500.  *
  1501.  * The segment object was unable to load all tracks from the IStream* object data.
  1502.  * This may be due to errors in the stream, or the tracks being incorrectly
  1503.  * registered on the client.
  1504.  *)
  1505.   DMUS_E_ALL_TRACKS_FAILED        = (MAKE_DMHRESULTERROR_R + $0160);
  1506.   {$EXTERNALSYM DMUS_E_ALL_TRACKS_FAILED}
  1507.  
  1508. (* DMUS_E_NOT_FOUND
  1509.  *
  1510.  * The requested item was not contained by the object.
  1511.  *)
  1512.   DMUS_E_NOT_FOUND                = (MAKE_DMHRESULTERROR_R + $0161);
  1513.   {$EXTERNALSYM DMUS_E_NOT_FOUND}
  1514.  
  1515. (* DMUS_E_NOT_INIT
  1516.  *
  1517.  * A required object is not initialized or failed to initialize.
  1518.  *)
  1519.   DMUS_E_NOT_INIT                 = (MAKE_DMHRESULTERROR_R + $0162);
  1520.   {$EXTERNALSYM DMUS_E_NOT_INIT}
  1521.  
  1522. (* DMUS_E_TYPE_DISABLED
  1523.  *
  1524.  * The requested parameter type is currently disabled. Parameter types may
  1525.  * be enabled and disabled by certain calls to SetParam().
  1526.  *)
  1527.   DMUS_E_TYPE_DISABLED            = (MAKE_DMHRESULTERROR_R + $0163);
  1528.   {$EXTERNALSYM DMUS_E_TYPE_DISABLED}
  1529.  
  1530. (* DMUS_E_TYPE_UNSUPPORTED
  1531.  *
  1532.  * The requested parameter type is not supported on the object.
  1533.  *)
  1534.   DMUS_E_TYPE_UNSUPPORTED         = (MAKE_DMHRESULTERROR_R + $0164);
  1535.   {$EXTERNALSYM DMUS_E_TYPE_UNSUPPORTED}
  1536.  
  1537. (* DMUS_E_TIME_PAST
  1538.  *
  1539.  * The time is in the past, and the operation can not succeed.
  1540.  *)
  1541.   DMUS_E_TIME_PAST                = (MAKE_DMHRESULTERROR_R + $0165);
  1542.   {$EXTERNALSYM DMUS_E_TIME_PAST}
  1543.  
  1544. (* DMUS_E_TRACK_NOT_FOUND
  1545.  *
  1546.  * The requested track is not contained by the segment.
  1547.  *)
  1548.   DMUS_E_TRACK_NOT_FOUND            = (MAKE_DMHRESULTERROR_R + $0166);
  1549.   {$EXTERNALSYM DMUS_E_TRACK_NOT_FOUND}
  1550.  
  1551. (* DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT
  1552.  *
  1553.  * The track does not support clock time playback or getparam.
  1554.  *)
  1555.   DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT   = (MAKE_DMHRESULTERROR_R + $0167);
  1556.   {$EXTERNALSYM DMUS_E_TRACK_NO_CLOCKTIME_SUPPORT}
  1557.  
  1558. (* DMUS_E_NO_MASTER_CLOCK
  1559.  *
  1560.  * There is no master clock in the performance. Be sure to call
  1561.  * IDirectMusicPerformance::Init().
  1562.  *)
  1563.   DMUS_E_NO_MASTER_CLOCK          = (MAKE_DMHRESULTERROR_R + $0170);
  1564.   {$EXTERNALSYM DMUS_E_NO_MASTER_CLOCK}
  1565.  
  1566. (* DMUS_E_LOADER_NOCLASSID
  1567.  *
  1568.  * The class id field is required and missing in the DMUS_OBJECTDESC.
  1569.  *)
  1570.   DMUS_E_LOADER_NOCLASSID         = (MAKE_DMHRESULTERROR_R + $0180);
  1571.   {$EXTERNALSYM DMUS_E_LOADER_NOCLASSID}
  1572.  
  1573. (* DMUS_E_LOADER_BADPATH
  1574.  *
  1575.  * The requested file path is invalid.
  1576.  *)
  1577.   DMUS_E_LOADER_BADPATH           = (MAKE_DMHRESULTERROR_R + $0181);
  1578.   {$EXTERNALSYM DMUS_E_LOADER_BADPATH}
  1579.  
  1580. (* DMUS_E_LOADER_FAILEDOPEN
  1581.  *
  1582.  * File open failed - either file doesn't exist or is locked.
  1583.  *)
  1584.   DMUS_E_LOADER_FAILEDOPEN        = (MAKE_DMHRESULTERROR_R + $0182);
  1585.   {$EXTERNALSYM DMUS_E_LOADER_FAILEDOPEN}
  1586.  
  1587. (* DMUS_E_LOADER_FORMATNOTSUPPORTED
  1588.  *
  1589.  * Search data type is not supported.
  1590.  *)
  1591.   DMUS_E_LOADER_FORMATNOTSUPPORTED    = (MAKE_DMHRESULTERROR_R + $0183);
  1592.   {$EXTERNALSYM DMUS_E_LOADER_FORMATNOTSUPPORTED}
  1593.  
  1594. (* DMUS_E_LOADER_FAILEDCREATE
  1595.  *
  1596.  * Unable to find or create object.
  1597.  *)
  1598.   DMUS_E_LOADER_FAILEDCREATE      = (MAKE_DMHRESULTERROR_R + $0184);
  1599.   {$EXTERNALSYM DMUS_E_LOADER_FAILEDCREATE}
  1600.  
  1601. (* DMUS_E_LOADER_OBJECTNOTFOUND
  1602.  *
  1603.  * Object was not found.
  1604.  *)
  1605.   DMUS_E_LOADER_OBJECTNOTFOUND    = (MAKE_DMHRESULTERROR_R + $0185);
  1606.   {$EXTERNALSYM DMUS_E_LOADER_OBJECTNOTFOUND}
  1607.  
  1608. (* DMUS_E_LOADER_NOFILENAME
  1609.  *
  1610.  * The file name is missing from the DMUS_OBJECTDESC.
  1611.  *)
  1612.   DMUS_E_LOADER_NOFILENAME        = (MAKE_DMHRESULTERROR_R + $0186);
  1613.   {$EXTERNALSYM DMUS_E_LOADER_NOFILENAME}
  1614.  
  1615. (* DMUS_E_INVALIDFILE
  1616.  *
  1617.  * The file requested is not a valid file.
  1618.  *)
  1619.   DMUS_E_INVALIDFILE              = (MAKE_DMHRESULTERROR_R + $0200);
  1620.   {$EXTERNALSYM DMUS_E_INVALIDFILE}
  1621.  
  1622. (* DMUS_E_ALREADY_EXISTS
  1623.  *
  1624.  * The tool is already contained in the graph. Create a new instance.
  1625.  *)
  1626.   DMUS_E_ALREADY_EXISTS           = (MAKE_DMHRESULTERROR_R + $0201);
  1627.   {$EXTERNALSYM DMUS_E_ALREADY_EXISTS}
  1628.  
  1629. (* DMUS_E_OUT_OF_RANGE
  1630.  *
  1631.  * Value is out of range, for instance the requested length is longer than
  1632.  * the segment.
  1633.  *)
  1634.   DMUS_E_OUT_OF_RANGE             = (MAKE_DMHRESULTERROR_R + $0202);
  1635.   {$EXTERNALSYM DMUS_E_OUT_OF_RANGE}
  1636.  
  1637. (* DMUS_E_SEGMENT_INIT_FAILED
  1638.  *
  1639.  * Segment initialization failed, most likely due to a critical memory situation.
  1640.  *)
  1641.   DMUS_E_SEGMENT_INIT_FAILED      = (MAKE_DMHRESULTERROR_R + $0203);
  1642.   {$EXTERNALSYM DMUS_E_SEGMENT_INIT_FAILED}
  1643.  
  1644. (* DMUS_E_ALREADY_SENT
  1645.  *
  1646.  * The DMUS_PMSG has already been sent to the performance object via
  1647.  * IDirectMusicPerformance::SendPMsg().
  1648.  *)
  1649.   DMUS_E_ALREADY_SENT             = (MAKE_DMHRESULTERROR_R + $0204);
  1650.   {$EXTERNALSYM DMUS_E_ALREADY_SENT}
  1651.  
  1652. (* DMUS_E_CANNOT_FREE
  1653.  *
  1654.  * The DMUS_PMSG was either not allocated by the performance via
  1655.  * IDirectMusicPerformance::AllocPMsg(), or it was already freed via
  1656.  * IDirectMusicPerformance::FreePMsg().
  1657.  *)
  1658.   DMUS_E_CANNOT_FREE              = (MAKE_DMHRESULTERROR_R + $0205);
  1659.   {$EXTERNALSYM DMUS_E_CANNOT_FREE}
  1660.  
  1661. (* DMUS_E_CANNOT_OPEN_PORT
  1662.  *
  1663.  * The default system port could not be opened.
  1664.  *)
  1665.   DMUS_E_CANNOT_OPEN_PORT         = (MAKE_DMHRESULTERROR_R + $0206);
  1666.   {$EXTERNALSYM DMUS_E_CANNOT_OPEN_PORT}
  1667.  
  1668. (* DMUS_E_CANNOT_CONVERT
  1669.  *
  1670.  * A call to MIDIToMusic() or MusicToMIDI() resulted in an error because
  1671.  * the requested conversion could not happen. This usually occurs when the
  1672.  * provided DMUS_CHORD_KEY structure has an invalid chord or scale pattern.
  1673.  *)
  1674.   DMUS_E_CANNOT_CONVERT           = (MAKE_DMHRESULTERROR_R + $0207);
  1675.   {$EXTERNALSYM DMUS_E_CANNOT_CONVERT}
  1676. (* misspelling in previous versions of DirectX preserved for backward compatibility *)
  1677.   DMUS_E_CONNOT_CONVERT           = DMUS_E_CANNOT_CONVERT;
  1678.   {$EXTERNALSYM DMUS_E_CONNOT_CONVERT}
  1679.  
  1680. (* DMUS_E_DESCEND_CHUNK_FAIL
  1681.  *
  1682.  * DMUS_E_DESCEND_CHUNK_FAIL is returned when the end of the file
  1683.  * was reached before the desired chunk was found.
  1684.  *)
  1685.   DMUS_E_DESCEND_CHUNK_FAIL       = (MAKE_DMHRESULTERROR_R + $0210);
  1686.   {$EXTERNALSYM DMUS_E_DESCEND_CHUNK_FAIL}
  1687.  
  1688. (* DMUS_E_NOT_LOADED
  1689.  *
  1690.  * An attempt to use this object failed because it first needs to
  1691.  * be loaded.
  1692.  *)
  1693.   DMUS_E_NOT_LOADED               = (MAKE_DMHRESULTERROR_R + $0211);
  1694.   {$EXTERNALSYM DMUS_E_NOT_LOADED}
  1695.  
  1696. (* DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE
  1697.  *
  1698.  * The activeX scripting engine for the script's language is not compatible with
  1699.  * DirectMusic.
  1700.  *
  1701.  *)
  1702.   DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE  = (MAKE_DMHRESULTERROR_R + $0213);
  1703.   {$EXTERNALSYM DMUS_E_SCRIPT_LANGUAGE_INCOMPATIBLE}
  1704.  
  1705. (* DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE
  1706.  *
  1707.  * A varient was used that had a type that is not supported by DirectMusic.
  1708.  *
  1709.  *)
  1710.   DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE    = (MAKE_DMHRESULTERROR_R + $0214);
  1711.   {$EXTERNALSYM DMUS_E_SCRIPT_UNSUPPORTED_VARTYPE}
  1712.  
  1713. (* DMUS_E_SCRIPT_ERROR_IN_SCRIPT
  1714.  *
  1715.  * An error was encountered while parsing or executing the script.
  1716.  * The pErrorInfo parameter (if supplied) was filled with information about the error.
  1717.  *)
  1718.   DMUS_E_SCRIPT_ERROR_IN_SCRIPT        = (MAKE_DMHRESULTERROR_R + $0215);
  1719.   {$EXTERNALSYM DMUS_E_SCRIPT_ERROR_IN_SCRIPT}
  1720.  
  1721. (* DMUS_E_SCRIPT_CANTLOAD_OLEAUT32
  1722.  *
  1723.  * Loading of oleaut32.dll failed.  VBScript and other activeX scripting languages
  1724.  * require use of oleaut32.dll.  On platforms where oleaut32.dll is not present, only
  1725.  * the DirectMusicScript language, which doesn't require oleaut32.dll can be used.
  1726.  *)
  1727.   DMUS_E_SCRIPT_CANTLOAD_OLEAUT32      = (MAKE_DMHRESULTERROR_R + $0216);
  1728.   {$EXTERNALSYM DMUS_E_SCRIPT_CANTLOAD_OLEAUT32}
  1729.  
  1730. (* DMUS_E_SCRIPT_LOADSCRIPT_ERROR
  1731.  *
  1732.  * An error occured while parsing a script loaded using LoadScript.  The script that
  1733.  * was loaded contains an error.
  1734.  *)
  1735.   DMUS_E_SCRIPT_LOADSCRIPT_ERROR       = (MAKE_DMHRESULTERROR_R + $0217);
  1736.   {$EXTERNALSYM DMUS_E_SCRIPT_LOADSCRIPT_ERROR}
  1737.  
  1738. (* DMUS_E_SCRIPT_INVALID_FILE
  1739.  *
  1740.  * The script file is invalid.
  1741.  *)
  1742.   DMUS_E_SCRIPT_INVALID_FILE           = (MAKE_DMHRESULTERROR_R + $0218);
  1743.   {$EXTERNALSYM DMUS_E_SCRIPT_INVALID_FILE}
  1744.  
  1745. (* DMUS_E_INVALID_SCRIPTTRACK
  1746.  *
  1747.  * The file contains an invalid script track.
  1748.  *)
  1749.   DMUS_E_INVALID_SCRIPTTRACK           = (MAKE_DMHRESULTERROR_R + $0219);
  1750.   {$EXTERNALSYM DMUS_E_INVALID_SCRIPTTRACK}
  1751.  
  1752. (* DMUS_E_SCRIPT_VARIABLE_NOT_FOUND
  1753.  *
  1754.  * The script does not contain a variable with the specified name.
  1755.  *)
  1756.   DMUS_E_SCRIPT_VARIABLE_NOT_FOUND     = (MAKE_DMHRESULTERROR_R + $021A);
  1757.   {$EXTERNALSYM DMUS_E_SCRIPT_VARIABLE_NOT_FOUND}
  1758.  
  1759. (* DMUS_E_SCRIPT_ROUTINE_NOT_FOUND
  1760.  *
  1761.  * The script does not contain a routine with the specified name.
  1762.  *)
  1763.   DMUS_E_SCRIPT_ROUTINE_NOT_FOUND      = (MAKE_DMHRESULTERROR_R + $021B);
  1764.   {$EXTERNALSYM DMUS_E_SCRIPT_ROUTINE_NOT_FOUND}
  1765.  
  1766. (* DMUS_E_SCRIPT_CONTENT_READONLY
  1767.  *
  1768.  * Scripts variables for content referenced or embedded in a script cannot be set.
  1769.  *)
  1770.   DMUS_E_SCRIPT_CONTENT_READONLY       = (MAKE_DMHRESULTERROR_R + $021C);
  1771.   {$EXTERNALSYM DMUS_E_SCRIPT_CONTENT_READONLY}
  1772.  
  1773. (* DMUS_E_SCRIPT_NOT_A_REFERENCE
  1774.  *
  1775.  * Attempt was made to set a script's variable by reference to a value that was
  1776.  * not an object type.
  1777.  *)
  1778.   DMUS_E_SCRIPT_NOT_A_REFERENCE        = (MAKE_DMHRESULTERROR_R + $021D);
  1779.   {$EXTERNALSYM DMUS_E_SCRIPT_NOT_A_REFERENCE}
  1780.  
  1781. (* DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED
  1782.  *
  1783.  * Attempt was made to set a script's variable by value to an object that does
  1784.  * not support a default value property.
  1785.  *)
  1786.   DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED    = (MAKE_DMHRESULTERROR_R + $021E);
  1787.   {$EXTERNALSYM DMUS_E_SCRIPT_VALUE_NOT_SUPPORTED}
  1788.  
  1789. (* DMUS_E_INVALID_SEGMENTTRIGGERTRACK
  1790.  *
  1791.  * The file contains an invalid segment trigger track.
  1792.  *)
  1793.   DMUS_E_INVALID_SEGMENTTRIGGERTRACK   = (MAKE_DMHRESULTERROR_R + $0220);
  1794.   {$EXTERNALSYM DMUS_E_INVALID_SEGMENTTRIGGERTRACK}
  1795.  
  1796. (* DMUS_E_INVALID_LYRICSTRACK
  1797.  *
  1798.  * The file contains an invalid lyrics track.
  1799.  *)
  1800.   DMUS_E_INVALID_LYRICSTRACK           = (MAKE_DMHRESULTERROR_R + $0221);
  1801.   {$EXTERNALSYM DMUS_E_INVALID_LYRICSTRACK}
  1802.  
  1803. (* DMUS_E_INVALID_PARAMCONTROLTRACK
  1804.  *
  1805.  * The file contains an invalid parameter control track.
  1806.  *)
  1807.   DMUS_E_INVALID_PARAMCONTROLTRACK     = (MAKE_DMHRESULTERROR_R + $0222);
  1808.   {$EXTERNALSYM DMUS_E_INVALID_PARAMCONTROLTRACK}
  1809.  
  1810. (* DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR
  1811.  *
  1812.  * A script written in AudioVBScript could not be read because it contained a statement that
  1813.  * is not allowed by the AudioVBScript language.
  1814.  *)
  1815.   DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR     = (MAKE_DMHRESULTERROR_R + $0223);
  1816.   {$EXTERNALSYM DMUS_E_AUDIOVBSCRIPT_SYNTAXERROR}
  1817.  
  1818. (* DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR
  1819.  *
  1820.  * A script routine written in AudioVBScript failed because an invalid operation occurred.  For example,
  1821.  * adding the number 3 to a segment object would produce this error.  So would attempting to call a routine
  1822.  * that doesn't exist.
  1823.  *)
  1824.   DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR     = (MAKE_DMHRESULTERROR_R + $0224);
  1825.   {$EXTERNALSYM DMUS_E_AUDIOVBSCRIPT_RUNTIMEERROR}
  1826.  
  1827. (* DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE
  1828.  *
  1829.  * A script routine written in AudioVBScript failed because a function outside of a script failed to complete.
  1830.  * For example, a call to PlaySegment that fails to play because of low memory would return this error.
  1831.  *)
  1832.   DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE     = (MAKE_DMHRESULTERROR_R + $0225);
  1833.   {$EXTERNALSYM DMUS_E_AUDIOVBSCRIPT_OPERATIONFAILURE}
  1834.  
  1835. (* DMUS_E_AUDIOPATHS_NOT_VALID
  1836.  *
  1837.  * The Performance has set up some PChannels using the AssignPChannel command, which
  1838.  * makes it not capable of supporting audio paths.
  1839.  *)
  1840.   DMUS_E_AUDIOPATHS_NOT_VALID     = (MAKE_DMHRESULTERROR_R + $0226);
  1841.   {$EXTERNALSYM DMUS_E_AUDIOPATHS_NOT_VALID}
  1842.  
  1843. (* DMUS_E_AUDIOPATHS_IN_USE
  1844.  *
  1845.  * This is the inverse of the previous error.
  1846.  * The Performance has set up some audio paths, which makes is incompatible
  1847.  * with the calls to allocate pchannels, etc.
  1848.  *)
  1849.   DMUS_E_AUDIOPATHS_IN_USE     = (MAKE_DMHRESULTERROR_R + $0227);
  1850.   {$EXTERNALSYM DMUS_E_AUDIOPATHS_IN_USE}
  1851.  
  1852. (* DMUS_E_NO_AUDIOPATH_CONFIG
  1853.  *
  1854.  * A segment was asked for its embedded audio path configuration,
  1855.  * but there isn't any.
  1856.  *)
  1857.   DMUS_E_NO_AUDIOPATH_CONFIG     = (MAKE_DMHRESULTERROR_R + $0228);
  1858.   {$EXTERNALSYM DMUS_E_NO_AUDIOPATH_CONFIG}
  1859.  
  1860. (* DMUS_E_AUDIOPATH_INACTIVE
  1861.  *
  1862.  * An audiopath is inactive, perhaps because closedown was called.
  1863.  *)
  1864.   DMUS_E_AUDIOPATH_INACTIVE     = (MAKE_DMHRESULTERROR_R + $0229);
  1865.   {$EXTERNALSYM DMUS_E_AUDIOPATH_INACTIVE}
  1866.  
  1867. (* DMUS_E_AUDIOPATH_NOBUFFER
  1868.  *
  1869.  * An audiopath failed to create because a requested buffer could not be created.
  1870.  *)
  1871.   DMUS_E_AUDIOPATH_NOBUFFER     = (MAKE_DMHRESULTERROR_R + $022A);
  1872.   {$EXTERNALSYM DMUS_E_AUDIOPATH_NOBUFFER}
  1873.  
  1874. (* DMUS_E_AUDIOPATH_NOPORT
  1875.  *
  1876.  * An audiopath could not be used for playback because it lacked port assignments.
  1877.  *)
  1878.   DMUS_E_AUDIOPATH_NOPORT     = (MAKE_DMHRESULTERROR_R + $022B);
  1879.   {$EXTERNALSYM DMUS_E_AUDIOPATH_NOPORT}
  1880.  
  1881. (* DMUS_E_NO_AUDIOPATH
  1882.  *
  1883.  * Attempt was made to play segment in audiopath mode and there was no audiopath.
  1884.  *)
  1885.   DMUS_E_NO_AUDIOPATH     = (MAKE_DMHRESULTERROR_R + $022C);
  1886.   {$EXTERNALSYM DMUS_E_NO_AUDIOPATH}
  1887.  
  1888. (* DMUS_E_INVALIDCHUNK
  1889.  *
  1890.  * Invalid data was found in a RIFF file chunk.
  1891.  *)
  1892.   DMUS_E_INVALIDCHUNK     = (MAKE_DMHRESULTERROR_R + $022D);
  1893.   {$EXTERNALSYM DMUS_E_INVALIDCHUNK}
  1894.  
  1895. (* DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER
  1896.  *
  1897.  * Attempt was made to create an audiopath that sends to a global effects buffer which did not exist.
  1898.  *)
  1899.   DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER     = (MAKE_DMHRESULTERROR_R + $022E);
  1900.   {$EXTERNALSYM DMUS_E_AUDIOPATH_NOGLOBALFXBUFFER}
  1901.  
  1902. (* DMUS_E_INVALID_CONTAINER_OBJECT
  1903.  *
  1904.  * The file does not contain a valid container object.
  1905.  *)
  1906.   DMUS_E_INVALID_CONTAINER_OBJECT    = (MAKE_DMHRESULTERROR_R + $022F);
  1907.   {$EXTERNALSYM DMUS_E_INVALID_CONTAINER_OBJECT}
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913. (************************************************************************
  1914. *                                                                       *
  1915. *   dmusicc.h -- This module defines the DirectMusic core API's         *
  1916. *                                                                       *
  1917. *   Copyright (c) Microsoft Corporation.  All rights reserved.          *
  1918. *                                                                       *
  1919. ************************************************************************)
  1920.  
  1921. type
  1922.   SAMPLE_TIME = Int64;
  1923.   {$EXTERNALSYM SAMPLE_TIME}
  1924.   TSampleTime = SAMPLE_TIME;
  1925.   PSampleTime = ^TSampleTime;
  1926.  
  1927.   SAMPLE_POSITION = Int64;
  1928.   {$EXTERNALSYM SAMPLE_POSITION}
  1929.   TSamplePosition = SAMPLE_POSITION;
  1930.   PSamplePosition = ^TSamplePosition;
  1931.  
  1932. const
  1933.   DMUS_MAX_DESCRIPTION  = 128;
  1934.   {$EXTERNALSYM DMUS_MAX_DESCRIPTION}
  1935.   DMUS_MAX_DRIVER       = 128;
  1936.   {$EXTERNALSYM DMUS_MAX_DRIVER}
  1937.  
  1938. type
  1939.   PDMusBufferDesc = ^TDMusBufferDesc;
  1940.   _DMUS_BUFFERDESC = packed record
  1941.     dwSize: DWORD;
  1942.     dwFlags: DWORD;
  1943.     guidBufferFormat: TGUID;
  1944.     cbBuffer: DWORD;
  1945.   end;
  1946.   {$EXTERNALSYM _DMUS_BUFFERDESC}
  1947.   DMUS_BUFFERDESC = _DMUS_BUFFERDESC;
  1948.   {$EXTERNALSYM DMUS_BUFFERDESC}
  1949.   TDMusBufferDesc = _DMUS_BUFFERDESC;
  1950.  
  1951. const  
  1952. (* DMUS_EFFECT_ flags are used in the dwEffectFlags fields of both DMUS_PORTCAPS
  1953.  * and DMUS_PORTPARAMS.
  1954.  *)
  1955.   DMUS_EFFECT_NONE             = $00000000;
  1956.   {$EXTERNALSYM DMUS_EFFECT_NONE}
  1957.   DMUS_EFFECT_REVERB           = $00000001;
  1958.   {$EXTERNALSYM DMUS_EFFECT_REVERB}
  1959.   DMUS_EFFECT_CHORUS           = $00000002;
  1960.   {$EXTERNALSYM DMUS_EFFECT_CHORUS}
  1961.   DMUS_EFFECT_DELAY            = $00000004;
  1962.   {$EXTERNALSYM DMUS_EFFECT_DELAY}
  1963.  
  1964. (* For DMUS_PORTCAPS dwClass
  1965.  *)
  1966.   DMUS_PC_INPUTCLASS       = (0);
  1967.   {$EXTERNALSYM DMUS_PC_INPUTCLASS}
  1968.   DMUS_PC_OUTPUTCLASS      = (1);
  1969.   {$EXTERNALSYM DMUS_PC_OUTPUTCLASS}
  1970.  
  1971. (* For DMUS_PORTCAPS dwFlags
  1972.  *)
  1973.   DMUS_PC_DLS              = ($00000001);   // Supports DLS downloading and DLS level 1.
  1974.   {$EXTERNALSYM DMUS_PC_DLS}
  1975.   DMUS_PC_EXTERNAL         = ($00000002);   // External MIDI module.
  1976.   {$EXTERNALSYM DMUS_PC_EXTERNAL}
  1977.   DMUS_PC_SOFTWARESYNTH    = ($00000004);   // Software synthesizer.
  1978.   {$EXTERNALSYM DMUS_PC_SOFTWARESYNTH}
  1979.   DMUS_PC_MEMORYSIZEFIXED  = ($00000008);   // Memory size is fixed.
  1980.   {$EXTERNALSYM DMUS_PC_MEMORYSIZEFIXED}
  1981.   DMUS_PC_GMINHARDWARE     = ($00000010);   // GM sound set is built in, no need to download.
  1982.   {$EXTERNALSYM DMUS_PC_GMINHARDWARE}
  1983.   DMUS_PC_GSINHARDWARE     = ($00000020);   // GS sound set is built in.
  1984.   {$EXTERNALSYM DMUS_PC_GSINHARDWARE}
  1985.   DMUS_PC_XGINHARDWARE     = ($00000040);   // XG sound set is built in.
  1986.   {$EXTERNALSYM DMUS_PC_XGINHARDWARE}
  1987.   DMUS_PC_DIRECTSOUND      = ($00000080);   // Connects to DirectSound via a DSound buffer.
  1988.   {$EXTERNALSYM DMUS_PC_DIRECTSOUND}
  1989.   DMUS_PC_SHAREABLE        = ($00000100);   // Synth can be actively shared by multiple apps at once.
  1990.   {$EXTERNALSYM DMUS_PC_SHAREABLE}
  1991.   DMUS_PC_DLS2             = ($00000200);   // Supports DLS2 instruments.
  1992.   {$EXTERNALSYM DMUS_PC_DLS2}
  1993.   DMUS_PC_AUDIOPATH        = ($00000400);   // Multiple outputs can be connected to DirectSound for audiopaths.
  1994.   {$EXTERNALSYM DMUS_PC_AUDIOPATH}
  1995.   DMUS_PC_WAVE             = ($00000800);   // Supports streaming and one shot waves.
  1996.   {$EXTERNALSYM DMUS_PC_WAVE}
  1997.  
  1998.   DMUS_PC_SYSTEMMEMORY     = ($7FFFFFFF);   // Sample memory is system memory.
  1999.   {$EXTERNALSYM DMUS_PC_SYSTEMMEMORY}
  2000.  
  2001.  
  2002. type
  2003.   PDMusPortCaps = ^TDMusPortCaps;
  2004.   _DMUS_PORTCAPS = packed record
  2005.     dwSize: DWORD;
  2006.     dwFlags: DWORD;
  2007.     guidPort: TGUID;
  2008.     dwClass: DWORD;
  2009.     dwType: DWORD;
  2010.     dwMemorySize: DWORD;
  2011.     dwMaxChannelGroups: DWORD;
  2012.     dwMaxVoices: DWORD;
  2013.     dwMaxAudioChannels: DWORD;
  2014.     dwEffectFlags: DWORD;
  2015.     wszDescription: array[0..DMUS_MAX_DESCRIPTION-1] of WideChar;
  2016.   end;
  2017.   {$EXTERNALSYM _DMUS_PORTCAPS}
  2018.   DMUS_PORTCAPS = _DMUS_PORTCAPS;
  2019.   {$EXTERNALSYM DMUS_PORTCAPS}
  2020.   TDMusPortCaps = _DMUS_PORTCAPS;
  2021.  
  2022. const
  2023. (* Values for DMUS_PORTCAPS dwType. This field indicates the underlying
  2024.  * driver type of the port.
  2025.  *)
  2026.   DMUS_PORT_WINMM_DRIVER      = (0);
  2027.   {$EXTERNALSYM DMUS_PORT_WINMM_DRIVER}
  2028.   DMUS_PORT_USER_MODE_SYNTH   = (1);
  2029.   {$EXTERNALSYM DMUS_PORT_USER_MODE_SYNTH}
  2030.   DMUS_PORT_KERNEL_MODE       = (2);
  2031.   {$EXTERNALSYM DMUS_PORT_KERNEL_MODE}
  2032.  
  2033. // These flags (set in dwValidParams) indicate which other members of the
  2034. // DMUS_PORTPARAMS are valid.
  2035. //
  2036.   DMUS_PORTPARAMS_VOICES           = $00000001;
  2037.   {$EXTERNALSYM DMUS_PORTPARAMS_VOICES}
  2038.   DMUS_PORTPARAMS_CHANNELGROUPS    = $00000002;
  2039.   {$EXTERNALSYM DMUS_PORTPARAMS_CHANNELGROUPS}
  2040.   DMUS_PORTPARAMS_AUDIOCHANNELS    = $00000004;
  2041.   {$EXTERNALSYM DMUS_PORTPARAMS_AUDIOCHANNELS}
  2042.   DMUS_PORTPARAMS_SAMPLERATE       = $00000008;
  2043.   {$EXTERNALSYM DMUS_PORTPARAMS_SAMPLERATE}
  2044.   DMUS_PORTPARAMS_EFFECTS          = $00000020;
  2045.   {$EXTERNALSYM DMUS_PORTPARAMS_EFFECTS}
  2046.   DMUS_PORTPARAMS_SHARE            = $00000040;
  2047.   {$EXTERNALSYM DMUS_PORTPARAMS_SHARE}
  2048.   DMUS_PORTPARAMS_FEATURES         = $00000080;     // DirectX 8.0 and above
  2049.   {$EXTERNALSYM DMUS_PORTPARAMS_FEATURES}
  2050.  
  2051. type
  2052.   PDMusPortParams7 = ^TDMusPortParams7;
  2053.   _DMUS_PORTPARAMS = packed record
  2054.     dwSize: DWORD;
  2055.     dwValidParams: DWORD;
  2056.     dwVoices: DWORD;
  2057.     dwChannelGroups: DWORD;
  2058.     dwAudioChannels: DWORD;
  2059.     dwSampleRate: DWORD;
  2060.     dwEffectFlags: DWORD;
  2061.     fShare: BOOL;
  2062.   end;
  2063.   {$EXTERNALSYM _DMUS_PORTPARAMS}
  2064.   DMUS_PORTPARAMS7 = _DMUS_PORTPARAMS;
  2065.   {$EXTERNALSYM DMUS_PORTPARAMS7}
  2066.   TDMusPortParams7 = _DMUS_PORTPARAMS;
  2067.  
  2068.   PDMusPortParams8 = ^TDMusPortParams8;
  2069.   _DMUS_PORTPARAMS8 = packed record
  2070.     dwSize: DWORD;
  2071.     dwValidParams: DWORD;
  2072.     dwVoices: DWORD;
  2073.     dwChannelGroups: DWORD;
  2074.     dwAudioChannels: DWORD;
  2075.     dwSampleRate: DWORD;
  2076.     dwEffectFlags: DWORD;
  2077.     fShare: BOOL;
  2078.     dwFeatures: DWORD;
  2079.   end;
  2080.   {$EXTERNALSYM _DMUS_PORTPARAMS8}
  2081.   DMUS_PORTPARAMS8 = _DMUS_PORTPARAMS8;
  2082.   {$EXTERNALSYM DMUS_PORTPARAMS8}
  2083.   TDMusPortParams8 = _DMUS_PORTPARAMS8;
  2084.  
  2085. const
  2086.   DMUS_PORT_FEATURE_AUDIOPATH     = $00000001; // Supports audiopath connection to DSound buffers.
  2087.   {$EXTERNALSYM DMUS_PORT_FEATURE_AUDIOPATH}
  2088.   DMUS_PORT_FEATURE_STREAMING     = $00000002; // Supports streaming waves through the synth.
  2089.   {$EXTERNALSYM DMUS_PORT_FEATURE_STREAMING}
  2090.  
  2091.  
  2092. type
  2093.   DMUS_PORTPARAMS = DMUS_PORTPARAMS8;
  2094.   {$EXTERNALSYM DMUS_PORTPARAMS}
  2095.   TDMusPortParams = DMUS_PORTPARAMS;
  2096.   PDMusPortParams = PDMusPortParams8;
  2097.  
  2098.   PDMusSynthStats = ^TDMusSynthStats;
  2099.   _DMUS_SYNTHSTATS = packed record
  2100.     dwSize: DWORD;             (* Size in bytes of the structure *)
  2101.     dwValidStats: DWORD;       (* Flags indicating which fields below are valid. *)
  2102.     dwVoices: DWORD;           (* Average number of voices playing. *)
  2103.     dwTotalCPU: DWORD;         (* Total CPU usage as percent * 100. *)
  2104.     dwCPUPerVoice: DWORD;      (* CPU per voice as percent * 100. *)
  2105.     dwLostNotes: DWORD;        (* Number of notes lost in 1 second. *)
  2106.     dwFreeMemory: DWORD;       (* Free memory in bytes *)
  2107.     lPeakVolume: Longint;      (* Decibel level * 100. *)
  2108.   end;
  2109.   {$EXTERNALSYM _DMUS_SYNTHSTATS}
  2110.   DMUS_SYNTHSTATS = _DMUS_SYNTHSTATS;
  2111.   {$EXTERNALSYM DMUS_SYNTHSTATS}
  2112.   TDMusSynthStats = _DMUS_SYNTHSTATS;
  2113.  
  2114.   PDMusSynthStats8 = ^TDMusSynthStats8;
  2115.   _DMUS_SYNTHSTATS8 = packed record
  2116.     dwSize: DWORD;             (* Size in bytes of the structure *)
  2117.     dwValidStats: DWORD;       (* Flags indicating which fields below are valid. *)
  2118.     dwVoices: DWORD;           (* Average number of voices playing. *)
  2119.     dwTotalCPU: DWORD;         (* Total CPU usage as percent * 100. *)
  2120.     dwCPUPerVoice: DWORD;      (* CPU per voice as percent * 100. *)
  2121.     dwLostNotes: DWORD;        (* Number of notes lost in 1 second. *)
  2122.     dwFreeMemory: DWORD;       (* Free memory in bytes *)
  2123.     lPeakVolume: Longint;      (* Decibel level * 100. *)
  2124.     dwSynthMemUse: DWORD;      (* Memory used by synth wave data *)
  2125.   end;
  2126.   {$EXTERNALSYM _DMUS_SYNTHSTATS8}
  2127.   DMUS_SYNTHSTATS8 = _DMUS_SYNTHSTATS8;
  2128.   {$EXTERNALSYM DMUS_SYNTHSTATS8}
  2129.   TDMusSynthStats8 = _DMUS_SYNTHSTATS8;
  2130.  
  2131. const
  2132.   DMUS_SYNTHSTATS_VOICES          = (1 shl 0);
  2133.   {$EXTERNALSYM DMUS_SYNTHSTATS_VOICES}
  2134.   DMUS_SYNTHSTATS_TOTAL_CPU       = (1 shl 1);
  2135.   {$EXTERNALSYM DMUS_SYNTHSTATS_TOTAL_CPU}
  2136.   DMUS_SYNTHSTATS_CPU_PER_VOICE   = (1 shl 2);
  2137.   {$EXTERNALSYM DMUS_SYNTHSTATS_CPU_PER_VOICE}
  2138.   DMUS_SYNTHSTATS_LOST_NOTES      = (1 shl 3);
  2139.   {$EXTERNALSYM DMUS_SYNTHSTATS_LOST_NOTES}
  2140.   DMUS_SYNTHSTATS_PEAK_VOLUME     = (1 shl 4);
  2141.   {$EXTERNALSYM DMUS_SYNTHSTATS_PEAK_VOLUME}
  2142.   DMUS_SYNTHSTATS_FREE_MEMORY     = (1 shl 5);
  2143.   {$EXTERNALSYM DMUS_SYNTHSTATS_FREE_MEMORY}
  2144.  
  2145.   DMUS_SYNTHSTATS_SYSTEMMEMORY    = DMUS_PC_SYSTEMMEMORY;
  2146.   {$EXTERNALSYM DMUS_SYNTHSTATS_SYSTEMMEMORY}
  2147.  
  2148. type
  2149.   PDMusWavesReverbParams = ^TDMusWavesReverbParams;
  2150.   _DMUS_WAVES_REVERB_PARAMS = packed record
  2151.     fInGain: Single;     (* Input gain in dB (to avoid output overflows) *)
  2152.     fReverbMix: Single;  (* Reverb mix in dB. 0dB means 100% wet reverb (no direct signal)
  2153.                             Negative values gives less wet signal.
  2154.                             The coeficients are calculated so that the overall output level stays
  2155.                             (approximately) constant regardless of the ammount of reverb mix. *)
  2156.     fReverbTime: Single;    (* The reverb decay time, in milliseconds. *)
  2157.     fHighFreqRTRatio: Single; (* The ratio of the high frequencies to the global reverb time.
  2158.                             Unless very 'splashy-bright' reverbs are wanted, this should be set to
  2159.                             a value < 1.0.
  2160.                             For example if dRevTime==1000ms and dHighFreqRTRatio=0.1 than the
  2161.                             decay time for high frequencies will be 100ms.*)
  2162.   end;
  2163.   {$EXTERNALSYM _DMUS_WAVES_REVERB_PARAMS}
  2164.   DMUS_WAVES_REVERB_PARAMS = _DMUS_WAVES_REVERB_PARAMS;
  2165.   {$EXTERNALSYM DMUS_WAVES_REVERB_PARAMS}
  2166.   TDMusWavesReverbParams = _DMUS_WAVES_REVERB_PARAMS;
  2167.  
  2168. (*  Note: Default values for Reverb are:
  2169.     fInGain             = 0.0dB   (no change in level)
  2170.     fReverbMix          = -10.0dB   (a reasonable reverb mix)
  2171.     fReverbTime         = 1000.0ms (one second global reverb time)
  2172.     fHighFreqRTRatio    = 0.001    (the ratio of the high frequencies to the global reverb time)
  2173. *)
  2174.  
  2175.   DMUS_CLOCKTYPE = (
  2176.     DMUS_CLOCK_SYSTEM {= 0},
  2177.     DMUS_CLOCK_WAVE {= 1}
  2178.   );
  2179.   {$EXTERNALSYM DMUS_CLOCKTYPE}
  2180.   TDMusClockType = DMUS_CLOCKTYPE;
  2181.  
  2182. const
  2183.   DMUS_CLOCKF_GLOBAL              = $00000001;
  2184.   {$EXTERNALSYM DMUS_CLOCKF_GLOBAL}
  2185.  
  2186. type
  2187.   PDMusClockInfo7 = ^TDMusClockInfo7;
  2188.   _DMUS_CLOCKINFO7 = packed record
  2189.     dwSize: DWORD;
  2190.     ctType: TDMusClockType;
  2191.     guidClock: TGUID;          // Identifies this time source
  2192.     wszDescription: array[0..DMUS_MAX_DESCRIPTION-1] of WideChar;
  2193.   end;
  2194.   {$EXTERNALSYM _DMUS_CLOCKINFO7}
  2195.   DMUS_CLOCKINFO7 = _DMUS_CLOCKINFO7;
  2196.   {$EXTERNALSYM DMUS_CLOCKINFO7}
  2197.   TDMusClockInfo7 = _DMUS_CLOCKINFO7;
  2198.  
  2199.   PDMusClockInfo8 = ^TDMusClockInfo8;
  2200.   _DMUS_CLOCKINFO8 = packed record
  2201.     dwSize: DWORD;
  2202.     ctType: TDMusClockType;
  2203.     guidClock: TGUID;          // Identifies this time source
  2204.     wszDescription: array[0..DMUS_MAX_DESCRIPTION-1] of WideChar;
  2205.     dwFlags: DWORD;
  2206.   end;
  2207.   {$EXTERNALSYM _DMUS_CLOCKINFO8}
  2208.   DMUS_CLOCKINFO8 = _DMUS_CLOCKINFO8;
  2209.   {$EXTERNALSYM DMUS_CLOCKINFO8}
  2210.   TDMusClockInfo8 = _DMUS_CLOCKINFO8;
  2211.  
  2212.  
  2213.   DMUS_CLOCKINFO = DMUS_CLOCKINFO8;
  2214.   {$EXTERNALSYM DMUS_CLOCKINFO}
  2215.   TDMusClockInfo = DMUS_CLOCKINFO;
  2216.   PDMusClockInfo = PDMusClockInfo8;
  2217.  
  2218. const
  2219. (* Default bus identifiers
  2220.  *
  2221.  * The first 17 are direct mappings to the destinations defined in both
  2222.  * the MMA DLS Level 2 specification and the Microsoft Multi-Channel audio
  2223.  * specification.
  2224.  *)
  2225.   DSBUSID_FIRST_SPKR_LOC              = 0;
  2226.   {$EXTERNALSYM DSBUSID_FIRST_SPKR_LOC}
  2227.   DSBUSID_FRONT_LEFT                  = 0;
  2228.   {$EXTERNALSYM DSBUSID_FRONT_LEFT}
  2229.   DSBUSID_LEFT                        = 0;   // Front left is also just left
  2230.   {$EXTERNALSYM DSBUSID_LEFT}
  2231.   DSBUSID_FRONT_RIGHT                 = 1;
  2232.   {$EXTERNALSYM DSBUSID_FRONT_RIGHT}
  2233.   DSBUSID_RIGHT                       = 1;   // Ditto front right
  2234.   {$EXTERNALSYM DSBUSID_RIGHT}
  2235.   DSBUSID_FRONT_CENTER                = 2;
  2236.   {$EXTERNALSYM DSBUSID_FRONT_CENTER}
  2237.   DSBUSID_LOW_FREQUENCY               = 3;
  2238.   {$EXTERNALSYM DSBUSID_LOW_FREQUENCY}
  2239.   DSBUSID_BACK_LEFT                   = 4;
  2240.   {$EXTERNALSYM DSBUSID_BACK_LEFT}
  2241.   DSBUSID_BACK_RIGHT                  = 5;
  2242.   {$EXTERNALSYM DSBUSID_BACK_RIGHT}
  2243.   DSBUSID_FRONT_LEFT_OF_CENTER        = 6;
  2244.   {$EXTERNALSYM DSBUSID_FRONT_LEFT_OF_CENTER}
  2245.   DSBUSID_FRONT_RIGHT_OF_CENTER       = 7;
  2246.   {$EXTERNALSYM DSBUSID_FRONT_RIGHT_OF_CENTER}
  2247.   DSBUSID_BACK_CENTER                 = 8;
  2248.   {$EXTERNALSYM DSBUSID_BACK_CENTER}
  2249.   DSBUSID_SIDE_LEFT                   = 9;
  2250.   {$EXTERNALSYM DSBUSID_SIDE_LEFT}
  2251.   DSBUSID_SIDE_RIGHT                 = 10;
  2252.   {$EXTERNALSYM DSBUSID_SIDE_RIGHT}
  2253.   DSBUSID_TOP_CENTER                 = 11;
  2254.   {$EXTERNALSYM DSBUSID_TOP_CENTER}
  2255.   DSBUSID_TOP_FRONT_LEFT             = 12;
  2256.   {$EXTERNALSYM DSBUSID_TOP_FRONT_LEFT}
  2257.   DSBUSID_TOP_FRONT_CENTER           = 13;
  2258.   {$EXTERNALSYM DSBUSID_TOP_FRONT_CENTER}
  2259.   DSBUSID_TOP_FRONT_RIGHT            = 14;
  2260.   {$EXTERNALSYM DSBUSID_TOP_FRONT_RIGHT}
  2261.   DSBUSID_TOP_BACK_LEFT              = 15;
  2262.   {$EXTERNALSYM DSBUSID_TOP_BACK_LEFT}
  2263.   DSBUSID_TOP_BACK_CENTER            = 16;
  2264.   {$EXTERNALSYM DSBUSID_TOP_BACK_CENTER}
  2265.   DSBUSID_TOP_BACK_RIGHT             = 17;
  2266.   {$EXTERNALSYM DSBUSID_TOP_BACK_RIGHT}
  2267.   DSBUSID_LAST_SPKR_LOC              = 17;
  2268.   {$EXTERNALSYM DSBUSID_LAST_SPKR_LOC}
  2269.  
  2270. // #define DSBUSID_IS_SPKR_LOC(id) ( ((id) >= DSBUSID_FIRST_SPKR_LOC) && ((id) <= DSBUSID_LAST_SPKR_LOC) )
  2271. function DSBUSID_IS_SPKR_LOC(id: Integer): Boolean;
  2272. {$EXTERNALSYM DSBUSID_IS_SPKR_LOC}
  2273.  
  2274. const
  2275. (* These bus identifiers are for the standard DLS effect sends
  2276.  *)
  2277.   DSBUSID_REVERB_SEND                = 64;
  2278.   {$EXTERNALSYM DSBUSID_REVERB_SEND}
  2279.   DSBUSID_CHORUS_SEND                = 65;
  2280.   {$EXTERNALSYM DSBUSID_CHORUS_SEND}
  2281.  
  2282. (* Dynamic bus identifiers start here. See the documentation for how
  2283.  * synthesizers map the output of voices to static and dynamic
  2284.  * bus identifiers.
  2285.  *)
  2286.   DSBUSID_DYNAMIC_0                  = 512;
  2287.   {$EXTERNALSYM DSBUSID_DYNAMIC_0}
  2288.  
  2289. (* Null bus, used to identify busses that have no function mapping.
  2290. *)
  2291.   DSBUSID_NULL                       = $FFFFFFFF;
  2292.   {$EXTERNALSYM DSBUSID_NULL}
  2293.  
  2294.  
  2295. (* Standard values for voice priorities. Numerically higher priorities are higher in priority.
  2296.  * These priorities are used to set the voice priority for all voices on a channel. They are
  2297.  * used in the dwPriority parameter of IDirectMusicPort::GetPriority and returned in the
  2298.  * lpwPriority parameter of pdwPriority.
  2299.  *
  2300.  * These priorities are shared with DirectSound.
  2301.  *)
  2302.  
  2303. const
  2304.   DAUD_CRITICAL_VOICE_PRIORITY    = ($F0000000);
  2305.   {$EXTERNALSYM DAUD_CRITICAL_VOICE_PRIORITY}
  2306.   DAUD_HIGH_VOICE_PRIORITY        = ($C0000000);
  2307.   {$EXTERNALSYM DAUD_HIGH_VOICE_PRIORITY}
  2308.   DAUD_STANDARD_VOICE_PRIORITY    = ($80000000);
  2309.   {$EXTERNALSYM DAUD_STANDARD_VOICE_PRIORITY}
  2310.   DAUD_LOW_VOICE_PRIORITY         = ($40000000);
  2311.   {$EXTERNALSYM DAUD_LOW_VOICE_PRIORITY}
  2312.   DAUD_PERSIST_VOICE_PRIORITY     = ($10000000);
  2313.   {$EXTERNALSYM DAUD_PERSIST_VOICE_PRIORITY}
  2314.  
  2315. (* These are the default priorities assigned if not overridden. By default priorities are
  2316.  * equal across channel groups (e.g. channel 5 on channel group 1 has the same priority as
  2317.  * channel 5 on channel group 2).
  2318.  *
  2319.  * In accordance with DLS level 1, channel 10 has the highest priority, followed by 1 through 16
  2320.  * except for 10.
  2321.  *)
  2322.   DAUD_CHAN1_VOICE_PRIORITY_OFFSET    = ($0000000E);
  2323.   {$EXTERNALSYM DAUD_CHAN1_VOICE_PRIORITY_OFFSET}
  2324.   DAUD_CHAN2_VOICE_PRIORITY_OFFSET    = ($0000000D);
  2325.   {$EXTERNALSYM DAUD_CHAN2_VOICE_PRIORITY_OFFSET}
  2326.   DAUD_CHAN3_VOICE_PRIORITY_OFFSET    = ($0000000C);
  2327.   {$EXTERNALSYM DAUD_CHAN3_VOICE_PRIORITY_OFFSET}
  2328.   DAUD_CHAN4_VOICE_PRIORITY_OFFSET    = ($0000000B);
  2329.   {$EXTERNALSYM DAUD_CHAN4_VOICE_PRIORITY_OFFSET}
  2330.   DAUD_CHAN5_VOICE_PRIORITY_OFFSET    = ($0000000A);
  2331.   {$EXTERNALSYM DAUD_CHAN5_VOICE_PRIORITY_OFFSET}
  2332.   DAUD_CHAN6_VOICE_PRIORITY_OFFSET    = ($00000009);
  2333.   {$EXTERNALSYM DAUD_CHAN6_VOICE_PRIORITY_OFFSET}
  2334.   DAUD_CHAN7_VOICE_PRIORITY_OFFSET    = ($00000008);
  2335.   {$EXTERNALSYM DAUD_CHAN7_VOICE_PRIORITY_OFFSET}
  2336.   DAUD_CHAN8_VOICE_PRIORITY_OFFSET    = ($00000007);
  2337.   {$EXTERNALSYM DAUD_CHAN8_VOICE_PRIORITY_OFFSET}
  2338.   DAUD_CHAN9_VOICE_PRIORITY_OFFSET    = ($00000006);
  2339.   {$EXTERNALSYM DAUD_CHAN9_VOICE_PRIORITY_OFFSET}
  2340.   DAUD_CHAN10_VOICE_PRIORITY_OFFSET   = ($0000000F);
  2341.   {$EXTERNALSYM DAUD_CHAN10_VOICE_PRIORITY_OFFSET}
  2342.   DAUD_CHAN11_VOICE_PRIORITY_OFFSET   = ($00000005);
  2343.   {$EXTERNALSYM DAUD_CHAN11_VOICE_PRIORITY_OFFSET}
  2344.   DAUD_CHAN12_VOICE_PRIORITY_OFFSET   = ($00000004);
  2345.   {$EXTERNALSYM DAUD_CHAN12_VOICE_PRIORITY_OFFSET}
  2346.   DAUD_CHAN13_VOICE_PRIORITY_OFFSET   = ($00000003);
  2347.   {$EXTERNALSYM DAUD_CHAN13_VOICE_PRIORITY_OFFSET}
  2348.   DAUD_CHAN14_VOICE_PRIORITY_OFFSET   = ($00000002);
  2349.   {$EXTERNALSYM DAUD_CHAN14_VOICE_PRIORITY_OFFSET}
  2350.   DAUD_CHAN15_VOICE_PRIORITY_OFFSET   = ($00000001);
  2351.   {$EXTERNALSYM DAUD_CHAN15_VOICE_PRIORITY_OFFSET}
  2352.   DAUD_CHAN16_VOICE_PRIORITY_OFFSET   = ($00000000);
  2353.   {$EXTERNALSYM DAUD_CHAN16_VOICE_PRIORITY_OFFSET}
  2354.  
  2355.  
  2356.   DAUD_CHAN1_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN1_VOICE_PRIORITY_OFFSET);
  2357.   {$EXTERNALSYM DAUD_CHAN1_DEF_VOICE_PRIORITY}
  2358.   DAUD_CHAN2_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN2_VOICE_PRIORITY_OFFSET);
  2359.   {$EXTERNALSYM DAUD_CHAN2_DEF_VOICE_PRIORITY}
  2360.   DAUD_CHAN3_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN3_VOICE_PRIORITY_OFFSET);
  2361.   {$EXTERNALSYM DAUD_CHAN3_DEF_VOICE_PRIORITY}
  2362.   DAUD_CHAN4_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN4_VOICE_PRIORITY_OFFSET);
  2363.   {$EXTERNALSYM DAUD_CHAN4_DEF_VOICE_PRIORITY}
  2364.   DAUD_CHAN5_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN5_VOICE_PRIORITY_OFFSET);
  2365.   {$EXTERNALSYM DAUD_CHAN5_DEF_VOICE_PRIORITY}
  2366.   DAUD_CHAN6_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN6_VOICE_PRIORITY_OFFSET);
  2367.   {$EXTERNALSYM DAUD_CHAN6_DEF_VOICE_PRIORITY}
  2368.   DAUD_CHAN7_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN7_VOICE_PRIORITY_OFFSET);
  2369.   {$EXTERNALSYM DAUD_CHAN7_DEF_VOICE_PRIORITY}
  2370.   DAUD_CHAN8_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN8_VOICE_PRIORITY_OFFSET);
  2371.   {$EXTERNALSYM DAUD_CHAN8_DEF_VOICE_PRIORITY}
  2372.   DAUD_CHAN9_DEF_VOICE_PRIORITY   = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN9_VOICE_PRIORITY_OFFSET);
  2373.   {$EXTERNALSYM DAUD_CHAN9_DEF_VOICE_PRIORITY}
  2374.   DAUD_CHAN10_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN10_VOICE_PRIORITY_OFFSET);
  2375.   {$EXTERNALSYM DAUD_CHAN10_DEF_VOICE_PRIORITY}
  2376.   DAUD_CHAN11_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN11_VOICE_PRIORITY_OFFSET);
  2377.   {$EXTERNALSYM DAUD_CHAN11_DEF_VOICE_PRIORITY}
  2378.   DAUD_CHAN12_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN12_VOICE_PRIORITY_OFFSET);
  2379.   {$EXTERNALSYM DAUD_CHAN12_DEF_VOICE_PRIORITY}
  2380.   DAUD_CHAN13_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN13_VOICE_PRIORITY_OFFSET);
  2381.   {$EXTERNALSYM DAUD_CHAN13_DEF_VOICE_PRIORITY}
  2382.   DAUD_CHAN14_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN14_VOICE_PRIORITY_OFFSET);
  2383.   {$EXTERNALSYM DAUD_CHAN14_DEF_VOICE_PRIORITY}
  2384.   DAUD_CHAN15_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN15_VOICE_PRIORITY_OFFSET);
  2385.   {$EXTERNALSYM DAUD_CHAN15_DEF_VOICE_PRIORITY}
  2386.   DAUD_CHAN16_DEF_VOICE_PRIORITY  = (DAUD_STANDARD_VOICE_PRIORITY or DAUD_CHAN16_VOICE_PRIORITY_OFFSET);
  2387.   {$EXTERNALSYM DAUD_CHAN16_DEF_VOICE_PRIORITY}
  2388.  
  2389. type
  2390.   IDirectMusicBuffer = interface;
  2391.   IDirectMusicPort = interface;
  2392.  
  2393.   PIReferenceClock = ^IReferenceClock;
  2394.   PIDirectSound = ^IDirectSound;
  2395.  
  2396.   PIDirectMusic = ^IDirectMusic;
  2397.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusic);'}
  2398.   {$EXTERNALSYM IDirectMusic}
  2399.   IDirectMusic = interface(IUnknown)
  2400.     ['{6536115a-7b2d-11d2-ba18-0000f875ac12}']
  2401.     (*  IDirectMusic *)
  2402.     function EnumPort(dwIndex: DWORD; var pPortCaps: TDMusPortCaps): HResult; stdcall;
  2403.     function CreateMusicBuffer(var pBufferDesc: TDMusBufferDesc;
  2404.       out ppBuffer: IDirectMusicBuffer; pUnkOuter: IUnknown): HResult; stdcall;
  2405.     function CreatePort(const rclsidPort: TGUID; const pPortParams: TDMusPortParams;
  2406.       out ppPort: IDirectMusicPort; pUnkOuter: IUnknown): HResult; stdcall;
  2407.     function EnumMasterClock(dwIndex: DWORD; var lpClockInfo: TDMusClockInfo): HResult; stdcall;
  2408.     function GetMasterClock(pguidClock: PGUID; ppReferenceClock: PIReferenceClock): HResult; stdcall;
  2409.     function SetMasterClock(const rguidClock: TGUID): HResult; stdcall;
  2410.     function Activate(fEnable: BOOL): HResult; stdcall;
  2411.     function GetDefaultPort(out pguidPort: TGUID): HResult; stdcall;
  2412.     function SetDirectSound(pDirectSound: IDirectSound; hWnd: HWND): HResult; stdcall;
  2413.   end;
  2414.  
  2415.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusic8);'}
  2416.   {$EXTERNALSYM IDirectMusic8}
  2417.   IDirectMusic8 = interface(IDirectMusic)
  2418.     ['{2d3629f7-813d-4939-8508-f05c6b75fd97}']
  2419.     (*  IDirectMusic8 *)
  2420.     function SetExternalMasterClock(pClock: IReferenceClock): HResult; stdcall;
  2421.   end;
  2422.  
  2423.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicBuffer);'}
  2424.   {$EXTERNALSYM IDirectMusicBuffer}
  2425.   IDirectMusicBuffer = interface(IUnknown)
  2426.     ['{d2ac2878-b39b-11d1-8704-00600893b1bd}']
  2427.     (*  IDirectMusicBuffer *)
  2428.     function Flush: HResult; stdcall;
  2429.     function TotalTime(out prtTime: TReferenceTime): HResult; stdcall;
  2430.     function PackStructured(const rt: TReferenceTime; dwChannelGroup: DWORD;
  2431.         dwChannelMessage: DWORD): HResult; stdcall;
  2432.     function PackUnstructured(const rt: TReferenceTime; dwChannelGroup: DWORD;
  2433.         cb: DWORD; const lpb): HResult; stdcall;
  2434.     function ResetReadPtr : HResult; stdcall;
  2435.     function GetNextEvent(out prt: TReferenceTime; out pdwChannelGroup: DWORD;
  2436.         out pdwLength: DWORD; out ppData: Pointer): HResult; stdcall;
  2437.     function GetRawBufferPtr(out ppData: Pointer): HResult; stdcall;
  2438.     function GetStartTime(out prt: TReferenceTime): HResult; stdcall;
  2439.     function GetUsedBytes(out pcb: DWORD): HResult; stdcall;
  2440.     function GetMaxBytes(out pcb: DWORD): HResult; stdcall;
  2441.     function GetBufferFormat(out pGuidFormat: TGUID): HResult; stdcall;
  2442.     function SetStartTime(const rt: TReferenceTime): HResult; stdcall;
  2443.     function SetUsedBytes(cb: DWORD): HResult; stdcall;
  2444.   end;
  2445.  
  2446.   IDirectMusicBuffer8 = IDirectMusicBuffer;
  2447.   {$NODEFINE IDirectMusicBuffer8}
  2448.   {$HPPEMIT 'typedef _di_IDirectMusicBuffer _di_IDirectMusicBuffer8;'}
  2449.  
  2450.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicInstrument);'}
  2451.   {$EXTERNALSYM IDirectMusicInstrument}
  2452.   IDirectMusicInstrument = interface(IUnknown)
  2453.     ['{d2ac287d-b39b-11d1-8704-00600893b1bd}']
  2454.     (* IDirectMusicInstrument *)
  2455.     function GetPatch(out pdwPatch: DWORD): HResult; stdcall;
  2456.     function SetPatch(dwPatch: DWORD): HResult; stdcall;
  2457.   end;
  2458.  
  2459.   IDirectMusicInstrument8 = IDirectMusicInstrument;
  2460.   {$NODEFINE IDirectMusicInstrument8}
  2461.   {$HPPEMIT 'typedef _di_IDirectMusicInstrument _di_IDirectMusicInstrument8;'}
  2462.  
  2463.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicDownloadedInstrument);'}
  2464.   {$EXTERNALSYM IDirectMusicDownloadedInstrument}
  2465.   IDirectMusicDownloadedInstrument = interface(IUnknown)
  2466.     ['{d2ac287e-b39b-11d1-8704-00600893b1bd}']
  2467.     (* IDirectMusicDownloadedInstrument *)
  2468.     (* None at this time *)
  2469.   end;
  2470.  
  2471.   IDirectMusicDownloadedInstrument8 = IDirectMusicDownloadedInstrument;
  2472.   {$NODEFINE IDirectMusicDownloadedInstrument8}
  2473.   {$HPPEMIT 'typedef _di_IDirectMusicDownloadedInstrument _di_IDirectMusicDownloadedInstrument8;'}
  2474.  
  2475.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicCollection);'}
  2476.   {$EXTERNALSYM IDirectMusicCollection}
  2477.   IDirectMusicCollection = interface(IUnknown)
  2478.     ['{d2ac287c-b39b-11d1-8704-00600893b1bd}']
  2479.     (* IDirectMusicCollection *)
  2480.     function GetInstrument(dwPatch: DWORD; out ppInstrument: IDirectMusicInstrument): HResult; stdcall;
  2481.     function EnumInstrument(dwIndex: DWORD; out pdwPatch: DWORD;
  2482.       pwszName: PWideChar; dwNameLen: DWORD): HResult; stdcall;
  2483.   end;
  2484.  
  2485.   IDirectMusicCollection8 = IDirectMusicCollection;
  2486.   {$NODEFINE IDirectMusicCollection8}
  2487.   {$HPPEMIT 'typedef _di_IDirectMusicCollection _di_IDirectMusicCollection8;'}
  2488.  
  2489.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicDownload);'}
  2490.   {$EXTERNALSYM IDirectMusicDownload}
  2491.   IDirectMusicDownload = interface(IUnknown)
  2492.     ['{d2ac287b-b39b-11d1-8704-00600893b1bd}']
  2493.     (* IDirectMusicDownload *)
  2494.     function GetBuffer(out ppvBuffer: Pointer; out pdwSize: DWORD): HResult; stdcall;
  2495.   end;
  2496.  
  2497.   IDirectMusicDownload8 = IDirectMusicDownload;
  2498.   {$NODEFINE IDirectMusicDownload8}
  2499.   {$HPPEMIT 'typedef _di_IDirectMusicDownload _di_IDirectMusicDownload8;'}
  2500.  
  2501.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicPortDownload);'}
  2502.   {$EXTERNALSYM IDirectMusicPortDownload}
  2503.   IDirectMusicPortDownload = interface(IUnknown)
  2504.     ['{d2ac287a-b39b-11d1-8704-00600893b1bd}']
  2505.     (* IDirectMusicPortDownload *)
  2506.     function GetBuffer(dwDLId: DWORD; out ppIDMDownload: IDirectMusicDownload): HResult; stdcall;
  2507.     function AllocateBuffer(dwSize: DWORD; out ppIDMDownload: IDirectMusicDownload): HResult; stdcall;
  2508.     function GetDLId(out pdwStartDLId: DWORD; dwCount: DWORD): HResult; stdcall;
  2509.     function GetAppend(out pdwAppend: DWORD): HResult; stdcall;
  2510.     function Download(pIDMDownload: IDirectMusicDownload): HResult; stdcall;
  2511.     function Unload(pIDMDownload: IDirectMusicDownload): HResult; stdcall;
  2512.   end;
  2513.  
  2514.   IDirectMusicPortDownload8 = IDirectMusicPortDownload;
  2515.   {$NODEFINE IDirectMusicPortDownload8}
  2516.   {$HPPEMIT 'typedef _di_IDirectMusicPortDownload _di_IDirectMusicPortDownload8;'}
  2517.  
  2518.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicPort);'}
  2519.   {$EXTERNALSYM IDirectMusicPort}
  2520.   IDirectMusicPort = interface(IUnknown)
  2521.     ['{08f2d8c9-37c2-11d2-b9f9-0000f875ac12}']
  2522.     (*  IDirectMusicPort *)
  2523.     function PlayBuffer(pBuffer: IDirectMusicBuffer): HResult; stdcall;
  2524.     function SetReadNotificationHandle(hEvent: THANDLE): HResult; stdcall;
  2525.     function Read(pBuffer: IDirectMusicBuffer): HResult; stdcall;
  2526.     function DownloadInstrument(pInstrument: IDirectMusicInstrument;
  2527.       out ppDownloadedInstrument: IDirectMusicDownloadedInstrument;
  2528.       pNoteRanges: PDMusNoteRange; dwNumNoteRanges: DWORD): HResult; stdcall;
  2529.     function UnloadInstrument(pDownloadedInstrument: IDirectMusicDownloadedInstrument): HResult; stdcall;
  2530.     function GetLatencyClock(out ppClock: IReferenceClock): HResult; stdcall;
  2531.     function GetRunningStats(var pStats: TDMusSynthStats): HResult; stdcall;
  2532.     function Compact: HResult; stdcall;
  2533.     function GetCaps(var pPortCaps: TDMusPortCaps): HResult; stdcall;
  2534.     function DeviceIoControl(dwIoControlCode: DWORD; const lpInBuffer; nInBufferSize: DWORD;
  2535.       out lpOutBuffer; nOutBufferSize: DWORD; out lpBytesReturned: DWORD;
  2536.       var lpOverlapped: TOVERLAPPED): HResult; stdcall;
  2537.     function SetNumChannelGroups(dwChannelGroups: DWORD): HResult; stdcall;
  2538.     function GetNumChannelGroups(out pdwChannelGroups: DWORD): HResult; stdcall;
  2539.     function Activate(fActive: BOOL): HResult; stdcall;
  2540.     function SetChannelPriority(dwChannelGroup, dwChannel, dwPriority: DWORD): HResult; stdcall;
  2541.     function GetChannelPriority(dwChannelGroup, dwChannel: DWORD; out pdwPriority: DWORD): HResult; stdcall;
  2542.     function SetDirectSound(pDirectSound: IDirectSound; pDirectSoundBuffer: IDirectSoundBuffer): HResult; stdcall;
  2543.     function GetFormat(pWaveFormatEx: PWaveFormatEx; var pdwWaveFormatExSize: DWORD;
  2544.       out pdwBufferSize: DWORD): HResult; stdcall;
  2545.   end;
  2546.  
  2547.   IDirectMusicPort8 = IDirectMusicPort;
  2548.   {$NODEFINE IDirectMusicPort8}
  2549.   {$HPPEMIT 'typedef _di_IDirectMusicPort _di_IDirectMusicPort8;'}
  2550.  
  2551.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicThru);'}
  2552.   {$EXTERNALSYM IDirectMusicThru}
  2553.   IDirectMusicThru = interface(IUnknown)
  2554.     ['{ced153e7-3606-11d2-b9f9-0000f875ac12}']
  2555.     (* IDirectMusicThru *)
  2556.     function ThruChannel(dwSourceChannelGroup, dwSourceChannel, dwDestinationChannelGroup,
  2557.       dwDestinationChannel: DWORD; pDestinationPort: IDirectMusicPort): HResult; stdcall;
  2558.   end;
  2559.  
  2560.   IDirectMusicThru8 = IDirectMusicThru;
  2561.   {$NODEFINE IDirectMusicThru8}
  2562.   {$HPPEMIT 'typedef _di_IDirectMusicThru _di_IDirectMusicThru8;'}
  2563.  
  2564. //Translator: IReferenceClock is already defined in DirectSound.pas
  2565.   IReferenceClock = DirectSound.IReferenceClock;
  2566.   {$NODEFINE IReferenceClock}
  2567. (*
  2568.   IReferenceClock = interface(IUnknown)
  2569.     ['{56a86897-0ad4-11ce-b03a-0020af0ba770}'] *) {
  2570.     (*  IReferenceClock *)
  2571.  
  2572.     (*  get the time now *)
  2573.     function GetTime(out pTime: TReferenceTime): HResult; stdcall;
  2574.  
  2575.     (*  ask for an async notification that a time has elapsed *)
  2576.     function AdviseTime(const baseTime,                  (*  base time *)
  2577.                         streamTime: TReferenceTime;      (*  stream offset time *)
  2578.                         hEvent: THANDLE;                 (*  advise via this event *)
  2579.                         var pdwAdviseCookie: DWORD): HResult; stdcall;   (*  where your cookie goes *)
  2580.  
  2581.     (*  ask for an async periodic notification that a time has elapsed *)
  2582.     function AdvisePeriodic(const startTime,                  (*  starting at this time *)
  2583.                             periodTime: TReferenceTime;       (*  time between notifications *)
  2584.                             hSemaphore: THANDLE;              (*  advise via a semaphore *)
  2585.                             var pdwAdviseCookie: DWORD): HResult; stdcall;   (*  where your cookie goes *)
  2586.  
  2587.     (*  cancel a request for notification *)
  2588.     function Unadvise(dwAdviseCookie: DWORD): HResult; stdcall;
  2589.   end;
  2590. }
  2591.  
  2592.   IID_IReferenceClock = IReferenceClock;
  2593.   {$EXTERNALSYM IID_IReferenceClock}
  2594.  
  2595. const
  2596.   CLSID_DirectMusic: TGUID = '{636b9f10-0c7d-11d1-95b2-0020afdc7421}';
  2597.   {$EXTERNALSYM CLSID_DirectMusic}
  2598.   CLSID_DirectMusicCollection: TGUID = '{480ff4b0-28b2-11d1-bef7-00c04fbf8fef}';
  2599.   {$EXTERNALSYM CLSID_DirectMusicCollection}
  2600.   CLSID_DirectMusicSynth: TGUID = '{58C2B4D0-46E7-11D1-89AC-00A0C9054129}';
  2601.   {$EXTERNALSYM CLSID_DirectMusicSynth}
  2602.  
  2603.   // Alternate interface ID for IID_IDirectMusic, available in DX7 release and after.
  2604.   IID_IDirectMusic2: TGUID = '{6fc2cae1-bc78-11d2-afa6-00aa0024d8b6}';
  2605.   {$EXTERNALSYM IID_IDirectMusic2}
  2606.  
  2607. type
  2608.   IID_IDirectMusic = IDirectMusic;
  2609.   {$EXTERNALSYM IID_IDirectMusic}
  2610.   IID_IDirectMusicBuffer = IDirectMusicBuffer;
  2611.   {$EXTERNALSYM IID_IDirectMusicBuffer}
  2612.   IID_IDirectMusicPort = IDirectMusicPort;
  2613.   {$EXTERNALSYM IID_IDirectMusicPort}
  2614.   IID_IDirectMusicThru = IDirectMusicThru;
  2615.   {$EXTERNALSYM IID_IDirectMusicThru}
  2616.   IID_IDirectMusicPortDownload = IDirectMusicPortDownload;
  2617.   {$EXTERNALSYM IID_IDirectMusicPortDownload}
  2618.   IID_IDirectMusicDownload = IDirectMusicDownload;
  2619.   {$EXTERNALSYM IID_IDirectMusicDownload}
  2620.   IID_IDirectMusicCollection = IDirectMusicCollection;
  2621.   {$EXTERNALSYM IID_IDirectMusicCollection}
  2622.   IID_IDirectMusicInstrument = IDirectMusicInstrument;
  2623.   {$EXTERNALSYM IID_IDirectMusicInstrument}
  2624.   IID_IDirectMusicDownloadedInstrument = IDirectMusicDownloadedInstrument;
  2625.   {$EXTERNALSYM IID_IDirectMusicDownloadedInstrument}
  2626.  
  2627.   IID_IDirectMusic8 = IDirectMusic8;
  2628.   {$EXTERNALSYM IID_IDirectMusic8}
  2629.  
  2630.   IID_IDirectMusicThru8 = IID_IDirectMusicThru;
  2631.   {$EXTERNALSYM IID_IDirectMusicThru8}
  2632.   IID_IDirectMusicPortDownload8 = IID_IDirectMusicPortDownload;
  2633.   {$EXTERNALSYM IID_IDirectMusicPortDownload8}
  2634.   IID_IDirectMusicDownload8 = IID_IDirectMusicDownload;
  2635.   {$EXTERNALSYM IID_IDirectMusicDownload8}
  2636.   IID_IDirectMusicCollection8 = IID_IDirectMusicCollection;
  2637.   {$EXTERNALSYM IID_IDirectMusicCollection8}
  2638.   IID_IDirectMusicInstrument8 = IID_IDirectMusicInstrument;
  2639.   {$EXTERNALSYM IID_IDirectMusicInstrument8}
  2640.   IID_IDirectMusicDownloadedInstrument8 = IID_IDirectMusicDownloadedInstrument;
  2641.   {$EXTERNALSYM IID_IDirectMusicDownloadedInstrument8}
  2642.   IID_IDirectMusicPort8 = IID_IDirectMusicPort;
  2643.   {$EXTERNALSYM IID_IDirectMusicPort8}
  2644.  
  2645.  
  2646. const   
  2647. (* Property Query GUID_DMUS_PROP_GM_Hardware - Local GM set, no need to download
  2648.  * Property Query GUID_DMUS_PROP_GS_Hardware - Local GS set, no need to download
  2649.  * Property Query GUID_DMUS_PROP_XG_Hardware - Local XG set, no need to download
  2650.  * Property Query GUID_DMUS_PROP_DLS1        - Support DLS level 1
  2651.  * Property Query GUID_DMUS_PROP_INSTRUMENT2 - Support new INSTRUMENT2 download format
  2652.  * Property Query GUID_DMUS_PROP_XG_Capable  - Support minimum requirements of XG
  2653.  * Property Query GUID_DMUS_PROP_GS_Capable  - Support minimum requirements of GS
  2654.  * Property Query GUID_DMUS_PROP_SynthSink_DSOUND - Synthsink talks to DSound
  2655.  * Property Query GUID_DMUS_PROP_SynthSink_WAVE - Synthsink talks to Wave device
  2656.  *
  2657.  * Item 0: Supported
  2658.  * Returns a DWORD which is non-zero if the feature is supported
  2659.  *)
  2660.   GUID_DMUS_PROP_GM_Hardware: TGUID = '{178f2f24-c364-11d1-a760-0000f875ac12}';
  2661.   {$EXTERNALSYM GUID_DMUS_PROP_GM_Hardware}
  2662.   GUID_DMUS_PROP_GS_Hardware: TGUID = '{178f2f25-c364-11d1-a760-0000f875ac12}';
  2663.   {$EXTERNALSYM GUID_DMUS_PROP_GS_Hardware}
  2664.   GUID_DMUS_PROP_XG_Hardware: TGUID = '{178f2f26-c364-11d1-a760-0000f875ac12}';
  2665.   {$EXTERNALSYM GUID_DMUS_PROP_XG_Hardware}
  2666.   GUID_DMUS_PROP_XG_Capable: TGUID = '{6496aba1-61b0-11d2-afa6-00aa0024d8b6}';
  2667.   {$EXTERNALSYM GUID_DMUS_PROP_XG_Capable}
  2668.   GUID_DMUS_PROP_GS_Capable: TGUID = '{6496aba2-61b0-11d2-afa6-00aa0024d8b6}';
  2669.   {$EXTERNALSYM GUID_DMUS_PROP_GS_Capable}
  2670.   GUID_DMUS_PROP_DLS1: TGUID = '{178f2f27-c364-11d1-a760-0000f875ac12}';
  2671.   {$EXTERNALSYM GUID_DMUS_PROP_DLS1}
  2672.   GUID_DMUS_PROP_DLS2: TGUID = '{f14599e5-4689-11d2-afa6-00aa0024d8b6}';
  2673.   {$EXTERNALSYM GUID_DMUS_PROP_DLS2}
  2674.   GUID_DMUS_PROP_INSTRUMENT2: TGUID = '{865fd372-9f67-11d2-872a-00600893b1bd}';
  2675.   {$EXTERNALSYM GUID_DMUS_PROP_INSTRUMENT2}
  2676.   GUID_DMUS_PROP_SynthSink_DSOUND: TGUID = '{0aa97844-c877-11d1-870c-00600893b1bd}';
  2677.   {$EXTERNALSYM GUID_DMUS_PROP_SynthSink_DSOUND}
  2678.   GUID_DMUS_PROP_SynthSink_WAVE: TGUID = '{0aa97845-c877-11d1-870c-00600893b1bd}';
  2679.   {$EXTERNALSYM GUID_DMUS_PROP_SynthSink_WAVE}
  2680.   GUID_DMUS_PROP_SampleMemorySize: TGUID = '{178f2f28-c364-11d1-a760-0000f875ac12}';
  2681.   {$EXTERNALSYM GUID_DMUS_PROP_SampleMemorySize}
  2682.   GUID_DMUS_PROP_SamplePlaybackRate: TGUID = '{2a91f713-a4bf-11d2-bbdf-00600833dbd8}';
  2683.   {$EXTERNALSYM GUID_DMUS_PROP_SamplePlaybackRate}
  2684.  
  2685. (* Property Get/Set GUID_DMUS_PROP_WriteLatency
  2686.  *
  2687.  * Item 0: Synth buffer write latency, in milliseconds
  2688.  * Get/Set SynthSink latency, the average time after the play head that the next buffer gets written.
  2689.  *)
  2690.   GUID_DMUS_PROP_WriteLatency: TGUID = '{268a0fa0-60f2-11d2-afa6-00aa0024d8b6}';
  2691.   {$EXTERNALSYM GUID_DMUS_PROP_WriteLatency}
  2692.  
  2693. (* Property Get/Set GUID_DMUS_PROP_WritePeriod
  2694.  *
  2695.  * Item 0: Synth buffer write period, in milliseconds
  2696.  * Get/Set SynthSink buffer write period, time span between successive writes.
  2697.  *)
  2698.   GUID_DMUS_PROP_WritePeriod: TGUID = '{268a0fa1-60f2-11d2-afa6-00aa0024d8b6}';
  2699.   {$EXTERNALSYM GUID_DMUS_PROP_WritePeriod}
  2700.  
  2701. (* Property Get GUID_DMUS_PROP_MemorySize
  2702.  *
  2703.  * Item 0: Memory size
  2704.  * Returns a DWORD containing the total number of bytes of sample RAM
  2705.  *)
  2706.   GUID_DMUS_PROP_MemorySize: TGUID = '{178f2f28-c364-11d1-a760-0000f875ac12}';
  2707.   {$EXTERNALSYM GUID_DMUS_PROP_MemorySize}
  2708.  
  2709. (* Property Set GUID_DMUS_PROP_WavesReverb
  2710.  *
  2711.  * Item 0: DMUS_WAVES_REVERB structure
  2712.  * Sets reverb parameters
  2713.  *)
  2714.   GUID_DMUS_PROP_WavesReverb: TGUID = '{04cb5622-32e5-11d2-afa6-00aa0024d8b6}';
  2715.   {$EXTERNALSYM GUID_DMUS_PROP_WavesReverb}
  2716.  
  2717. (* Property Set GUID_DMUS_PROP_Effects
  2718.  *
  2719.  * Item 0: DWORD with effects flags.
  2720.  * Get/Set effects bits, same as dwEffectFlags in DMUS_PORTPARAMS and DMUS_PORTCAPS:
  2721.  * DMUS_EFFECT_NONE
  2722.  * DMUS_EFFECT_REVERB
  2723.  * DMUS_EFFECT_CHORUS
  2724.  *)
  2725.   GUID_DMUS_PROP_Effects: TGUID = '{cda8d611-684a-11d2-871e-00600893b1bd}';
  2726.   {$EXTERNALSYM GUID_DMUS_PROP_Effects}
  2727.  
  2728. (* Property Set GUID_DMUS_PROP_LegacyCaps
  2729.  *
  2730.  * Item 0: The MIDINCAPS or MIDIOUTCAPS which describes the port's underlying WinMM device. This property is only supported
  2731.  * by ports which wrap WinMM devices.
  2732.  *)
  2733.  
  2734.   GUID_DMUS_PROP_LegacyCaps: TGUID = '{cfa7cdc2-00a1-11d2-aad5-0000f875ac12}';
  2735.   {$EXTERNALSYM GUID_DMUS_PROP_LegacyCaps}
  2736.  
  2737. (* Property Set GUID_DMUS_PROP_Volume
  2738.  *
  2739.  * Item 0: A long which contains an offset, in 1/100 dB, to be added to the final volume
  2740.  *
  2741.  *)
  2742.   GUID_DMUS_PROP_Volume: TGUID = '{fedfae25-e46e-11d1-aace-0000f875ac12}';
  2743.   {$EXTERNALSYM GUID_DMUS_PROP_Volume}
  2744.  
  2745.   // Min and Max values for setting volume with GUID_DMUS_PROP_Volume
  2746.  
  2747.   DMUS_VOLUME_MAX     = 2000;        (* +20 dB *)
  2748.   {$EXTERNALSYM DMUS_VOLUME_MAX}
  2749.   DMUS_VOLUME_MIN   = -20000;        (* -200 dB *)
  2750.   {$EXTERNALSYM DMUS_VOLUME_MIN}
  2751.  
  2752.  
  2753.  
  2754. (************************************************************************
  2755. *                                                                       *
  2756. *   dmusici.h -- This module contains the API for the                   *
  2757. *                DirectMusic performance layer                          *
  2758. *                                                                       *
  2759. *   Copyright (c) Microsoft Corporation.  All rights reserved.          *
  2760. *                                                                       *
  2761. ************************************************************************)
  2762.  
  2763. type
  2764.   TRANSITION_TYPE = Word;
  2765.   {$EXTERNALSYM TRANSITION_TYPE}
  2766.  
  2767.   PMusicTime = ^TMusicTime;
  2768.   MUSIC_TIME = Longint;
  2769.   {$EXTERNALSYM MUSIC_TIME}
  2770.   TMusicTime = MUSIC_TIME;
  2771.  
  2772.  
  2773. const
  2774.   MT_MIN          = $80000000;  // Minimum music time value.
  2775.   {$EXTERNALSYM MT_MIN}
  2776.   MT_MAX          = $7FFFFFFF;  // Maximum music time value.
  2777.   {$EXTERNALSYM MT_MAX}
  2778.  
  2779.   DMUS_PPQ        = 768;     // parts per quarter note
  2780.   {$EXTERNALSYM DMUS_PPQ}
  2781.  
  2782.  
  2783. type
  2784.   PDMusStyletTypes = ^TDMusStyletTypes;
  2785.   enumDMUS_STYLET_TYPES = (
  2786.     DMUS_STYLET_PATTERN         {= 0},
  2787.     DMUS_STYLET_MOTIF           {= 1}
  2788.   );
  2789.   {$EXTERNALSYM enumDMUS_STYLET_TYPES}
  2790.   DMUS_STYLET_TYPES = enumDMUS_STYLET_TYPES;
  2791.   {$EXTERNALSYM DMUS_STYLET_TYPES}
  2792.   TDMusStyletTypes = DMUS_STYLET_TYPES;
  2793.  
  2794.  
  2795.   enumDMUS_COMMANDT_TYPES = (
  2796.     DMUS_COMMANDT_GROOVE            {= 0},
  2797.     DMUS_COMMANDT_FILL              {= 1},
  2798.     DMUS_COMMANDT_INTRO             {= 2},
  2799.     DMUS_COMMANDT_BREAK             {= 3},
  2800.     DMUS_COMMANDT_END               {= 4},
  2801.     DMUS_COMMANDT_ENDANDINTRO       {= 5}
  2802.   );
  2803.   {$EXTERNALSYM enumDMUS_COMMANDT_TYPES}
  2804.   DMUS_COMMANDT_TYPES = enumDMUS_COMMANDT_TYPES;
  2805.   {$EXTERNALSYM DMUS_COMMANDT_TYPES}
  2806.   TDMusCommandtTypes = DMUS_COMMANDT_TYPES;
  2807.   PDMusCommandtTypes = ^TDMusCommandtTypes;
  2808.  
  2809.   PDMusShapetTypes = ^TDMusShapetTypes;
  2810.   enumDMUS_SHAPET_TYPES = (
  2811.     DMUS_SHAPET_FALLING             {= 0},
  2812.     DMUS_SHAPET_LEVEL               {= 1},
  2813.     DMUS_SHAPET_LOOPABLE            {= 2},
  2814.     DMUS_SHAPET_LOUD                {= 3},
  2815.     DMUS_SHAPET_QUIET               {= 4},
  2816.     DMUS_SHAPET_PEAKING             {= 5},
  2817.     DMUS_SHAPET_RANDOM              {= 6},
  2818.     DMUS_SHAPET_RISING              {= 7},
  2819.     DMUS_SHAPET_SONG                {= 8}
  2820.   );
  2821.   {$EXTERNALSYM enumDMUS_SHAPET_TYPES}
  2822.   DMUS_SHAPET_TYPES = enumDMUS_SHAPET_TYPES;
  2823.   {$EXTERNALSYM DMUS_SHAPET_TYPES}
  2824.   TDMusShapetTypes = DMUS_SHAPET_TYPES;
  2825.  
  2826.   enumDMUS_COMPOSEF_FLAGS = DWORD;
  2827.   {$EXTERNALSYM enumDMUS_COMPOSEF_FLAGS}
  2828.   DMUS_COMPOSEF_FLAGS = enumDMUS_COMPOSEF_FLAGS;
  2829.   {$EXTERNALSYM DMUS_COMPOSEF_FLAGS}
  2830.   TDMusComposefFlags = DMUS_COMPOSEF_FLAGS;
  2831.   PDMusComposefFlags = ^TDMusComposefFlags;
  2832.  
  2833. const
  2834.   DMUS_COMPOSEF_NONE              = 0;
  2835.   {$EXTERNALSYM DMUS_COMPOSEF_NONE}
  2836.   DMUS_COMPOSEF_ALIGN             = $1;
  2837.   {$EXTERNALSYM DMUS_COMPOSEF_ALIGN}
  2838.   DMUS_COMPOSEF_OVERLAP           = $2;
  2839.   {$EXTERNALSYM DMUS_COMPOSEF_OVERLAP}
  2840.   DMUS_COMPOSEF_IMMEDIATE         = $4;
  2841.   {$EXTERNALSYM DMUS_COMPOSEF_IMMEDIATE}
  2842.   DMUS_COMPOSEF_GRID              = $8;
  2843.   {$EXTERNALSYM DMUS_COMPOSEF_GRID}
  2844.   DMUS_COMPOSEF_BEAT              = $10;
  2845.   {$EXTERNALSYM DMUS_COMPOSEF_BEAT}
  2846.   DMUS_COMPOSEF_MEASURE           = $20;
  2847.   {$EXTERNALSYM DMUS_COMPOSEF_MEASURE}
  2848.   DMUS_COMPOSEF_AFTERPREPARETIME  = $40;
  2849.   {$EXTERNALSYM DMUS_COMPOSEF_AFTERPREPARETIME}
  2850.   DMUS_COMPOSEF_VALID_START_BEAT  = $80;   (* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any beat. *)
  2851.   {$EXTERNALSYM DMUS_COMPOSEF_VALID_START_BEAT}
  2852.   DMUS_COMPOSEF_VALID_START_GRID  = $100;  (* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any grid. *)
  2853.   {$EXTERNALSYM DMUS_COMPOSEF_VALID_START_GRID}
  2854.   DMUS_COMPOSEF_VALID_START_TICK  = $200;  (* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur any time. *)
  2855.   {$EXTERNALSYM DMUS_COMPOSEF_VALID_START_TICK}
  2856.   DMUS_COMPOSEF_SEGMENTEND        = $400;  (* Play the transition at the end of the current segment. *)
  2857.   {$EXTERNALSYM DMUS_COMPOSEF_SEGMENTEND}
  2858.   DMUS_COMPOSEF_MARKER            = $800;  (* Play the transition at the next marker in the current segment. *)
  2859.   {$EXTERNALSYM DMUS_COMPOSEF_MARKER}
  2860.   DMUS_COMPOSEF_MODULATE          = $1000;
  2861.   {$EXTERNALSYM DMUS_COMPOSEF_MODULATE}
  2862.   DMUS_COMPOSEF_LONG              = $2000;
  2863.   {$EXTERNALSYM DMUS_COMPOSEF_LONG}
  2864.   DMUS_COMPOSEF_ENTIRE_TRANSITION = $4000;    (* play the entire transition pattern *)
  2865.   {$EXTERNALSYM DMUS_COMPOSEF_ENTIRE_TRANSITION}
  2866.   DMUS_COMPOSEF_1BAR_TRANSITION   = $8000;    (* play one bar of the transition pattern *)
  2867.   {$EXTERNALSYM DMUS_COMPOSEF_1BAR_TRANSITION}
  2868.   DMUS_COMPOSEF_ENTIRE_ADDITION   = $10000;   (* play the additional pattern in its entirety *)
  2869.   {$EXTERNALSYM DMUS_COMPOSEF_ENTIRE_ADDITION}
  2870.   DMUS_COMPOSEF_1BAR_ADDITION     = $20000;   (* play one bar of the additional pattern *)
  2871.   {$EXTERNALSYM DMUS_COMPOSEF_1BAR_ADDITION}
  2872.   DMUS_COMPOSEF_VALID_START_MEASURE = $40000; (* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any bar. *)
  2873.   {$EXTERNALSYM DMUS_COMPOSEF_VALID_START_MEASURE}
  2874.   DMUS_COMPOSEF_DEFAULT           = $80000;   (* Use segment's default boundary *)
  2875.   {$EXTERNALSYM DMUS_COMPOSEF_DEFAULT}
  2876.   DMUS_COMPOSEF_NOINVALIDATE      = $100000;  (* Play without invalidating the currently playing segment(s) *)
  2877.   {$EXTERNALSYM DMUS_COMPOSEF_NOINVALIDATE}
  2878.   DMUS_COMPOSEF_USE_AUDIOPATH     = $200000;  (* Uses the audio paths that are embedded in the segments *)
  2879.   {$EXTERNALSYM DMUS_COMPOSEF_USE_AUDIOPATH}
  2880.   DMUS_COMPOSEF_INVALIDATE_PRI    = $400000;  (* Invalidate only the current primary seg state *)
  2881.   {$EXTERNALSYM DMUS_COMPOSEF_INVALIDATE_PRI}
  2882.  
  2883.  
  2884.  
  2885. const
  2886.   DMUS_PCHANNEL_BROADCAST_PERFORMANCE = $FFFFFFFF;  // PMsg is sent on all PChannels of the performance.
  2887.   {$EXTERNALSYM DMUS_PCHANNEL_BROADCAST_PERFORMANCE}
  2888.   DMUS_PCHANNEL_BROADCAST_AUDIOPATH   = $FFFFFFFE;  // PMsg is sent on all PChannels of the audio path.
  2889.   {$EXTERNALSYM DMUS_PCHANNEL_BROADCAST_AUDIOPATH}
  2890.   DMUS_PCHANNEL_BROADCAST_SEGMENT     = $FFFFFFFD;  // PMsg is sent on all PChannels of the segment.
  2891.   {$EXTERNALSYM DMUS_PCHANNEL_BROADCAST_SEGMENT}
  2892.   DMUS_PCHANNEL_BROADCAST_GROUPS      = $FFFFFFFC;  // A duplicate PMsg is for each Channels Groups in the performance.
  2893.   {$EXTERNALSYM DMUS_PCHANNEL_BROADCAST_GROUPS}
  2894.  
  2895. (*  The DMUS_PATH constants are used in conjunction with GetObjectInPath to find a requested
  2896.     interface at a particular stage in the audio path.
  2897. *)
  2898.   DMUS_PATH_SEGMENT          = $1000;      // Get the segment itself (from a segment state.)
  2899.   {$EXTERNALSYM DMUS_PATH_SEGMENT}
  2900.   DMUS_PATH_SEGMENT_TRACK    = $1100;      // Look in Track List of Segment.
  2901.   {$EXTERNALSYM DMUS_PATH_SEGMENT_TRACK}
  2902.   DMUS_PATH_SEGMENT_GRAPH    = $1200;      // Get the segment's tool graph.
  2903.   {$EXTERNALSYM DMUS_PATH_SEGMENT_GRAPH}
  2904.   DMUS_PATH_SEGMENT_TOOL     = $1300;      // Look in Tool Graph of Segment.
  2905.   {$EXTERNALSYM DMUS_PATH_SEGMENT_TOOL}
  2906.   DMUS_PATH_AUDIOPATH        = $2000;      // Get the audiopath itself (from a segment state.)
  2907.   {$EXTERNALSYM DMUS_PATH_AUDIOPATH}
  2908.   DMUS_PATH_AUDIOPATH_GRAPH  = $2200;      // Get the audiopath's tool graph.
  2909.   {$EXTERNALSYM DMUS_PATH_AUDIOPATH_GRAPH}
  2910.   DMUS_PATH_AUDIOPATH_TOOL   = $2300;      // Look in Tool Graph of Audio Path.
  2911.   {$EXTERNALSYM DMUS_PATH_AUDIOPATH_TOOL}
  2912.   DMUS_PATH_PERFORMANCE      = $3000;      // Access the performance.
  2913.   {$EXTERNALSYM DMUS_PATH_PERFORMANCE}
  2914.   DMUS_PATH_PERFORMANCE_GRAPH = $3200;     // Get the performance's tool graph.
  2915.   {$EXTERNALSYM DMUS_PATH_PERFORMANCE_GRAPH}
  2916.   DMUS_PATH_PERFORMANCE_TOOL = $3300;      // Look in Tool Graph of Performance.
  2917.   {$EXTERNALSYM DMUS_PATH_PERFORMANCE_TOOL}
  2918.   DMUS_PATH_PORT             = $4000;      // Access the synth.
  2919.   {$EXTERNALSYM DMUS_PATH_PORT}
  2920.   DMUS_PATH_BUFFER           = $6000;      // Look in DirectSoundBuffer.
  2921.   {$EXTERNALSYM DMUS_PATH_BUFFER}
  2922.   DMUS_PATH_BUFFER_DMO       = $6100;      // Access a DMO in the buffer.
  2923.   {$EXTERNALSYM DMUS_PATH_BUFFER_DMO}
  2924.   DMUS_PATH_MIXIN_BUFFER     = $7000;      // Look in a global mixin buffer.
  2925.   {$EXTERNALSYM DMUS_PATH_MIXIN_BUFFER}
  2926.   DMUS_PATH_MIXIN_BUFFER_DMO = $7100;      // Access a DMO in a global mixin buffer.
  2927.   {$EXTERNALSYM DMUS_PATH_MIXIN_BUFFER_DMO}
  2928.   DMUS_PATH_PRIMARY_BUFFER   = $8000;      // Access the primary buffer.
  2929.   {$EXTERNALSYM DMUS_PATH_PRIMARY_BUFFER}
  2930.  
  2931. (*  To ignore PChannels when calling GetObjectInPath(), use the DMUS_PCHANNEL_ALL constant. *)
  2932.   DMUS_PCHANNEL_ALL           = $FFFFFFFB;
  2933.   {$EXTERNALSYM DMUS_PCHANNEL_ALL}
  2934.  
  2935. (*  The DMUS_APATH types are used in conjunction with CreateStandardAudioPath to
  2936.     build default path types. _SHARED_ means the same buffer is shared across multiple
  2937.     instantiations of the audiopath type. _DYNAMIC_ means a unique buffer is created
  2938.     every time.
  2939. *)
  2940.  
  2941.   DMUS_APATH_SHARED_STEREOPLUSREVERB   = 1;       // A standard music set up with stereo outs and reverb.
  2942.   {$EXTERNALSYM DMUS_APATH_SHARED_STEREOPLUSREVERB}
  2943.   DMUS_APATH_DYNAMIC_3D                = 6;       // An audio path with one dynamic bus from the synth feeding to a dynamic 3d buffer. Does not send to env reverb.
  2944.   {$EXTERNALSYM DMUS_APATH_DYNAMIC_3D}
  2945.   DMUS_APATH_DYNAMIC_MONO              = 7;       // An audio path with one dynamic bus from the synth feeding to a dynamic mono buffer.
  2946.   {$EXTERNALSYM DMUS_APATH_DYNAMIC_MONO}
  2947.   DMUS_APATH_DYNAMIC_STEREO            = 8;       // An audio path with two dynamic buses from the synth feeding to a dynamic stereo buffer.
  2948.   {$EXTERNALSYM DMUS_APATH_DYNAMIC_STEREO}
  2949.  
  2950. type
  2951.   PDMusAudioParams = ^TDMusAudioParams;
  2952.   _DMUS_AUDIOPARAMS = packed record
  2953.     dwSize: DWORD;             // Size of this structure.
  2954.     fInitNow: BOOL;            // If true, the sink and synth are created immediately and results returned in this structure.
  2955.     dwValidData: DWORD;        // Flags indicating which fields below are valid.
  2956.     dwFeatures: DWORD;         // Required DMUS_AUDIOF features.
  2957.     dwVoices: DWORD;           // Required number of voices.
  2958.     dwSampleRate: DWORD;       // Sample rate of synths and sink.
  2959.     clsidDefaultSynth: TGUID; // Class ID of default synthesizer.
  2960.   end;
  2961.   {$EXTERNALSYM _DMUS_AUDIOPARAMS}
  2962.   DMUS_AUDIOPARAMS = _DMUS_AUDIOPARAMS;
  2963.   {$EXTERNALSYM DMUS_AUDIOPARAMS}
  2964.   TDMusAudioParams = _DMUS_AUDIOPARAMS;
  2965.  
  2966. const
  2967.   (* dwFeatures flags. These indicate which features are required for the audio environment. *)
  2968.   DMUS_AUDIOF_3D          = $1;   // Require 3D buffers.
  2969.   {$EXTERNALSYM DMUS_AUDIOF_3D}
  2970.   DMUS_AUDIOF_ENVIRON     = $2;   // Require environmental modeling.
  2971.   {$EXTERNALSYM DMUS_AUDIOF_ENVIRON}
  2972.   DMUS_AUDIOF_EAX         = $4;   // Require use of EAX effects.
  2973.   {$EXTERNALSYM DMUS_AUDIOF_EAX}
  2974.   DMUS_AUDIOF_DMOS        = $8;   // Require use of additional DMOs.
  2975.   {$EXTERNALSYM DMUS_AUDIOF_DMOS}
  2976.   DMUS_AUDIOF_STREAMING   = $10;  // Require support for streaming waves.
  2977.   {$EXTERNALSYM DMUS_AUDIOF_STREAMING}
  2978.   DMUS_AUDIOF_BUFFERS     = $20;  // Require support for multiple buffers (all above cases need this.)
  2979.   {$EXTERNALSYM DMUS_AUDIOF_BUFFERS}
  2980.   DMUS_AUDIOF_ALL         = $3F;  // Requires everything.
  2981.   {$EXTERNALSYM DMUS_AUDIOF_ALL}
  2982.  
  2983.   (* dwValidData flags. These indicate which fields in DMUS_AUDIOPARAMS have been filled in. If fInitNow is set, these also return what was allocated. *)
  2984.   DMUS_AUDIOPARAMS_FEATURES       = $00000001;
  2985.   {$EXTERNALSYM DMUS_AUDIOPARAMS_FEATURES}
  2986.   DMUS_AUDIOPARAMS_VOICES         = $00000002;
  2987.   {$EXTERNALSYM DMUS_AUDIOPARAMS_VOICES}
  2988.   DMUS_AUDIOPARAMS_SAMPLERATE     = $00000004;
  2989.   {$EXTERNALSYM DMUS_AUDIOPARAMS_SAMPLERATE}
  2990.   DMUS_AUDIOPARAMS_DEFAULTSYNTH   = $00000008;
  2991.   {$EXTERNALSYM DMUS_AUDIOPARAMS_DEFAULTSYNTH}
  2992.  
  2993. (* DMUS_PMSGF_FLAGS fill the DMUS_PMSG's dwFlags member *)
  2994. type
  2995.   enumDMUS_PMSGF_FLAGS = DWORD;
  2996.   {$EXTERNALSYM enumDMUS_PMSGF_FLAGS}
  2997.   DMUS_PMSGF_FLAGS = enumDMUS_PMSGF_FLAGS;
  2998.   {$EXTERNALSYM DMUS_PMSGF_FLAGS}
  2999.   TDMusPmsgfFlags = DMUS_PMSGF_FLAGS;
  3000.   PDMusPmsgfFlags = ^TDMusPmsgfFlags;
  3001.  
  3002. const
  3003.   DMUS_PMSGF_REFTIME          = 1;      // if rtTime is valid
  3004.   {$EXTERNALSYM DMUS_PMSGF_REFTIME}
  3005.   DMUS_PMSGF_MUSICTIME        = 2;      // if mtTime is valid
  3006.   {$EXTERNALSYM DMUS_PMSGF_MUSICTIME}
  3007.   DMUS_PMSGF_TOOL_IMMEDIATE   = 4;      // if PMSG should be processed immediately
  3008.   {$EXTERNALSYM DMUS_PMSGF_TOOL_IMMEDIATE}
  3009.   DMUS_PMSGF_TOOL_QUEUE       = 8;      // if PMSG should be processed a little early, at Queue time
  3010.   {$EXTERNALSYM DMUS_PMSGF_TOOL_QUEUE}
  3011.   DMUS_PMSGF_TOOL_ATTIME      = $10;    // if PMSG should be processed at the time stamp
  3012.   {$EXTERNALSYM DMUS_PMSGF_TOOL_ATTIME}
  3013.   DMUS_PMSGF_TOOL_FLUSH       = $20;    // if PMSG is being flushed
  3014.   {$EXTERNALSYM DMUS_PMSGF_TOOL_FLUSH}
  3015.   DMUS_PMSGF_LOCKTOREFTIME    = $40;    // if rtTime can not be overriden by a tempo change.
  3016.   {$EXTERNALSYM DMUS_PMSGF_LOCKTOREFTIME}
  3017.   DMUS_PMSGF_DX8              = $80;    // if the message has DX8 or later extensions.
  3018.   {$EXTERNALSYM DMUS_PMSGF_DX8}
  3019.   // The values of DMUS_TIME_RESOLVE_FLAGS may also be used inside the
  3020.   // DMUS_PMSG's dwFlags member.
  3021.  
  3022. (* DMUS_PMSGT_TYPES fill the DMUS_PMSG's dwType member *)
  3023. type
  3024.   enumDMUS_PMSGT_TYPES = DWORD;
  3025.   {$EXTERNALSYM enumDMUS_PMSGT_TYPES}
  3026.   DMUS_PMSGT_TYPES = enumDMUS_PMSGT_TYPES;
  3027.   {$EXTERNALSYM DMUS_PMSGT_TYPES}
  3028.   TDMusPmsgtTypes = DMUS_PMSGT_TYPES;
  3029.   PDMusPmsgtTypes = ^TDMusPmsgtTypes;
  3030.  
  3031. const
  3032.   DMUS_PMSGT_MIDI             = 0;      // MIDI short message
  3033.   {$EXTERNALSYM DMUS_PMSGT_MIDI}
  3034.   DMUS_PMSGT_NOTE             = 1;      // Interactive Music Note
  3035.   {$EXTERNALSYM DMUS_PMSGT_NOTE}
  3036.   DMUS_PMSGT_SYSEX            = 2;      // MIDI long message (system exclusive message)
  3037.   {$EXTERNALSYM DMUS_PMSGT_SYSEX}
  3038.   DMUS_PMSGT_NOTIFICATION     = 3;      // Notification message
  3039.   {$EXTERNALSYM DMUS_PMSGT_NOTIFICATION}
  3040.   DMUS_PMSGT_TEMPO            = 4;      // Tempo message
  3041.   {$EXTERNALSYM DMUS_PMSGT_TEMPO}
  3042.   DMUS_PMSGT_CURVE            = 5;      // Control change / pitch bend, etc. curve
  3043.   {$EXTERNALSYM DMUS_PMSGT_CURVE}
  3044.   DMUS_PMSGT_TIMESIG          = 6;      // Time signature
  3045.   {$EXTERNALSYM DMUS_PMSGT_TIMESIG}
  3046.   DMUS_PMSGT_PATCH            = 7;      // Patch changes
  3047.   {$EXTERNALSYM DMUS_PMSGT_PATCH}
  3048.   DMUS_PMSGT_TRANSPOSE        = 8;      // Transposition messages
  3049.   {$EXTERNALSYM DMUS_PMSGT_TRANSPOSE}
  3050.   DMUS_PMSGT_CHANNEL_PRIORITY = 9;      // Channel priority
  3051.   {$EXTERNALSYM DMUS_PMSGT_CHANNEL_PRIORITY}
  3052.   DMUS_PMSGT_STOP             = 10;     // Stop message
  3053.   {$EXTERNALSYM DMUS_PMSGT_STOP}
  3054.   DMUS_PMSGT_DIRTY            = 11;     // Tells Tools that cache GetParam() info to refresh
  3055.   {$EXTERNALSYM DMUS_PMSGT_DIRTY}
  3056.   DMUS_PMSGT_WAVE             = 12;     // Carries control information for playing a wave.
  3057.   {$EXTERNALSYM DMUS_PMSGT_WAVE}
  3058.   DMUS_PMSGT_LYRIC            = 13;     // Lyric message from lyric track.
  3059.   {$EXTERNALSYM DMUS_PMSGT_LYRIC}
  3060.   DMUS_PMSGT_SCRIPTLYRIC      = 14;     // Lyric message sent by a script with the Trace function.
  3061.   {$EXTERNALSYM DMUS_PMSGT_SCRIPTLYRIC}
  3062.   DMUS_PMSGT_USER             = 255;    // User message
  3063.   {$EXTERNALSYM DMUS_PMSGT_USER}
  3064.  
  3065. type
  3066.   (* DMUS_SEGF_FLAGS correspond to IDirectMusicPerformance::PlaySegment, and other API *)
  3067.   enumDMUS_SEGF_FLAGS = DWORD;
  3068.   DMUS_SEGF_FLAGS = enumDMUS_SEGF_FLAGS;
  3069.   {$EXTERNALSYM DMUS_SEGF_FLAGS}
  3070.   TDMusSegfFlags = DMUS_SEGF_FLAGS;
  3071.   PDMusSegfFlags = ^TDMusSegfFlags;
  3072.  
  3073. const
  3074.   DMUS_SEGF_REFTIME           = 1 shr 6;   // 0x40 Time parameter is in reference time
  3075.   {$EXTERNALSYM DMUS_SEGF_REFTIME}
  3076.   DMUS_SEGF_SECONDARY         = 1 shr 7;   // 0x80 Secondary segment
  3077.   {$EXTERNALSYM DMUS_SEGF_SECONDARY}
  3078.   DMUS_SEGF_QUEUE             = 1 shr 8;   // 0x100 Queue at the end of the primary segment queue (primary only)
  3079.   {$EXTERNALSYM DMUS_SEGF_QUEUE}
  3080.   DMUS_SEGF_CONTROL           = 1 shr 9;   // 0x200 Play as a control track (secondary segments only)
  3081.   {$EXTERNALSYM DMUS_SEGF_CONTROL}
  3082.   DMUS_SEGF_AFTERPREPARETIME  = 1 shr 10;  // 0x400 Play after the prepare time (See IDirectMusicPerformance::GetPrepareTime)
  3083.   {$EXTERNALSYM DMUS_SEGF_AFTERPREPARETIME}
  3084.   DMUS_SEGF_GRID              = 1 shr 11;  // 0x800 Play on grid boundary
  3085.   {$EXTERNALSYM DMUS_SEGF_GRID}
  3086.   DMUS_SEGF_BEAT              = 1 shr 12;  // 0x1000 Play on beat boundary
  3087.   {$EXTERNALSYM DMUS_SEGF_BEAT}
  3088.   DMUS_SEGF_MEASURE           = 1 shr 13;  // 0x2000 Play on measure boundary
  3089.   {$EXTERNALSYM DMUS_SEGF_MEASURE}
  3090.   DMUS_SEGF_DEFAULT           = 1 shr 14;  // 0x4000 Use segment's default boundary
  3091.   {$EXTERNALSYM DMUS_SEGF_DEFAULT}
  3092.   DMUS_SEGF_NOINVALIDATE      = 1 shr 15;  // 0x8000 Play without invalidating the currently playing segment(s)
  3093.   {$EXTERNALSYM DMUS_SEGF_NOINVALIDATE}
  3094.   DMUS_SEGF_ALIGN             = 1 shr 16;  // 0x10000 Align segment with requested boundary, but switch at first valid point
  3095.   {$EXTERNALSYM DMUS_SEGF_ALIGN}
  3096.   DMUS_SEGF_VALID_START_BEAT  = 1 shr 17;  // 0x20000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any beat.
  3097.   {$EXTERNALSYM DMUS_SEGF_VALID_START_BEAT}
  3098.   DMUS_SEGF_VALID_START_GRID  = 1 shr 18;  // 0x40000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any grid.
  3099.   {$EXTERNALSYM DMUS_SEGF_VALID_START_GRID}
  3100.   DMUS_SEGF_VALID_START_TICK  = 1 shr 19;  // 0x80000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur any time.
  3101.   {$EXTERNALSYM DMUS_SEGF_VALID_START_TICK}
  3102.   DMUS_SEGF_AUTOTRANSITION    = 1 shr 20;  // 0x100000 Compose and play a transition segment, using the transition template. 
  3103.   {$EXTERNALSYM DMUS_SEGF_AUTOTRANSITION}
  3104.   DMUS_SEGF_AFTERQUEUETIME    = 1 shr 21;  // 0x200000 Make sure to play after the queue time. This is default for primary segments
  3105.   {$EXTERNALSYM DMUS_SEGF_AFTERQUEUETIME}
  3106.   DMUS_SEGF_AFTERLATENCYTIME  = 1 shr 22;  // 0x400000 Make sure to play after the latency time. This is true for all segments, so this is a nop
  3107.   {$EXTERNALSYM DMUS_SEGF_AFTERLATENCYTIME}
  3108.   DMUS_SEGF_SEGMENTEND        = 1 shr 23;  // 0x800000 Play at the next end of segment.
  3109.   {$EXTERNALSYM DMUS_SEGF_SEGMENTEND}
  3110.   DMUS_SEGF_MARKER            = 1 shr 24;  // 0x1000000 Play at next marker in the primary segment. If there are no markers, default to any other resolution requests.
  3111.   {$EXTERNALSYM DMUS_SEGF_MARKER}
  3112.   DMUS_SEGF_TIMESIG_ALWAYS    = 1 shr 25;  // 0x2000000 Even if there is no primary segment, align start time with current time signature.
  3113.   {$EXTERNALSYM DMUS_SEGF_TIMESIG_ALWAYS}
  3114.   DMUS_SEGF_USE_AUDIOPATH     = 1 shr 26;  // 0x4000000 Uses the audio path that is embedded in the segment.
  3115.   {$EXTERNALSYM DMUS_SEGF_USE_AUDIOPATH}
  3116.   DMUS_SEGF_VALID_START_MEASURE = 1 shr 27; // 0x8000000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any bar.
  3117.   {$EXTERNALSYM DMUS_SEGF_VALID_START_MEASURE}
  3118.   DMUS_SEGF_INVALIDATE_PRI    = 1 shr 28;  // 0x10000000 invalidate only the current primary seg state
  3119.   {$EXTERNALSYM DMUS_SEGF_INVALIDATE_PRI}
  3120.  
  3121.   DMUS_SEG_REPEAT_INFINITE    = $FFFFFFFF;  // For IDirectMusicSegment::SetRepeat
  3122.   {$EXTERNALSYM DMUS_SEG_REPEAT_INFINITE}
  3123.   DMUS_SEG_ALLTRACKS          = $80000000;  // For IDirectMusicSegment::SetParam() and SetTrackConfig() - selects all tracks instead on nth index.
  3124.   {$EXTERNALSYM DMUS_SEG_ALLTRACKS}
  3125.   DMUS_SEG_ANYTRACK           = $80000000;  // For IDirectMusicSegment::GetParam() - checks each track until it finds one that returns data (not DMUS_E_NOT_FOUND.)
  3126.   {$EXTERNALSYM DMUS_SEG_ANYTRACK}
  3127.  
  3128.  
  3129. // DMUS_TIME_RESOLVE_FLAGS correspond to IDirectMusicPerformance::GetResolvedTime, and can
  3130. // also be used interchangeably with the corresponding DMUS_SEGF_FLAGS, since their values
  3131. // are intentionally the same
  3132. type
  3133.   enumDMUS_TIME_RESOLVE_FLAGS = DWORD;
  3134.   {$EXTERNALSYM enumDMUS_TIME_RESOLVE_FLAGS}
  3135.   DMUS_TIME_RESOLVE_FLAGS = enumDMUS_TIME_RESOLVE_FLAGS;
  3136.   {$EXTERNALSYM DMUS_TIME_RESOLVE_FLAGS}
  3137.   TDMusTimeResolveFlags = DMUS_TIME_RESOLVE_FLAGS;
  3138.   PDMusTimeResolveFlags = ^TDMusTimeResolveFlags;
  3139.  
  3140. const
  3141.   DMUS_TIME_RESOLVE_AFTERPREPARETIME  = DMUS_SEGF_AFTERPREPARETIME;
  3142.   {$EXTERNALSYM DMUS_TIME_RESOLVE_AFTERPREPARETIME}
  3143.   DMUS_TIME_RESOLVE_AFTERQUEUETIME    = DMUS_SEGF_AFTERQUEUETIME;
  3144.   {$EXTERNALSYM DMUS_TIME_RESOLVE_AFTERQUEUETIME}
  3145.   DMUS_TIME_RESOLVE_AFTERLATENCYTIME  = DMUS_SEGF_AFTERLATENCYTIME;
  3146.   {$EXTERNALSYM DMUS_TIME_RESOLVE_AFTERLATENCYTIME}
  3147.   DMUS_TIME_RESOLVE_GRID              = DMUS_SEGF_GRID;
  3148.   {$EXTERNALSYM DMUS_TIME_RESOLVE_GRID}
  3149.   DMUS_TIME_RESOLVE_BEAT              = DMUS_SEGF_BEAT;
  3150.   {$EXTERNALSYM DMUS_TIME_RESOLVE_BEAT}
  3151.   DMUS_TIME_RESOLVE_MEASURE           = DMUS_SEGF_MEASURE;
  3152.   {$EXTERNALSYM DMUS_TIME_RESOLVE_MEASURE}
  3153.   DMUS_TIME_RESOLVE_MARKER            = DMUS_SEGF_MARKER;
  3154.   {$EXTERNALSYM DMUS_TIME_RESOLVE_MARKER}
  3155.   DMUS_TIME_RESOLVE_SEGMENTEND        = DMUS_SEGF_SEGMENTEND;
  3156.   {$EXTERNALSYM DMUS_TIME_RESOLVE_SEGMENTEND}
  3157.  
  3158. type
  3159.   (* The following flags are sent inside the DMUS_CHORD_KEY.dwFlags parameter *)
  3160.   enumDMUS_CHORDKEYF_FLAGS = DWORD;
  3161.   {$EXTERNALSYM enumDMUS_CHORDKEYF_FLAGS}
  3162.   DMUS_CHORDKEYF_FLAGS = enumDMUS_CHORDKEYF_FLAGS;
  3163.   {$EXTERNALSYM DMUS_CHORDKEYF_FLAGS}
  3164.   TDMusChordkeyfFlags = DMUS_CHORDKEYF_FLAGS;
  3165.   PDMusChordkeyfFlags = ^TDMusChordkeyfFlags;
  3166.  
  3167. const
  3168.   DMUS_CHORDKEYF_SILENT            = 1;      // is the chord silent?
  3169.   {$EXTERNALSYM DMUS_CHORDKEYF_SILENT}
  3170.  
  3171.   DMUS_MAXSUBCHORD = 8;
  3172.   {$EXTERNALSYM DMUS_MAXSUBCHORD}
  3173.  
  3174. type
  3175.   PDMusSubChord = ^TDMusSubChord;
  3176.   _DMUS_SUBCHORD = packed record
  3177.     dwChordPattern: DWORD;     // Notes in the subchord
  3178.     dwScalePattern: DWORD;     // Notes in the scale
  3179.     dwInversionPoints: DWORD;  // Where inversions can occur
  3180.     dwLevels: DWORD;           // Which levels are supported by this subchord
  3181.     bChordRoot: Byte;          // Root of the subchord
  3182.     bScaleRoot: Byte;          // Root of the scale
  3183.   end;
  3184.   {$EXTERNALSYM _DMUS_SUBCHORD}
  3185.   DMUS_SUBCHORD = _DMUS_SUBCHORD;
  3186.   {$EXTERNALSYM DMUS_SUBCHORD}
  3187.   TDMusSubChord = _DMUS_SUBCHORD;
  3188.  
  3189.   PDMusChordKey = ^TDMusChordKey;
  3190.   _DMUS_CHORD_KEY = packed record
  3191.     wszName: array [0..15] of WideChar;   // Name of the chord
  3192.     wMeasure: Word;           // Measure this falls on
  3193.     bBeat: Byte;              // Beat this falls on
  3194.     bSubChordCount: Byte;     // Number of chords in the list of subchords
  3195.     SubChordList: array[0..DMUS_MAXSUBCHORD-1] of TDMUSSUBCHORD; // List of sub chords
  3196.     dwScale: DWORD;            // Scale underlying the entire chord
  3197.     bKey: Byte;               // Key underlying the entire chord
  3198.     bFlags: Byte;             // Miscelaneous flags
  3199.   end;
  3200.   {$EXTERNALSYM _DMUS_CHORD_KEY}
  3201.   DMUS_CHORD_KEY = _DMUS_CHORD_KEY;
  3202.   {$EXTERNALSYM DMUS_CHORD_KEY}
  3203.   TDMusChordKey = _DMUS_CHORD_KEY;
  3204.  
  3205.   enumDMUS_NOTEF_FLAGS = DWORD;
  3206.   {$EXTERNALSYM enumDMUS_NOTEF_FLAGS}
  3207.   DMUS_NOTEF_FLAGS = enumDMUS_NOTEF_FLAGS;
  3208.   {$EXTERNALSYM DMUS_NOTEF_FLAGS}
  3209.   TDMusNotefFlags = DMUS_NOTEF_FLAGS;
  3210.   PDMusNotefFlags = ^TDMusNotefFlags;
  3211.  
  3212. const
  3213.   DMUS_NOTEF_NOTEON = 1;              // Set if this is a MIDI Note On. Otherwise, it is MIDI Note Off
  3214.   {$EXTERNALSYM DMUS_NOTEF_NOTEON}
  3215.   // DX8 flags: 
  3216.   DMUS_NOTEF_NOINVALIDATE = 2;        // Don't invalidate this note off.
  3217.   {$EXTERNALSYM DMUS_NOTEF_NOINVALIDATE}
  3218.   DMUS_NOTEF_NOINVALIDATE_INSCALE = 4;// Don't invalidate if still within the scale.
  3219.   {$EXTERNALSYM DMUS_NOTEF_NOINVALIDATE_INSCALE}
  3220.   DMUS_NOTEF_NOINVALIDATE_INCHORD = 8;// Don't invalidate if still within the chord.
  3221.   {$EXTERNALSYM DMUS_NOTEF_NOINVALIDATE_INCHORD}
  3222.   DMUS_NOTEF_REGENERATE = #10;        // Regenerate the note on an invalidate.
  3223.   {$EXTERNALSYM DMUS_NOTEF_REGENERATE}
  3224.  
  3225. type
  3226. (* The DMUS_PLAYMODE_FLAGS are used to determine how to convert wMusicValue
  3227.    into the appropriate bMidiValue.
  3228. *)
  3229.   enumDMUS_PLAYMODE_FLAGS = Byte;
  3230.   DMUS_PLAYMODE_FLAGS = enumDMUS_PLAYMODE_FLAGS;
  3231.  
  3232. const
  3233.   DMUS_PLAYMODE_KEY_ROOT          = 1;  // Transpose on top of the key root.
  3234.   {$EXTERNALSYM DMUS_PLAYMODE_KEY_ROOT}
  3235.   DMUS_PLAYMODE_CHORD_ROOT        = 2;  // Transpose on top of the chord root.
  3236.   {$EXTERNALSYM DMUS_PLAYMODE_CHORD_ROOT}
  3237.   DMUS_PLAYMODE_SCALE_INTERVALS   = 4;  // Use scale intervals from scale pattern.
  3238.   {$EXTERNALSYM DMUS_PLAYMODE_SCALE_INTERVALS}
  3239.   DMUS_PLAYMODE_CHORD_INTERVALS   = 8;  // Use chord intervals from chord pattern.
  3240.   {$EXTERNALSYM DMUS_PLAYMODE_CHORD_INTERVALS}
  3241.   DMUS_PLAYMODE_NONE              = 16; // No mode. Indicates the parent part's mode should be used.
  3242.   {$EXTERNALSYM DMUS_PLAYMODE_NONE}
  3243.  
  3244. (* The following are playback modes that can be created by combining the DMUS_PLAYMODE_FLAGS
  3245.    in various ways:
  3246. *)
  3247.  
  3248. (* Fixed. wMusicValue holds final MIDI note value. This is used for drums, sound effects, and sequenced
  3249.    notes that should not be transposed by the chord or scale.
  3250. *)
  3251.   DMUS_PLAYMODE_FIXED             = 0;
  3252.   {$EXTERNALSYM DMUS_PLAYMODE_FIXED}
  3253. (* In fixed to key, the musicvalue is again a fixed MIDI value, but it
  3254.    is transposed on top of the key root.
  3255. *)
  3256.   DMUS_PLAYMODE_FIXEDTOKEY        = DMUS_PLAYMODE_KEY_ROOT;
  3257.   {$EXTERNALSYM DMUS_PLAYMODE_FIXEDTOKEY}
  3258. (* In fixed to chord, the musicvalue is also a fixed MIDI value, but it
  3259.    is transposed on top of the chord root.
  3260. *)
  3261.   DMUS_PLAYMODE_FIXEDTOCHORD      = DMUS_PLAYMODE_CHORD_ROOT;
  3262.   {$EXTERNALSYM DMUS_PLAYMODE_FIXEDTOCHORD}
  3263. (* In Pedalpoint, the key root is used and the notes only track the intervals in
  3264.    the scale. The chord root and intervals are completely ignored. This is useful
  3265.    for melodic lines that play relative to the key root.
  3266. *)
  3267.   DMUS_PLAYMODE_PEDALPOINT        = (DMUS_PLAYMODE_KEY_ROOT or DMUS_PLAYMODE_SCALE_INTERVALS);
  3268.   {$EXTERNALSYM DMUS_PLAYMODE_PEDALPOINT}
  3269. (* In the Melodic mode, the chord root is used but the notes only track the intervals in
  3270.    the scale. The key root and chord intervals are completely ignored. This is useful
  3271.    for melodic lines that play relative to the chord root.
  3272. *)
  3273.   DMUS_PLAYMODE_MELODIC           = (DMUS_PLAYMODE_CHORD_ROOT or DMUS_PLAYMODE_SCALE_INTERVALS);
  3274.   {$EXTERNALSYM DMUS_PLAYMODE_MELODIC}
  3275. (* Normal chord mode is the prevalent playback mode.
  3276.    The notes track the intervals in the chord, which is based on the chord root.
  3277.    If there is a scale component to the MusicValue, the additional intervals
  3278.    are pulled from the scale and added.
  3279.    If the chord does not have an interval to match the chord component of
  3280.    the MusicValue, the note is silent.
  3281. *)
  3282.   DMUS_PLAYMODE_NORMALCHORD       = (DMUS_PLAYMODE_CHORD_ROOT or DMUS_PLAYMODE_CHORD_INTERVALS);
  3283.   {$EXTERNALSYM DMUS_PLAYMODE_NORMALCHORD}
  3284. (* If it is desirable to play a note that is above the top of the chord, the
  3285.    always play mode (known as "purpleized" in a former life) finds a position
  3286.    for the note by using intervals from the scale. Essentially, this mode is
  3287.    a combination of the Normal and Melodic playback modes, where a failure
  3288.    in Normal causes a second try in Melodic mode.
  3289. *)
  3290.   DMUS_PLAYMODE_ALWAYSPLAY        = (DMUS_PLAYMODE_MELODIC or DMUS_PLAYMODE_NORMALCHORD);
  3291.   {$EXTERNALSYM DMUS_PLAYMODE_ALWAYSPLAY}
  3292.  
  3293. (* These playmodes are new for dx8. *)
  3294. (* In PedalpointChord, the key root is used and the notes only track the intervals in
  3295.    the chord. The chord root and scale intervals are completely ignored. This is useful
  3296.    for chordal lines that play relative to the key root.
  3297. *)
  3298.   DMUS_PLAYMODE_PEDALPOINTCHORD   = (DMUS_PLAYMODE_KEY_ROOT or DMUS_PLAYMODE_CHORD_INTERVALS);
  3299.   {$EXTERNALSYM DMUS_PLAYMODE_PEDALPOINTCHORD}
  3300.  
  3301. (* For completeness, here's a mode that tries for pedalpointchord, but if it fails
  3302.    uses scale intervals
  3303. *)
  3304.   DMUS_PLAYMODE_PEDALPOINTALWAYS  = (DMUS_PLAYMODE_PEDALPOINT or DMUS_PLAYMODE_PEDALPOINTCHORD);
  3305.   {$EXTERNALSYM DMUS_PLAYMODE_PEDALPOINTALWAYS}
  3306.  
  3307.  
  3308.   (*  Legacy names for modes... *)
  3309.   DMUS_PLAYMODE_PURPLEIZED        = DMUS_PLAYMODE_ALWAYSPLAY;
  3310.   {$EXTERNALSYM DMUS_PLAYMODE_PURPLEIZED}
  3311.   DMUS_PLAYMODE_SCALE_ROOT        = DMUS_PLAYMODE_KEY_ROOT;
  3312.   {$EXTERNALSYM DMUS_PLAYMODE_SCALE_ROOT}
  3313.   DMUS_PLAYMODE_FIXEDTOSCALE      = DMUS_PLAYMODE_FIXEDTOKEY;
  3314.   {$EXTERNALSYM DMUS_PLAYMODE_FIXEDTOSCALE}
  3315.  
  3316. const
  3317.   DMUS_TEMPO_MAX          = 1000;
  3318.   {$EXTERNALSYM DMUS_TEMPO_MAX}
  3319.   DMUS_TEMPO_MIN          = 1;
  3320.   {$EXTERNALSYM DMUS_TEMPO_MIN}
  3321.  
  3322.   DMUS_MASTERTEMPO_MAX    = 100.0;
  3323.   {$EXTERNALSYM DMUS_MASTERTEMPO_MAX}
  3324.   DMUS_MASTERTEMPO_MIN    = 0.01;
  3325.   {$EXTERNALSYM DMUS_MASTERTEMPO_MIN}
  3326.  
  3327. const
  3328.   DMUS_CURVE_RESET = 1;              (* When set, the nResetValue must be sent when the
  3329.                                         time is reached or an invalidate occurs because
  3330.                                         of a transition. If not set, the curve stays
  3331.                                         permanently stuck at the new value. *)
  3332.   {$EXTERNALSYM DMUS_CURVE_RESET}
  3333.   DMUS_CURVE_START_FROM_CURRENT = 2; (* Ignore Start, start the curve at the current value.
  3334.                                         This only works for volume, expression, and pitchbend. *)
  3335.   {$EXTERNALSYM DMUS_CURVE_START_FROM_CURRENT}
  3336.  
  3337.  
  3338.   (* Curve shapes *)
  3339.   DMUS_CURVES_LINEAR  = 0;
  3340.   {$EXTERNALSYM DMUS_CURVES_LINEAR}
  3341.   DMUS_CURVES_INSTANT = 1;
  3342.   {$EXTERNALSYM DMUS_CURVES_INSTANT}
  3343.   DMUS_CURVES_EXP     = 2;
  3344.   {$EXTERNALSYM DMUS_CURVES_EXP}
  3345.   DMUS_CURVES_LOG     = 3;
  3346.   {$EXTERNALSYM DMUS_CURVES_LOG}
  3347.   DMUS_CURVES_SINE    = 4;
  3348.   {$EXTERNALSYM DMUS_CURVES_SINE}
  3349.  
  3350.   (* curve types *)
  3351.   DMUS_CURVET_PBCURVE      = $03;   // Pitch bend curve.
  3352.   {$EXTERNALSYM DMUS_CURVET_PBCURVE}
  3353.   DMUS_CURVET_CCCURVE      = $04;   // Control change curve.
  3354.   {$EXTERNALSYM DMUS_CURVET_CCCURVE}
  3355.   DMUS_CURVET_MATCURVE     = $05;   // Mono aftertouch curve.
  3356.   {$EXTERNALSYM DMUS_CURVET_MATCURVE}
  3357.   DMUS_CURVET_PATCURVE     = $06;   // Poly aftertouch curve.
  3358.   {$EXTERNALSYM DMUS_CURVET_PATCURVE}
  3359.   DMUS_CURVET_RPNCURVE     = $07;   // RPN curve with curve type in wParamType.
  3360.   {$EXTERNALSYM DMUS_CURVET_RPNCURVE}
  3361.   DMUS_CURVET_NRPNCURVE    = $08;   // NRPN curve with curve type in wParamType.
  3362.   {$EXTERNALSYM DMUS_CURVET_NRPNCURVE}
  3363.  
  3364. const
  3365. (* notification type values *)
  3366.   (* The following correspond to GUID_NOTIFICATION_SEGMENT *)
  3367.   DMUS_NOTIFICATION_SEGSTART       = 0;
  3368.   {$EXTERNALSYM DMUS_NOTIFICATION_SEGSTART}
  3369.   DMUS_NOTIFICATION_SEGEND         = 1;
  3370.   {$EXTERNALSYM DMUS_NOTIFICATION_SEGEND}
  3371.   DMUS_NOTIFICATION_SEGALMOSTEND   = 2;
  3372.   {$EXTERNALSYM DMUS_NOTIFICATION_SEGALMOSTEND}
  3373.   DMUS_NOTIFICATION_SEGLOOP        = 3;
  3374.   {$EXTERNALSYM DMUS_NOTIFICATION_SEGLOOP}
  3375.   DMUS_NOTIFICATION_SEGABORT       = 4;
  3376.   {$EXTERNALSYM DMUS_NOTIFICATION_SEGABORT}
  3377.   (* The following correspond to GUID_NOTIFICATION_PERFORMANCE *)
  3378.   DMUS_NOTIFICATION_MUSICSTARTED   = 0;
  3379.   {$EXTERNALSYM DMUS_NOTIFICATION_MUSICSTARTED}
  3380.   DMUS_NOTIFICATION_MUSICSTOPPED   = 1;
  3381.   {$EXTERNALSYM DMUS_NOTIFICATION_MUSICSTOPPED}
  3382.   DMUS_NOTIFICATION_MUSICALMOSTEND = 2;
  3383.   {$EXTERNALSYM DMUS_NOTIFICATION_MUSICALMOSTEND}
  3384.   (* The following corresponds to GUID_NOTIFICATION_MEASUREANDBEAT *)
  3385.   DMUS_NOTIFICATION_MEASUREBEAT    = 0;
  3386.   {$EXTERNALSYM DMUS_NOTIFICATION_MEASUREBEAT}
  3387.   (* The following corresponds to GUID_NOTIFICATION_CHORD *)
  3388.   DMUS_NOTIFICATION_CHORD          = 0;
  3389.   {$EXTERNALSYM DMUS_NOTIFICATION_CHORD}
  3390.   (* The following correspond to GUID_NOTIFICATION_COMMAND *)
  3391.   DMUS_NOTIFICATION_GROOVE         = 0;
  3392.   {$EXTERNALSYM DMUS_NOTIFICATION_GROOVE}
  3393.   DMUS_NOTIFICATION_EMBELLISHMENT  = 1;
  3394.   {$EXTERNALSYM DMUS_NOTIFICATION_EMBELLISHMENT}
  3395.   (* The following corresponds to GUID_NOTIFICATION_RECOMPOSE *)
  3396.   DMUS_NOTIFICATION_RECOMPOSE          = 0;
  3397.   {$EXTERNALSYM DMUS_NOTIFICATION_RECOMPOSE}
  3398.  
  3399. const
  3400.   DMUS_WAVEF_OFF           = 1;       // If wave is playing and this is the off message.
  3401.   {$EXTERNALSYM DMUS_WAVEF_OFF}
  3402.   DMUS_WAVEF_STREAMING     = 2;       // If wave is streaming.
  3403.   {$EXTERNALSYM DMUS_WAVEF_STREAMING}
  3404.   DMUS_WAVEF_NOINVALIDATE  = 4;       // Don't invalidate this wave.
  3405.   {$EXTERNALSYM DMUS_WAVEF_NOINVALIDATE}
  3406.   DMUS_WAVEF_NOPREROLL     = 8;       // Don't preroll any wave data.
  3407.   {$EXTERNALSYM DMUS_WAVEF_NOPREROLL}
  3408.   DMUS_WAVEF_IGNORELOOPS   = $20;     // Ignore segment looping.
  3409.   {$EXTERNALSYM DMUS_WAVEF_IGNORELOOPS}
  3410.  
  3411. const
  3412.   DMUS_MAX_NAME           = 64;         (* Maximum object name length. *)
  3413.   {$EXTERNALSYM DMUS_MAX_NAME}
  3414.   DMUS_MAX_CATEGORY       = 64;         (* Maximum object category name length. *)
  3415.   {$EXTERNALSYM DMUS_MAX_CATEGORY}
  3416.   DMUS_MAX_FILENAME       = MAX_PATH;
  3417.   {$EXTERNALSYM DMUS_MAX_FILENAME}
  3418.  
  3419. type
  3420.   PDMusVersion = ^TDMusVersion;
  3421.   _DMUS_VERSION = packed record
  3422.     dwVersionMS: DWORD;
  3423.     dwVersionLS: DWORD;
  3424.   end;
  3425.   {$EXTERNALSYM _DMUS_VERSION}
  3426.   DMUS_VERSION = _DMUS_VERSION;
  3427.   {$EXTERNALSYM DMUS_VERSION}
  3428.   TDMusVersion = _DMUS_VERSION;
  3429.  
  3430.   // Time Signature structure, used by IDirectMusicStyle
  3431.   // Also used as a parameter for GetParam() and SetParam
  3432.   PDMusTimeSignature = ^TDMusTimeSignature;
  3433.   _DMUS_TIMESIGNATURE = packed record
  3434.     mtTime: TMusicTime;
  3435.     bBeatsPerMeasure: Byte;       (* beats per measure (top of time sig) *)
  3436.     bBeat: Byte;                  (* what note receives the beat (bottom of time sig.) *)
  3437.                                   (* we can assume that 0 means 256th note *)
  3438.     wGridsPerBeat: Word;          (* grids per beat *)
  3439.   end;
  3440.   {$EXTERNALSYM _DMUS_TIMESIGNATURE}
  3441.   DMUS_TIMESIGNATURE = _DMUS_TIMESIGNATURE;
  3442.   {$EXTERNALSYM DMUS_TIMESIGNATURE}
  3443.   TDMusTimeSignature = _DMUS_TIMESIGNATURE;
  3444.  
  3445.   PDMusValidStartParam = ^TDMusValidStartParam;
  3446.   _DMUS_VALID_START_PARAM = packed record
  3447.     mtTime: TMUSICTIME;                     (* Time of the first legal start
  3448.                                                point after (or including) the requested time.
  3449.                                                This is a returned value.
  3450.                                                Time format is the relative offset from requested time. *)
  3451.   end;
  3452.   {$EXTERNALSYM _DMUS_VALID_START_PARAM}
  3453.   DMUS_VALID_START_PARAM = _DMUS_VALID_START_PARAM;
  3454.   {$EXTERNALSYM DMUS_VALID_START_PARAM}
  3455.   TDMusValidStartParam = _DMUS_VALID_START_PARAM;
  3456.  
  3457.   PDMusPlayMarkerParam = ^TDMusPlayMarkerParam;
  3458.   _DMUS_PLAY_MARKER_PARAM = packed record
  3459.     mtTime: TMusicTime;                     (* Time of the first legal segment play
  3460.                                                marker before (or including) the requested time.
  3461.                                                This is a returned value.
  3462.                                                Time format is the relative offset from requested time. *)
  3463.   end;
  3464.   {$EXTERNALSYM _DMUS_PLAY_MARKER_PARAM}
  3465.   DMUS_PLAY_MARKER_PARAM = _DMUS_PLAY_MARKER_PARAM;
  3466.   {$EXTERNALSYM DMUS_PLAY_MARKER_PARAM}
  3467.   TDMusPlayMarkerParam = _DMUS_PLAY_MARKER_PARAM;
  3468.  
  3469. //      The DMUSOBJECTDESC structure is used to communicate everything you could
  3470. //      possibly use to describe a DirectMusic object.
  3471.  
  3472.   PDMusObjectDesc = ^TDMusObjectDesc;
  3473.   _DMUS_OBJECTDESC = packed record
  3474.     dwSize: DWORD;                 (* Size of this structure. *)
  3475.     dwValidData: DWORD;            (* Flags indicating which fields below are valid. *)
  3476.     guidObject: TGUID;             (* Unique ID for this object. *)
  3477.     guidClass: TGUID;              (* GUID for the class of object. *)
  3478.     ftDate: TFileTime;             (* Last edited date of object. *)
  3479.     vVersion: TDMusVersion;        (* Version. *)
  3480.     wszName: array[0..DMUS_MAX_NAME-1] of WideChar; (* Name of object. *)
  3481.     wszCategory: array[0..DMUS_MAX_CATEGORY-1] of WideChar; (* Category for object (optional). *)
  3482.     wszFileName: array[0..DMUS_MAX_FILENAME-1] of WideChar; (* File path. *)
  3483.     llMemLength: LONGLONG;         (* Size of Memory data. *)
  3484.     pbMemData: PByte;              (* Memory pointer for data. *)
  3485.     pStream: IStream;              (* Stream with data. *)
  3486.   end;
  3487.   {$EXTERNALSYM _DMUS_OBJECTDESC}
  3488.   DMUS_OBJECTDESC = _DMUS_OBJECTDESC;
  3489.   {$EXTERNALSYM DMUS_OBJECTDESC}
  3490.   TDMusObjectDesc = _DMUS_OBJECTDESC;
  3491.  
  3492. //      Flags for dwValidData. When set, a flag indicates that the
  3493. //      corresponding field in DMUSOBJECTDESC holds valid data.
  3494.  
  3495. const
  3496.   DMUS_OBJ_OBJECT         = (1 shl 0);     (* Object GUID is valid. *)
  3497.   {$EXTERNALSYM DMUS_OBJ_OBJECT}
  3498.   DMUS_OBJ_CLASS          = (1 shl 1);     (* Class GUID is valid. *)
  3499.   {$EXTERNALSYM DMUS_OBJ_CLASS}
  3500.   DMUS_OBJ_NAME           = (1 shl 2);     (* Name is valid. *)
  3501.   {$EXTERNALSYM DMUS_OBJ_NAME}
  3502.   DMUS_OBJ_CATEGORY       = (1 shl 3);     (* Category is valid. *)
  3503.   {$EXTERNALSYM DMUS_OBJ_CATEGORY}
  3504.   DMUS_OBJ_FILENAME       = (1 shl 4);     (* File path is valid. *)
  3505.   {$EXTERNALSYM DMUS_OBJ_FILENAME}
  3506.   DMUS_OBJ_FULLPATH       = (1 shl 5);     (* Path is full path. *)
  3507.   {$EXTERNALSYM DMUS_OBJ_FULLPATH}
  3508.   DMUS_OBJ_URL            = (1 shl 6);     (* Path is URL. *)
  3509.   {$EXTERNALSYM DMUS_OBJ_URL}
  3510.   DMUS_OBJ_VERSION        = (1 shl 7);     (* Version is valid. *)
  3511.   {$EXTERNALSYM DMUS_OBJ_VERSION}
  3512.   DMUS_OBJ_DATE           = (1 shl 8);     (* Date is valid. *)
  3513.   {$EXTERNALSYM DMUS_OBJ_DATE}
  3514.   DMUS_OBJ_LOADED         = (1 shl 9);     (* Object is currently loaded in memory. *)
  3515.   {$EXTERNALSYM DMUS_OBJ_LOADED}
  3516.   DMUS_OBJ_MEMORY         = (1 shl 10);    (* Object is pointed to by pbMemData. *)
  3517.   {$EXTERNALSYM DMUS_OBJ_MEMORY}
  3518.   DMUS_OBJ_STREAM         = (1 shl 11);    (* Object is stored in pStream. *)
  3519.   {$EXTERNALSYM DMUS_OBJ_STREAM}
  3520.  
  3521. type
  3522. (*      The DMUS_SCRIPT_ERRORINFO structure describes an error that occurred in a script.
  3523.         It is returned by methods in IDirectMusicScript. *)
  3524.   PDMusScriptErrorInfo = ^TDMusScriptErrorInfo;
  3525.   _DMUS_SCRIPT_ERRORINFO = packed record
  3526.     dwSize: DWORD; (* Size of this structure. *)
  3527.     hr: HRESULT;
  3528.     ulLineNumber: Cardinal;
  3529.     ichCharPosition: Longint;
  3530.     wszSourceFile: array[0..DMUS_MAX_FILENAME-1] of WideChar;
  3531.     wszSourceComponent: array[0..DMUS_MAX_FILENAME-1] of WideChar;
  3532.     wszDescription: array[0..DMUS_MAX_FILENAME-1] of WideChar;
  3533.     wszSourceLineText: array[0..DMUS_MAX_FILENAME-1] of WideChar;
  3534.   end;
  3535.   {$EXTERNALSYM _DMUS_SCRIPT_ERRORINFO}
  3536.   DMUS_SCRIPT_ERRORINFO = _DMUS_SCRIPT_ERRORINFO;
  3537.   {$EXTERNALSYM DMUS_SCRIPT_ERRORINFO}
  3538.   TDMusScriptErrorInfo = _DMUS_SCRIPT_ERRORINFO;
  3539.  
  3540. (*  Track configuration flags, used with IDirectMusicSegment8::SetTrackConfig() *)
  3541.  
  3542. const
  3543.   DMUS_TRACKCONFIG_OVERRIDE_ALL           = 1;      (* This track should get parameters from this segment before controlling and primary tracks. *)
  3544.   {$EXTERNALSYM DMUS_TRACKCONFIG_OVERRIDE_ALL}
  3545.   DMUS_TRACKCONFIG_OVERRIDE_PRIMARY       = 2;      (* This track should get parameters from this segment before the primary segment tracks. *)
  3546.   {$EXTERNALSYM DMUS_TRACKCONFIG_OVERRIDE_PRIMARY}
  3547.   DMUS_TRACKCONFIG_FALLBACK               = 4;        (* This track should get parameters from this segment if the primary and controlling segments don't succeed. *)
  3548.   {$EXTERNALSYM DMUS_TRACKCONFIG_FALLBACK}
  3549.   DMUS_TRACKCONFIG_CONTROL_ENABLED        = 8;     (* GetParam() enabled for this track. *)
  3550.   {$EXTERNALSYM DMUS_TRACKCONFIG_CONTROL_ENABLED}
  3551.   DMUS_TRACKCONFIG_PLAY_ENABLED           = $10;  (* Play() enabled for this track. *)
  3552.   {$EXTERNALSYM DMUS_TRACKCONFIG_PLAY_ENABLED}
  3553.   DMUS_TRACKCONFIG_NOTIFICATION_ENABLED   = $20;  (* Notifications enabled for this track. *)
  3554.   {$EXTERNALSYM DMUS_TRACKCONFIG_NOTIFICATION_ENABLED}
  3555.   DMUS_TRACKCONFIG_PLAY_CLOCKTIME         = $40;  (* This track plays in clock time, not music time. *)
  3556.   {$EXTERNALSYM DMUS_TRACKCONFIG_PLAY_CLOCKTIME}
  3557.   DMUS_TRACKCONFIG_PLAY_COMPOSE             = $80;  (* This track should regenerate data each time it starts playing. *)
  3558.   {$EXTERNALSYM DMUS_TRACKCONFIG_PLAY_COMPOSE}
  3559.   DMUS_TRACKCONFIG_LOOP_COMPOSE           = $100; (* This track should regenerate data each time it repeats. *)
  3560.   {$EXTERNALSYM DMUS_TRACKCONFIG_LOOP_COMPOSE}
  3561.   DMUS_TRACKCONFIG_COMPOSING              = $200; (* This track is used to compose other tracks. *)
  3562.   {$EXTERNALSYM DMUS_TRACKCONFIG_COMPOSING}
  3563.   DMUS_TRACKCONFIG_CONTROL_PLAY           = $10000; (* This track, when played in a controlling segment, overrides playback of primary segment tracks. *)
  3564.   {$EXTERNALSYM DMUS_TRACKCONFIG_CONTROL_PLAY}
  3565.   DMUS_TRACKCONFIG_CONTROL_NOTIFICATION   = $20000; (* This track, when played in a controlling segment, overrides notification of primary segment tracks. *)
  3566.   {$EXTERNALSYM DMUS_TRACKCONFIG_CONTROL_NOTIFICATION}
  3567. (* Additional track config flags for composing transitions *)
  3568.   DMUS_TRACKCONFIG_TRANS1_FROMSEGSTART    = $400;  (* Get track info from start of From segment *)
  3569.   {$EXTERNALSYM DMUS_TRACKCONFIG_TRANS1_FROMSEGSTART}
  3570.   DMUS_TRACKCONFIG_TRANS1_FROMSEGCURRENT  = $800;  (* Get track info from current place in From segment *)
  3571.   {$EXTERNALSYM DMUS_TRACKCONFIG_TRANS1_FROMSEGCURRENT}
  3572.   DMUS_TRACKCONFIG_TRANS1_TOSEGSTART      = $1000; (* Get track info from start of To segment *)
  3573.   {$EXTERNALSYM DMUS_TRACKCONFIG_TRANS1_TOSEGSTART}
  3574.   DMUS_TRACKCONFIG_DEFAULT    = (DMUS_TRACKCONFIG_CONTROL_ENABLED or DMUS_TRACKCONFIG_PLAY_ENABLED or DMUS_TRACKCONFIG_NOTIFICATION_ENABLED);
  3575.   {$EXTERNALSYM DMUS_TRACKCONFIG_DEFAULT}
  3576.  
  3577. type
  3578.   // Get/SetParam structs for commands
  3579.   // PARAM structures, used by GetParam() and SetParam()
  3580.   PDMusCommandParam = ^TDMusCommandParam;
  3581.   _DMUS_COMMAND_PARAM = packed record
  3582.     bCommand: Byte;
  3583.     bGrooveLevel: Byte;
  3584.     bGrooveRange: Byte;
  3585.     bRepeatMode: Byte;
  3586.   end;
  3587.   {$EXTERNALSYM _DMUS_COMMAND_PARAM}
  3588.   DMUS_COMMAND_PARAM = _DMUS_COMMAND_PARAM;
  3589.   {$EXTERNALSYM DMUS_COMMAND_PARAM}
  3590.   TDMusCommandParam = _DMUS_COMMAND_PARAM;
  3591.  
  3592.   PDMusCommandParam2 = ^TDMusCommandParam2;
  3593.   _DMUS_COMMAND_PARAM_2 = packed record
  3594.     mtTime: TMusicTime;
  3595.     bCommand: Byte;
  3596.     bGrooveLevel: Byte;
  3597.     bGrooveRange: Byte;
  3598.     bRepeatMode: Byte;
  3599.   end;
  3600.   {$EXTERNALSYM _DMUS_COMMAND_PARAM_2}
  3601.   DMUS_COMMAND_PARAM_2 = _DMUS_COMMAND_PARAM_2;
  3602.   {$EXTERNALSYM DMUS_COMMAND_PARAM_2}
  3603.   TDMusCommandParam2 = _DMUS_COMMAND_PARAM_2;
  3604.  
  3605. const
  3606.   DMUSB_LOADED    = (1 shl 0);        (* Set when band has been loaded *)
  3607.   {$EXTERNALSYM DMUSB_LOADED}
  3608.   DMUSB_DEFAULT   = (1 shl 1);        (* Set when band is default band for a style *)
  3609.   {$EXTERNALSYM DMUSB_DEFAULT}
  3610.  
  3611.   
  3612. type
  3613.   IDirectMusicTrack = interface;
  3614.   IDirectMusicSegment = interface;
  3615.   IDirectMusicSegmentState = interface;
  3616.   IDirectMusicGraph = interface;
  3617.   IDirectMusicPerformance = interface;
  3618.   IDirectMusicTool = interface;
  3619.   IDirectMusicChordMap = interface;
  3620.  
  3621.   PIDirectMusicSegmentState = ^IDirectMusicSegmentState;
  3622.  
  3623.  
  3624. // Translator: Structure declarations below (until interface declaration) were
  3625. // moved here from above of header due to refereces to IDirectMusicTool and
  3626. // IDirectMusicGraph interfaces
  3627.  
  3628. {
  3629. //Translator: this '#define' will be used later is several places
  3630. //#define DMUS_PMSG_PART
  3631.     dwSize: DWORD;
  3632.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  3633.     mtTime: TMusicTime;        (* music time *)
  3634.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  3635.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  3636.                                (* use this to determine the port/channel. *)
  3637.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  3638.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  3639.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *)
  3640.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  3641.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  3642.                                (* identify a specific event. For DirectX 6.0, *)
  3643.                                (* this field should always be 0. *)
  3644.     dwGroupID: DWORD;          (* Track group id *)
  3645.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  3646. }
  3647.  
  3648. (* every DMUS_PMSG is based off of this structure. The Performance needs
  3649.    to access these members consistently in every PMSG that goes through it. *)
  3650.   PDMusPMsg = ^TDMusPMsg;
  3651.   _DMUS_PMSG = packed record
  3652.     (* begin DMUS_PMSG_PART *)
  3653.     dwSize: DWORD;
  3654.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  3655.     mtTime: TMusicTime;        (* music time *)
  3656.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  3657.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  3658.                                (* use this to determine the port/channel. *)
  3659.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  3660.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  3661.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *)
  3662.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  3663.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  3664.                                (* identify a specific event. For DirectX 6.0, *)
  3665.                                (* this field should always be 0. *)
  3666.     dwGroupID: DWORD;          (* Track group id *)
  3667.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  3668.     (* end DMUS_PMSG_PART *)
  3669.   end;
  3670.   {$EXTERNALSYM _DMUS_PMSG}
  3671.   DMUS_PMSG = _DMUS_PMSG;
  3672.   {$EXTERNALSYM DMUS_PMSG}
  3673.   TDMusPMsg = _DMUS_PMSG;
  3674.  
  3675.   (* DMUS_NOTE_PMSG *)
  3676.   PDMusNotePMsg = ^TDMusNotePMsg;
  3677.   _DMUS_NOTE_PMSG = packed record
  3678.     (* begin DMUS_PMSG_PART *)
  3679.     dwSize: DWORD;
  3680.     rtTime: TReferenceTime;    // real time (in 100 nanosecond increments)
  3681.     mtTime: TMusicTime;        // music time
  3682.     dwFlags: DWORD;            // various bits (see DMUS_PMSGF_FLAGS enumeration)
  3683.     dwPChannel: DWORD;         // Performance Channel. The Performance can
  3684.                                // use this to determine the port/channel.
  3685.     dwVirtualTrackID: DWORD;   // virtual track ID
  3686.     pTool: IDirectMusicTool;   // tool interface pointer
  3687.     pGraph: IDirectMusicGraph; // tool graph interface pointer
  3688.     dwType: DWORD;             // PMSG type (see DMUS_PMSGT_TYPES defines)
  3689.     dwVoiceID: DWORD;          // unique voice id which allows synthesizers to
  3690.                                // identify a specific event. For DirectX 6.0,
  3691.                                // this field should always be 0.
  3692.     dwGroupID: DWORD;          // Track group id
  3693.     punkUser: IUnknown;        // user com pointer, auto released upon PMSG free
  3694.     (* end DMUS_PMSG_PART *)
  3695.  
  3696.     mtDuration: TMusicTime;     // duration
  3697.     wMusicValue: Word;          // Description of note in chord and key.
  3698.     wMeasure: Word;             // Measure in which this note occurs
  3699.     nOffset: Smallint;              // Offset from grid at which this note occurs
  3700.     bBeat: Byte;                // Beat (in measure) at which this note occurs
  3701.     bGrid: Byte;                // Grid offset from beat at which this note occurs
  3702.     bVelocity: Byte;            // Note velocity
  3703.     bFlags: Byte;               // see DMUS_NOTEF_FLAGS
  3704.     bTimeRange: Byte;           // Range to randomize time.
  3705.     bDurRange: Byte;            // Range to randomize duration.
  3706.     bVelRange: Byte;            // Range to randomize velocity.
  3707.     bPlayModeFlags: Byte;       // Play mode
  3708.     bSubChordLevel: Byte;       // Which subchord level this note uses.
  3709.     bMidiValue: Byte;           // The MIDI note value, converted from wMusicValue
  3710.     cTranspose: Char;           // Transposition to add to midi note value after converted from wMusicValue.
  3711.   end;
  3712.   {$EXTERNALSYM _DMUS_NOTE_PMSG}
  3713.   DMUS_NOTE_PMSG = _DMUS_NOTE_PMSG;
  3714.   {$EXTERNALSYM DMUS_NOTE_PMSG}
  3715.   TDMusNotePMsg = _DMUS_NOTE_PMSG;
  3716.  
  3717.   (* DMUS_MIDI_PMSG *)
  3718.   PDMusMidiPMsg = ^TDMusMidiPMsg;
  3719.   _DMUS_MIDI_PMSG = packed record
  3720.     (* begin DMUS_PMSG_PART *)
  3721.     dwSize: DWORD;
  3722.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  3723.     mtTime: TMusicTime;        (* music time *)
  3724.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  3725.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  3726.                                (* use this to determine the port/channel. *)
  3727.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  3728.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  3729.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *)
  3730.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  3731.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  3732.                                (* identify a specific event. For DirectX 6.0, *)
  3733.                                (* this field should always be 0. *)
  3734.     dwGroupID: DWORD;          (* Track group id *)
  3735.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  3736.     (* end DMUS_PMSG_PART *)
  3737.  
  3738.     bStatus: Byte;
  3739.     bByte1: Byte;
  3740.     bByte2: Byte;
  3741.     bPad: array[0..0] of Byte;
  3742.   end;
  3743.   {$EXTERNALSYM _DMUS_MIDI_PMSG}
  3744.   DMUS_MIDI_PMSG = _DMUS_MIDI_PMSG;
  3745.   {$EXTERNALSYM DMUS_MIDI_PMSG}
  3746.   TDMusMidiPMsg = _DMUS_MIDI_PMSG;
  3747.  
  3748.   (* DMUS_PATCH_PMSG *)
  3749.   PDMusPatchPMsg = ^TDMusPatchPMsg;
  3750.   _DMUS_PATCH_PMSG = packed record
  3751.     (* begin DMUS_PMSG_PART *)
  3752.     dwSize: DWORD;
  3753.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  3754.     mtTime: TMusicTime;        (* music time *)
  3755.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  3756.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  3757.                                (* use this to determine the port/channel. *)
  3758.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  3759.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  3760.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *)
  3761.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  3762.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  3763.                                (* identify a specific event. For DirectX 6.0, *)
  3764.                                (* this field should always be 0. *)
  3765.     dwGroupID: DWORD;          (* Track group id *)
  3766.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  3767.     (* end DMUS_PMSG_PART *)
  3768.  
  3769.     byInstrument: Byte;
  3770.     byMSB: Byte;
  3771.     byLSB: Byte;
  3772.     byPad: array[0..0] of Byte;
  3773.   end;
  3774.   {$EXTERNALSYM _DMUS_PATCH_PMSG}
  3775.   DMUS_PATCH_PMSG = _DMUS_PATCH_PMSG;
  3776.   {$EXTERNALSYM DMUS_PATCH_PMSG}
  3777.   TDMusPatchPMsg = _DMUS_PATCH_PMSG;
  3778.  
  3779.   (* DMUS_TRANSPOSE_PMSG *)
  3780.   PDMusTransposePMsg = ^TDMusTransposePMsg;
  3781.   _DMUS_TRANSPOSE_PMSG = packed record
  3782.     (* begin DMUS_PMSG_PART *)
  3783.     dwSize: DWORD;
  3784.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  3785.     mtTime: TMusicTime;        (* music time *)
  3786.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  3787.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  3788.                                (* use this to determine the port/channel. *)
  3789.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  3790.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  3791.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *) 
  3792.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  3793.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  3794.                                (* identify a specific event. For DirectX 6.0, *)
  3795.                                (* this field should always be 0. *)
  3796.     dwGroupID: DWORD;          (* Track group id *)
  3797.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  3798.     (* end DMUS_PMSG_PART *)
  3799.  
  3800.     nTranspose: Smallint;
  3801.     (* Following exists only under DX8 and on (check dwFlags for DMUS_PMSGF_DX8) *)
  3802.     wMergeIndex: Word;     (* Allows multiple parameters to be merged (pitchbend, volume, and expression.)*)
  3803.   end;
  3804.   {$EXTERNALSYM _DMUS_TRANSPOSE_PMSG}
  3805.   DMUS_TRANSPOSE_PMSG = _DMUS_TRANSPOSE_PMSG;
  3806.   {$EXTERNALSYM DMUS_TRANSPOSE_PMSG}
  3807.   TDMusTransposePMsg = _DMUS_TRANSPOSE_PMSG;
  3808.  
  3809.   (* DMUS_CHANNEL_PRIORITY_PMSG *)
  3810.   PDMusChannelPriorityPMsg = ^TDMusChannelPriorityPMsg;
  3811.   _DMUS_CHANNEL_PRIORITY_PMSG = packed record
  3812.     (* begin DMUS_PMSG_PART *)
  3813.     dwSize: DWORD;
  3814.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  3815.     mtTime: TMusicTime;        (* music time *)
  3816.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  3817.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  3818.                                (* use this to determine the port/channel. *)
  3819.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  3820.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  3821.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *)
  3822.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  3823.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  3824.                                (* identify a specific event. For DirectX 6.0, *)
  3825.                                (* this field should always be 0. *)
  3826.     dwGroupID: DWORD;          (* Track group id *)
  3827.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  3828.     (* end DMUS_PMSG_PART *)
  3829.  
  3830.     dwChannelPriority:   DWORD;
  3831.   end;
  3832.   {$EXTERNALSYM _DMUS_CHANNEL_PRIORITY_PMSG}
  3833.   DMUS_CHANNEL_PRIORITY_PMSG = _DMUS_CHANNEL_PRIORITY_PMSG;
  3834.   {$EXTERNALSYM DMUS_CHANNEL_PRIORITY_PMSG}
  3835.   TDMusChannelPriorityPMsg = _DMUS_CHANNEL_PRIORITY_PMSG;
  3836.  
  3837.   (* DMUS_TEMPO_PMSG *)
  3838.   PDMusTempoPMsg = ^TDMusTempoPMsg;
  3839.   _DMUS_TEMPO_PMSG = packed record
  3840.     (* begin DMUS_PMSG_PART *)
  3841.     dwSize: DWORD;
  3842.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  3843.     mtTime: TMusicTime;        (* music time *)
  3844.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  3845.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  3846.                                (* use this to determine the port/channel. *)
  3847.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  3848.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  3849.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *)
  3850.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  3851.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  3852.                                (* identify a specific event. For DirectX 6.0, *)
  3853.                                (* this field should always be 0. *)
  3854.     dwGroupID: DWORD;          (* Track group id *)
  3855.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  3856.     (* end DMUS_PMSG_PART *)
  3857.  
  3858.     dblTempo: Double;                       (* the tempo *)
  3859.   end;
  3860.   {$EXTERNALSYM _DMUS_TEMPO_PMSG}
  3861.   DMUS_TEMPO_PMSG = _DMUS_TEMPO_PMSG;
  3862.   {$EXTERNALSYM DMUS_TEMPO_PMSG}
  3863.   TDMusTempoPMsg = _DMUS_TEMPO_PMSG;
  3864.  
  3865.   (* DMUS_SYSEX_PMSG *)
  3866.   PDMusSysexPMsg = ^TDMusSysexPMsg;
  3867.   _DMUS_SYSEX_PMSG = packed record
  3868.     (* begin DMUS_PMSG_PART *)
  3869.     dwSize: DWORD;
  3870.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  3871.     mtTime: TMusicTime;        (* music time *)
  3872.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  3873.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  3874.                                (* use this to determine the port/channel. *)
  3875.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  3876.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  3877.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *) 
  3878.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  3879.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  3880.                                (* identify a specific event. For DirectX 6.0, *)
  3881.                                (* this field should always be 0. *)
  3882.     dwGroupID: DWORD;          (* Track group id *)
  3883.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  3884.     (* end DMUS_PMSG_PART *)
  3885.  
  3886.     dwLen: DWORD;                 // length of the data
  3887.     abData: array[0..0] of Byte;  // array of data, length equal to dwLen
  3888.   end;
  3889.   {$EXTERNALSYM _DMUS_SYSEX_PMSG}
  3890.   DMUS_SYSEX_PMSG = _DMUS_SYSEX_PMSG;
  3891.   {$EXTERNALSYM DMUS_SYSEX_PMSG}
  3892.   TDMusSysexPMsg = _DMUS_SYSEX_PMSG;
  3893.  
  3894.   (* DMUS_CURVE_PMSG *)
  3895.   PDMusCurvePMsg = ^TDMusCurvePMsg;
  3896.   _DMUS_CURVE_PMSG = packed record
  3897.     (* begin DMUS_PMSG_PART *)
  3898.     dwSize: DWORD;
  3899.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  3900.     mtTime: TMusicTime;        (* music time *)
  3901.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  3902.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  3903.                                (* use this to determine the port/channel. *)
  3904.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  3905.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  3906.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *) 
  3907.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  3908.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  3909.                                (* identify a specific event. For DirectX 6.0, *)
  3910.                                (* this field should always be 0. *)
  3911.     dwGroupID: DWORD;          (* Track group id *)
  3912.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  3913.     (* end DMUS_PMSG_PART *)
  3914.  
  3915.     mtDuration: TMusicTime;      // how long this curve lasts
  3916.     mtOriginalStart: TMusicTime; // must be set to either zero when this PMSG is created or to the original mtTime of the curve
  3917.     mtResetDuration: TMusicTime; (* how long after the curve is finished to allow a flush or
  3918.                                         invalidation to reset to the reset value, nResetValue *)
  3919.     nStartValue: Smallint;       // curve's start value
  3920.     nEndValue: Smallint;         // curve's end value
  3921.     nResetValue: Smallint;       (* curve's reset value, set when a flush or invalidation
  3922.                                         occurs within mtDuration + mtResetDuration *)
  3923.     wMeasure: Word;              // Measure in which this curve occurs
  3924.     nOffset: Smallint;           // Offset from grid at which this curve occurs
  3925.     bBeat: Byte;                 // Beat (in measure) at which this curve occurs
  3926.     bGrid: Byte;                 // Grid offset from beat at which this curve occurs
  3927.     bType: Byte;                 // type of curve
  3928.     bCurveShape: Byte;           // shape of curve
  3929.     bCCData: Byte;               // CC# if this is a control change type
  3930.     bFlags: Byte;                // Curve reset and start from current value flags.
  3931.     // Following exists only under DX8 and on (check dwFlags for DMUS_PMSGF_DX8)
  3932.     wParamType: Word;            // RPN or NRPN parameter number.
  3933.     wMergeIndex: Word;           // Allows multiple parameters to be merged (pitchbend, volume, and expression.)*/
  3934.   end;
  3935.   {$EXTERNALSYM _DMUS_CURVE_PMSG}
  3936.   DMUS_CURVE_PMSG = _DMUS_CURVE_PMSG;
  3937.   {$EXTERNALSYM DMUS_CURVE_PMSG}
  3938.   TDMusCurvePMsg = _DMUS_CURVE_PMSG;
  3939.  
  3940.   enumDMUS_CURVE_FLAGS = DWORD;
  3941.   DMUS_CURVE_FLAGS = enumDMUS_CURVE_FLAGS;
  3942.   {$EXTERNALSYM DMUS_CURVE_FLAGS}
  3943.   TDMusCurveFlags = DMUS_CURVE_FLAGS;
  3944.   PDMusCurveFlags = ^TDMusCurveFlags;
  3945.  
  3946.   (* DMUS_TIMESIG_PMSG *)
  3947.   PDMusTimeSigPMsg = ^TDMusTimesigPMsg;
  3948.   _DMUS_TIMESIG_PMSG = packed record
  3949.     (* begin DMUS_PMSG_PART *)
  3950.     dwSize: DWORD;
  3951.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  3952.     mtTime: TMusicTime;        (* music time *)
  3953.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  3954.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  3955.                                (* use this to determine the port/channel. *)
  3956.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  3957.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  3958.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *)
  3959.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  3960.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  3961.                                (* identify a specific event. For DirectX 6.0, *)
  3962.                                (* this field should always be 0. *)
  3963.     dwGroupID: DWORD;          (* Track group id *)
  3964.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  3965.     (* end DMUS_PMSG_PART *)
  3966.  
  3967.     // Time signatures define how many beats per measure, which note receives
  3968.     // the beat, and the grid resolution.
  3969.     bBeatsPerMeasure: Byte;       // beats per measure (top of time sig)
  3970.     bBeat: Byte;                  // what note receives the beat (bottom of time sig.)
  3971.                                   // we can assume that 0 means 256th note
  3972.     wGridsPerBeat: Word;          // grids per beat
  3973.   end;
  3974.   {$EXTERNALSYM _DMUS_TIMESIG_PMSG}
  3975.   DMUS_TIMESIG_PMSG = _DMUS_TIMESIG_PMSG;
  3976.   {$EXTERNALSYM DMUS_TIMESIG_PMSG}
  3977.   TDMusTimeSigPMsg = _DMUS_TIMESIG_PMSG;
  3978.  
  3979.   (* DMUS_NOTIFICATION_PMSG *)
  3980.   PDMusNotificationPMsg = ^TDMusNotificationPMsg;
  3981.   _DMUS_NOTIFICATION_PMSG = packed record
  3982.     (* begin DMUS_PMSG_PART *)
  3983.     dwSize: DWORD;
  3984.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  3985.     mtTime: TMusicTime;        (* music time *)
  3986.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  3987.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  3988.                                (* use this to determine the port/channel. *)
  3989.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  3990.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  3991.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *)
  3992.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  3993.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  3994.                                (* identify a specific event. For DirectX 6.0, *)
  3995.                                (* this field should always be 0. *)
  3996.     dwGroupID: DWORD;          (* Track group id *)
  3997.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  3998.     (* end DMUS_PMSG_PART *)
  3999.  
  4000.     guidNotificationType: TGUID;
  4001.     dwNotificationOption: DWORD;
  4002.     dwField1: DWORD;
  4003.     dwField2: DWORD;
  4004.   end;
  4005.   {$EXTERNALSYM _DMUS_NOTIFICATION_PMSG}
  4006.   DMUS_NOTIFICATION_PMSG = _DMUS_NOTIFICATION_PMSG;
  4007.   {$EXTERNALSYM DMUS_NOTIFICATION_PMSG}
  4008.   TDMusNotificationPMsg = _DMUS_NOTIFICATION_PMSG;
  4009.  
  4010.   (* DMUS_WAVE_PMSG *)
  4011.   PDMusWavePMsg = ^TDMusWavePMsg;
  4012.   _DMUS_WAVE_PMSG = packed record
  4013.     (* begin DMUS_PMSG_PART *)
  4014.     dwSize: DWORD;
  4015.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  4016.     mtTime: TMusicTime;        (* music time *)
  4017.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  4018.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  4019.                                (* use this to determine the port/channel. *)
  4020.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  4021.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  4022.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *)
  4023.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  4024.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  4025.                                (* identify a specific event. For DirectX 6.0, *)
  4026.                                (* this field should always be 0. *)
  4027.     dwGroupID: DWORD;          (* Track group id *)
  4028.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  4029.     (* end DMUS_PMSG_PART *)
  4030.  
  4031.     rtStartOffset: TReferenceTime;   (* How far into the wave to start, in reference time units only. *)
  4032.     rtDuration: TReferenceTime;      (* Duration of the wave, in either reference time or music time. *)
  4033.     lOffset: Longint;                (* Offset from actual time to logical time, in music or ref time. *)
  4034.     lVolume: Longint;                (* Initial volume, in 100ths of a dB. *)
  4035.     lPitch: Longint;                 (* Initial pitch, in 100ths of a semitone. *)
  4036.     bFlags: Byte;                    (* Flags, including DMUS_WAVEF_OFF... *)
  4037.   end;
  4038.   {$EXTERNALSYM _DMUS_WAVE_PMSG}
  4039.   DMUS_WAVE_PMSG = _DMUS_WAVE_PMSG;
  4040.   {$EXTERNALSYM DMUS_WAVE_PMSG}
  4041.   TDMusWavePMsg = _DMUS_WAVE_PMSG;
  4042.  
  4043.   (* DMUS_LYRIC_PMSG *)
  4044.   PDMusLyricPMsg = ^TDMusLyricPMsg;
  4045.   _DMUS_LYRIC_PMSG = packed record
  4046.     (* begin DMUS_PMSG_PART *)
  4047.     dwSize: DWORD;
  4048.     rtTime: TReferenceTime;    (* real time (in 100 nanosecond increments) *)
  4049.     mtTime: TMusicTime;        (* music time *)
  4050.     dwFlags: DWORD;            (* various bits (see DMUS_PMSGF_FLAGS enumeration) *)
  4051.     dwPChannel: DWORD;         (* Performance Channel. The Performance can *)
  4052.                                (* use this to determine the port/channel. *)
  4053.     dwVirtualTrackID: DWORD;   (* virtual track ID *)
  4054.     pTool: IDirectMusicTool;   (* tool interface pointer *)
  4055.     pGraph: IDirectMusicGraph; (* tool graph interface pointer *)
  4056.     dwType: DWORD;             (* PMSG type (see DMUS_PMSGT_TYPES defines) *)
  4057.     dwVoiceID: DWORD;          (* unique voice id which allows synthesizers to *)
  4058.                                (* identify a specific event. For DirectX 6.0, *)
  4059.                                (* this field should always be 0. *)
  4060.     dwGroupID: DWORD;          (* Track group id *)
  4061.     punkUser: IUnknown;        (* user com pointer, auto released upon PMSG free *)
  4062.     (* end DMUS_PMSG_PART *)
  4063.  
  4064.     wszString: array[0..0] of WideChar;      (* null-terminated Unicode lyric string (structure is actually larger than size 1) *)
  4065.   end;
  4066.   {$EXTERNALSYM _DMUS_LYRIC_PMSG}
  4067.   DMUS_LYRIC_PMSG = _DMUS_LYRIC_PMSG;
  4068.   {$EXTERNALSYM DMUS_LYRIC_PMSG}
  4069.   TDMusLyricPMsg = _DMUS_LYRIC_PMSG;
  4070.  
  4071.  
  4072.  
  4073. (*)///////////////////////////////////////////////////////////////////
  4074. // IDirectMusicBand *)
  4075.  
  4076.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicBand);'}
  4077.   {$EXTERNALSYM IDirectMusicBand}
  4078.   IDirectMusicBand = interface(IUnknown)
  4079.     ['{d2ac28c0-b39b-11d1-8704-00600893b1bd}']
  4080.     (* IDirectMusicBand *)
  4081.     function CreateSegment(out ppSegment: IDirectMusicSegment): HResult; stdcall;
  4082.     function Download(pPerformance: IDirectMusicPerformance): HResult; stdcall;
  4083.     function Unload(pPerformance: IDirectMusicPerformance): HResult; stdcall;
  4084.   end;
  4085.  
  4086.   IDirectMusicBand8 = IDirectMusicBand;
  4087.   {$NODEFINE IDirectMusicBand8}
  4088.   {$HPPEMIT 'typedef _di_IDirectMusicBand _di_IDirectMusicBand8;'}
  4089.  
  4090. (*////////////////////////////////////////////////////////////////////
  4091. // IDirectMusicObject *)
  4092.  
  4093.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicObject);'}
  4094.   {$EXTERNALSYM IDirectMusicObject}
  4095.   IDirectMusicObject = interface(IUnknown)
  4096.     ['{d2ac28b5-b39b-11d1-8704-00600893b1bd}']
  4097.     (* IDirectMusicObject *)
  4098.     function GetDescriptor(out pDesc: TDMusObjectDesc): HResult; stdcall;
  4099.     function SetDescriptor(const pDesc: TDMusObjectDesc): HResult; stdcall;
  4100.     function ParseDescriptor(var pStream; out pDesc: TDMusObjectDesc): HResult; stdcall;
  4101.   end;
  4102.  
  4103.   IDirectMusicObject8 = IDirectMusicObject;
  4104.   {$NODEFINE IDirectMusicObject8}
  4105.   {$HPPEMIT 'typedef _di_IDirectMusicObject _di_IDirectMusicObject8;'}
  4106.  
  4107. (*////////////////////////////////////////////////////////////////////
  4108. // IDirectMusicLoader *)
  4109.  
  4110.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicLoader);'}
  4111.   {$EXTERNALSYM IDirectMusicLoader}
  4112.   IDirectMusicLoader = interface(IUnknown)
  4113.     ['{2ffaaca2-5dca-11d2-afa6-00aa0024d8b6}']
  4114.     (* IDirectMusicLoader *)
  4115.     function GetObject(const pDesc: TDMusObjectDesc; const riid : TGUID;
  4116.       out ppv): HResult; stdcall;
  4117.     function SetObject(const pDesc: TDMusObjectDesc): HResult; stdcall;
  4118.     function SetSearchDirectory(const rguidClass: TGUID; pwzPath: PWideChar;
  4119.       fClear: BOOL): HResult; stdcall;
  4120.     function ScanDirectory(const rguidClass: TGUID; pwzFileExtension,
  4121.       pwzScanFileName: PWideChar): HResult; stdcall;
  4122.     function CacheObject(pObject: IDirectMusicObject): HResult; stdcall;
  4123.     function ReleaseObject(pObject: IDirectMusicObject): HResult; stdcall;
  4124.     function ClearCache(const rguidClass: TGUID): HResult; stdcall;
  4125.     function EnableCache(const rguidClass: TGUID; fEnable: BOOL): HResult; stdcall;
  4126.     function EnumObject(const rguidClass: TGUID; dwIndex: DWORD;
  4127.       const pDesc: TDMusObjectDesc): HResult; stdcall;
  4128.   end;
  4129.  
  4130. (*////////////////////////////////////////////////////////////////////
  4131. // IDirectMusicLoader8 *)
  4132.  
  4133.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicLoader8);'}
  4134.   {$EXTERNALSYM IDirectMusicLoader8}
  4135.   IDirectMusicLoader8 = interface(IDirectMusicLoader)
  4136.     ['{19e7c08c-0a44-4e6a-a116-595a7cd5de8c}']
  4137.     (* IDirectMusicLoader8 *)
  4138.     function CollectGarbage: HResult; stdcall;
  4139.     function ReleaseObjectByUnknown(pObject: IUnknown): HResult; stdcall;
  4140.     function LoadObjectFromFile(const rguidClassID: TGUID; const iidInterfaceID: TGUID;
  4141.       pwzFilePath: PWideChar; out ppObject): HResult; stdcall;
  4142.   end;
  4143.  
  4144. (*  Stream object supports IDirectMusicGetLoader interface to access loader while file parsing. *)
  4145.  
  4146.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicGetLoader);'}
  4147.   {$EXTERNALSYM IDirectMusicGetLoader}
  4148.   IDirectMusicGetLoader = interface(IUnknown)
  4149.     ['{68a04844-d13d-11d1-afa6-00aa0024d8b6}']
  4150.     (* IDirectMusicGetLoader *)
  4151.     function GetLoader(out ppLoader: IDirectMusicLoader): HResult; stdcall;
  4152.   end;
  4153.  
  4154.   IDirectMusicGetLoader8 = IDirectMusicGetLoader;
  4155.   {$NODEFINE IDirectMusicGetLoader8}
  4156.   {$HPPEMIT 'typedef _di_IDirectMusicGetLoader _di_IDirectMusicGetLoader8;'}
  4157.  
  4158. (*////////////////////////////////////////////////////////////////////
  4159. // IDirectMusicSegment *)
  4160.  
  4161.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicSegment);'}
  4162.   {$EXTERNALSYM IDirectMusicSegment}
  4163.   IDirectMusicSegment = interface(IUnknown)
  4164.     ['{f96029a2-4282-11d2-8717-00600893b1bd}']
  4165.     (*  IDirectMusicSegment *)
  4166.     function GetLength(out pmtLength: TMusicTime): HResult; stdcall;
  4167.     function SetLength(mtLength: TMusicTime): HResult; stdcall;
  4168.     function GetRepeats(out pdwRepeats: DWORD): HResult; stdcall;
  4169.     function SetRepeats(dwRepeats: DWORD): HResult; stdcall;
  4170.     function GetDefaultResolution(out pdwResolution: DWORD): HResult; stdcall;
  4171.     function SetDefaultResolution(dwResolution: DWORD): HResult; stdcall;
  4172.     function GetTrack(const rguidType: TGUID; dwGroupBits, dwIndex: DWORD;
  4173.       out ppTrack: IDirectMusicTrack): HResult; stdcall;
  4174.     function GetTrackGroup(pTrack: IDirectMusicTrack; out pdwGroupBits: DWORD): HResult; stdcall;
  4175.     function InsertTrack(pTrack: IDirectMusicTrack; dwGroupBits: DWORD): HResult; stdcall;
  4176.     function RemoveTrack(pTrack: IDirectMusicTrack): HResult; stdcall;
  4177.     function InitPlay(out ppSegState: IDirectMusicSegmentState;
  4178.       pPerformance: IDirectMusicPerformance; dwFlags: DWORD): HResult; stdcall;
  4179.     function GetGraph(out ppGraph: IDirectMusicGraph): HResult; stdcall;
  4180.     function SetGraph(pGraph: IDirectMusicGraph): HResult; stdcall;
  4181.     function AddNotificationType(const rguidNotificationType: TGUID): HResult; stdcall;
  4182.     function RemoveNotificationType(const rguidNotificationType: TGUID): HResult; stdcall;
  4183.     function GetParam(const rguidType: TGUID; dwGroupBits, dwIndex: DWORD;
  4184.       mtTime: TMusicTime; out pmtNext: TMusicTime; pParam: Pointer): HResult; stdcall;
  4185.     function SetParam(const rguidType: TGUID; dwGroupBits, dwIndex: DWORD;
  4186.       mtTime: TMusicTime; pParam: Pointer): HResult; stdcall;
  4187.     function Clone(mtStart: TMusicTime; mtEnd: TMusicTime;
  4188.       out ppSegment: IDirectMusicSegment): HResult; stdcall;
  4189.     function SetStartPoint(mtStart: TMusicTime): HResult; stdcall;
  4190.     function GetStartPoint(out pmtStart: TMusicTime): HResult; stdcall;
  4191.     function SetLoopPoints(mtStart: TMusicTime; mtEnd: TMusicTime): HResult; stdcall;
  4192.     function GetLoopPoints(out pmtStart, pmtEnd: TMusicTime): HResult; stdcall;
  4193.     function SetPChannelsUsed(dwNumPChannels: DWORD; var paPChannels: DWORD): HResult; stdcall;
  4194.   end;
  4195.  
  4196. (*////////////////////////////////////////////////////////////////////
  4197. // IDirectMusicSegment8 *)
  4198.  
  4199.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicSegment8);'}
  4200.   {$EXTERNALSYM IDirectMusicSegment8}
  4201.   IDirectMusicSegment8 = interface(IDirectMusicSegment)
  4202.     ['{c6784488-41a3-418f-aa15-b35093ba42d4}']
  4203.     (*  IDirectMusicSegment8 *)
  4204.     function SetTrackConfig(const rguidTrackClassID: TGUID;
  4205.       dwGroupBits, dwIndex, dwFlagsOn, dwFlagsOff: DWORD): HResult; stdcall;
  4206.     function GetAudioPathConfig(out ppAudioPathConfig: IUnknown): HResult; stdcall;
  4207.     function Compose(mtTime: TMusicTime; pFromSegment, pToSegment: IDirectMusicSegment;
  4208.       out ppComposedSegment: IDirectMusicSegment): HResult; stdcall;
  4209.     function Download(pAudioPath: IUnknown): HResult; stdcall;
  4210.     function Unload(pAudioPath: IUnknown): HResult; stdcall;
  4211.   end;
  4212.  
  4213. (*/////////////////////////////////////////////////////////////////////
  4214. // IDirectMusicSegmentState *)
  4215.  
  4216.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicSegmentState);'}
  4217.   {$EXTERNALSYM IDirectMusicSegmentState}
  4218.   IDirectMusicSegmentState = interface(IUnknown)
  4219.     ['{a3afdcc7-d3ee-11d1-bc8d-00a0c922e6eb}']
  4220.     (*  IDirectMusicSegmentState *)
  4221.     function GetRepeats(out pdwRepeats: DWORD): HResult; stdcall;
  4222.     function GetSegment(out ppSegment: IDirectMusicSegment): HResult; stdcall;
  4223.     function GetStartTime(out pmtStart: TMusicTime): HResult; stdcall;
  4224.     function GetSeek(out pmtSeek: TMusicTime): HResult; stdcall;
  4225.     function GetStartPoint(out pmtStart: TMusicTime): HResult; stdcall;
  4226.   end;
  4227.  
  4228. (*/////////////////////////////////////////////////////////////////////
  4229. // IDirectMusicSegmentState8 *)
  4230.  
  4231.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicSegmentState8);'}
  4232.   {$EXTERNALSYM IDirectMusicSegmentState8}
  4233.   IDirectMusicSegmentState8 = interface(IDirectMusicSegmentState)
  4234.     ['{a50e4730-0ae4-48a7-9839-bc04bfe07772}']
  4235.     (* IDirectMusicSegmentState8 *)
  4236.     function SetTrackConfig(
  4237.       const rguidTrackClassID: TGUID;        // Class ID of the type of track on which to set the configuration flags.
  4238.       dwGroupBits,                           // Group bits.
  4239.       dwIndex,                               // Nth track (or DMUS_SEG_ALLTRACKS) that matches class id and group id.
  4240.       dwFlagsOn,                             // DMUS_TRACKCONFIG_ flags to enable.
  4241.       dwFlagsOff: DWORD): HResult; stdcall;  // DMUS_TRACKCONFIG_ flags to disable.
  4242.     function GetObjectInPath(
  4243.       dwPChannel,                            // PChannel to search.
  4244.       dwStage,                               // Which stage in the path.
  4245.       dwBuffer: DWORD;                       // Which buffer to address, if more than one.
  4246.       const guidObject: TGUID;               // ClassID of object.
  4247.       dwIndex: DWORD;                        // Which object of that class.
  4248.       const iidInterface: TGUID;             // Requested COM interface.
  4249.       out ppObject): HResult; stdcall;       // Pointer to interface.
  4250.   end;
  4251.  
  4252. (*////////////////////////////////////////////////////////////////////
  4253. // IDirectMusicAudioPath *)
  4254.  
  4255.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicAudioPath);'}
  4256.   {$EXTERNALSYM IDirectMusicAudioPath}
  4257.   IDirectMusicAudioPath = interface(IUnknown)
  4258.     ['{c87631f5-23be-4986-8836-05832fcc48f9}']
  4259.     (*  IDirectMusicAudioPath *)
  4260.     function GetObjectInPath(
  4261.       dwPChannel,                         // PChannel to search.
  4262.       dwStage,                            // Which stage in the path.
  4263.       dwBuffer: DWORD;                    // Which buffer to address, if more than one.
  4264.       const guidObject: TGUID;            // ClassID of object.
  4265.       dwIndex: DWORD;                     // Which object of that class.
  4266.       const iidInterface: TGUID;          // Requested COM interface.
  4267.       out ppObject): HResult; stdcall;    // Pointer to interface.
  4268.     function Activate(fActivate: BOOL): HResult; stdcall; // True to activate, False to deactivate.
  4269.     function SetVolume(lVolume: Longint;    // Gain, in 100ths of a dB. This must be negative (0 represents full volume.)
  4270.       dwDuration: DWORD): HResult; stdcall; // Duration of volume ramp in  milliseconds. Note that 0 is more efficient.
  4271.     function ConvertPChannel (dwPChannelIn: DWORD;   // Pchannel of source.
  4272.       var pdwPChannelOut: DWORD): HResult; stdcall;  // Equivalent pchannel on performance.
  4273.   end;
  4274.  
  4275.   IDirectMusicAudioPath8 = IDirectMusicAudioPath;
  4276.   {$NODEFINE IDirectMusicAudioPath8}
  4277.   {$HPPEMIT 'typedef _di_IDirectMusicAudioPath _di_IDirectMusicAudioPath8;'}
  4278.  
  4279. (*////////////////////////////////////////////////////////////////////
  4280. // IDirectMusicPerformance *)
  4281.  
  4282.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicPerformance);'}
  4283.   {$EXTERNALSYM IDirectMusicPerformance}
  4284.   IDirectMusicPerformance = interface(IUnknown)
  4285.     ['{07d43d03-6523-11d2-871d-00600893b1bd}']
  4286.     (*  IDirectMusicPerformance *)
  4287.     function Init(var ppDirectMusic: IDirectMusic;
  4288.       pDirectSound: IDirectSound; hWnd: HWND): HResult; stdcall;
  4289.     function PlaySegment(pSegment: IDirectMusicSegment; dwFlags: DWORD;
  4290.       i64StartTime: LongLong; ppSegmentState: PIDirectMusicSegmentState): HResult; stdcall;
  4291.     function Stop(pSegment: IDirectMusicSegment; pSegmentState: IDirectMusicSegmentState;
  4292.       mtTime: TMusicTime; dwFlags: DWORD): HResult; stdcall;
  4293.     function GetSegmentState(out ppSegmentState: IDirectMusicSegmentState;
  4294.       mtTime: TMusicTime): HResult; stdcall;
  4295.     function SetPrepareTime(dwMilliSeconds: DWORD): HResult; stdcall;
  4296.     function GetPrepareTime(out pdwMilliSeconds: DWORD): HResult; stdcall;
  4297.     function SetBumperLength(dwMilliSeconds: DWORD): HResult; stdcall;
  4298.     function GetBumperLength(out pdwMilliSeconds: DWORD): HResult; stdcall;
  4299.     function SendPMsg(pPMSG: PDMusPMsg): HResult; stdcall;
  4300.     function MusicToReferenceTime(mtTime: TMusicTime; out prtTime: TReferenceTime): HResult; stdcall;
  4301.     function ReferenceToMusicTime(rtTime: TReferenceTime; out pmtTime: TMusicTime): HResult; stdcall;
  4302.     function IsPlaying(pSegment: IDirectMusicSegment; pSegState: IDirectMusicSegmentState): HResult; stdcall;
  4303.     function GetTime(prtNow: PReference_Time; pmtNow: PMusicTime): HResult; stdcall;
  4304.     function AllocPMsg(cb: ULONG; out ppPMSG: PDMusPMsg): HResult; stdcall;
  4305.     function FreePMsg(pPMSG: PDMusPMsg): HResult; stdcall;
  4306.     function GetGraph(out ppGraph: IDirectMusicGraph): HResult; stdcall;
  4307.     function SetGraph(pGraph: IDirectMusicGraph): HResult; stdcall;
  4308.     function SetNotificationHandle(hNotification: THANDLE; rtMinimum: TReferenceTime): HResult; stdcall;
  4309.     function GetNotificationPMsg(out ppNotificationPMsg: PDMusNotificationPMsg): HResult; stdcall;
  4310.     function AddNotificationType(const rguidNotificationType: TGUID): HResult; stdcall;
  4311.     function RemoveNotificationType(const rguidNotificationType: TGUID): HResult; stdcall;
  4312.     function AddPort(pPort: IDirectMusicPort): HResult; stdcall; 
  4313.     function RemovePort(pPort: IDirectMusicPort): HResult; stdcall;
  4314.     function AssignPChannelBlock(dwBlockNum: DWORD; pPort: IDirectMusicPort;
  4315.       dwGroup: DWORD): HResult; stdcall;
  4316.     function AssignPChannel(dwPChannel: DWORD; pPort: IDirectMusicPort;
  4317.       dwGroup, dwMChannel: DWORD): HResult; stdcall;
  4318.     function PChannelInfo(dwPChannel: DWORD; out ppPort: IDirectMusicPort;
  4319.       out pdwGroup, pdwMChannel: DWORD ): HResult; stdcall;
  4320.     function DownloadInstrument(pInst: IDirectMusicInstrument; dwPChannel: DWORD;
  4321.       out ppDownInst: IDirectMusicDownloadedInstrument; var pNoteRanges: TDMusNoteRange;
  4322.       dwNumNoteRanges: DWORD; out ppPort: IDirectMusicPort;
  4323.       out pdwGroup, pdwMChannel: DWORD): HResult; stdcall;
  4324.     function Invalidate(mtTime: TMusicTime; dwFlags: DWORD): HResult; stdcall;
  4325.     function GetParam(const rguidType: TGUID; dwGroupBits, dwIndex: DWORD;
  4326.       mtTime: TMusicTime; out pmtNext: TMusicTime; pParam: Pointer): HResult; stdcall;
  4327.     function SetParam(const rguidType: TGUID; dwGroupBits, dwIndex: DWORD;
  4328.       mtTime: TMusicTime; pParam: Pointer): HResult; stdcall;
  4329.     function GetGlobalParam(const rguidType: TGUID; pParam: Pointer;
  4330.       dwSize: DWORD): HResult; stdcall;
  4331.     function SetGlobalParam(const rguidType: TGUID; pParam: Pointer;
  4332.       dwSize: DWORD): HResult; stdcall;
  4333.     function GetLatencyTime(out prtTime: TReferenceTime): HResult; stdcall;
  4334.     function GetQueueTime(out prtTime: TReferenceTime): HResult; stdcall;
  4335.     function AdjustTime(rtAmount: TReferenceTime): HResult; stdcall;
  4336.     function CloseDown : HResult; stdcall;
  4337.     function GetResolvedTime(rtTime: TReferenceTime; out prtResolved: TReferenceTime;
  4338.       dwTimeResolveFlags: DWORD): HResult; stdcall;
  4339.     function MIDIToMusic(bMIDIValue: Byte; const pChord: TDMusChordKey;
  4340.       bPlayMode, bChordLevel: Byte; out pwMusicValue: Word): HResult; stdcall;
  4341.     function MusicToMIDI(wMusicValue: Word; const pChord: TDMusChordKey;
  4342.       bPlayMode, bChordLevel: Byte; out pbMIDIValue: Byte): HResult; stdcall;
  4343.     function TimeToRhythm(mtTime: TMusicTime; const pTimeSig: TDMusTimeSignature;
  4344.       out pwMeasure: Word; out pbBeat, pbGrid: Byte;
  4345.       out pnOffset: SmallInt): HResult; stdcall;
  4346.     function RhythmToTime(wMeasure: Word; bBeat, bGrid: Byte; nOffset: Smallint;
  4347.       const pTimeSig: TDMusTimeSignature; out pmtTime: TMusicTime): HResult; stdcall;
  4348.   end;
  4349.  
  4350. (*////////////////////////////////////////////////////////////////////
  4351. // IDirectMusicPerformance8 *)
  4352.  
  4353.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicPerformance8);'}
  4354.   {$EXTERNALSYM IDirectMusicPerformance8}
  4355.   IDirectMusicPerformance8 = interface(IDirectMusicPerformance)
  4356.     ['{679c4137-c62e-4147-b2b4-9d569acb254c}']
  4357.     (*  IDirectMusicPerformance8 *)
  4358.     function InitAudio(
  4359.       ppDirectMusic: PIDirectMusic;                  // Optional DMusic pointer.
  4360.       ppDirectSound: PIDirectSound;                  // Optional DSound pointer.
  4361.       hWnd: hWnd;                                    // HWND for DSound.
  4362.       dwDefaultPathType,                             // Requested default audio path type, also optional.
  4363.       dwPChannelCount,                               // Number of PChannels, if default audio path to be created.
  4364.       dwFlags: DWORD;                                // DMUS_AUDIOF flags, if no pParams structure.
  4365.       pParams: PDMUSAudioParams): HResult; stdcall;  // Optional initialization structure, defining required voices, buffers, etc. 
  4366.     function PlaySegmentEx(
  4367.       pSource: IUnknown;                             // Segment to play.
  4368.       pwzSegmentName: PWideChar;                     // Not supported in DX8.
  4369.       pTransition: IUnknown;                         // Optional template segment to compose transition with. 
  4370.       dwFlags: DWORD;                                // DMUS_SEGF_ flags. 
  4371.       i64StartTime: Int64;                           // Time to start playback. 
  4372.       out ppSegmentState: IDirectMusicSegmentState;  // Returned Segment State. 
  4373.       pFrom,                                         // Optional segmentstate or audiopath to replace. 
  4374.       pAudioPath: IUnknown): HResult; stdcall;       // Optional audioPath to play on.
  4375.     function StopEx(pObjectToStop: IUnknown;         // Segstate, AudioPath, or Segment.
  4376.       i64StopTime: int64; dwFlags: DWORD): HResult; stdcall;
  4377.     function ClonePMsg(pSourcePMSG: TDMusPMsg;
  4378.       var ppCopyPMSG: TDMusPMsg): HResult; stdcall;
  4379.     function CreateAudioPath(
  4380.       pSourceConfig: IUnknown;                       // Source configuration, from AudioPathConfig file. 
  4381.       fActivate: BOOL;                               // TRUE to activate on creation. 
  4382.       out ppNewPath: IDirectMusicAudioPath): HResult; stdcall; // Returns created audiopath. 
  4383.     function CreateStandardAudioPath(
  4384.       dwType,                                        // Type of path to create. 
  4385.       dwPChannelCount: DWORD;                        // How many PChannels to allocate for it. 
  4386.       fActivate: BOOL;                               // TRUE to activate on creation. 
  4387.       out ppNewPath: IDirectMusicAudioPath): HResult; stdcall; // Returns created audiopath. 
  4388.     function SetDefaultAudioPath(pAudioPath: IDirectMusicAudioPath): HResult; stdcall;
  4389.     function GetDefaultAudioPath(out ppAudioPath: IDirectMusicAudioPath): HResult; stdcall;
  4390.     function GetParamEx(
  4391.       const rguidType: TGUID;                        // GetParam command ID. 
  4392.       dwTrackID,                                     // Virtual track ID of caller. 
  4393.       dwGroupBits,                                   // Group bits of caller. 
  4394.       dwIndex: DWORD;                                // Index to Nth parameter. 
  4395.       mtTime,                                        // Time of requested parameter. 
  4396.       pmtNext: TMusicTime;                           // Returned delta to next parameter. 
  4397.       pParam: Pointer): HResult; stdcall;            // Data structure to fill with parameter. 
  4398.   end;
  4399.  
  4400. (*////////////////////////////////////////////////////////////////////
  4401. // IDirectMusicGraph *)
  4402.  
  4403.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicGraph);'}
  4404.   {$EXTERNALSYM IDirectMusicGraph}
  4405.   IDirectMusicGraph = interface(IUnknown)
  4406.     ['{2befc277-5497-11d2-bccb-00a0c922e6eb}']
  4407.     (*  IDirectMusicGraph *)
  4408.     function StampPMsg(var pPMSG: TDMusPMsg): HResult; stdcall;
  4409.     function InsertTool(pTool: IDirectMusicTool; var pdwPChannels: DWORD;
  4410.       cPChannels: DWORD; lIndex: LongInt): HResult; stdcall;
  4411.     function GetTool(dwIndex: DWORD; out ppTool: IDirectMusicTool): HResult; stdcall;
  4412.     function RemoveTool(pTool: IDirectMusicTool): HResult; stdcall;
  4413.   end;
  4414.  
  4415.   IDirectMusicGraph8 = IDirectMusicGraph;
  4416.   {$NODEFINE IDirectMusicGraph8}
  4417.   {$HPPEMIT 'typedef _di_IDirectMusicGraph _di_IDirectMusicGraph8;'}
  4418.  
  4419. (*////////////////////////////////////////////////////////////////////
  4420. // IDirectMusicTool *)
  4421.  
  4422.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicTool);'}
  4423.   {$EXTERNALSYM IDirectMusicTool}
  4424.   IDirectMusicTool = interface(IUnknown)
  4425.     ['{d2ac28ba-b39b-11d1-8704-00600893b1bd}']
  4426.     (*  IDirectMusicTool *)
  4427.     function Init(pGraph: IDirectMusicGraph): HResult; stdcall;
  4428.     function GetMsgDeliveryType(out pdwDeliveryType: DWORD): HResult; stdcall;
  4429.     function GetMediaTypeArraySize(out pdwNumElements: DWORD): HResult; stdcall;
  4430.     function GetMediaTypes(out padwMediaTypes: PDWORD; dwNumElements: DWORD): HResult; stdcall;
  4431.     function ProcessPMsg(pPerf: IDirectMusicPerformance; pPMSG: PDMusPMsg): HResult; stdcall;
  4432.     function Flush(pPerf: IDirectMusicPerformance; const pPMSG: TDMusPMsg;
  4433.       rtTime: TReferenceTime): HResult; stdcall;
  4434.   end;
  4435.  
  4436. (*/////////////////////////////////////////////////////////////////////
  4437. // IDirectMusicStyle *)
  4438.  
  4439.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicStyle);'}
  4440.   {$EXTERNALSYM IDirectMusicStyle}
  4441.   IDirectMusicStyle = interface(IUnknown)
  4442.     ['{d2ac28bd-b39b-11d1-8704-00600893b1bd}']
  4443.     (*  IDirectMusicStyle *)
  4444.     function GetBand(pwszName: PWideChar; out ppBand: IDirectMusicBand): HResult; stdcall;
  4445.     function EnumBand(dwIndex: DWORD; pwszName: PWideChar): HResult; stdcall;
  4446.     function GetDefaultBand(out ppBand: IDirectMusicBand): HResult; stdcall;
  4447.     function EnumMotif(dwIndex: DWORD; pwszName: PWideChar): HResult; stdcall;
  4448.     function GetMotif(pwszName: PWideChar; out ppSegment: IDirectMusicSegment): HResult; stdcall;
  4449.     function GetDefaultChordMap(out ppChordMap: IDirectMusicChordMap): HResult; stdcall;
  4450.     function EnumChordMap(dwIndex: DWORD; pwszName: PWideChar): HResult; stdcall;
  4451.     function GetChordMap(pwszName: PWideChar; out ppChordMap: IDirectMusicChordMap): HResult; stdcall;
  4452.     function GetTimeSignature(out pTimeSig: TDMusTimeSignature): HResult; stdcall;
  4453.     function GetEmbellishmentLength(dwType, dwLevel: DWORD; out pdwMin, pdwMax: DWORD): HResult; stdcall;
  4454.     function GetTempo(out pTempo: Double): HResult; stdcall;
  4455.   end;
  4456.  
  4457. (*/////////////////////////////////////////////////////////////////////
  4458. // IDirectMusicStyle8 *)
  4459.  
  4460.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicStyle8);'}
  4461.   {$EXTERNALSYM IDirectMusicStyle8}
  4462.   IDirectMusicStyle8 = interface(IDirectMusicStyle)
  4463.     ['{fd24ad8a-a260-453d-bf50-6f9384f70985}']
  4464.     (*  IDirectMusicStyle8 *)
  4465.     function EnumPattern(dwIndex, dwPatternType: DWORD; pwszName: PWideChar): HResult; stdcall;
  4466.   end;
  4467.  
  4468. (*/////////////////////////////////////////////////////////////////////
  4469. // IDirectMusicChordMap *)
  4470.  
  4471.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicChordMap);'}
  4472.   {$EXTERNALSYM IDirectMusicChordMap}
  4473.   IDirectMusicChordMap = interface(IUnknown)
  4474.     ['{d2ac28be-b39b-11d1-8704-00600893b1bd}']
  4475.     (*  IDirectMusicChordMap *)
  4476.     function GetScale(out pdwScale: DWORD): HResult; stdcall;
  4477.   end;
  4478.  
  4479.   IDirectMusicChordMap8 = IDirectMusicChordMap;
  4480.   {$NODEFINE IDirectMusicChordMap8}
  4481.   {$HPPEMIT 'typedef _di_IDirectMusicChordMap _di_IDirectMusicChordMap8;'}
  4482.  
  4483. (*/////////////////////////////////////////////////////////////////////
  4484. // IDirectMusicComposer *)
  4485.  
  4486.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicComposer);'}
  4487.   {$EXTERNALSYM IDirectMusicComposer}
  4488.   IDirectMusicComposer = interface(IUnknown)
  4489.     ['{d2ac28bf-b39b-11d1-8704-00600893b1bd}']
  4490.     (*  IDirectMusicComposer *)
  4491.     function ComposeSegmentFromTemplate(pStyle: IDirectMusicStyle;
  4492.       pTempSeg: IDirectMusicSegment; wActivity: Word;
  4493.       pChordMap: IDirectMusicChordMap; out ppSectionSeg: IDirectMusicSegment): HResult; stdcall;
  4494.     function ComposeSegmentFromShape(pStyle: IDirectMusicStyle; wNumMeasures,
  4495.       wShape, wActivity: Word; fIntro: BOOL; fEnd: BOOL;
  4496.       pChordMap: IDirectMusicChordMap; out ppSectionSeg: IDirectMusicSegment): HResult; stdcall;
  4497.     function ComposeTransition(pFromSeg: IDirectMusicSegment; pToSeg: IDirectMusicSegment;
  4498.       mtTime: TMusicTime; wCommand: Word; dwFlags: DWORD; pChordMap: IDirectMusicChordMap;
  4499.       out ppSectionSeg: IDirectMusicSegment): HResult; stdcall;
  4500.     function AutoTransition(pPerformance: IDirectMusicPerformance;
  4501.       pToSeg: IDirectMusicSegment; wCommand: Word; dwFlags: DWORD;
  4502.       pChordMap: IDirectMusicChordMap; out ppTransSeg: IDirectMusicSegment;
  4503.       out ppToSegState: IDirectMusicSegmentState; out ppTransSegState: IDirectMusicSegmentState): HResult; stdcall;
  4504.     function ComposeTemplateFromShape(wNumMeasures: Word; wShape: Word; fIntro: BOOL;
  4505.       fEnd: BOOL; wEndLength: Word; out ppTempSeg:IDirectMusicSegment): HResult; stdcall;
  4506.     function ChangeChordMap(pSectionSeg: IDirectMusicSegment;
  4507.       fTrackScale: BOOL; pChordMap: IDirectMusicChordMap): HResult; stdcall;
  4508.   end;
  4509.  
  4510.   IDirectMusicComposer8 = IDirectMusicComposer;
  4511.   {$NODEFINE IDirectMusicComposer8}
  4512.   {$HPPEMIT 'typedef _di_IDirectMusicComposer _di_IDirectMusicComposer8;'}
  4513.  
  4514. (*/////////////////////////////////////////////////////////////////////
  4515. // IDirectMusicPatternTrack *)
  4516.  
  4517.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicPatternTrack);'}
  4518.   {$EXTERNALSYM IDirectMusicPatternTrack}
  4519.   IDirectMusicPatternTrack = interface(IUnknown)
  4520.     ['{51c22e10-b49f-46fc-bec2-e6288fb9ede6}']
  4521.     (*  IDirectMusicPatternTrack *)
  4522.     function CreateSegment(pStyle: IDirectMusicStyle;
  4523.       out ppSegment: IDirectMusicSegment): HResult; stdcall;
  4524.     function SetVariation(pSegState: IDirectMusicSegmentState;
  4525.       dwVariationFlags, dwPart: DWORD): HResult; stdcall;
  4526.     function SetPatternByName(pSegState: IDirectMusicSegmentState;
  4527.       wszName: PWideChar; pStyle: IDirectMusicStyle; dwPatternType: DWORD;
  4528.       var pdwLength: DWORD): HResult; stdcall;
  4529.   end;
  4530.  
  4531.   IDirectMusicPatternTrack8 = IDirectMusicPatternTrack;
  4532.   {$NODEFINE IDirectMusicPatternTrack8}
  4533.   {$HPPEMIT 'typedef _di_IDirectMusicPatternTrack _di_IDirectMusicPatternTrack8;'}
  4534.  
  4535. (*/////////////////////////////////////////////////////////////////////
  4536. // IDirectMusicScript *)
  4537.  
  4538.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicScript);'}
  4539.   {$EXTERNALSYM IDirectMusicScript}
  4540.   IDirectMusicScript = interface(IUnknown)
  4541.     ['{2252373a-5814-489b-8209-31fedebaf137}']
  4542.     (*  IDirectMusicScript *)
  4543.     function Init(pPerformance: IDirectMusicPerformance;
  4544.       pErrorInfo: PDMusScriptErrorInfo): HResult; stdcall;
  4545.     function CallRoutine(pwszRoutineName: PWideChar;
  4546.       pErrorInfo: PDMusScriptErrorInfo): HResult; stdcall;
  4547.     function SetVariableVariant(pwszVariableName: PWideChar; varValue: Variant;
  4548.       fSetRef: BOOL; pErrorInfo: PDMusScriptErrorInfo): HResult; stdcall;
  4549.     function GetVariableVariant(pwszVariableName: PWideChar; var pvarValue: Variant;
  4550.       pErrorInfo: PDMusScriptErrorInfo): HResult; stdcall;
  4551.     function SetVariableNumber(pwszVariableName: PWideChar; lValue: Longint;
  4552.       pErrorInfo: PDMusScriptErrorInfo): HResult; stdcall;
  4553.     function GetVariableNumber(pwszVariableName: PWideChar; var plValue: Longint;
  4554.       pErrorInfo: PDMusScriptErrorInfo): HResult; stdcall;
  4555.     function SetVariableObject(pwszVariableName: PWideChar; punkValue: IUnknown;
  4556.       pErrorInfo: PDMusScriptErrorInfo): HResult; stdcall;
  4557.     function GetVariableObject(pwszVariableName: PWideChar; const riid: TGUID;
  4558.       out ppv; pErrorInfo: PDMusScriptErrorInfo): HResult; stdcall;
  4559.     function EnumRoutine(dwIndex: DWORD; pwszName: PWideChar): HResult; stdcall;
  4560.     function EnumVariable(dwIndex: DWORD; pwszName: PWideChar): HResult; stdcall;
  4561.   end;
  4562.  
  4563.   IDirectMusicScript8 = IDirectMusicScript;
  4564.   {$NODEFINE IDirectMusicScript8}
  4565.   {$HPPEMIT 'typedef _di_IDirectMusicScript _di_IDirectMusicScript8;'}
  4566.  
  4567. (*/////////////////////////////////////////////////////////////////////
  4568. // IDirectMusicContainer *)
  4569.  
  4570.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicContainer);'}
  4571.   {$EXTERNALSYM IDirectMusicContainer}
  4572.   IDirectMusicContainer = interface(IUnknown)
  4573.     ['{9301e386-1f22-11d3-8226-d2fa76255d47}']
  4574.     (*  IDirectMusicContainer *)
  4575.     function EnumObject(const rguidClass: TGUID; dwIndex: DWORD;
  4576.       pDesc: PDMusObjectDesc; pwszAlias: PWideChar): HResult; stdcall;
  4577.   end;
  4578.  
  4579.   IDirectMusicContainer8 = IDirectMusicContainer;
  4580.   {$NODEFINE IDirectMusicContainer8}
  4581.   {$HPPEMIT 'typedef _di_IDirectMusicContainer _di_IDirectMusicContainer8;'}
  4582.  
  4583. (*////////////////////////////////////////////////////////////////////
  4584. // IDirectMusicTrack *)
  4585.  
  4586.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicTrack);'}
  4587.   {$EXTERNALSYM IDirectMusicTrack}
  4588.   IDirectMusicTrack = interface(IUnknown)
  4589.     ['{f96029a1-4282-11d2-8717-00600893b1bd}']
  4590.     (*  IDirectMusicTrack *)
  4591.     function Init(pSegment: IDirectMusicSegment): HResult; stdcall;
  4592.     function InitPlay(pSegmentState: IDirectMusicSegmentState;
  4593.       pPerformance: IDirectMusicPerformance; out ppStateData: Pointer;
  4594.       dwVirtualTrackID, dwFlags: DWORD): HResult; stdcall;
  4595.     function EndPlay(pStateData: Pointer): HResult; stdcall;
  4596.     function Play(pStateData: Pointer; mtStart, mtEnd, mtOffset: TMusicTime;
  4597.       dwFlags: DWORD; pPerf: IDirectMusicPerformance;
  4598.       pSegSt: IDirectMusicSegmentState; dwVirtualID: DWORD): HResult; stdcall;
  4599.     function GetParam (const rguidType: TGUID; mtTime: TMusicTime; out pmtNext: TMusicTime;
  4600.       pParam: Pointer): HResult; stdcall;
  4601.     function SetParam(const rguidType: TGUID; mtTime: TMusicTime; pParam: Pointer): HResult; stdcall;
  4602.     function IsParamSupported(const rguidType: TGUID): HResult; stdcall;
  4603.     function AddNotificationType(const rguidNotificationType: TGUID): HResult; stdcall;
  4604.     function RemoveNotificationType(const rguidNotificationType: TGUID): HResult; stdcall;
  4605.     function Clone(mtStart: TMusicTime; mtEnd: TMusicTime; out ppTrack: IDirectMusicTrack): HResult; stdcall;
  4606.   end;
  4607.  
  4608.  
  4609. const
  4610.   (* CLSID's *)
  4611.   CLSID_DirectMusicPerformance: TGUID = '{d2ac2881-b39b-11d1-8704-00600893b1bd}';
  4612.   {$EXTERNALSYM CLSID_DirectMusicPerformance}
  4613.   CLSID_DirectMusicSegment: TGUID = '{d2ac2882-b39b-11d1-8704-00600893b1bd}';
  4614.   {$EXTERNALSYM CLSID_DirectMusicSegment}
  4615.   CLSID_DirectMusicSegmentState: TGUID = '{d2ac2883-b39b-11d1-8704-00600893b1bd}';
  4616.   {$EXTERNALSYM CLSID_DirectMusicSegmentState}
  4617.   CLSID_DirectMusicGraph: TGUID = '{d2ac2884-b39b-11d1-8704-00600893b1bd}';
  4618.   {$EXTERNALSYM CLSID_DirectMusicGraph}
  4619.   CLSID_DirectMusicStyle: TGUID = '{d2ac288a-b39b-11d1-8704-00600893b1bd}';
  4620.   {$EXTERNALSYM CLSID_DirectMusicStyle}
  4621.   CLSID_DirectMusicChordMap: TGUID = '{d2ac288f-b39b-11d1-8704-00600893b1bd}';
  4622.   {$EXTERNALSYM CLSID_DirectMusicChordMap}
  4623.   CLSID_DirectMusicComposer: TGUID = '{d2ac2890-b39b-11d1-8704-00600893b1bd}';
  4624.   {$EXTERNALSYM CLSID_DirectMusicComposer}
  4625.   CLSID_DirectMusicLoader: TGUID = '{d2ac2892-b39b-11d1-8704-00600893b1bd}';
  4626.   {$EXTERNALSYM CLSID_DirectMusicLoader}
  4627.   CLSID_DirectMusicBand: TGUID = '{79ba9e00-b6ee-11d1-86be-00c04fbf8fef}';
  4628.   {$EXTERNALSYM CLSID_DirectMusicBand}
  4629.  
  4630.   (* New CLSID's for DX8 *)
  4631.   CLSID_DirectMusicPatternTrack: TGUID = '{d2ac2897-b39b-11d1-8704-00600893b1bd}';
  4632.   {$EXTERNALSYM CLSID_DirectMusicPatternTrack}
  4633.   CLSID_DirectMusicScript: TGUID = '{810b5013-e88d-11d2-8bc1-00600893b1b6}'; (* {810B5013-E88D-11d2-8BC1-00600893B1B6} *)
  4634.   {$EXTERNALSYM CLSID_DirectMusicScript}
  4635.   CLSID_DirectMusicContainer: TGUID = '{9301e380-1f22-11d3-8226-d2fa76255d47}';
  4636.   {$EXTERNALSYM CLSID_DirectMusicContainer}
  4637.   CLSID_DirectSoundWave: TGUID = '{8a667154-f9cb-11d2-ad8a-0060b0575abc}';
  4638.   {$EXTERNALSYM CLSID_DirectSoundWave}
  4639.   CLSID_DirectMusicAudioPathConfig: TGUID = '{ee0b9ca0-a81e-11d3-9bd1-0080c7150a74}';
  4640.   {$EXTERNALSYM CLSID_DirectMusicAudioPathConfig}
  4641.  
  4642.   (* Special GUID for all object types. This is used by the loader. *)
  4643.   GUID_DirectMusicAllTypes: TGUID = '{d2ac2893-b39b-11d1-8704-00600893b1bd}';
  4644.   {$EXTERNALSYM GUID_DirectMusicAllTypes}
  4645.  
  4646.   (* Notification guids *)
  4647.   GUID_NOTIFICATION_SEGMENT: TGUID = '{d2ac2899-b39b-11d1-8704-00600893b1bd}';
  4648.   {$EXTERNALSYM GUID_NOTIFICATION_SEGMENT}
  4649.   GUID_NOTIFICATION_PERFORMANCE: TGUID = '{81f75bc5-4e5d-11d2-bcc7-00a0c922e6eb}';
  4650.   {$EXTERNALSYM GUID_NOTIFICATION_PERFORMANCE}
  4651.   GUID_NOTIFICATION_MEASUREANDBEAT: TGUID = '{d2ac289a-b39b-11d1-8704-00600893b1bd}';
  4652.   {$EXTERNALSYM GUID_NOTIFICATION_MEASUREANDBEAT}
  4653.   GUID_NOTIFICATION_CHORD: TGUID = '{d2ac289b-b39b-11d1-8704-00600893b1bd}';
  4654.   {$EXTERNALSYM GUID_NOTIFICATION_CHORD}
  4655.   GUID_NOTIFICATION_COMMAND: TGUID = '{d2ac289c-b39b-11d1-8704-00600893b1bd}';
  4656.   {$EXTERNALSYM GUID_NOTIFICATION_COMMAND}
  4657.   GUID_NOTIFICATION_RECOMPOSE: TGUID = '{d348372b-945b-45ae-a522-450f125b84a5}';
  4658.   {$EXTERNALSYM GUID_NOTIFICATION_RECOMPOSE}
  4659.  
  4660.   (* Track param type guids *)
  4661.   (* Use to get/set a DMUS_COMMAND_PARAM param in the Command track *)
  4662.   GUID_CommandParam: TGUID = '{d2ac289d-b39b-11d1-8704-00600893b1bd}';
  4663.   {$EXTERNALSYM GUID_CommandParam}
  4664.  
  4665.   (* Use to get a DMUS_COMMAND_PARAM_2 param in the Command track *)
  4666.   GUID_CommandParam2: TGUID = '{28f97ef7-9538-11d2-97a9-00c04fa36e58}';
  4667.   {$EXTERNALSYM GUID_CommandParam2}
  4668.  
  4669.   (* Use to get/set a DMUS_COMMAND_PARAM_2 param to be used as the command following all commands in
  4670.   the Command track (this information can't be saved) *)
  4671.   GUID_CommandParamNext: TGUID = '{472afe7a-281b-11d3-817d-00c04fa36e58}';
  4672.   {$EXTERNALSYM GUID_CommandParamNext}
  4673.  
  4674.   (* Use to get/set a DMUS_CHORD_PARAM param in the Chord track *)
  4675.   GUID_ChordParam: TGUID = '{d2ac289e-b39b-11d1-8704-00600893b1bd}';
  4676.   {$EXTERNALSYM GUID_ChordParam}
  4677.  
  4678.   (* Use to get a DMUS_RHYTHM_PARAM param in the Chord track *)
  4679.   GUID_RhythmParam: TGUID = '{d2ac289f-b39b-11d1-8704-00600893b1bd}';
  4680.   {$EXTERNALSYM GUID_RhythmParam}
  4681.  
  4682.   (* Use to get/set an IDirectMusicStyle param in the Style track *)
  4683.   GUID_IDirectMusicStyle: TGUID = '{d2ac28a1-b39b-11d1-8704-00600893b1bd}';
  4684.   {$EXTERNALSYM GUID_IDirectMusicStyle}
  4685.  
  4686.   (* Use to get a DMUS_TIMESIGNATURE param in the Style and TimeSig tracks *)
  4687.   GUID_TimeSignature: TGUID = '{d2ac28a4-b39b-11d1-8704-00600893b1bd}';
  4688.   {$EXTERNALSYM GUID_TimeSignature}
  4689.  
  4690.   (* Use to get/set a DMUS_TEMPO_PARAM param in the Tempo track *)
  4691.   GUID_TempoParam: TGUID = '{d2ac28a5-b39b-11d1-8704-00600893b1bd}';
  4692.   {$EXTERNALSYM GUID_TempoParam}
  4693.  
  4694.   (* Use to get the next valid point in a segment at which it may start *)
  4695.   GUID_Valid_Start_Time: TGUID = '{7f6b1760-1fdb-11d3-8226-444553540000}';
  4696.   {$EXTERNALSYM GUID_Valid_Start_Time}
  4697.  
  4698.   (* Use to get the next point in the currently playing primary segment at which a new segment may start *)
  4699.   GUID_Play_Marker: TGUID = '{d8761a41-801a-11d3-9bd1-daf7e1c3d834}';
  4700.   {$EXTERNALSYM GUID_Play_Marker}
  4701.  
  4702.   (* Use to get (GetParam) or add (SetParam) bands in the Band track *)
  4703.   GUID_BandParam: TGUID = '{02bb1938-cb8b-11d2-8bb9-00600893b1b6}';
  4704.   {$EXTERNALSYM GUID_BandParam}
  4705.  
  4706. type
  4707.   _DMUS_BAND_PARAM = packed record
  4708.     mtTimePhysical:  MUSIC_TIME; // Note: If this is a clock-time track, then this field is interpreted in the track's internal time format, which is the number of milliseconds after the beginning of playback.
  4709.     pBand: IDirectMusicBand;
  4710.   end;
  4711.   {$EXTERNALSYM _DMUS_BAND_PARAM}
  4712.   DMUS_BAND_PARAM = _DMUS_BAND_PARAM;
  4713.   {$EXTERNALSYM DMUS_BAND_PARAM}
  4714.   TDMusBandParam = _DMUS_BAND_PARAM;
  4715.   PDMusBandParam = ^TDMusBandParam;
  4716.  
  4717. const
  4718.   (* Obsolete -- doesn't distinguish physical and logical time.  Use GUID_BandParam instead. *)
  4719.   GUID_IDirectMusicBand: TGUID = '{d2ac28ac-b39b-11d1-8704-00600893b1bd}';
  4720.   {$EXTERNALSYM GUID_IDirectMusicBand}
  4721.  
  4722.   (* Use to get/set an IDirectMusicChordMap param in the ChordMap track *)
  4723.   GUID_IDirectMusicChordMap: TGUID = '{d2ac28ad-b39b-11d1-8704-00600893b1bd}';
  4724.   {$EXTERNALSYM GUID_IDirectMusicChordMap}
  4725.  
  4726.   (* Use to get/set a DMUS_MUTE_PARAM param in the Mute track *)
  4727.   GUID_MuteParam: TGUID = '{d2ac28af-b39b-11d1-8704-00600893b1bd}';
  4728.   {$EXTERNALSYM GUID_MuteParam}
  4729.  
  4730.   (* These guids are used in IDirectMusicSegment::SetParam to tell the band track to perform various actions.
  4731.      Some of these guids (where noted) also apply to wave tracks.
  4732.    *)
  4733.   (* Download bands/waves for the IDirectMusicSegment *)
  4734.   GUID_Download: TGUID = '{d2ac28a7-b39b-11d1-8704-00600893b1bd}';
  4735.   {$EXTERNALSYM GUID_Download}
  4736.  
  4737.   (* Unload bands/waves for the IDirectMusicSegment *)
  4738.   GUID_Unload: TGUID = '{d2ac28a8-b39b-11d1-8704-00600893b1bd}';
  4739.   {$EXTERNALSYM GUID_Unload}
  4740.  
  4741.   (* Connect segment's bands to an IDirectMusicCollection *)
  4742.   GUID_ConnectToDLSCollection: TGUID = '{1db1ae6b-e92e-11d1-a8c5-00c04fa3726e}';
  4743.   {$EXTERNALSYM GUID_ConnectToDLSCollection}
  4744.  
  4745.   (* Enable/disable autodownloading of bands/waves *)
  4746.   GUID_Enable_Auto_Download: TGUID = '{d2ac28a9-b39b-11d1-8704-00600893b1bd}';
  4747.   {$EXTERNALSYM GUID_Enable_Auto_Download}
  4748.   GUID_Disable_Auto_Download: TGUID = '{d2ac28aa-b39b-11d1-8704-00600893b1bd}';
  4749.   {$EXTERNALSYM GUID_Disable_Auto_Download}
  4750.  
  4751.   (* Clear all bands *)
  4752.   GUID_Clear_All_Bands: TGUID = '{d2ac28ab-b39b-11d1-8704-00600893b1bd}';
  4753.   {$EXTERNALSYM GUID_Clear_All_Bands}
  4754.  
  4755.   (* Set segment to manage all program changes, bank selects, etc. for simple playback of a standard MIDI file *)
  4756.   GUID_StandardMIDIFile: TGUID = '{06621075-e92e-11d1-a8c5-00c04fa3726e}';
  4757.   {$EXTERNALSYM GUID_StandardMIDIFile}
  4758.   (* For compatibility with beta releases... *)
  4759.   GUID_IgnoreBankSelectForGM: TGUID = '{06621075-e92e-11d1-a8c5-00c04fa3726e}'; // = GUID_StandardMIDIFile;
  4760.   {$EXTERNALSYM GUID_IgnoreBankSelectForGM}
  4761.  
  4762.   (* Disable/enable param guids. Use these in SetParam calls to disable or enable sending
  4763.    * specific PMsg types.
  4764.    *)
  4765.   GUID_DisableTimeSig: TGUID = '{45fc707b-1db4-11d2-bcac-00a0c922e6eb}';
  4766.   {$EXTERNALSYM GUID_DisableTimeSig}
  4767.   GUID_EnableTimeSig: TGUID = '{45fc707c-1db4-11d2-bcac-00a0c922e6eb}';
  4768.   {$EXTERNALSYM GUID_EnableTimeSig}
  4769.   GUID_DisableTempo: TGUID = '{45fc707d-1db4-11d2-bcac-00a0c922e6eb}';
  4770.   {$EXTERNALSYM GUID_DisableTempo}
  4771.   GUID_EnableTempo: TGUID = '{45fc707e-1db4-11d2-bcac-00a0c922e6eb}';
  4772.   {$EXTERNALSYM GUID_EnableTempo}
  4773.  
  4774.   (* Used in SetParam calls for pattern-based tracks.  A nonzero value seeds the random number
  4775.   generator for variation selection; a value of zero reverts to the default behavior of
  4776.   getting the seed from the system clock.
  4777.   *)
  4778.   GUID_SeedVariations: TGUID = '{65b76fa5-ff37-11d2-814e-00c04fa36e58}';
  4779.   {$EXTERNALSYM GUID_SeedVariations}
  4780.  
  4781.   (* Used to get the variations currently in effect across PChannels *)
  4782.   GUID_Variations: TGUID = '{11f72cce-26e6-4ecd-af2e-d668e66707d8}';
  4783.   {$EXTERNALSYM GUID_Variations}
  4784.  
  4785. type
  4786.   PDMusVariationsParam = ^TDMusVariationsParam;
  4787.   _DMUS_VARIATIONS_PARAM = packed record
  4788.     dwPChannelsUsed: DWORD;  // number of PChannels in use
  4789.     padwPChannels: PDWORD;   // array of PChannels in use
  4790.     padwVariations: PDWORD;  // array of variations in effect for each PChannel
  4791.   end;
  4792.   {$EXTERNALSYM _DMUS_VARIATIONS_PARAM}
  4793.   DMUS_VARIATIONS_PARAM = _DMUS_VARIATIONS_PARAM;
  4794.   {$EXTERNALSYM DMUS_VARIATIONS_PARAM}
  4795.   TDMusVariationsParam = _DMUS_VARIATIONS_PARAM;
  4796.  
  4797. const  
  4798.   (* Download bands/waves for the IDirectMusicSegment, passed an IDirectMusicAudioPath instead of an IDirectMusicPerformance *)
  4799.   GUID_DownloadToAudioPath: TGUID = '{9f2c0341-c5c4-11d3-9bd1-444553540000}';
  4800.   {$EXTERNALSYM GUID_DownloadToAudioPath}
  4801.  
  4802.   (* Unload bands/waves for the IDirectMusicSegment, passed an IDirectMusicAudioPath instead of an IDirectMusicPerformance *)
  4803.   GUID_UnloadFromAudioPath: TGUID = '{9f2c0342-c5c4-11d3-9bd1-444553540000}';
  4804.   {$EXTERNALSYM GUID_UnloadFromAudioPath}
  4805.  
  4806.  
  4807.   (* Global data guids *)
  4808.   GUID_PerfMasterTempo: TGUID = '{d2ac28b0-b39b-11d1-8704-00600893b1bd}';
  4809.   {$EXTERNALSYM GUID_PerfMasterTempo}
  4810.   GUID_PerfMasterVolume: TGUID = '{d2ac28b1-b39b-11d1-8704-00600893b1bd}';
  4811.   {$EXTERNALSYM GUID_PerfMasterVolume}
  4812.   GUID_PerfMasterGrooveLevel: TGUID = '{d2ac28b2-b39b-11d1-8704-00600893b1bd}';
  4813.   {$EXTERNALSYM GUID_PerfMasterGrooveLevel}
  4814.   GUID_PerfAutoDownload: TGUID = '{fb09565b-3631-11d2-bcb8-00a0c922e6eb}';
  4815.   {$EXTERNALSYM GUID_PerfAutoDownload}
  4816.  
  4817.   (* GUID for default GM/GS dls collection. *)
  4818.   GUID_DefaultGMCollection: TGUID = '{f17e8673-c3b4-11d1-870b-00600893b1bd}';
  4819.   {$EXTERNALSYM GUID_DefaultGMCollection}
  4820.  
  4821.   (* GUID to define default synth, placed in AudioPath configuration file. *)
  4822.   GUID_Synth_Default: TGUID = '{26bb9432-45fe-48d3-a375-2472c5e3e786}';
  4823.   {$EXTERNALSYM GUID_Synth_Default}
  4824.  
  4825.   (* GUIDs to define default buffer configurations to place in AudioPath configuration file. *)
  4826.   GUID_Buffer_Reverb: TGUID = '{186cc541-db29-11d3-9bd1-0080c7150a74}';
  4827.   {$EXTERNALSYM GUID_Buffer_Reverb}
  4828.   GUID_Buffer_EnvReverb: TGUID = '{186cc542-db29-11d3-9bd1-0080c7150a74}';
  4829.   {$EXTERNALSYM GUID_Buffer_EnvReverb}
  4830.   GUID_Buffer_Stereo: TGUID = '{186cc545-db29-11d3-9bd1-0080c7150a74}';
  4831.   {$EXTERNALSYM GUID_Buffer_Stereo}
  4832.   GUID_Buffer_3D_Dry: TGUID = '{186cc546-db29-11d3-9bd1-0080c7150a74}';
  4833.   {$EXTERNALSYM GUID_Buffer_3D_Dry}
  4834.   GUID_Buffer_Mono: TGUID = '{186cc547-db29-11d3-9bd1-0080c7150a74}';
  4835.   {$EXTERNALSYM GUID_Buffer_Mono}
  4836.  
  4837. type
  4838.   (* IID's *)
  4839.   IID_IDirectMusicLoader = IDirectMusicLoader;
  4840.   {$EXTERNALSYM IID_IDirectMusicLoader}
  4841.   IID_IDirectMusicGetLoader = IDirectMusicGetLoader;
  4842.   {$EXTERNALSYM IID_IDirectMusicGetLoader}
  4843.   IID_IDirectMusicObject = IDirectMusicObject;
  4844.   {$EXTERNALSYM IID_IDirectMusicObject}
  4845.   IID_IDirectMusicSegment = IDirectMusicSegment;
  4846.   {$EXTERNALSYM IID_IDirectMusicSegment}
  4847.   IID_IDirectMusicSegmentState = IDirectMusicSegmentState;
  4848.   {$EXTERNALSYM IID_IDirectMusicSegmentState}
  4849.   IID_IDirectMusicPerformance = IDirectMusicPerformance;
  4850.   {$EXTERNALSYM IID_IDirectMusicPerformance}
  4851.   IID_IDirectMusicGraph = IDirectMusicGraph;
  4852.   {$EXTERNALSYM IID_IDirectMusicGraph}
  4853.   IID_IDirectMusicStyle = IDirectMusicStyle;
  4854.   {$EXTERNALSYM IID_IDirectMusicStyle}
  4855.   IID_IDirectMusicChordMap = IDirectMusicChordMap;
  4856.   {$EXTERNALSYM IID_IDirectMusicChordMap}
  4857.   IID_IDirectMusicComposer = IDirectMusicComposer;
  4858.   {$EXTERNALSYM IID_IDirectMusicComposer}
  4859.   IID_IDirectMusicBand = IDirectMusicBand;
  4860.   {$EXTERNALSYM IID_IDirectMusicBand}
  4861.  
  4862. const
  4863.   (* Alternate interface IDs, available in DX7 release and after. *)
  4864.   IID_IDirectMusicPerformance2: TGUID = '{6fc2cae0-bc78-11d2-afa6-00aa0024d8b6}';
  4865.   {$EXTERNALSYM IID_IDirectMusicPerformance2}
  4866.   IID_IDirectMusicSegment2: TGUID = '{d38894d1-c052-11d2-872f-00600893b1bd}';
  4867.   {$EXTERNALSYM IID_IDirectMusicSegment2}
  4868.  
  4869. type
  4870.   (* Interface IDs for DX8 *)
  4871.   (* changed interfaces (GUID only) *)
  4872.   IID_IDirectMusicLoader8 = IDirectMusicLoader8;
  4873.   {$EXTERNALSYM IID_IDirectMusicLoader8}
  4874.   IID_IDirectMusicPerformance8 = IDirectMusicPerformance8;
  4875.   {$EXTERNALSYM IID_IDirectMusicPerformance8}
  4876.   IID_IDirectMusicSegment8 = IDirectMusicSegment8;
  4877.   {$EXTERNALSYM IID_IDirectMusicSegment8}
  4878.   IID_IDirectMusicSegmentState8 = IDirectMusicSegmentState8;
  4879.   {$EXTERNALSYM IID_IDirectMusicSegmentState8}
  4880.   IID_IDirectMusicStyle8 = IDirectMusicStyle8;
  4881.   {$EXTERNALSYM IID_IDirectMusicStyle8}
  4882.  
  4883.   (* new interfaces (GUID + alias) *)
  4884.   IID_IDirectMusicPatternTrack = IDirectMusicPatternTrack;
  4885.   {$EXTERNALSYM IID_IDirectMusicPatternTrack}
  4886.   IID_IDirectMusicScript = IDirectMusicScript; (* {2252373A-5814-489b-8209-31FEDEBAF137} *)
  4887.   {$EXTERNALSYM IID_IDirectMusicScript}
  4888.   IID_IDirectMusicContainer = IDirectMusicContainer;
  4889.   {$EXTERNALSYM IID_IDirectMusicContainer}
  4890.   IID_IDirectMusicAudioPath = IDirectMusicAudioPath;
  4891.   {$EXTERNALSYM IID_IDirectMusicAudioPath}
  4892.  
  4893.   IID_IDirectMusicPatternTrack8 = IID_IDirectMusicPatternTrack;
  4894.   {$EXTERNALSYM IID_IDirectMusicPatternTrack8}
  4895.   IID_IDirectMusicScript8 = IID_IDirectMusicScript;
  4896.   {$EXTERNALSYM IID_IDirectMusicScript8}
  4897.   IID_IDirectMusicContainer8 = IID_IDirectMusicContainer;
  4898.   {$EXTERNALSYM IID_IDirectMusicContainer8}
  4899.   IID_IDirectMusicAudioPath8 = IID_IDirectMusicAudioPath;
  4900.   {$EXTERNALSYM IID_IDirectMusicAudioPath8}
  4901.   (* unchanged interfaces (alias only) *)
  4902.   IID_IDirectMusicGetLoader8 = IID_IDirectMusicGetLoader;
  4903.   {$EXTERNALSYM IID_IDirectMusicGetLoader8}
  4904.   IID_IDirectMusicChordMap8 = IID_IDirectMusicChordMap;
  4905.   {$EXTERNALSYM IID_IDirectMusicChordMap8}
  4906.   IID_IDirectMusicGraph8 = IID_IDirectMusicGraph;
  4907.   {$EXTERNALSYM IID_IDirectMusicGraph8}
  4908.   IID_IDirectMusicBand8 = IID_IDirectMusicBand;
  4909.   {$EXTERNALSYM IID_IDirectMusicBand8}
  4910.   IID_IDirectMusicObject8 = IID_IDirectMusicObject;
  4911.   {$EXTERNALSYM IID_IDirectMusicObject8}
  4912.   IID_IDirectMusicComposer8 = IID_IDirectMusicComposer;
  4913.   {$EXTERNALSYM IID_IDirectMusicComposer8}
  4914.  
  4915.  
  4916.  
  4917.  
  4918.  
  4919. (************************************************************************
  4920. *                                                                       *
  4921. *   dmusicf.h -- This module defines the DirectMusic file formats       *
  4922. *                                                                       *
  4923. *   Copyright (c) Microsoft Corporation.  All rights reserved.          *
  4924. *                                                                       *
  4925. ************************************************************************)
  4926.  
  4927. const
  4928.   // Common chunks
  4929.  
  4930.   DMUS_FOURCC_GUID_CHUNK = DWORD(Byte('g') or (Byte('u') shl 8) or (Byte('i') shl 16) or (Byte('d') shl 24)); // mmioFOURCC('g','u','i','d')
  4931.   {$EXTERNALSYM DMUS_FOURCC_GUID_CHUNK}
  4932.   DMUS_FOURCC_INFO_LIST  = DWORD(Byte('I') or (Byte('N') shl 8) or (Byte('F') shl 16) or (Byte('O') shl 24)); // mmioFOURCC('I','N','F','O')
  4933.   {$EXTERNALSYM DMUS_FOURCC_INFO_LIST}
  4934.   DMUS_FOURCC_UNFO_LIST  = DWORD(Byte('U') or (Byte('N') shl 8) or (Byte('F') shl 16) or (Byte('O') shl 24)); // mmioFOURCC('U','N','F','O')
  4935.   {$EXTERNALSYM DMUS_FOURCC_UNFO_LIST}
  4936.   DMUS_FOURCC_UNAM_CHUNK = DWORD(Byte('U') or (Byte('N') shl 8) or (Byte('A') shl 16) or (Byte('M') shl 24)); // mmioFOURCC('U','N','A','M')
  4937.   {$EXTERNALSYM DMUS_FOURCC_UNAM_CHUNK}
  4938.   DMUS_FOURCC_UART_CHUNK = DWORD(Byte('U') or (Byte('A') shl 8) or (Byte('R') shl 16) or (Byte('T') shl 24)); // mmioFOURCC('U','A','R','T')
  4939.   {$EXTERNALSYM DMUS_FOURCC_UART_CHUNK}
  4940.   DMUS_FOURCC_UCOP_CHUNK = DWORD(Byte('U') or (Byte('C') shl 8) or (Byte('O') shl 16) or (Byte('P') shl 24)); // mmioFOURCC('U','C','O','P')
  4941.   {$EXTERNALSYM DMUS_FOURCC_UCOP_CHUNK}
  4942.   DMUS_FOURCC_USBJ_CHUNK = DWORD(Byte('U') or (Byte('S') shl 8) or (Byte('B') shl 16) or (Byte('J') shl 24)); // mmioFOURCC('U','S','B','J')
  4943.   {$EXTERNALSYM DMUS_FOURCC_USBJ_CHUNK}
  4944.   DMUS_FOURCC_UCMT_CHUNK = DWORD(Byte('U') or (Byte('C') shl 8) or (Byte('M') shl 16) or (Byte('T') shl 24)); // mmioFOURCC('U','C','M','T')
  4945.   {$EXTERNALSYM DMUS_FOURCC_UCMT_CHUNK}
  4946.   DMUS_FOURCC_CATEGORY_CHUNK = DWORD(Byte('c') or (Byte('a') shl 8) or (Byte('t') shl 16) or (Byte('g') shl 24)); // mmioFOURCC('c','a','t','g')
  4947.   {$EXTERNALSYM DMUS_FOURCC_CATEGORY_CHUNK}
  4948.   DMUS_FOURCC_VERSION_CHUNK  = DWORD(Byte('v') or (Byte('e') shl 8) or (Byte('r') shl 16) or (Byte('s') shl 24)); // mmioFOURCC('v','e','r','s')
  4949.   {$EXTERNALSYM DMUS_FOURCC_VERSION_CHUNK}
  4950.  
  4951. type
  4952.   // The following structures are used by the Tracks, and are the packed structures
  4953.   // that are passed to the Tracks inside the IStream.
  4954.  
  4955.  
  4956.   PDMusIoSeqItem = ^TDMusIoSeqItem;
  4957.   _DMUS_IO_SEQ_ITEM = packed record
  4958.     mtTime: TMusicTime;
  4959.     mtDuration: TMusicTime;
  4960.     dwPChannel: DWORD;
  4961.     nOffset: Smallint;
  4962.     bStatus: Byte;
  4963.     bByte1: Byte;
  4964.     bByte2: Byte;
  4965.   end;
  4966.   {$EXTERNALSYM _DMUS_IO_SEQ_ITEM}
  4967.   DMUS_IO_SEQ_ITEM = _DMUS_IO_SEQ_ITEM;
  4968.   {$EXTERNALSYM DMUS_IO_SEQ_ITEM}
  4969.   TDMusIoSeqItem = _DMUS_IO_SEQ_ITEM;
  4970.  
  4971.  
  4972.   PDMusIoCurveItem = ^TDMusIoCurveItem;
  4973.   _DMUS_IO_CURVE_ITEM = packed record
  4974.     mtStart: TMusicTime;
  4975.     mtDuration: TMusicTime;
  4976.     mtResetDuration: TMusicTime;
  4977.     dwPChannel: DWORD;
  4978.     nOffset: Smallint;
  4979.     nStartValue: Smallint;
  4980.     nEndValue: Smallint;
  4981.     nResetValue: Smallint;
  4982.     bType: Byte;
  4983.     bCurveShape: Byte;
  4984.     bCCData: Byte;
  4985.     bFlags: Byte;
  4986.     // Following was added for DX8.
  4987.     wParamType: Word;      // RPN or NRPN parameter number.
  4988.     wMergeIndex: Word;     // Allows multiple parameters to be merged (pitchbend, volume, and expression.)
  4989.   end;
  4990.   {$EXTERNALSYM _DMUS_IO_CURVE_ITEM}
  4991.   DMUS_IO_CURVE_ITEM = _DMUS_IO_CURVE_ITEM;
  4992.   {$EXTERNALSYM DMUS_IO_CURVE_ITEM}
  4993.   TDMusIoCurveItem = _DMUS_IO_CURVE_ITEM;
  4994.  
  4995.  
  4996.   PDMusIoTempoItem = ^TDMusIoTempoItem;
  4997.   _DMUS_IO_TEMPO_ITEM = packed record
  4998.     lTime: TMusicTime;
  4999.     dblTempo: Double;
  5000.   end;
  5001.   {$EXTERNALSYM _DMUS_IO_TEMPO_ITEM}
  5002.   DMUS_IO_TEMPO_ITEM = _DMUS_IO_TEMPO_ITEM;
  5003.   {$EXTERNALSYM DMUS_IO_TEMPO_ITEM}
  5004.   TDMusIoTempoItem = _DMUS_IO_TEMPO_ITEM;
  5005.  
  5006.  
  5007.   PDMusIoSysExItem = ^TDMusIoSysExItem;
  5008.   _DMUS_IO_SYSEX_ITEM = packed record
  5009.     mtTime: TMusicTime;
  5010.     dwPChannel: DWORD;
  5011.     dwSysExLength: DWORD;
  5012.   end;
  5013.   {$EXTERNALSYM _DMUS_IO_SYSEX_ITEM}
  5014.   DMUS_IO_SYSEX_ITEM = _DMUS_IO_SYSEX_ITEM;
  5015.   {$EXTERNALSYM DMUS_IO_SYSEX_ITEM}
  5016.   TDMusIoSysExItem = _DMUS_IO_SYSEX_ITEM;
  5017.  
  5018.   DMUS_CHORD_PARAM = DMUS_CHORD_KEY; (* DMUS_CHORD_KEY defined in dmusici.h *)
  5019.   {$EXTERNALSYM DMUS_CHORD_PARAM}
  5020.   TDMusChordParam = DMUS_CHORD_PARAM;
  5021.   PDMusChordParam = ^TDMusChordParam;
  5022.  
  5023.   _DMUS_RHYTHM_PARAM = packed record
  5024.     TimeSig:  TDMusTimeSignature;
  5025.     dwRhythmPattern: DWORD;
  5026.   end;
  5027.   {$EXTERNALSYM _DMUS_RHYTHM_PARAM}
  5028.   DMUS_RHYTHM_PARAM = _DMUS_RHYTHM_PARAM;
  5029.   {$EXTERNALSYM DMUS_RHYTHM_PARAM}
  5030.   TDMusRhythmParam = _DMUS_RHYTHM_PARAM;
  5031.   PDMusRhythmParam = ^TDMusRhythmParam;
  5032.  
  5033.   PDMusTempoParam = ^TDMusTempoParam;
  5034.   _DMUS_TEMPO_PARAM = packed record
  5035.     mtTime:  TMusicTime;
  5036.     dblTempo: Double;
  5037.   end;
  5038.   {$EXTERNALSYM _DMUS_TEMPO_PARAM}
  5039.   DMUS_TEMPO_PARAM = _DMUS_TEMPO_PARAM;
  5040.   {$EXTERNALSYM DMUS_TEMPO_PARAM}
  5041.   TDMusTempoParam = _DMUS_TEMPO_PARAM;
  5042.  
  5043.   PDMusMuteParam = ^TDMusMuteParam;
  5044.   _DMUS_MUTE_PARAM = packed record
  5045.     dwPChannel: DWORD;
  5046.     dwPChannelMap: DWORD;
  5047.     fMute: BOOL;
  5048.   end;
  5049.   {$EXTERNALSYM _DMUS_MUTE_PARAM}
  5050.   DMUS_MUTE_PARAM = _DMUS_MUTE_PARAM;
  5051.   {$EXTERNALSYM DMUS_MUTE_PARAM}
  5052.   TDMusMuteParam = _DMUS_MUTE_PARAM;
  5053.  
  5054. const
  5055.   (* Style chunks *)
  5056.  
  5057.   DMUS_FOURCC_STYLE_FORM          = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('S') shl 16) or (Byte('T') shl 24)); // mmioFOURCC('D','M','S','T')
  5058.   {$EXTERNALSYM DMUS_FOURCC_STYLE_FORM}
  5059.   DMUS_FOURCC_STYLE_CHUNK         = DWORD(Byte('s') or (Byte('t') shl 8) or (Byte('y') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('s','t','y','h')
  5060.   {$EXTERNALSYM DMUS_FOURCC_STYLE_CHUNK}
  5061.   DMUS_FOURCC_PART_LIST           = DWORD(Byte('p') or (Byte('a') shl 8) or (Byte('r') shl 16) or (Byte('t') shl 24)); // mmioFOURCC('p','a','r','t')
  5062.   {$EXTERNALSYM DMUS_FOURCC_PART_LIST}
  5063.   DMUS_FOURCC_PART_CHUNK          = DWORD(Byte('p') or (Byte('r') shl 8) or (Byte('t') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('p','r','t','h')
  5064.   {$EXTERNALSYM DMUS_FOURCC_PART_CHUNK}
  5065.   DMUS_FOURCC_NOTE_CHUNK          = DWORD(Byte('n') or (Byte('o') shl 8) or (Byte('t') shl 16) or (Byte('e') shl 24)); // mmioFOURCC('n','o','t','e')
  5066.   {$EXTERNALSYM DMUS_FOURCC_NOTE_CHUNK}
  5067.   DMUS_FOURCC_CURVE_CHUNK         = DWORD(Byte('c') or (Byte('r') shl 8) or (Byte('v') shl 16) or (Byte('e') shl 24)); // mmioFOURCC('c','r','v','e')
  5068.   {$EXTERNALSYM DMUS_FOURCC_CURVE_CHUNK}
  5069.   DMUS_FOURCC_MARKER_CHUNK        = DWORD(Byte('m') or (Byte('r') shl 8) or (Byte('k') shl 16) or (Byte('r') shl 24)); // mmioFOURCC('m','r','k','r')
  5070.   {$EXTERNALSYM DMUS_FOURCC_MARKER_CHUNK}
  5071.   DMUS_FOURCC_RESOLUTION_CHUNK    = DWORD(Byte('r') or (Byte('s') shl 8) or (Byte('l') shl 16) or (Byte('n') shl 24)); // mmioFOURCC('r','s','l','n')
  5072.   {$EXTERNALSYM DMUS_FOURCC_RESOLUTION_CHUNK}
  5073.   DMUS_FOURCC_ANTICIPATION_CHUNK  = DWORD(Byte('a') or (Byte('n') shl 8) or (Byte('p') shl 16) or (Byte('n') shl 24)); // mmioFOURCC('a','n','p','n')
  5074.   {$EXTERNALSYM DMUS_FOURCC_ANTICIPATION_CHUNK}
  5075.   DMUS_FOURCC_PATTERN_LIST        = DWORD(Byte('p') or (Byte('t') shl 8) or (Byte('t') shl 16) or (Byte('n') shl 24)); // mmioFOURCC('p','t','t','n')
  5076.   {$EXTERNALSYM DMUS_FOURCC_PATTERN_LIST}
  5077.   DMUS_FOURCC_PATTERN_CHUNK       = DWORD(Byte('p') or (Byte('t') shl 8) or (Byte('n') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('p','t','n','h')
  5078.   {$EXTERNALSYM DMUS_FOURCC_PATTERN_CHUNK}
  5079.   DMUS_FOURCC_RHYTHM_CHUNK        = DWORD(Byte('r') or (Byte('h') shl 8) or (Byte('t') shl 16) or (Byte('m') shl 24)); // mmioFOURCC('r','h','t','m')
  5080.   {$EXTERNALSYM DMUS_FOURCC_RHYTHM_CHUNK}
  5081.   DMUS_FOURCC_PARTREF_LIST        = DWORD(Byte('p') or (Byte('r') shl 8) or (Byte('e') shl 16) or (Byte('f') shl 24)); // mmioFOURCC('p','r','e','f')
  5082.   {$EXTERNALSYM DMUS_FOURCC_PARTREF_LIST}
  5083.   DMUS_FOURCC_PARTREF_CHUNK       = DWORD(Byte('p') or (Byte('r') shl 8) or (Byte('f') shl 16) or (Byte('c') shl 24)); // mmioFOURCC('p','r','f','c')
  5084.   {$EXTERNALSYM DMUS_FOURCC_PARTREF_CHUNK}
  5085.   DMUS_FOURCC_STYLE_PERS_REF_LIST = DWORD(Byte('p') or (Byte('r') shl 8) or (Byte('r') shl 16) or (Byte('f') shl 24)); // mmioFOURCC('p','r','r','f')
  5086.   {$EXTERNALSYM DMUS_FOURCC_STYLE_PERS_REF_LIST}
  5087.   DMUS_FOURCC_MOTIFSETTINGS_CHUNK = DWORD(Byte('m') or (Byte('t') shl 8) or (Byte('f') shl 16) or (Byte('s') shl 24)); // mmioFOURCC('m','t','f','s')
  5088.   {$EXTERNALSYM DMUS_FOURCC_MOTIFSETTINGS_CHUNK}
  5089.  
  5090.   (* Flags used by variations: these make up the DWORDs in dwVariationChoices.               *)
  5091.  
  5092.   (* These flags determine the types of chords supported by a given variation in DirectMusic *)
  5093.   (* mode.  The first seven flags (bits 1-7) are set if the variation supports major chords  *)
  5094.   (* rooted in scale positions, so, e.g., if bits 1, 2, and 4 are set, the variation         *)
  5095.   (* supports major chords rooted in the tonic, second, and fourth scale positions.  The     *)
  5096.   (* next seven flags serve the same purpose, but for minor chords, and the following seven  *)
  5097.   (* flags serve the same purpose for chords that are not major or minor (e.g., SUS 4        *)
  5098.   (* chords).  Bits 22, 23, and 24 are set if the variation supports chords rooted in the    *)
  5099.   (* scale, chords rooted sharp of scale tones, and chords rooted flat of scale tones,       *)
  5100.   (* respectively.  For example, to support a C# minor chord in the scale of C Major,        *)
  5101.   (* bits 8 (for tonic minor) and 24 (for sharp) need to be set.  Bits 25, 26, an 27 handle  *)
  5102.   (* chords that are triads, 6th or 7th chords, and chords with extensions, respectively.    *)
  5103.   (* bits 28 and 29 handle chords that are followed by tonic and dominant chords,            *)
  5104.   (* respectively.                                                                           *)
  5105.   DMUS_VARIATIONF_MAJOR        = $0000007F; (* Seven positions in the scale - major chords. *)
  5106.   {$EXTERNALSYM DMUS_VARIATIONF_MAJOR}
  5107.   DMUS_VARIATIONF_MINOR        = $00003F80; (* Seven positions in the scale - minor chords. *)
  5108.   {$EXTERNALSYM DMUS_VARIATIONF_MINOR}
  5109.   DMUS_VARIATIONF_OTHER        = $001FC000; (* Seven positions in the scale - other chords. *)
  5110.   {$EXTERNALSYM DMUS_VARIATIONF_OTHER}
  5111.   DMUS_VARIATIONF_ROOT_SCALE   = $00200000; (* Handles chord roots in the scale. *)
  5112.   {$EXTERNALSYM DMUS_VARIATIONF_ROOT_SCALE}
  5113.   DMUS_VARIATIONF_ROOT_FLAT    = $00400000; (* Handles flat chord roots (based on scale notes). *)
  5114.   {$EXTERNALSYM DMUS_VARIATIONF_ROOT_FLAT}
  5115.   DMUS_VARIATIONF_ROOT_SHARP   = $00800000; (* Handles sharp chord roots (based on scale notes). *)
  5116.   {$EXTERNALSYM DMUS_VARIATIONF_ROOT_SHARP}
  5117.   DMUS_VARIATIONF_TYPE_TRIAD   = $01000000; (* Handles simple chords - triads. *)
  5118.   {$EXTERNALSYM DMUS_VARIATIONF_TYPE_TRIAD}
  5119.   DMUS_VARIATIONF_TYPE_6AND7   = $02000000; (* Handles simple chords - 6 and 7. *)
  5120.   {$EXTERNALSYM DMUS_VARIATIONF_TYPE_6AND7}
  5121.   DMUS_VARIATIONF_TYPE_COMPLEX = $04000000; (* Handles complex chords. *)
  5122.   {$EXTERNALSYM DMUS_VARIATIONF_TYPE_COMPLEX}
  5123.   DMUS_VARIATIONF_DEST_TO1     = $08000000; (* Handles transitions to 1 chord. *)
  5124.   {$EXTERNALSYM DMUS_VARIATIONF_DEST_TO1}
  5125.   DMUS_VARIATIONF_DEST_TO5     = $10000000; (* Handles transitions to 5 chord. *)
  5126.   {$EXTERNALSYM DMUS_VARIATIONF_DEST_TO5}
  5127.   DMUS_VARIATIONF_DEST_OTHER   = $40000000; (* Handles transitions to chords other than 1 . *)
  5128.   {$EXTERNALSYM DMUS_VARIATIONF_DEST_OTHER}
  5129.  
  5130.   (* legacy mask for variation modes *)
  5131.   DMUS_VARIATIONF_MODES        = $E0000000;
  5132.   {$EXTERNALSYM DMUS_VARIATIONF_MODES}
  5133.   (* Bits 29 and 31 of the variation flags are the Mode bits.  If both are 0, it's IMA. *)
  5134.   (* If bit 29 is 1, it's Direct Music. *)
  5135.   DMUS_VARIATIONF_MODES_EX     = ($20000000 or $80000000);
  5136.   {$EXTERNALSYM DMUS_VARIATIONF_MODES_EX}
  5137.   DMUS_VARIATIONF_IMA25_MODE   = $00000000;
  5138.   {$EXTERNALSYM DMUS_VARIATIONF_IMA25_MODE}
  5139.   DMUS_VARIATIONF_DMUS_MODE    = $20000000;
  5140.   {$EXTERNALSYM DMUS_VARIATIONF_DMUS_MODE}
  5141.  
  5142.   (* Set this if the part uses marker events *)
  5143.   DMUS_PARTF_USE_MARKERS       = $1;
  5144.   {$EXTERNALSYM DMUS_PARTF_USE_MARKERS}
  5145.   (* Set this if the part is allowed to switch only on chord-aligned markers *)
  5146.   DMUS_PARTF_ALIGN_CHORDS      = $2;
  5147.   {$EXTERNALSYM DMUS_PARTF_ALIGN_CHORDS}
  5148.  
  5149.   (* These specify if the marker event signals whether to stop a variation or start a
  5150.   pattern/variation (or both), and whether new variations must align with a chord *)
  5151.   DMUS_MARKERF_START            = $1;
  5152.   {$EXTERNALSYM DMUS_MARKERF_START}
  5153.   DMUS_MARKERF_STOP             = $2;
  5154.   {$EXTERNALSYM DMUS_MARKERF_STOP}
  5155.   DMUS_MARKERF_CHORD_ALIGN      = $4;
  5156.   {$EXTERNALSYM DMUS_MARKERF_CHORD_ALIGN}
  5157.  
  5158.   (* if this flag is set, variation settings in a playing pattern-based track's state data will
  5159.   persist in the track after it stops playing *)
  5160.   DMUS_PATTERNF_PERSIST_CONTROL = $1;
  5161.   {$EXTERNALSYM DMUS_PATTERNF_PERSIST_CONTROL}
  5162.  
  5163.  
  5164.   (* These specify possible values for DMUS_IO_PATTERN.wEmbellishment (dx8) *)
  5165.   DMUS_EMBELLISHT_NORMAL          = 0;
  5166.   {$EXTERNALSYM DMUS_EMBELLISHT_NORMAL}
  5167.   DMUS_EMBELLISHT_FILL            = 1;
  5168.   {$EXTERNALSYM DMUS_EMBELLISHT_FILL}
  5169.   DMUS_EMBELLISHT_BREAK           = 2;
  5170.   {$EXTERNALSYM DMUS_EMBELLISHT_BREAK}
  5171.   DMUS_EMBELLISHT_INTRO           = 4;
  5172.   {$EXTERNALSYM DMUS_EMBELLISHT_INTRO}
  5173.   DMUS_EMBELLISHT_END             = 8;
  5174.   {$EXTERNALSYM DMUS_EMBELLISHT_END}
  5175.   DMUS_EMBELLISHT_MOTIF           = 16;
  5176.   {$EXTERNALSYM DMUS_EMBELLISHT_MOTIF}
  5177.   DMUS_EMBELLISHT_ALL             = $FFFF;
  5178.   {$EXTERNALSYM DMUS_EMBELLISHT_ALL}
  5179. type
  5180.   (* These specify possible values for DMUS_IO_PATTERN.wEmbellishment (dx8) *)
  5181.   enumDMUS_EMBELLISHT_TYPES = Word; 
  5182.   DMUS_EMBELLISHT_TYPES = enumDMUS_EMBELLISHT_TYPES;
  5183.   {$EXTERNALSYM DMUS_EMBELLISHT_TYPES}
  5184.   TDMusEmbellishtTypes = DMUS_EMBELLISHT_TYPES;
  5185.  
  5186. {$IFNDEF COMPILER6_UP}
  5187.   Byte2 = Word;
  5188.  
  5189. {$ELSE}{$ALIGN 2}
  5190. {$ENDIF}
  5191.   (* These specify possible values for DMUS_IO_PARTREF.bRandomVariation
  5192.    all but DMUS_VARIATIONT_SEQUENTIAL and DMUS_VARIATIONT_RANDOM are dx8. *)
  5193. {$IFNDEF COMPILER6_UP}{$MINENUMSIZE 2}{$ENDIF}
  5194.   enumDMUS_VARIATIONT_TYPES = (
  5195.     DMUS_VARIATIONT_SEQUENTIAL       {= 0}, (* Play sequential starting with variation 1. *)
  5196.     DMUS_VARIATIONT_RANDOM           {= 1}, (* Play randomly. *)
  5197.     DMUS_VARIATIONT_RANDOM_START     {= 2}, (* Play sequential starting with a random variation. *)
  5198.     DMUS_VARIATIONT_NO_REPEAT        {= 3}, (* Play randomly, but don't play the same variation twice. *)
  5199.     DMUS_VARIATIONT_RANDOM_ROW       {= 4}  (* Play randomly as a row: don't repeat any variation until all have played. *)
  5200.   );
  5201.   {$EXTERNALSYM enumDMUS_VARIATIONT_TYPES}
  5202.   DMUS_VARIATIONT_TYPES = enumDMUS_VARIATIONT_TYPES;
  5203.   {$EXTERNALSYM DMUS_VARIATIONT_TYPES}
  5204.   TDMusVariationtTypes = DMUS_VARIATIONT_TYPES;
  5205.   PDMusVariationtTypes = ^TDMusVariationtTypes;
  5206. {$IFNDEF COMPILER6_UP}{$MINENUMSIZE 1}{$ENDIF}
  5207.  
  5208.  
  5209.   PDMusIoTimesig = ^TDMusIoTimesig;
  5210.   _DMUS_IO_TIMESIG = record
  5211.     (* Time signatures define how many beats per measure, which note receives *)
  5212.     (* the beat, and the grid resolution. *)
  5213.     bBeatsPerMeasure: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};   // beats per measure (top of time sig)
  5214.     bBeat: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};              // what note receives the beat (bottom of time sig.)
  5215.                               // we can assume that 0 means 256th note
  5216.     wGridsPerBeat: Word;      // grids per beat
  5217.   end;
  5218.   {$EXTERNALSYM _DMUS_IO_TIMESIG}
  5219.   DMUS_IO_TIMESIG = _DMUS_IO_TIMESIG;
  5220.   {$EXTERNALSYM DMUS_IO_TIMESIG}
  5221.   TDMusIoTimesig = _DMUS_IO_TIMESIG;
  5222.  
  5223.   PDMusIoStyle = ^TDMusIoStyle;
  5224.   _DMUS_IO_STYLE = record
  5225.     timeSig: TDMusIoTimesig;        // Styles have a default Time Signature
  5226.     dblTempo: Double;
  5227.   end;
  5228.   {$EXTERNALSYM _DMUS_IO_STYLE}
  5229.   DMUS_IO_STYLE = _DMUS_IO_STYLE;
  5230.   {$EXTERNALSYM DMUS_IO_STYLE}
  5231.   TDMusIoStyle = _DMUS_IO_STYLE;
  5232.  
  5233.   PDMusIoVersion = ^TDMusIoVersion;
  5234.   _DMUS_IO_VERSION = record
  5235.     dwVersionMS: DWORD;        // Version # high-order 32 bits
  5236.     dwVersionLS: DWORD;        // Version # low-order 32 bits
  5237.   end;
  5238.   {$EXTERNALSYM _DMUS_IO_VERSION}
  5239.   DMUS_IO_VERSION = _DMUS_IO_VERSION;
  5240.   {$EXTERNALSYM DMUS_IO_VERSION}
  5241.   TDMusIoVersion = _DMUS_IO_VERSION;
  5242.  
  5243.   PDMusIoPattern = ^TDMusIoPattern;
  5244.   _DMUS_IO_PATTERN = record
  5245.     timeSig: TDMusIoTimesig; // Patterns can override the Style's Time sig.
  5246.     bGrooveBottom: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};     // bottom of groove range
  5247.     bGrooveTop: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};        // top of groove range
  5248.     wEmbellishment: TDMusEmbellishtTypes; // Fill, Break, Intro, End, Normal, Motif
  5249.     wNbrMeasures: Word;      // length in measures
  5250.     bDestGrooveBottom: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF}; // bottom of groove range for next pattern
  5251.     bDestGrooveTop: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};    // top of groove range for next pattern
  5252.     dwFlags: DWORD;          // various flags
  5253.   end;
  5254.   {$EXTERNALSYM _DMUS_IO_PATTERN}
  5255.   DMUS_IO_PATTERN = _DMUS_IO_PATTERN;
  5256.   {$EXTERNALSYM DMUS_IO_PATTERN}
  5257.   TDMusIoPattern = _DMUS_IO_PATTERN;
  5258.  
  5259.   PDMusIoStylePart = ^TDMusIoStylePart;
  5260.   _DMUS_IO_STYLEPART = record
  5261.     timeSig: TDMusIoTimesig;        // can override pattern's
  5262.     dwVariationChoices: array[0..31] of DWORD; // MOAW choice bitfield
  5263.     guidPartID: TGUID;              // identifies the part
  5264.     wNbrMeasures: Word;             // length of the Part
  5265.     bPlayModeFlags: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};           // see PLAYMODE flags
  5266.     bInvertUpper: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};             // inversion upper limit
  5267.     bInvertLower: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};             // inversion lower limit
  5268.     bPad: array[0..2] of Byte;      // for DWORD alignment
  5269.     dwFlags: DWORD;                 // various flags
  5270.   end;
  5271.   {$EXTERNALSYM _DMUS_IO_STYLEPART}
  5272.   DMUS_IO_STYLEPART = _DMUS_IO_STYLEPART;
  5273.   {$EXTERNALSYM DMUS_IO_STYLEPART}
  5274.   TDMusIoStylePart = _DMUS_IO_STYLEPART;
  5275.  
  5276.   PDMusIoPartRef = ^TDMusIoPartRef;
  5277.   _DMUS_IO_PARTREF = record
  5278.     guidPartID: TGUID;        (* unique ID for matching up with parts *)
  5279.     wLogicalPartID: Word;     (* corresponds to port/device/midi channel OBSOLETE *)
  5280.     bVariationLockID: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};   (* parts with the same ID lock variations. *)
  5281.                               (* high bit is used to identify master Part *)
  5282.     bSubChordLevel: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};     (* tells which sub chord level this part wants *)
  5283.     bPriority: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};          (* 256 priority levels. Parts with lower priority *)
  5284.                               (* aren't played first when a device runs out of *)
  5285.                               (* notes *)
  5286.     bRandomVariation: TDMusVariationtTypes; (* when set, matching variations play in random order *)
  5287.                               (* when clear, matching variations play sequentially *)
  5288.     wPad: Word;               (* not used *)
  5289.     dwPChannel: DWORD;        (* replaces wLogicalPartID *)
  5290.   end;
  5291.   {$EXTERNALSYM _DMUS_IO_PARTREF}
  5292.   DMUS_IO_PARTREF = _DMUS_IO_PARTREF;
  5293.   {$EXTERNALSYM DMUS_IO_PARTREF}
  5294.   TDMusIoPartRef = _DMUS_IO_PARTREF;
  5295.  
  5296.   PDMusIoStyleNote = ^TDMusIoStyleNote;
  5297.   _DMUS_IO_STYLENOTE = record
  5298.     mtGridStart: TMusicTime; (* when this note occurs *)
  5299.     dwVariation: DWORD;      (* variation bits *)
  5300.     mtDuration: TMusicTime;  (* how long this note lasts *)
  5301.     nTimeOffset: Smallint;   (* offset from mtGridStart *)
  5302.     wMusicValue: Word;       (* Position in scale. *)
  5303.     bVelocity: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};         (* Note velocity. *)
  5304.     bTimeRange: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};        (* Range to randomize start time. *)
  5305.     bDurRange: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};         (* Range to randomize duration. *)
  5306.     bVelRange: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};         (* Range to randomize velocity. *)
  5307.     bInversionID: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};      (* Identifies inversion group to which this note belongs *)
  5308.     bPlayModeFlags: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};    (* Can override part *)
  5309.     (* Following exists only under DX8 and on *)
  5310.     bNoteFlags: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};        (* values from DMUS_NOTEF_FLAGS *)
  5311.   end;
  5312.   {$EXTERNALSYM _DMUS_IO_STYLENOTE}
  5313.   DMUS_IO_STYLENOTE = _DMUS_IO_STYLENOTE;
  5314.   {$EXTERNALSYM DMUS_IO_STYLENOTE}
  5315.   TDMusIoStyleNote = _DMUS_IO_STYLENOTE;
  5316.  
  5317.   PDMusIoStyleCurve = ^TDMusIoStyleCurve;
  5318.   _DMUS_IO_STYLECURVE = record
  5319.     mtGridStart: TMusicTime;     (* when this curve occurs *)
  5320.     dwVariation: DWORD;          (* variation bits *)
  5321.     mtDuration: TMusicTime;      (* how long this curve lasts *)
  5322.     mtResetDuration: TMusicTime; (* how long after the end of the curve to reset the curve *)
  5323.     nTimeOffset: Smallint;       (* offset from mtGridStart *)
  5324.     nStartValue: Smallint;       (* curve's start value *)
  5325.     nEndValue: Smallint;         (* curve's end value *)
  5326.     nResetValue: Smallint;       (* the value to which to reset the curve *)
  5327.     bEventType: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};            (* type of curve *)
  5328.     bCurveShape: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};           (* shape of curve *)
  5329.     bCCData: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};               (* CC# *)
  5330.     bFlags: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};                (* Bit 1=TRUE means to send nResetValue. Otherwise, don't.
  5331.                                     Other bits are reserved. *)
  5332.     (*  Following was added for DX8. *)
  5333.     wParamType: Word;            (* RPN or NRPN parameter number. *)
  5334.     wMergeIndex: Word;           (* Allows multiple parameters to be merged (pitchbend, volume, and expression.) *)
  5335.   end;
  5336.   {$EXTERNALSYM _DMUS_IO_STYLECURVE}
  5337.   DMUS_IO_STYLECURVE = _DMUS_IO_STYLECURVE;
  5338.   {$EXTERNALSYM DMUS_IO_STYLECURVE}
  5339.   TDMusIoStyleCurve = _DMUS_IO_STYLECURVE;
  5340.  
  5341.   PDMusIoStyleMarker = ^TDMusIoStyleMarker;
  5342.   _DMUS_IO_STYLEMARKER = record
  5343.     mtGridStart: TMusicTime; (* when this marker occurs *)
  5344.     dwVariation: DWORD;      (* variation bits *)
  5345.     wMarkerFlags: Word;      (* how the marker is used *)
  5346.   end;
  5347.   {$EXTERNALSYM _DMUS_IO_STYLEMARKER}
  5348.   DMUS_IO_STYLEMARKER = _DMUS_IO_STYLEMARKER;
  5349.   {$EXTERNALSYM DMUS_IO_STYLEMARKER}
  5350.   TDMusIoStyleMarker = _DMUS_IO_STYLEMARKER;
  5351.  
  5352.   PDMusIoStyleResolution = ^TDMusIoStyleResolution;
  5353.   _DMUS_IO_STYLERESOLUTION = record
  5354.     dwVariation: DWORD;      (* variation bits *)
  5355.     wMusicValue: Word;       (* Position in scale. *)
  5356.     bInversionID: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};      (* Identifies inversion group to which this note belongs *)
  5357.     bPlayModeFlags: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};    (* Can override part *)
  5358.   end;
  5359.   {$EXTERNALSYM _DMUS_IO_STYLERESOLUTION}
  5360.   DMUS_IO_STYLERESOLUTION = _DMUS_IO_STYLERESOLUTION;
  5361.   {$EXTERNALSYM DMUS_IO_STYLERESOLUTION}
  5362.   TDMusIoStyleResolution = _DMUS_IO_STYLERESOLUTION;
  5363.  
  5364.   PDMusIoStyleAnticipation = ^TDMusIoStyleAnticipation;
  5365.   _DMUS_IO_STYLE_ANTICIPATION = record
  5366.     mtGridStart: TMusicTime; (* when this anticipation occurs *)
  5367.     dwVariation: DWORD;      (* variation bits *)
  5368.     nTimeOffset: Smallint;   (* offset from mtGridStart *)
  5369.     bTimeRange: {$IFNDEF COMPILER6_UP}Byte2{$ELSE}Byte{$ENDIF};        (* Range to randomize start time. *)
  5370.   end;
  5371.   {$EXTERNALSYM _DMUS_IO_STYLE_ANTICIPATION}
  5372.   DMUS_IO_STYLE_ANTICIPATION = _DMUS_IO_STYLE_ANTICIPATION;
  5373.   {$EXTERNALSYM DMUS_IO_STYLE_ANTICIPATION}
  5374.   TDMusIoStyleAnticipation = _DMUS_IO_STYLE_ANTICIPATION;
  5375.  
  5376.   PDMusIoMotifSettings = ^TDMusIoMotifSettings;
  5377.   _DMUS_IO_MOTIFSETTINGS = record
  5378.     dwRepeats: DWORD;           (* Number of repeats. By default, 0. *)
  5379.     mtPlayStart: TMusicTime;    (* Start of playback. By default, 0. *)
  5380.     mtLoopStart: TMusicTime;    (* Start of looping portion. By default, 0. *)
  5381.     mtLoopEnd: TMusicTime;      (* End of loop. Must be greater than mtLoopStart. Or, 0, indicating loop full motif.  *)
  5382.     dwResolution: DWORD;        (* Default resolution. *)
  5383.   end;
  5384.   {$EXTERNALSYM _DMUS_IO_MOTIFSETTINGS}
  5385.   DMUS_IO_MOTIFSETTINGS = _DMUS_IO_MOTIFSETTINGS;
  5386.   {$EXTERNALSYM DMUS_IO_MOTIFSETTINGS}
  5387.   TDMusIoMotifSettings = _DMUS_IO_MOTIFSETTINGS;
  5388.  
  5389. {$ALIGN ON}
  5390.  
  5391.  
  5392. (*
  5393. RIFF
  5394. (
  5395.     'DMST'          // Style
  5396.     <styh-ck>       // Style header chunk
  5397.     <guid-ck>       // Every Style has a GUID
  5398.     [<UNFO-list>]   // Name, author, copyright info., comments
  5399.     [<vers-ck>]     // version chunk
  5400.     <part-list>...  // Array of parts in the Style, used by patterns
  5401.     <pttn-list>...  // Array of patterns in the Style
  5402.     <DMBD-form>...  // Array of bands in the Style
  5403.     [<prrf-list>]...// Optional array of chord map references in the Style
  5404. )
  5405.  
  5406.     // <styh-ck>
  5407.     styh
  5408.     (
  5409.         <DMUS_IO_STYLE>
  5410.     )
  5411.  
  5412.     // <guid-ck>
  5413.     guid
  5414.     (
  5415.         <GUID>
  5416.     )
  5417.  
  5418.     // <vers-ck>
  5419.     vers
  5420.     (
  5421.         <DMUS_IO_VERSION>
  5422.     )
  5423.  
  5424.     // <part-list>
  5425.     LIST
  5426.     (
  5427.         'part'
  5428.         <prth-ck>       // Part header chunk
  5429.         [<UNFO-list>]   // Name, author, copyright info., comments
  5430.         [<note-ck>]     // Optional chunk containing an array of notes in Part
  5431.         [<crve-ck>]     // Optional chunk containing an array of curves in Part
  5432.         [<mrkr-ck>]     // Optional chunk containing an array of markers in Part
  5433.         [<rsln-ck>]     // Optional chunk containing an array of variation resolutions in Part
  5434.         [<anpn-ck>]     // Optional chunk containing an array of resolution anticipations in Part
  5435.     )
  5436.  
  5437.         // <orth-ck>
  5438.         prth
  5439.         (
  5440.             <DMUS_IO_STYLEPART>
  5441.         )
  5442.  
  5443.         // <note-ck>
  5444.         'note'
  5445.         (
  5446.             // sizeof DMUS_IO_STYLENOTE:DWORD
  5447.             <DMUS_IO_STYLENOTE>...
  5448.         )
  5449.  
  5450.         // <crve-ck>
  5451.         'crve'
  5452.         (
  5453.             // sizeof DMUS_IO_STYLECURVE:DWORD
  5454.             <DMUS_IO_STYLECURVE>...
  5455.         )
  5456.  
  5457.         // <mrkr-ck>
  5458.         'mrkr'
  5459.         (
  5460.             // sizeof DMUS_IO_STYLEMARKER:DWORD
  5461.             <DMUS_IO_STYLEMARKER>...
  5462.         )
  5463.  
  5464.         // <rsln-ck>
  5465.         'rsln'
  5466.         (
  5467.             // sizeof DMUS_IO_STYLERESOLUTION:DWORD
  5468.             <DMUS_IO_STYLERESOLUTION>...
  5469.         )
  5470.  
  5471.         // <anpn-ck>
  5472.         'anpn'
  5473.         (
  5474.             // sizeof DMUS_IO_STYLE_ANTICIPATION:DWORD
  5475.             <DMUS_IO_STYLE_ANTICIPATION>...
  5476.         )
  5477.  
  5478.     // <pttn-list>
  5479.     LIST
  5480.     (
  5481.         'pttn'
  5482.         <ptnh-ck>       // Pattern header chunk
  5483.         <rhtm-ck>       // Chunk containing an array of rhythms for chord matching
  5484.         [<UNFO-list>]   // Name, author, copyright info., comments
  5485.         [<mtfs-ck>]     // Motif settings chunk
  5486.         [<DMBD-form>]   // Optional band to be associated with the pattern (for motifs)
  5487.         <pref-list>...  // Array of part reference id's
  5488.     )
  5489.  
  5490.         // <ptnh-ck>
  5491.         ptnh
  5492.         (
  5493.             <DMUS_IO_PATTERN>
  5494.         )
  5495.  
  5496.         // <rhtm-ck>
  5497.         'rhtm'
  5498.         (
  5499.             // DWORD's representing rhythms for chord matching based on number
  5500.             // of measures in the pattern
  5501.         )
  5502.  
  5503.  
  5504.         // pref-list
  5505.         LIST
  5506.         (
  5507.             'pref'
  5508.             <prfc-ck>   // part ref chunk
  5509.         )
  5510.  
  5511.         // <prfc-ck>
  5512.         prfc
  5513.         (
  5514.             <DMUS_IO_PARTREF>
  5515.         )
  5516.  
  5517.         // <mtfs-ck>
  5518.         mtfs
  5519.         (
  5520.             <DMUS_IO_MOTIFSETTINGS>
  5521.         )
  5522.  
  5523.     // <prrf-list>
  5524.     LIST
  5525.     (
  5526.         'prrf'
  5527.         <DMRF-list>... // Array of Chordmap references
  5528.     )
  5529. *)
  5530.  
  5531. const
  5532.   (* Pattern chunk, for use in Pattern tracks *)
  5533.   DMUS_FOURCC_PATTERN_FORM = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('P') shl 16) or (Byte('T') shl 24)); // mmioFOURCC('D','M','P','T')
  5534.   {$EXTERNALSYM DMUS_FOURCC_PATTERN_FORM}
  5535.  
  5536. (*
  5537. RIFF
  5538. (
  5539.     'DMPT'          // Pattern
  5540.     <styh-ck>       // Style header chunk
  5541.     <pttn-list>     // The pattern, in single pattern format (includes DMUS_FOURCC_PART_LIST chunks)
  5542. )
  5543. *)
  5544.  
  5545.  
  5546. (* Chord and command file formats *)
  5547.  
  5548. type
  5549.   (* These specify possible values for DMUS_IO_COMMAND.bRepeatMode (dx8) *)
  5550.   enumDMUS_PATTERNT_TYPES = (
  5551.     DMUS_PATTERNT_RANDOM           {= 0}, (* Play randomly. (dx7 behavior) *)
  5552.     DMUS_PATTERNT_REPEAT           {= 1}, (* Repeat last pattern. *)
  5553.     DMUS_PATTERNT_SEQUENTIAL       {= 2}, (* Play sequential starting with first matching pattern. *)
  5554.     DMUS_PATTERNT_RANDOM_START     {= 3}, (* Play sequential starting with a random pattern. *)
  5555.     DMUS_PATTERNT_NO_REPEAT        {= 4}, (* Play randomly, but don't play the same pattern twice. *)
  5556.     DMUS_PATTERNT_RANDOM_ROW       {= 5}  (* Play randomly as a row: don't repeat any pattern until all have played. *)
  5557.   );
  5558.   {$EXTERNALSYM enumDMUS_PATTERNT_TYPES}
  5559.   DMUS_PATTERNT_TYPES = enumDMUS_PATTERNT_TYPES;
  5560.   {$EXTERNALSYM DMUS_PATTERNT_TYPES}
  5561.   TDMusPatterntTypes = DMUS_PATTERNT_TYPES;
  5562.  
  5563. const
  5564.   DMUS_FOURCC_CHORDTRACK_LIST        = DWORD(Byte('c') or (Byte('o') shl 8) or (Byte('r') shl 16) or (Byte('d') shl 24)); // mmioFOURCC('c','o','r','d')
  5565.   {$EXTERNALSYM DMUS_FOURCC_CHORDTRACK_LIST}
  5566.   DMUS_FOURCC_CHORDTRACKHEADER_CHUNK = DWORD(Byte('c') or (Byte('r') shl 8) or (Byte('d') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('c','r','d','h')
  5567.   {$EXTERNALSYM DMUS_FOURCC_CHORDTRACKHEADER_CHUNK}
  5568.   DMUS_FOURCC_CHORDTRACKBODY_CHUNK   = DWORD(Byte('c') or (Byte('r') shl 8) or (Byte('d') shl 16) or (Byte('b') shl 24)); // mmioFOURCC('c','r','d','b')
  5569.   {$EXTERNALSYM DMUS_FOURCC_CHORDTRACKBODY_CHUNK}
  5570.  
  5571.   DMUS_FOURCC_COMMANDTRACK_CHUNK     = DWORD(Byte('c') or (Byte('m') shl 8) or (Byte('n') shl 16) or (Byte('d') shl 24)); // mmioFOURCC('c','m','n','d')
  5572.   {$EXTERNALSYM DMUS_FOURCC_COMMANDTRACK_CHUNK}
  5573.  
  5574. type
  5575.   PDMusIoChord = ^TDMusIoChord;
  5576.   _DMUS_IO_CHORD = packed record
  5577.     wszName: array[0..15] of WideChar; (* Name of the chord *)
  5578.     mtTime: TMusicTime;   (* Time of this chord *)
  5579.     wMeasure: Word;       (* Measure this falls on *)
  5580.     bBeat: Byte;          (* Beat this falls on *)
  5581.     bFlags: Byte;         (* Various flags *)
  5582.   end;
  5583.   {$EXTERNALSYM _DMUS_IO_CHORD}
  5584.   DMUS_IO_CHORD = _DMUS_IO_CHORD;
  5585.   {$EXTERNALSYM DMUS_IO_CHORD}
  5586.   TDMusIoChord = _DMUS_IO_CHORD;
  5587.  
  5588.   PDMusIoSubChord = ^TDMusIoSubChord;
  5589.   _DMUS_IO_SUBCHORD = packed record
  5590.     dwChordPattern: DWORD;     (* Notes in the subchord *)
  5591.     dwScalePattern: DWORD;     (* Notes in the scale *)
  5592.     dwInversionPoints: DWORD;  (* Where inversions can occur *)
  5593.     dwLevels: DWORD;           (* Which levels are supported by this subchord *)
  5594.     bChordRoot: Byte;          (* Root of the subchord *)
  5595.     bScaleRoot: Byte;          (* Root of the scale *)
  5596.   end;
  5597.   {$EXTERNALSYM _DMUS_IO_SUBCHORD}
  5598.   DMUS_IO_SUBCHORD = _DMUS_IO_SUBCHORD;
  5599.   {$EXTERNALSYM DMUS_IO_SUBCHORD}
  5600.   TDMusIoSubChord = _DMUS_IO_SUBCHORD;
  5601.  
  5602.   PDMusIoCommand = ^TDMusIoCommand;
  5603.   _DMUS_IO_COMMAND = packed record
  5604.     mtTime: TMusicTime;   (* Time of this command *)
  5605.     wMeasure: Word;       (* Measure this falls on *)
  5606.     bBeat: Byte;          (* Beat this falls on *)
  5607.     bCommand: Byte;       (* Command type (see #defines below) *)
  5608.     bGrooveLevel: Byte;   (* Groove level (0 if command is not a groove) *)
  5609.     bGrooveRange: Byte;   (* Groove range  *)
  5610.     bRepeatMode: Byte;    (* Used to control selection of patterns with same groove level  *)
  5611.   end;
  5612.   {$EXTERNALSYM _DMUS_IO_COMMAND}
  5613.   DMUS_IO_COMMAND = _DMUS_IO_COMMAND;
  5614.   {$EXTERNALSYM DMUS_IO_COMMAND}
  5615.   TDMusIoCommand = _DMUS_IO_COMMAND;
  5616.  
  5617.  
  5618. (*
  5619.  
  5620.     // <cord-list>
  5621.     LIST
  5622.     (
  5623.         'cord'
  5624.         <crdh-ck>
  5625.         <crdb-ck>...    // Chord body chunks
  5626.     )
  5627.  
  5628.         // <crdh-ck>
  5629.         crdh
  5630.         (
  5631.             // Scale: dword (upper 8 bits for root, lower 24 for scale)
  5632.         )
  5633.  
  5634.         // <crdb-ck>
  5635.         crdb
  5636.         (
  5637.             // sizeof DMUS_IO_CHORD:dword
  5638.             <DMUS_IO_CHORD>
  5639.             // # of DMUS_IO_SUBCHORDS:dword
  5640.             // sizeof DMUS_IO_SUBCHORDS:dword
  5641.             // a number of <DMUS_IO_SUBCHORD>
  5642.         )
  5643.  
  5644.  
  5645.     // <cmnd-list>
  5646.     'cmnd'
  5647.     (
  5648.         //sizeof DMUS_IO_COMMAND: DWORD
  5649.         <DMUS_IO_COMMAND>...
  5650.     )
  5651.  
  5652. *)
  5653.  
  5654. (*  File io for DirectMusic Tool and ToolGraph objects
  5655. *)
  5656.  
  5657. const
  5658.   (* RIFF ids: *)
  5659.  
  5660.   DMUS_FOURCC_TOOLGRAPH_FORM = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('T') shl 16) or (Byte('G') shl 24)); // mmioFOURCC('D','M','T','G')
  5661.   {$EXTERNALSYM DMUS_FOURCC_TOOLGRAPH_FORM}
  5662.   DMUS_FOURCC_TOOL_LIST      = DWORD(Byte('t') or (Byte('o') shl 8) or (Byte('l') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('t','o','l','l')
  5663.   {$EXTERNALSYM DMUS_FOURCC_TOOL_LIST}
  5664.   DMUS_FOURCC_TOOL_FORM      = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('T') shl 16) or (Byte('L') shl 24)); // mmioFOURCC('D','M','T','L')
  5665.   {$EXTERNALSYM DMUS_FOURCC_TOOL_FORM}
  5666.   DMUS_FOURCC_TOOL_CHUNK     = DWORD(Byte('t') or (Byte('o') shl 8) or (Byte('l') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('t','o','l','h')
  5667.   {$EXTERNALSYM DMUS_FOURCC_TOOL_CHUNK}
  5668.  
  5669. type
  5670.   (* io type = recordures: *)
  5671.   PDMusIoToolHeader = ^TDMusIoToolHeader;
  5672.   _DMUS_IO_TOOL_HEADER = packed record
  5673.     guidClassID: TGUID;     (* Class id of tool. *)
  5674.     lIndex: Longint;        (* Position in graph. *)
  5675.     cPChannels: DWORD;      (* Number of items in channels array. *)
  5676.     ckid: FOURCC;           (* chunk ID of tool's data chunk if 0 fccType valid. *)
  5677.     fccType: FOURCC;        (* list type if NULL ckid valid. *)
  5678.     dwPChannels: array[0..0] of DWORD; (* Array of PChannels, size determined by cPChannels. *)
  5679.   end;
  5680.   {$EXTERNALSYM _DMUS_IO_TOOL_HEADER}
  5681.   DMUS_IO_TOOL_HEADER = _DMUS_IO_TOOL_HEADER;
  5682.   {$EXTERNALSYM DMUS_IO_TOOL_HEADER}
  5683.   TDMusIoToolHeader = _DMUS_IO_TOOL_HEADER;
  5684.  
  5685. (*
  5686. RIFF
  5687. (
  5688.     'DMTG'          // DirectMusic ToolGraph chunk
  5689.     [<guid-ck>]     // GUID for ToolGraph
  5690.     [<vers-ck>]     // Optional version info
  5691.     [<UNFO-list>]   // Name, author, copyright info., comments
  5692.     <toll-list>     // List of Tools
  5693. )
  5694.  
  5695.     // <guid-ck>
  5696.     'guid'
  5697.     (
  5698.         <GUID>
  5699.     )
  5700.  
  5701.     // <vers-ck>
  5702.     vers
  5703.     (
  5704.         <DMUS_IO_VERSION>
  5705.     )
  5706.  
  5707.     // <toll-list>
  5708.     LIST
  5709.     (
  5710.         'toll'          // Array of tools
  5711.         <DMTL-form>...  // Each tool is encapsulated in a RIFF chunk
  5712.     )
  5713.  
  5714. // <DMTL-form>      Tools are embedded in a graph. Theoretically, they can be saved as individual files too.
  5715. RIFF
  5716. (
  5717.     'DMTL'
  5718.     <tolh-ck>
  5719.     [<data>]        // Tool data. Must be a RIFF readable chunk.
  5720. )
  5721.  
  5722.     // <tolh-ck>            // Tool header chunk
  5723.     (
  5724.         'tolh'
  5725.         <DMUS_IO_TOOL_HEADER>   // Tool header
  5726.     )
  5727. *)
  5728.  
  5729. (*  The AudioPath file carries everything for describing a specific audio path,
  5730.     including Tool Graph and Buffer Descriptor.
  5731.     This can even be used for configuring a complete performance.
  5732. *)
  5733.  
  5734. const
  5735.   DMUS_FOURCC_AUDIOPATH_FORM = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('A') shl 16) or (Byte('P') shl 24)); // mmioFOURCC('D','M','A','P')
  5736.   {$EXTERNALSYM DMUS_FOURCC_AUDIOPATH_FORM}
  5737.  
  5738. (*
  5739. RIFF
  5740. (
  5741.     'DMAP'          // DirectMusic AudioPath chunk
  5742.     [<guid-ck>]     // GUID for this Audio Path configuration
  5743.     [<vers-ck>]     // Optional version info
  5744.     [<UNFO-list>]   // Name, author, copyright info., comments
  5745.     [<DMTG-form>]   // Optional ToolGraph
  5746.     [<pcsl-list>]   // Optional list of port configurations
  5747.     [<dbfl-list>]...// Optional array of Dsound buffer descriptors
  5748. )
  5749. *)
  5750.  
  5751.   DMUS_FOURCC_PORTCONFIGS_LIST = DWORD(Byte('p') or (Byte('c') shl 8) or (Byte('s') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('p','c','s','l')
  5752.   {$EXTERNALSYM DMUS_FOURCC_PORTCONFIGS_LIST}
  5753.   DMUS_FOURCC_PORTCONFIG_LIST  = DWORD(Byte('p') or (Byte('c') shl 8) or (Byte('f') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('p','c','f','l')
  5754.   {$EXTERNALSYM DMUS_FOURCC_PORTCONFIG_LIST}
  5755.   DMUS_FOURCC_PORTCONFIG_ITEM  = DWORD(Byte('p') or (Byte('c') shl 8) or (Byte('f') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('p','c','f','h')
  5756.   {$EXTERNALSYM DMUS_FOURCC_PORTCONFIG_ITEM}
  5757.   DMUS_FOURCC_PORTPARAMS_ITEM  = DWORD(Byte('p') or (Byte('p') shl 8) or (Byte('r') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('p','p','r','h')
  5758.   {$EXTERNALSYM DMUS_FOURCC_PORTPARAMS_ITEM}
  5759.   DMUS_FOURCC_DSBUFFER_LIST    = DWORD(Byte('d') or (Byte('b') shl 8) or (Byte('f') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('d','b','f','l')
  5760.   {$EXTERNALSYM DMUS_FOURCC_DSBUFFER_LIST}
  5761.   DMUS_FOURCC_DSBUFFATTR_ITEM  = DWORD(Byte('d') or (Byte('d') shl 8) or (Byte('a') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('d','d','a','h')
  5762.   {$EXTERNALSYM DMUS_FOURCC_DSBUFFATTR_ITEM}
  5763.   DMUS_FOURCC_PCHANNELS_LIST   = DWORD(Byte('p') or (Byte('c') shl 8) or (Byte('h') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('p','c','h','l')
  5764.   {$EXTERNALSYM DMUS_FOURCC_PCHANNELS_LIST}
  5765.   DMUS_FOURCC_PCHANNELS_ITEM   = DWORD(Byte('p') or (Byte('c') shl 8) or (Byte('h') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('p','c','h','h')
  5766.   {$EXTERNALSYM DMUS_FOURCC_PCHANNELS_ITEM}
  5767.  
  5768. type
  5769.   PDMusIoPortConfigHeader = ^TDMusIoPortConfigHeader;
  5770.   _DMUS_IO_PORTCONFIG_HEADER = packed record
  5771.     guidPort: TGUID;           (* GUID of requested port. *)
  5772.     dwPChannelBase: DWORD;     (* PChannel that this should start on. *)
  5773.     dwPChannelCount: DWORD;    (* How many channels. *)
  5774.     dwFlags: DWORD;            (* Various flags. *)
  5775.   end;
  5776.   {$EXTERNALSYM _DMUS_IO_PORTCONFIG_HEADER}
  5777.   DMUS_IO_PORTCONFIG_HEADER = _DMUS_IO_PORTCONFIG_HEADER;
  5778.   {$EXTERNALSYM DMUS_IO_PORTCONFIG_HEADER}
  5779.   TDMusIoPortConfigHeader = _DMUS_IO_PORTCONFIG_HEADER;
  5780.  
  5781. const
  5782.   DMUS_PORTCONFIGF_DRUMSON10  = 1;   (* This port configured for drums on channel 10. *)
  5783.   {$EXTERNALSYM DMUS_PORTCONFIGF_DRUMSON10}
  5784.   DMUS_PORTCONFIGF_USEDEFAULT = 2;   (* Use the default port. *)
  5785.   {$EXTERNALSYM DMUS_PORTCONFIGF_USEDEFAULT}
  5786.  
  5787. (* Each portconfig has one or more pchannel to buffer mappings. Each buffer
  5788.    is identified by a guid. Each pchannel can map to one or more buffers.
  5789.    This is defined with one or more DMUS_IO_PCHANNELTOBUFFER_HEADER
  5790.    structures. Each defines a range of PChannels and the set of buffers
  5791.    that they connect to.
  5792. *)
  5793.  
  5794. type
  5795.   PDMusIoPChannelToBufferHeader = ^TDMusIoPChannelToBufferHeader;
  5796.   _DMUS_IO_PCHANNELTOBUFFER_HEADER = packed record
  5797.     dwPChannelBase:   DWORD;     (* PChannel that this should start on. *)
  5798.     dwPChannelCount:   DWORD;    (* How many PChannels. *)
  5799.     dwBufferCount:   DWORD;      (* How many buffers do these connect to. *)
  5800.     dwFlags:   DWORD;            (* Various flags. Currently reserved for future use. Must be 0. *)
  5801.   end;
  5802.   {$EXTERNALSYM _DMUS_IO_PCHANNELTOBUFFER_HEADER}
  5803.   DMUS_IO_PCHANNELTOBUFFER_HEADER = _DMUS_IO_PCHANNELTOBUFFER_HEADER;
  5804.   {$EXTERNALSYM DMUS_IO_PCHANNELTOBUFFER_HEADER}
  5805.   TDMusIoPChannelToBufferHeader = _DMUS_IO_PCHANNELTOBUFFER_HEADER;
  5806.  
  5807. (* Each buffer is represented by an DSBC form. This is wrapped by the
  5808.    DMUS_IO_BUFFER_ATTRIBUTES_HEADER which identifies how to use the
  5809.    buffer. In particular, it indicates whether this gets dynamically duplicated
  5810.    or all references to this should share the same instance.
  5811.    To resolve references, the unique GUID of the buffer is also stored
  5812.    in this structure.
  5813. *)
  5814.  
  5815.   PDMusIoBufferAttributesHeader = ^TDMusIoBufferAttributesHeader;
  5816.   _DMUS_IO_BUFFER_ATTRIBUTES_HEADER = packed record
  5817.     guidBufferID: TGUID;       (* Each buffer config has a unique ID. *)
  5818.     dwFlags: DWORD;            (* Various flags. *)
  5819.   end;
  5820.   {$EXTERNALSYM _DMUS_IO_BUFFER_ATTRIBUTES_HEADER}
  5821.   DMUS_IO_BUFFER_ATTRIBUTES_HEADER = _DMUS_IO_BUFFER_ATTRIBUTES_HEADER;
  5822.   {$EXTERNALSYM DMUS_IO_BUFFER_ATTRIBUTES_HEADER}
  5823.   TDMusIoBufferAttributesHeader = _DMUS_IO_BUFFER_ATTRIBUTES_HEADER;
  5824.  
  5825. const
  5826.   (* DMUS_IO_BUFFER_ATTRIBUTES_HEADER.dwFlags: *)
  5827.   DMUS_BUFFERF_SHARED     = 1;   (* Share this with other audio paths, instead of creating unique copies. *)
  5828.   {$EXTERNALSYM DMUS_BUFFERF_SHARED}
  5829.   DMUS_BUFFERF_DEFINED    = 2;   (* Use one of the standard predefined buffers (see GUID_Buffer... in dmusici.h.) *)
  5830.   {$EXTERNALSYM DMUS_BUFFERF_DEFINED}
  5831.   DMUS_BUFFERF_MIXIN      = 8;   (* This is a mixin buffer. *)
  5832.   {$EXTERNALSYM DMUS_BUFFERF_MIXIN}
  5833.  
  5834. (*
  5835.  
  5836. LIST
  5837. (
  5838.     'pcsl'          // Array of port configurations
  5839.     <pcfl-list>...  // One or more port configurations, each in a list chunk
  5840. )
  5841.  
  5842. LIST
  5843. (
  5844.     'pcfl'          // List container for one port configuration.
  5845.     <pcfh-ck>       // Portconfig header chunk.
  5846.     <pprh-ck>       // Port params, to be used to create the port.
  5847.     [<dbfl-list>]...// Optional array of Dsound buffer descriptors
  5848.     [<pchl-list>]   // Optional list of pchannel to buffer assignments
  5849.  
  5850. )
  5851.  
  5852.     // <pcfh-ck>            // Port config header chunk
  5853.     (
  5854.         'pcfh'
  5855.         <DMUS_IO_PORTCONFIG_HEADER>   // Port config header
  5856.     )
  5857.  
  5858.     // <pprh-ck>            // Port params header chunk
  5859.     (
  5860.         'pprh'
  5861.         <DMUS_PORTPARAMS8>   // Port params header
  5862.     )
  5863.  
  5864. LIST
  5865. (
  5866.     'pchl'          // List container for one or more pchannel to buffer assignments.
  5867.     <pchh-ck>...    // One or more pchannel to buffer assignment headers and data.
  5868.  
  5869.     // <pchh-ck>
  5870.     (
  5871.         'pchh'
  5872.         <DMUS_IO_PCHANNELTOBUFFER_HEADER>   // Description of PChannels
  5873.         <GUID>...                           // Array of GUIDs defining the buffers they all connect to.
  5874.     )
  5875. )
  5876.  
  5877. LIST
  5878. (
  5879.     'dbfl'          // List container for one buffer and buffer attributes header.
  5880.     <ddah-ck>       // Buffer attributes header. 
  5881.     [<DSBC-form>]   // Buffer configuration. Not required when header uses a predefined buffer type.
  5882.  
  5883.     // <ddah-ck>
  5884.     (
  5885.         'ddah'
  5886.         <DMUS_IO_BUFFER_ATTRIBUTES_HEADER>   // Buffer attributes.
  5887.     )
  5888. )
  5889. *)
  5890.  
  5891. (*  File io for DirectMusic Band Track object *)
  5892.  
  5893.  
  5894. const
  5895.   (* RIFF ids: *)
  5896.   DMUS_FOURCC_BANDTRACK_FORM  = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('B') shl 16) or (Byte('T') shl 24)); // mmioFOURCC('D','M','B','T')
  5897.   {$EXTERNALSYM DMUS_FOURCC_BANDTRACK_FORM}
  5898.   DMUS_FOURCC_BANDTRACK_CHUNK = DWORD(Byte('b') or (Byte('d') shl 8) or (Byte('t') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('b','d','t','h')
  5899.   {$EXTERNALSYM DMUS_FOURCC_BANDTRACK_CHUNK}
  5900.   DMUS_FOURCC_BANDS_LIST      = DWORD(Byte('l') or (Byte('b') shl 8) or (Byte('d') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('l','b','d','l')
  5901.   {$EXTERNALSYM DMUS_FOURCC_BANDS_LIST}
  5902.   DMUS_FOURCC_BAND_LIST       = DWORD(Byte('l') or (Byte('b') shl 8) or (Byte('n') shl 16) or (Byte('d') shl 24)); // mmioFOURCC('l','b','n','d')
  5903.   {$EXTERNALSYM DMUS_FOURCC_BAND_LIST}
  5904.   DMUS_FOURCC_BANDITEM_CHUNK  = DWORD(Byte('b') or (Byte('d') shl 8) or (Byte('i') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('b','d','i','h')
  5905.   {$EXTERNALSYM DMUS_FOURCC_BANDITEM_CHUNK}
  5906.   DMUS_FOURCC_BANDITEM_CHUNK2 = DWORD(Byte('b') or (Byte('d') shl 8) or (Byte('2') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('b','d','2','h')
  5907.   {$EXTERNALSYM DMUS_FOURCC_BANDITEM_CHUNK2}
  5908.  
  5909. type
  5910.   (* io structures *)
  5911.   PDMusIoBandTrackHeader = ^TDMusIoBandTrackHeader;
  5912.   _DMUS_IO_BAND_TRACK_HEADER = packed record
  5913.     bAutoDownload: BOOL;     (* Determines if Auto-Download is enabled. *)
  5914.   end;
  5915.   {$EXTERNALSYM _DMUS_IO_BAND_TRACK_HEADER}
  5916.   DMUS_IO_BAND_TRACK_HEADER = _DMUS_IO_BAND_TRACK_HEADER;
  5917.   {$EXTERNALSYM DMUS_IO_BAND_TRACK_HEADER}
  5918.   TDMusIoBandTrackHeader = _DMUS_IO_BAND_TRACK_HEADER;
  5919.  
  5920.   PDMusIoBandItemHeader = ^TDMusIoBandItemHeader;
  5921.   _DMUS_IO_BAND_ITEM_HEADER = packed record
  5922.     lBandTime: TMusicTime;   (* Position in track list. *)
  5923.   end;
  5924.   {$EXTERNALSYM _DMUS_IO_BAND_ITEM_HEADER}
  5925.   DMUS_IO_BAND_ITEM_HEADER = _DMUS_IO_BAND_ITEM_HEADER;
  5926.   {$EXTERNALSYM DMUS_IO_BAND_ITEM_HEADER}
  5927.   TDMusIoBandItemHeader = _DMUS_IO_BAND_ITEM_HEADER;
  5928.  
  5929.   PDMusIoBandItemHeader2 = ^TDMusIoBandItemHeader2;
  5930.   _DMUS_IO_BAND_ITEM_HEADER2 = packed record
  5931.     lBandTimeLogical: TMusicTime;   (* Position in track list. Time in the music with which band change is associated. *)
  5932.     lBandTimePhysical: TMusicTime;  (* Precise time band change will take effect. Should be close to logical time. *)
  5933.   end;
  5934.   {$EXTERNALSYM _DMUS_IO_BAND_ITEM_HEADER2}
  5935.   DMUS_IO_BAND_ITEM_HEADER2 = _DMUS_IO_BAND_ITEM_HEADER2;
  5936.   {$EXTERNALSYM DMUS_IO_BAND_ITEM_HEADER2}
  5937.   TDMusIoBandItemHeader2 = _DMUS_IO_BAND_ITEM_HEADER2;
  5938.  
  5939. (*
  5940. RIFF
  5941. (
  5942.     'DMBT'          // DirectMusic Band Track form-type
  5943.     [<bdth-ck>]     // Band track header
  5944.     [<guid-ck>]     // GUID for band track
  5945.     [<vers-ck>]     // Optional version info
  5946.     [<UNFO-list>]   // Name, author, copyright info., comments
  5947.     <lbdl-list>     // List of Band items
  5948. )
  5949.  
  5950.     // <bnth-ck>
  5951.     'bdth'
  5952.     (
  5953.         <DMUS_IO_BAND_TRACK_HEADER>
  5954.     )
  5955.  
  5956.     // <guid-ck>
  5957.     'guid'
  5958.     (
  5959.         <GUID>
  5960.     )
  5961.  
  5962.     // <vers-ck>
  5963.     vers
  5964.     (
  5965.         <DMUS_IO_VERSION>
  5966.     )
  5967.  
  5968.     // <lbdl-list>
  5969.     LIST
  5970.     (
  5971.         'lbdl'
  5972.         <lbnd-list>...  // Array of bands, each encapsulated in a list chunk
  5973.     )
  5974.  
  5975.         // <lbnd-list>
  5976.         LIST
  5977.         (
  5978.             'lbnd'
  5979.             <bdih-ck> or <bd2h-ck>  // bdih is a legacy format.  bd2h is preferred for new content.
  5980.             <DMBD-form> // Band
  5981.         )
  5982.  
  5983.             // <bdih-ck> or <bd2h-ck>       // band item header
  5984.             (
  5985.                 <DMUS_IO_BAND_ITEM_HEADER> or <DMUS_IO_BAND_ITEM_HEADER2> // Band item header
  5986.             )
  5987. *)
  5988.  
  5989.  
  5990. (*  File io for DirectMusic Band object
  5991. *)
  5992.  
  5993. const
  5994.   (* RIFF ids: *)
  5995.  
  5996.   DMUS_FOURCC_BAND_FORM        = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('B') shl 16) or (Byte('D') shl 24)); // mmioFOURCC('D','M','B','D')
  5997.   {$EXTERNALSYM DMUS_FOURCC_BAND_FORM}
  5998.   DMUS_FOURCC_INSTRUMENTS_LIST = DWORD(Byte('l') or (Byte('b') shl 8) or (Byte('i') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('l','b','i','l')
  5999.   {$EXTERNALSYM DMUS_FOURCC_INSTRUMENTS_LIST}
  6000.   DMUS_FOURCC_INSTRUMENT_LIST  = DWORD(Byte('l') or (Byte('b') shl 8) or (Byte('i') shl 16) or (Byte('n') shl 24)); // mmioFOURCC('l','b','i','n')
  6001.   {$EXTERNALSYM DMUS_FOURCC_INSTRUMENT_LIST}
  6002.   DMUS_FOURCC_INSTRUMENT_CHUNK = DWORD(Byte('b') or (Byte('i') shl 8) or (Byte('n') shl 16) or (Byte('s') shl 24)); // mmioFOURCC('b','i','n','s')
  6003.   {$EXTERNALSYM DMUS_FOURCC_INSTRUMENT_CHUNK}
  6004.  
  6005. (* Flags for DMUS_IO_INSTRUMENT
  6006.  *)
  6007.   DMUS_IO_INST_PATCH          = (1 shl 0);        (* dwPatch is valid. *)
  6008.   {$EXTERNALSYM DMUS_IO_INST_PATCH}
  6009.   DMUS_IO_INST_BANKSELECT     = (1 shl 1);        (* dwPatch contains a valid Bank Select MSB and LSB part *)
  6010.   {$EXTERNALSYM DMUS_IO_INST_BANKSELECT}
  6011.   DMUS_IO_INST_ASSIGN_PATCH   = (1 shl 3);        (* dwAssignPatch is valid *)
  6012.   {$EXTERNALSYM DMUS_IO_INST_ASSIGN_PATCH}
  6013.   DMUS_IO_INST_NOTERANGES     = (1 shl 4);        (* dwNoteRanges is valid *)
  6014.   {$EXTERNALSYM DMUS_IO_INST_NOTERANGES}
  6015.   DMUS_IO_INST_PAN            = (1 shl 5);        (* bPan is valid *)
  6016.   {$EXTERNALSYM DMUS_IO_INST_PAN}
  6017.   DMUS_IO_INST_VOLUME         = (1 shl 6);        (* bVolume is valid *)
  6018.   {$EXTERNALSYM DMUS_IO_INST_VOLUME}
  6019.   DMUS_IO_INST_TRANSPOSE      = (1 shl 7);        (* nTranspose is valid *)
  6020.   {$EXTERNALSYM DMUS_IO_INST_TRANSPOSE}
  6021.   DMUS_IO_INST_GM             = (1 shl 8);        (* Instrument is from GM collection *)
  6022.   {$EXTERNALSYM DMUS_IO_INST_GM}
  6023.   DMUS_IO_INST_GS             = (1 shl 9);        (* Instrument is from GS collection *)
  6024.   {$EXTERNALSYM DMUS_IO_INST_GS}
  6025.   DMUS_IO_INST_XG             = (1 shl 10);       (* Instrument is from XG collection *)
  6026.   {$EXTERNALSYM DMUS_IO_INST_XG}
  6027.   DMUS_IO_INST_CHANNEL_PRIORITY = (1 shl 11);     (* dwChannelPriority is valid *)
  6028.   {$EXTERNALSYM DMUS_IO_INST_CHANNEL_PRIORITY}
  6029.   DMUS_IO_INST_USE_DEFAULT_GM_SET = (1 shl 12);   (* Always use the default GM set for this patch,  *)
  6030.   {$EXTERNALSYM DMUS_IO_INST_USE_DEFAULT_GM_SET}
  6031.                                                   (* don't rely on the synth caps stating GM or GS in hardware. *)
  6032.   DMUS_IO_INST_PITCHBENDRANGE = (1 shl 13);       (* nPitchBendRange is valid *)
  6033.   {$EXTERNALSYM DMUS_IO_INST_PITCHBENDRANGE}
  6034.  
  6035. type
  6036.   (* io structures *)
  6037.   PDMusIoInstrument = ^TDMusIoInstrument;
  6038.   _DMUS_IO_INSTRUMENT = packed record
  6039.     dwPatch: DWORD;            (* MSB, LSB and Program change to define instrument *)
  6040.     dwAssignPatch: DWORD;      (* MSB, LSB and Program change to assign to instrument when downloading *)
  6041.     dwNoteRanges: array[0..3] of DWORD; (* 128 bits; one for each MIDI note instrument needs to able to play *)
  6042.     dwPChannel: DWORD;         (* PChannel instrument plays on *)
  6043.     dwFlags: DWORD;            (* DMUS_IO_INST_ flags *)
  6044.     bPan: Byte;                (* Pan for instrument *)
  6045.     bVolume: Byte;             (* Volume for instrument *)
  6046.     nTranspose: Smallint;      (* Number of semitones to transpose notes *)
  6047.     dwChannelPriority: DWORD;  (* Channel priority *)
  6048.     nPitchBendRange: Smallint; (* Number of semitones shifted by pitch bend *)
  6049.   end;
  6050.   {$EXTERNALSYM _DMUS_IO_INSTRUMENT}
  6051.   DMUS_IO_INSTRUMENT = _DMUS_IO_INSTRUMENT;
  6052.   {$EXTERNALSYM DMUS_IO_INSTRUMENT}
  6053.   TDMusIoInstrument = _DMUS_IO_INSTRUMENT;
  6054.  
  6055. (*
  6056. // <DMBD-form> bands can be embedded in other forms
  6057. RIFF
  6058. (
  6059.     'DMBD'          // DirectMusic Band chunk
  6060.     [<guid-ck>]     // GUID for band
  6061.     [<vers-ck>]     // Optional version info
  6062.     [<UNFO-list>]   // Name, author, copyright info., comments
  6063.     <lbil-list>     // List of Instruments
  6064. )
  6065.  
  6066.     // <guid-ck>
  6067.     'guid'
  6068.     (
  6069.         <GUID>
  6070.     )
  6071.  
  6072.     // <vers-ck>
  6073.     vers
  6074.     (
  6075.         <DMUS_IO_VERSION>
  6076.     )
  6077.  
  6078.     // <lbil-list>
  6079.     LIST
  6080.     (
  6081.         'lbil'          // Array of instruments
  6082.         <lbin-list>...  // Each instrument is encapsulated in a list
  6083.     )
  6084.  
  6085.         // <lbin-list>
  6086.         LIST
  6087.         (
  6088.             'lbin'
  6089.             <bins-ck>
  6090.             [<DMRF-list>]       // Optional reference to DLS Collection file.
  6091.         )
  6092.  
  6093.             // <bins-ck>            // Instrument chunk
  6094.             (
  6095.                 'bins'
  6096.                 <DMUS_IO_INSTRUMENT>    // Instrument header
  6097.             )
  6098. *)
  6099.  
  6100. (* This RIFF id and io struct have been added to allow wave files (and the wave object) to
  6101.    differentiate between streaming and one-shot waves, and to give a prefetch for streaming
  6102.    waves  *)
  6103.  
  6104. const
  6105.   DMUS_FOURCC_WAVEHEADER_CHUNK = DWORD(Byte('w') or (Byte('a') shl 8) or (Byte('v') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('w','a','v','h')
  6106.   {$EXTERNALSYM DMUS_FOURCC_WAVEHEADER_CHUNK}
  6107.  
  6108. type
  6109.   PDMusIoWaveHeader = ^TDMusIoWaveHeader;
  6110.   _DMUS_IO_WAVE_HEADER = packed record
  6111.     rtReadAhead: TReferenceTime; (* How far ahead in the stream wave data will be read (in REFERENCE_TIME).  Ignored for one-shot waves. *)
  6112.     dwFlags: DWORD;              (* Various flags, including whether this is a streaming wave and whether it can be invalidated. *)
  6113.   end;
  6114.   {$EXTERNALSYM _DMUS_IO_WAVE_HEADER}
  6115.   DMUS_IO_WAVE_HEADER = _DMUS_IO_WAVE_HEADER;
  6116.   {$EXTERNALSYM DMUS_IO_WAVE_HEADER}
  6117.   TDMusIoWaveHeader = _DMUS_IO_WAVE_HEADER;
  6118.  
  6119.  
  6120. (*  File io for Wave track *)
  6121.  
  6122. const
  6123. (* RIFF ids: *)
  6124.  
  6125.   DMUS_FOURCC_WAVETRACK_LIST  = DWORD(Byte('w') or (Byte('a') shl 8) or (Byte('v') shl 16) or (Byte('t') shl 24)); // mmioFOURCC('w','a','v','t')
  6126.   {$EXTERNALSYM DMUS_FOURCC_WAVETRACK_LIST}
  6127.   DMUS_FOURCC_WAVETRACK_CHUNK = DWORD(Byte('w') or (Byte('a') shl 8) or (Byte('t') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('w','a','t','h')
  6128.   {$EXTERNALSYM DMUS_FOURCC_WAVETRACK_CHUNK}
  6129.   DMUS_FOURCC_WAVEPART_LIST   = DWORD(Byte('w') or (Byte('a') shl 8) or (Byte('v') shl 16) or (Byte('p') shl 24)); // mmioFOURCC('w','a','v','p')
  6130.   {$EXTERNALSYM DMUS_FOURCC_WAVEPART_LIST}
  6131.   DMUS_FOURCC_WAVEPART_CHUNK  = DWORD(Byte('w') or (Byte('a') shl 8) or (Byte('p') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('w','a','p','h')
  6132.   {$EXTERNALSYM DMUS_FOURCC_WAVEPART_CHUNK}
  6133.   DMUS_FOURCC_WAVEITEM_LIST   = DWORD(Byte('w') or (Byte('a') shl 8) or (Byte('v') shl 16) or (Byte('i') shl 24)); // mmioFOURCC('w','a','v','i')
  6134.   {$EXTERNALSYM DMUS_FOURCC_WAVEITEM_LIST}
  6135.   DMUS_FOURCC_WAVE_LIST       = DWORD(Byte('w') or (Byte('a') shl 8) or (Byte('v') shl 16) or (Byte('e') shl 24)); // mmioFOURCC('w','a','v','e')
  6136.   {$EXTERNALSYM DMUS_FOURCC_WAVE_LIST}
  6137.   DMUS_FOURCC_WAVEITEM_CHUNK  = DWORD(Byte('w') or (Byte('a') shl 8) or (Byte('i') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('w','a','i','h')
  6138.   {$EXTERNALSYM DMUS_FOURCC_WAVEITEM_CHUNK}
  6139.  
  6140. (* This flag is included in DMUS_IO_WAVE_TRACK_HEADER.dwFlags.  If set, the track will get its
  6141.    variations from a pattern track, via GetParam(GUID_Variations). *)
  6142.   DMUS_WAVETRACKF_SYNC_VAR   = $1;
  6143.   {$EXTERNALSYM DMUS_WAVETRACKF_SYNC_VAR}
  6144. (* This is also included in DMUS_IO_WAVE_TRACK_HEADER.dwFlags.  If set, variation control
  6145.    information will persist from one playback instance to the next.*)
  6146.   DMUS_WAVETRACKF_PERSIST_CONTROL = $2;
  6147.   {$EXTERNALSYM DMUS_WAVETRACKF_PERSIST_CONTROL}
  6148.  
  6149. type
  6150.   PDMusIoWaveTrackHeader = ^TDMusIoWaveTrackHeader;
  6151.   _DMUS_IO_WAVE_TRACK_HEADER = packed record
  6152.     lVolume: Longint;      (* Gain, in 1/100th of dB, to be applied to all waves.  Note:  All gain values should be negative. *)
  6153.     dwFlags: DWORD;        (* Flags, including whether this track syncs to a pattern track for its variations. *)
  6154.   end;
  6155.   {$EXTERNALSYM _DMUS_IO_WAVE_TRACK_HEADER}
  6156.   DMUS_IO_WAVE_TRACK_HEADER = _DMUS_IO_WAVE_TRACK_HEADER;
  6157.   {$EXTERNALSYM DMUS_IO_WAVE_TRACK_HEADER}
  6158.   TDMusIoWaveTrackHeader = _DMUS_IO_WAVE_TRACK_HEADER;
  6159.  
  6160.   PDMusIoWavePartHeader = ^TDMusIoWavePartHeader;
  6161.   _DMUS_IO_WAVE_PART_HEADER = packed record
  6162.     lVolume: Longint;      (* Gain, in 1/100th of dB, to be applied to all waves in wave part.  Note:  All gain values should be negative. *)
  6163.     dwVariations: DWORD;   (* Variation mask for which of 32 variations *)
  6164.     dwPChannel: DWORD;     (* PChannel *)
  6165.     dwLockToPart: DWORD;   (* Part ID to lock to. *)
  6166.     dwFlags: DWORD;        (* Flags, including stuff for managing how variations are chosen (in low-order nibble) *)
  6167.     dwIndex: DWORD;        (* Index for distinguishing multiple parts on the same PChannel*)
  6168.   end;
  6169.   {$EXTERNALSYM _DMUS_IO_WAVE_PART_HEADER}
  6170.   DMUS_IO_WAVE_PART_HEADER = _DMUS_IO_WAVE_PART_HEADER;
  6171.   {$EXTERNALSYM DMUS_IO_WAVE_PART_HEADER}
  6172.   TDMusIoWavePartHeader = _DMUS_IO_WAVE_PART_HEADER;
  6173.  
  6174.   PDMusIoWaveItemHeader = ^TDMusIoWaveItemHeader;
  6175.   _DMUS_IO_WAVE_ITEM_HEADER = packed record
  6176.     lVolume: Longint;               (* Gain, in 1/100th of dB.  Note:  All gain values should be negative. *)
  6177.     lPitch: Longint;                (* Pitch offset in 1/100th of a semitone. *)
  6178.     dwVariations: DWORD;            (* Variation flags for which of 32 variations this wave belongs to. *)
  6179.     rtTime: TReferenceTime;         (* Start time, in REFERENCE_TIME, if clock time track, or MUSIC_TIME for music time track. *)
  6180.     rtStartOffset: TReferenceTime;  (* Distance into wave to start playback, in reference time units. *)
  6181.     rtReserved: TReferenceTime;     (* Reserved field. *)
  6182.     rtDuration: TReferenceTime;     (* Duration, in REFERENCE_TIME or MUSIC_TIME, depending on track timing format. *)
  6183.     mtLogicalTime: TMusicTime;      (* If in music track format, this indicates the musical boundary where this belongs. Otherwise, ignored. *)
  6184.     dwLoopStart: DWORD;             (* Start point for a looping wave. *)
  6185.     dwLoopEnd: DWORD;               (* End point for a looping wave. *)
  6186.     dwFlags: DWORD;                 (* Various flags, including whether this is a streaming wave and whether it can be invalidated. *)
  6187.     wVolumeRange: Word;             (* Random range for volume. *)
  6188.     wPitchRange: Word;              (* Random range for pitch. *)
  6189.   end;
  6190.   {$EXTERNALSYM _DMUS_IO_WAVE_ITEM_HEADER}
  6191.   DMUS_IO_WAVE_ITEM_HEADER = _DMUS_IO_WAVE_ITEM_HEADER;
  6192.   {$EXTERNALSYM DMUS_IO_WAVE_ITEM_HEADER}
  6193.   TDMusIoWaveItemHeader = _DMUS_IO_WAVE_ITEM_HEADER;
  6194.  
  6195. (*
  6196. LIST
  6197. {
  6198.     'wavt'          // Wave track chunk
  6199.     <wath-ck>       // Wave track header
  6200.     <wavp-list>...  // Array of Wave Parts
  6201. }
  6202.     // <wath-ck>
  6203.     'wath'
  6204.     {
  6205.         <DMUS_IO_WAVE_TRACK_HEADER>
  6206.     }
  6207.  
  6208.     //  <wavp-list>
  6209.     LIST
  6210.     {
  6211.         'wavp'
  6212.         <waph-ck>       //  Wave Part Header
  6213.         <wavi-list>     //  List of wave items
  6214.     }
  6215.  
  6216.         //  <waph-ck>
  6217.         'waph'
  6218.         {
  6219.             <DMUS_IO_WAVE_PART_HEADER>
  6220.         }
  6221.  
  6222.         //  <wavi-list>
  6223.         LIST
  6224.         {
  6225.             'wavi'
  6226.             <wave-list>...  //  Array of waves; each wave is encapsulated in a list
  6227.         }
  6228.  
  6229.             //  <wave-list>
  6230.             LIST
  6231.             {
  6232.                 'wave'
  6233.                 <waih-ck>       //  Wave item header
  6234.                 <DMRF-list>     //  Reference to wave object
  6235.             }
  6236.  
  6237.                 //  <waih-ck>
  6238.                 'waih'
  6239.                 {
  6240.                     <DMUS_IO_WAVE_ITEM_HEADER>
  6241.                 }
  6242.  
  6243. *)
  6244.  
  6245. (*  File io for DirectMusic Container file. This embeds a set of related files. And,
  6246.     in turn, it can be embedded within a segment or script file.
  6247. *)
  6248.  
  6249. const
  6250.   DMUS_FOURCC_CONTAINER_FORM         = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('C') shl 16) or (Byte('N') shl 24)); // mmioFOURCC('D','M','C','N')
  6251.   {$EXTERNALSYM DMUS_FOURCC_CONTAINER_FORM}
  6252.   DMUS_FOURCC_CONTAINER_CHUNK        = DWORD(Byte('c') or (Byte('o') shl 8) or (Byte('n') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('c','o','n','h')
  6253.   {$EXTERNALSYM DMUS_FOURCC_CONTAINER_CHUNK}
  6254.   DMUS_FOURCC_CONTAINED_ALIAS_CHUNK  = DWORD(Byte('c') or (Byte('o') shl 8) or (Byte('b') shl 16) or (Byte('a') shl 24)); // mmioFOURCC('c','o','b','a')
  6255.   {$EXTERNALSYM DMUS_FOURCC_CONTAINED_ALIAS_CHUNK}
  6256.   DMUS_FOURCC_CONTAINED_OBJECT_CHUNK = DWORD(Byte('c') or (Byte('o') shl 8) or (Byte('b') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('c','o','b','h')
  6257.   {$EXTERNALSYM DMUS_FOURCC_CONTAINED_OBJECT_CHUNK}
  6258.   DMUS_FOURCC_CONTAINED_OBJECTS_LIST = DWORD(Byte('c') or (Byte('o') shl 8) or (Byte('s') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('c','o','s','l')
  6259.   {$EXTERNALSYM DMUS_FOURCC_CONTAINED_OBJECTS_LIST}
  6260.   DMUS_FOURCC_CONTAINED_OBJECT_LIST  = DWORD(Byte('c') or (Byte('o') shl 8) or (Byte('b') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('c','o','b','l')
  6261.   {$EXTERNALSYM DMUS_FOURCC_CONTAINED_OBJECT_LIST}
  6262.  
  6263. type
  6264.   PDMusIoContainerHeader = ^TDMusIoContainerHeader;
  6265.   _DMUS_IO_CONTAINER_HEADER = packed record
  6266.     dwFlags: DWORD;        (* Flags. *)
  6267.   end;
  6268.   {$EXTERNALSYM _DMUS_IO_CONTAINER_HEADER}
  6269.   DMUS_IO_CONTAINER_HEADER = _DMUS_IO_CONTAINER_HEADER;
  6270.   {$EXTERNALSYM DMUS_IO_CONTAINER_HEADER}
  6271.   TDMusIoContainerHeader = _DMUS_IO_CONTAINER_HEADER;
  6272.  
  6273.  
  6274. const
  6275.   DMUS_CONTAINER_NOLOADS  = (1 shl 1);  (* Contained items are not loaded when the container is loaded.
  6276.                                            Entries will be created in the loader (via SetObject) but
  6277.                                            the actual objects will not be created until they are
  6278.                                            specifically loaded at a later time. *)
  6279.   {$EXTERNALSYM DMUS_CONTAINER_NOLOADS}
  6280.  
  6281. type
  6282.   PDMusIoContainedObjectHeader = ^TDMusIoContainedObjectHeader;
  6283.   _DMUS_IO_CONTAINED_OBJECT_HEADER = packed record
  6284.     guidClassID: TGUID;    (* Class id of object. *)
  6285.     dwFlags: DWORD;        (* Flags, for example DMUS_CONTAINED_OBJF_KEEP. *)
  6286.     ckid: FOURCC;          (* chunk ID of track's data chunk if 0 fccType valid. *)
  6287.     fccType: FOURCC;       (* list type if NULL ckid valid */
  6288.         (* Note that LIST:DMRF may be used for ckid and fccType in order to reference an
  6289.            object instead of embedding it within the container. *)
  6290.   end;
  6291.   {$EXTERNALSYM _DMUS_IO_CONTAINED_OBJECT_HEADER}
  6292.   DMUS_IO_CONTAINED_OBJECT_HEADER = _DMUS_IO_CONTAINED_OBJECT_HEADER;
  6293.   {$EXTERNALSYM DMUS_IO_CONTAINED_OBJECT_HEADER}
  6294.   TDMusIoContainedObjectHeader = _DMUS_IO_CONTAINED_OBJECT_HEADER;
  6295.  
  6296. const
  6297.   DMUS_CONTAINED_OBJF_KEEP    = 1;   (* Keep the object cached in the loader after the container is released. *)
  6298.   {$EXTERNALSYM DMUS_CONTAINED_OBJF_KEEP}
  6299.  
  6300. (*
  6301. RIFF
  6302. (
  6303.     'DMCN'          // DirectMusic Container chunk
  6304.     <conh-ck>       // Container header chunk
  6305.     [<guid-ck>]     // GUID for container
  6306.     [<vers-ck>]     // Optional version info
  6307.     [<UNFO-list>]   // Name, author, copyright info., comments
  6308.     <cosl-list>     // List of objects.
  6309. )
  6310.  
  6311.     // <conh-ck>
  6312.     'conh'
  6313.     (
  6314.         <DMUS_IO_CONTAINER_HEADER>
  6315.     )
  6316.  
  6317.     // <guid-ck>
  6318.     'guid'
  6319.     (
  6320.         <GUID>
  6321.     )
  6322.  
  6323.     // <vers-ck>
  6324.     vers
  6325.     (
  6326.         <DMUS_IO_VERSION>
  6327.     )
  6328.  
  6329.     LIST
  6330.     (
  6331.         'cosl'          // Array of embedded objects.
  6332.         <cobl-list>...  // Each object is encapsulated in a LIST chunk
  6333.     )
  6334.  
  6335.     // <cobl-list>      // Encapsulates one object
  6336.     LIST
  6337.     (
  6338.         'cobl'
  6339.         [<coba-ck>]         // Alias.  An alternative name by which this object is known
  6340.                             // within the container.
  6341.         <cobh-ck>           // Required header, includes CLASS ID for object.
  6342.         [<data>] or <DMRF>  // Object data of the type specified in <cobh-ck>.
  6343.                             // If DMRF, it is a reference of where to find the object.
  6344.                             // Otherwise, it could be any RIFF readable chunk in the
  6345.                             //    exact same format as a file.  The object will load
  6346.                             //    itself from this data.
  6347.     )
  6348.  
  6349.     // <coba-ck>
  6350.     'coba'
  6351.     (
  6352.         // Alias, stored as NULL terminated string of WCHARs
  6353.     )
  6354.  
  6355.     // <cobh-ck>
  6356.     'cobh'
  6357.     (
  6358.         <DMUS_IO_CONTAINED_OBJECT_HEADER>
  6359.     )
  6360. *)
  6361.  
  6362. (*  File io for DirectMusic Segment object *)
  6363.  
  6364. (* RIFF ids: *)
  6365.  
  6366. const
  6367.   DMUS_FOURCC_SEGMENT_FORM  = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('S') shl 16) or (Byte('G') shl 24)); // mmioFOURCC('D','M','S','G')
  6368.   {$EXTERNALSYM DMUS_FOURCC_SEGMENT_FORM}
  6369.   DMUS_FOURCC_SEGMENT_CHUNK = DWORD(Byte('s') or (Byte('e') shl 8) or (Byte('g') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('s','e','g','h')
  6370.   {$EXTERNALSYM DMUS_FOURCC_SEGMENT_CHUNK}
  6371.   DMUS_FOURCC_TRACK_LIST    = DWORD(Byte('t') or (Byte('r') shl 8) or (Byte('k') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('t','r','k','l')
  6372.   {$EXTERNALSYM DMUS_FOURCC_TRACK_LIST}
  6373.   DMUS_FOURCC_TRACK_FORM    = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('T') shl 16) or (Byte('K') shl 24)); // mmioFOURCC('D','M','T','K')
  6374.   {$EXTERNALSYM DMUS_FOURCC_TRACK_FORM}
  6375.   DMUS_FOURCC_TRACK_CHUNK   = DWORD(Byte('t') or (Byte('r') shl 8) or (Byte('k') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('t','r','k','h')
  6376.   {$EXTERNALSYM DMUS_FOURCC_TRACK_CHUNK}
  6377.   DMUS_FOURCC_TRACK_EXTRAS_CHUNK = DWORD(Byte('t') or (Byte('r') shl 8) or (Byte('k') shl 16) or (Byte('x') shl 24)); // mmioFOURCC('t','r','k','x')
  6378.   {$EXTERNALSYM DMUS_FOURCC_TRACK_EXTRAS_CHUNK}
  6379.  
  6380.   (* io structures:*)
  6381.  
  6382. type
  6383.   PDMusIoSegmentHeader = ^TDMusIoSegmentHeader;
  6384.   _DMUS_IO_SEGMENT_HEADER = packed record
  6385.     dwRepeats: DWORD;           (* Number of repeats. By default, 0. *)
  6386.     mtLength: TMusicTime;       (* Length, in music time. *)
  6387.     mtPlayStart: TMusicTime;    (* Start of playback. By default, 0. *)
  6388.     mtLoopStart: TMusicTime;    (* Start of looping portion. By default, 0. *)
  6389.     mtLoopEnd: TMusicTime;      (* End of loop. Must be greater than dwPlayStart. Or, 0, indicating loop full segment. *)
  6390.     dwResolution: DWORD;        (* Default resolution. *)
  6391.     // Following added for DX8:
  6392.     rtLength: TReferenceTime;   (* Length, in reference time (overrides music time length.) *)
  6393.     dwFlags: DWORD;
  6394.     dwReserved: DWORD;          (* Reserved. *)
  6395.     // Added for DX9.
  6396.     rtLoopStart: TReferenceTime; (* Clock time loop start. *)
  6397.     rtLoopEnd: TReferenceTime;   (* Clock time loop end. *)
  6398.     rtPlayStart: TReferenceTime; (* Start of playback in clock time. *) 
  6399.   end;
  6400.   {$EXTERNALSYM _DMUS_IO_SEGMENT_HEADER}
  6401.   DMUS_IO_SEGMENT_HEADER = _DMUS_IO_SEGMENT_HEADER;
  6402.   {$EXTERNALSYM DMUS_IO_SEGMENT_HEADER}
  6403.   TDMusIoSegmentHeader = _DMUS_IO_SEGMENT_HEADER;
  6404.  
  6405. const
  6406.   DMUS_SEGIOF_REFLENGTH = 1;  // Use the time in rtLength for the segment length.
  6407.   {$EXTERNALSYM DMUS_SEGIOF_REFLENGTH}
  6408.   DMUS_SEGIOF_CLOCKTIME = 2;  // This is a clock time segment.
  6409.   {$EXTERNALSYM DMUS_SEGIOF_CLOCKTIME}
  6410.  
  6411. type
  6412.   PDMusIoTrackHeader = ^TDMusIoTrackHeader;
  6413.   _DMUS_IO_TRACK_HEADER = packed record
  6414.     guidClassID: TGUID;    (* Class id of track. *)
  6415.     dwPosition: DWORD;     (* Position in track list. *)
  6416.     dwGroup: DWORD;        (* Group bits for track. *)
  6417.     ckid: FOURCC;          (* chunk ID of track's data chunk. *)
  6418.     fccType: FOURCC;       (* list type if ckid is RIFF or LIST *)
  6419.   end;
  6420.   {$EXTERNALSYM _DMUS_IO_TRACK_HEADER}
  6421.   DMUS_IO_TRACK_HEADER = _DMUS_IO_TRACK_HEADER;
  6422.   {$EXTERNALSYM DMUS_IO_TRACK_HEADER}
  6423.   TDMusIoTrackHeader = _DMUS_IO_TRACK_HEADER;
  6424.  
  6425. (*  Additional parameters for the track header chunk, introduced in DX8 and
  6426.     on, are stored in a separate chunk. *)
  6427.  
  6428.   PDMusIoTrackExtrasHeader = ^TDMusIoTrackExtrasHeader;
  6429.   _DMUS_IO_TRACK_EXTRAS_HEADER = packed record
  6430.     dwFlags: DWORD;        (* DX8 Added flags for control tracks. *)
  6431.     dwPriority: DWORD;     (* Priority for composition. *)
  6432.   end;
  6433.   {$EXTERNALSYM _DMUS_IO_TRACK_EXTRAS_HEADER}
  6434.   DMUS_IO_TRACK_EXTRAS_HEADER = _DMUS_IO_TRACK_EXTRAS_HEADER;
  6435.   {$EXTERNALSYM DMUS_IO_TRACK_EXTRAS_HEADER}
  6436.   TDMusIoTrackExtrasHeader = _DMUS_IO_TRACK_EXTRAS_HEADER;
  6437.  
  6438. (*
  6439. RIFF
  6440. (
  6441.     'DMSG'          // DirectMusic Segment chunk
  6442.     <segh-ck>       // Segment header chunk
  6443.     [<guid-ck>]     // GUID for segment
  6444.     [<vers-ck>]     // Optional version info
  6445.     [<UNFO-list>]   // Name, author, copyright info., comments
  6446.     [<DMCN-form>]   // Optional container of objects embedded in file. Must precede tracklist.
  6447.     <trkl-list>     // List of Tracks
  6448.     [<DMTG-form>]   // Optional ToolGraph
  6449.     [<DMAP-form>]   // Optional Audio Path
  6450. )
  6451.  
  6452.     // <segh-ck>        
  6453.     'segh'
  6454.     (
  6455.         <DMUS_IO_SEGMENT_HEADER>
  6456.     )
  6457.     
  6458.     // <guid-ck>
  6459.     'guid'
  6460.     (
  6461.         <GUID>
  6462.     )
  6463.  
  6464.     // <vers-ck>
  6465.     vers
  6466.     (
  6467.         <DMUS_IO_VERSION>
  6468.     )
  6469.  
  6470.     // <trkl-list>
  6471.     LIST
  6472.     (
  6473.         'trkl'          // Array of tracks
  6474.         <DMTK-form>...  // Each track is encapsulated in a RIFF chunk
  6475.     )
  6476.  
  6477.     // <DMTK-form>      // Tracks can be embedded in a segment or stored as separate files.
  6478.     RIFF
  6479.     (
  6480.         'DMTK'
  6481.         <trkh-ck>
  6482.         [<trkx-ck>]     // Optional track flags.
  6483.         [<guid-ck>]     // Optional GUID for track object instance (not to be confused with Class id in track header)
  6484.         [<vers-ck>]     // Optional version info
  6485.         [<UNFO-list>]   // Optional name, author, copyright info., comments
  6486.         [<data>]        // Track data. Must be a RIFF readable chunk.
  6487.     )
  6488.  
  6489.     // <trkh-ck>            // Track header chunk
  6490.     (
  6491.         'trkh'
  6492.         <DMUS_IO_TRACK_HEADER>  // Track header
  6493.     )
  6494.  
  6495.     // <trkx-ck>            // Track flags chunk
  6496.     (
  6497.         'trkx'
  6498.         <DMUS_IO_TRACK_EXTRAS_HEADER>  // DX8 Track flags header
  6499.     )
  6500. *)
  6501.  
  6502. (*  File io for DirectMusic reference chunk.
  6503.     This is used to embed a reference to an object.
  6504. *)
  6505.  
  6506. const
  6507.   (*  RIFF ids: *)
  6508.  
  6509.   DMUS_FOURCC_REF_LIST   = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('R') shl 16) or (Byte('F') shl 24)); // mmioFOURCC('D','M','R','F')
  6510.   {$EXTERNALSYM DMUS_FOURCC_REF_LIST}
  6511.   DMUS_FOURCC_REF_CHUNK  = DWORD(Byte('r') or (Byte('e') shl 8) or (Byte('f') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('r','e','f','h')
  6512.   {$EXTERNALSYM DMUS_FOURCC_REF_CHUNK}
  6513.   DMUS_FOURCC_DATE_CHUNK = DWORD(Byte('d') or (Byte('a') shl 8) or (Byte('t') shl 16) or (Byte('e') shl 24)); // mmioFOURCC('d','a','t','e')
  6514.   {$EXTERNALSYM DMUS_FOURCC_DATE_CHUNK}
  6515.   DMUS_FOURCC_NAME_CHUNK = DWORD(Byte('n') or (Byte('a') shl 8) or (Byte('m') shl 16) or (Byte('e') shl 24)); // mmioFOURCC('n','a','m','e')
  6516.   {$EXTERNALSYM DMUS_FOURCC_NAME_CHUNK}
  6517.   DMUS_FOURCC_FILE_CHUNK = DWORD(Byte('f') or (Byte('i') shl 8) or (Byte('l') shl 16) or (Byte('e') shl 24)); // mmioFOURCC('f','i','l','e')
  6518.   {$EXTERNALSYM DMUS_FOURCC_FILE_CHUNK}
  6519.  
  6520. type
  6521.   PDMusIoReference = ^TDMusIoReference;
  6522.   _DMUS_IO_REFERENCE = packed record
  6523.     guidClassID: TGUID;    (* Class id is always required. *)
  6524.     dwValidData: DWORD;    (* Flags. *)
  6525.   end;
  6526.   {$EXTERNALSYM _DMUS_IO_REFERENCE}
  6527.   DMUS_IO_REFERENCE = _DMUS_IO_REFERENCE;
  6528.   {$EXTERNALSYM DMUS_IO_REFERENCE}
  6529.   TDMusIoReference = _DMUS_IO_REFERENCE;
  6530.  
  6531. (*
  6532. LIST
  6533. (
  6534.     'DMRF'          // DirectMusic Reference chunk
  6535.     <refh-ck>       // Reference header chunk
  6536.     [<guid-ck>]     // Optional object GUID.
  6537.     [<date-ck>]     // Optional file date.
  6538.     [<name-ck>]     // Optional name.
  6539.     [<file-ck>]     // Optional file name.
  6540.     [<catg-ck>]     // Optional category name.
  6541.     [<vers-ck>]     // Optional version info.
  6542. )
  6543.  
  6544.     // <refh-ck>
  6545.     'refh'
  6546.     (
  6547.         <DMUS_IO_REFERENCE>
  6548.     )
  6549.  
  6550.     // <guid-ck>
  6551.     'guid'
  6552.     (
  6553.         <GUID>
  6554.     )
  6555.  
  6556.     // <date-ck>
  6557.     date
  6558.     (
  6559.         <FILETIME>
  6560.     )
  6561.  
  6562.     // <name-ck>
  6563.     name
  6564.     (
  6565.         // Name, stored as NULL terminated string of WCHARs
  6566.     )
  6567.  
  6568.     // <file-ck>
  6569.     file
  6570.     (
  6571.         // File name, stored as NULL terminated string of WCHARs
  6572.     )
  6573.  
  6574.     // <catg-ck>
  6575.     catg
  6576.     (
  6577.         // Category name, stored as NULL terminated string of WCHARs
  6578.     )
  6579.  
  6580.     // <vers-ck>
  6581.     vers
  6582.     (
  6583.         <DMUS_IO_VERSION>
  6584.     )
  6585. *)
  6586.  
  6587. const
  6588.   (* Chord Maps *)
  6589.  
  6590.   (* runtime chunks *)
  6591.   DMUS_FOURCC_CHORDMAP_FORM      = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('P') shl 16) or (Byte('R') shl 24)); // mmioFOURCC('D','M','P','R')
  6592.   {$EXTERNALSYM DMUS_FOURCC_CHORDMAP_FORM}
  6593.   DMUS_FOURCC_IOCHORDMAP_CHUNK   = DWORD(Byte('p') or (Byte('e') shl 8) or (Byte('r') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('p','e','r','h')
  6594.   {$EXTERNALSYM DMUS_FOURCC_IOCHORDMAP_CHUNK}
  6595.   DMUS_FOURCC_SUBCHORD_CHUNK     = DWORD(Byte('c') or (Byte('h') shl 8) or (Byte('d') shl 16) or (Byte('t') shl 24)); // mmioFOURCC('c','h','d','t')
  6596.   {$EXTERNALSYM DMUS_FOURCC_SUBCHORD_CHUNK}
  6597.   DMUS_FOURCC_CHORDENTRY_CHUNK   = DWORD(Byte('c') or (Byte('h') shl 8) or (Byte('e') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('c','h','e','h')
  6598.   {$EXTERNALSYM DMUS_FOURCC_CHORDENTRY_CHUNK}
  6599.   DMUS_FOURCC_SUBCHORDID_CHUNK   = DWORD(Byte('s') or (Byte('b') shl 8) or (Byte('c') shl 16) or (Byte('n') shl 24)); // mmioFOURCC('s','b','c','n')
  6600.   {$EXTERNALSYM DMUS_FOURCC_SUBCHORDID_CHUNK}
  6601.   DMUS_FOURCC_IONEXTCHORD_CHUNK  = DWORD(Byte('n') or (Byte('c') shl 8) or (Byte('r') shl 16) or (Byte('d') shl 24)); // mmioFOURCC('n','c','r','d')
  6602.   {$EXTERNALSYM DMUS_FOURCC_IONEXTCHORD_CHUNK}
  6603.   DMUS_FOURCC_NEXTCHORDSEQ_CHUNK = DWORD(Byte('n') or (Byte('c') shl 8) or (Byte('s') shl 16) or (Byte('q') shl 24)); // mmioFOURCC('n','c','s','q')
  6604.   {$EXTERNALSYM DMUS_FOURCC_NEXTCHORDSEQ_CHUNK}
  6605.   DMUS_FOURCC_IOSIGNPOST_CHUNK   = DWORD(Byte('s') or (Byte('p') shl 8) or (Byte('s') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('s','p','s','h')
  6606.   {$EXTERNALSYM DMUS_FOURCC_IOSIGNPOST_CHUNK}
  6607.   DMUS_FOURCC_CHORDNAME_CHUNK    = DWORD(Byte('I') or (Byte('N') shl 8) or (Byte('A') shl 16) or (Byte('M') shl 24)); // mmioFOURCC('I','N','A','M')
  6608.   {$EXTERNALSYM DMUS_FOURCC_CHORDNAME_CHUNK}
  6609.  
  6610.   (* runtime list chunks *)
  6611.   DMUS_FOURCC_CHORDENTRY_LIST    = DWORD(Byte('c') or (Byte('h') shl 8) or (Byte('o') shl 16) or (Byte('e') shl 24)); // mmioFOURCC('c','h','o','e')
  6612.   {$EXTERNALSYM DMUS_FOURCC_CHORDENTRY_LIST}
  6613.   DMUS_FOURCC_CHORDMAP_LIST      = DWORD(Byte('c') or (Byte('m') shl 8) or (Byte('a') shl 16) or (Byte('p') shl 24)); // mmioFOURCC('c','m','a','p')
  6614.   {$EXTERNALSYM DMUS_FOURCC_CHORDMAP_LIST}
  6615.   DMUS_FOURCC_CHORD_LIST         = DWORD(Byte('c') or (Byte('h') shl 8) or (Byte('r') shl 16) or (Byte('d') shl 24)); // mmioFOURCC('c','h','r','d')
  6616.   {$EXTERNALSYM DMUS_FOURCC_CHORD_LIST}
  6617.   DMUS_FOURCC_CHORDPALETTE_LIST  = DWORD(Byte('c') or (Byte('h') shl 8) or (Byte('p') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('c','h','p','l')
  6618.   {$EXTERNALSYM DMUS_FOURCC_CHORDPALETTE_LIST}
  6619.   DMUS_FOURCC_CADENCE_LIST       = DWORD(Byte('c') or (Byte('a') shl 8) or (Byte('d') shl 16) or (Byte('e') shl 24)); // mmioFOURCC('c','a','d','e')
  6620.   {$EXTERNALSYM DMUS_FOURCC_CADENCE_LIST}
  6621.   DMUS_FOURCC_SIGNPOSTITEM_LIST  = DWORD(Byte('s') or (Byte('p') shl 8) or (Byte('s') shl 16) or (Byte('t') shl 24)); // mmioFOURCC('s','p','s','t')
  6622.   {$EXTERNALSYM DMUS_FOURCC_SIGNPOSTITEM_LIST}
  6623.  
  6624.   DMUS_FOURCC_SIGNPOST_LIST      = DWORD(Byte('s') or (Byte('p') shl 8) or (Byte('s') shl 16) or (Byte('q') shl 24)); // mmioFOURCC('s','p','s','q')
  6625.   {$EXTERNALSYM DMUS_FOURCC_SIGNPOST_LIST}
  6626.  
  6627.   (* values for dwChord field of DMUS_IO_PERS_SIGNPOST *)
  6628.   (* DMUS_SIGNPOSTF_ flags are also used in templates (DMUS_IO_SIGNPOST) *)
  6629.   DMUS_SIGNPOSTF_A        = 1;
  6630.   {$EXTERNALSYM DMUS_SIGNPOSTF_A}
  6631.   DMUS_SIGNPOSTF_B        = 2;
  6632.   {$EXTERNALSYM DMUS_SIGNPOSTF_B}
  6633.   DMUS_SIGNPOSTF_C        = 4;
  6634.   {$EXTERNALSYM DMUS_SIGNPOSTF_C}
  6635.   DMUS_SIGNPOSTF_D        = 8;
  6636.   {$EXTERNALSYM DMUS_SIGNPOSTF_D}
  6637.   DMUS_SIGNPOSTF_E        = $10;
  6638.   {$EXTERNALSYM DMUS_SIGNPOSTF_E}
  6639.   DMUS_SIGNPOSTF_F        = $20;
  6640.   {$EXTERNALSYM DMUS_SIGNPOSTF_F}
  6641.   DMUS_SIGNPOSTF_LETTER   = (DMUS_SIGNPOSTF_A or DMUS_SIGNPOSTF_B or DMUS_SIGNPOSTF_C or DMUS_SIGNPOSTF_D or DMUS_SIGNPOSTF_E or DMUS_SIGNPOSTF_F);
  6642.   {$EXTERNALSYM DMUS_SIGNPOSTF_LETTER}
  6643.   DMUS_SIGNPOSTF_1        = $100;
  6644.   {$EXTERNALSYM DMUS_SIGNPOSTF_1}
  6645.   DMUS_SIGNPOSTF_2        = $200;
  6646.   {$EXTERNALSYM DMUS_SIGNPOSTF_2}
  6647.   DMUS_SIGNPOSTF_3        = $400;
  6648.   {$EXTERNALSYM DMUS_SIGNPOSTF_3}
  6649.   DMUS_SIGNPOSTF_4        = $800;
  6650.   {$EXTERNALSYM DMUS_SIGNPOSTF_4}
  6651.   DMUS_SIGNPOSTF_5        = $1000;
  6652.   {$EXTERNALSYM DMUS_SIGNPOSTF_5}
  6653.   DMUS_SIGNPOSTF_6        = $2000;
  6654.   {$EXTERNALSYM DMUS_SIGNPOSTF_6}
  6655.   DMUS_SIGNPOSTF_7        = $4000;
  6656.   {$EXTERNALSYM DMUS_SIGNPOSTF_7}
  6657.   DMUS_SIGNPOSTF_ROOT     = (DMUS_SIGNPOSTF_1 or DMUS_SIGNPOSTF_2 or DMUS_SIGNPOSTF_3 or DMUS_SIGNPOSTF_4 or DMUS_SIGNPOSTF_5 or DMUS_SIGNPOSTF_6 or DMUS_SIGNPOSTF_7);
  6658.   {$EXTERNALSYM DMUS_SIGNPOSTF_ROOT}
  6659.   DMUS_SIGNPOSTF_CADENCE  = $8000;
  6660.   {$EXTERNALSYM DMUS_SIGNPOSTF_CADENCE}
  6661.  
  6662.   // values for dwFlags field of DMUS_IO_CHORDMAP
  6663.   DMUS_CHORDMAPF_VERSION8  = 1;   // Chordmap is version 8 or above.
  6664.   {$EXTERNALSYM DMUS_CHORDMAPF_VERSION8}
  6665.  
  6666.   // values for dwChord field of DMUS_IO_PERS_SIGNPOST
  6667.   DMUS_SPOSTCADENCEF_1  = 2;   // Use the first cadence chord.
  6668.   {$EXTERNALSYM DMUS_SPOSTCADENCEF_1}
  6669.   DMUS_SPOSTCADENCEF_2  = 4;   // Use the second cadence chord.
  6670.   {$EXTERNALSYM DMUS_SPOSTCADENCEF_2}
  6671.  
  6672. type  
  6673.   // run time data structs
  6674.   PDMusIoChordMap = ^TDMusIoChordMap;
  6675.   _DMUS_IO_CHORDMAP = packed record
  6676.     wszLoadName: array[0..19] of WideChar;
  6677.     dwScalePattern: DWORD;
  6678.     dwFlags: DWORD;           // Various flags. Only lower 16 bits are significant.
  6679.   end;
  6680.   {$EXTERNALSYM _DMUS_IO_CHORDMAP}
  6681.   DMUS_IO_CHORDMAP = _DMUS_IO_CHORDMAP;
  6682.   {$EXTERNALSYM DMUS_IO_CHORDMAP}
  6683.   TDMusIoChordMap = _DMUS_IO_CHORDMAP;
  6684.  
  6685.   PDMusIoChordmapSubChord = ^TDMusIoChordmapSubChord;
  6686.   _DMUS_IO_CHORDMAP_SUBCHORD = packed record
  6687.     dwChordPattern: DWORD;
  6688.     dwScalePattern: DWORD;
  6689.     dwInvertPattern: DWORD;
  6690.     bChordRoot: Byte;
  6691.     bScaleRoot: Byte;
  6692.     wCFlags: Word;
  6693.     dwLevels: DWORD;   // parts or which subchord levels this chord supports 
  6694.   end;
  6695.   {$EXTERNALSYM _DMUS_IO_CHORDMAP_SUBCHORD}
  6696.   DMUS_IO_CHORDMAP_SUBCHORD = _DMUS_IO_CHORDMAP_SUBCHORD;
  6697.   {$EXTERNALSYM DMUS_IO_CHORDMAP_SUBCHORD}
  6698.   TDMusIoChordmapSubChord = _DMUS_IO_CHORDMAP_SUBCHORD;
  6699.  
  6700.   // Legacy name...
  6701.   DMUS_IO_PERS_SUBCHORD = DMUS_IO_CHORDMAP_SUBCHORD;
  6702.   {$EXTERNALSYM DMUS_IO_PERS_SUBCHORD}
  6703.  
  6704.   PDMusIoChordEntry = ^TDMusIoChordEntry;
  6705.   _DMUS_IO_CHORDENTRY = packed record
  6706.     dwFlags: DWORD;
  6707.     wConnectionID: Word;  // replaces runtime "pointer to this"
  6708.   end;
  6709.   {$EXTERNALSYM _DMUS_IO_CHORDENTRY}
  6710.   DMUS_IO_CHORDENTRY = _DMUS_IO_CHORDENTRY;
  6711.   {$EXTERNALSYM DMUS_IO_CHORDENTRY}
  6712.   TDMusIoChordEntry = _DMUS_IO_CHORDENTRY;
  6713.  
  6714.   PDMusIoNextChord = ^TDMusIoNextChord;
  6715.   _DMUS_IO_NEXTCHORD = packed record
  6716.     dwFlags: DWORD;
  6717.     nWeight: Word;
  6718.     wMinBeats: Word;
  6719.     wMaxBeats: Word;
  6720.     wConnectionID: Word;  // points to an ioChordEntry
  6721.   end;
  6722.   {$EXTERNALSYM _DMUS_IO_NEXTCHORD}
  6723.   DMUS_IO_NEXTCHORD = _DMUS_IO_NEXTCHORD;
  6724.   {$EXTERNALSYM DMUS_IO_NEXTCHORD}
  6725.   TDMusIoNextChord = _DMUS_IO_NEXTCHORD;
  6726.  
  6727.   PDMusIoChordMapSignPost = ^TDMusIoChordMapSignPost;
  6728.   _DMUS_IO_CHORDMAP_SIGNPOST = packed record
  6729.     dwChords: DWORD;   // 1bit per group
  6730.     dwFlags: DWORD;
  6731.   end;
  6732.   {$EXTERNALSYM _DMUS_IO_CHORDMAP_SIGNPOST}
  6733.   DMUS_IO_CHORDMAP_SIGNPOST = _DMUS_IO_CHORDMAP_SIGNPOST;
  6734.   {$EXTERNALSYM DMUS_IO_CHORDMAP_SIGNPOST}
  6735.   TDMusIoChordMapSignPost = _DMUS_IO_CHORDMAP_SIGNPOST;
  6736.  
  6737.   // Legacy name...
  6738.   DMUS_IO_PERS_SIGNPOST = DMUS_IO_CHORDMAP_SIGNPOST;
  6739.   {$EXTERNALSYM DMUS_IO_PERS_SIGNPOST}
  6740.  
  6741. (*
  6742. RIFF
  6743. (
  6744.     'DMPR'
  6745.     <perh-ck>           // Chord map header chunk
  6746.     [<guid-ck>]         // guid chunk
  6747.     [<vers-ck>]         // version chunk (two DWORDS)
  6748.     [<UNFO-list>]       // Unfo chunk
  6749.     <chdt-ck>           // subchord database
  6750.     <chpl-list>         // chord palette
  6751.     <cmap-list>         // chord map
  6752.     <spsq-list>         // signpost list
  6753.  )
  6754.  
  6755. <cmap-list> ::= LIST('cmap' <choe-list> )
  6756.  
  6757. <choe-list> ::= LIST('choe'
  6758.                                 <cheh-ck>   // chord entry data
  6759.                                 <chrd-list> // chord definition
  6760.                                 <ncsq-ck>   // connecting(next) chords
  6761.                      )
  6762.  
  6763. <chrd-list> ::= LIST('chrd' 
  6764.                                 <INAM-ck>   // name of chord in wide char format
  6765.                                 <sbcn-ck>   // list of subchords composing chord
  6766.                     )
  6767.  
  6768. <chpl-list> ::= LIST('chpl' 
  6769.                                 <chrd-list> ... // chord definition
  6770.                     )
  6771.  
  6772. <spsq-list> ::== LIST('spsq' <spst-list> ... )
  6773.  
  6774. <spst-list> ::= LIST('spst'
  6775.                              <spsh-ck>
  6776.                              <chrd-list>
  6777.                              [<cade-list>]
  6778.                     )
  6779.  
  6780. <cade-list> ::= LIST('cade' <chrd-list> ...)
  6781.  
  6782. <perh-ck> ::= perh(<DMUS_IO_CHORDMAP>)
  6783.  
  6784. <chdt-ck> ::= chdt(<cbChordSize::WORD>
  6785.                    <DMUS_IO_PERS_SUBCHORD> ... )
  6786.  
  6787. <cheh-ck> ::= cheh(<DMUS_IO_CHORDENTRY>)
  6788.  
  6789. <sbcn-ck> ::= sbcn(<cSubChordID:WORD> ...)
  6790.  
  6791. <ncsq-ck> ::= ncsq(<wNextChordSize:WORD>
  6792.                    <DMUS_IO_NEXTCHORD>...)
  6793.  
  6794. <spsh-ck> ::= spsh(<DMUS_IO_PERS_SIGNPOST>)
  6795.  
  6796. *)
  6797.  
  6798. (*  File io for DirectMusic Script object *)
  6799.  
  6800. const
  6801.   (* RIFF ids: *)
  6802.  
  6803.   DMUS_FOURCC_SCRIPT_FORM          = DWORD(Byte('D') or (Byte('M') shl 8) or (Byte('S') shl 16) or (Byte('C') shl 24)); // mmioFOURCC('D','M','S','C')
  6804.   {$EXTERNALSYM DMUS_FOURCC_SCRIPT_FORM}
  6805.   DMUS_FOURCC_SCRIPT_CHUNK         = DWORD(Byte('s') or (Byte('c') shl 8) or (Byte('h') shl 16) or (Byte('d') shl 24)); // mmioFOURCC('s','c','h','d')
  6806.   {$EXTERNALSYM DMUS_FOURCC_SCRIPT_CHUNK}
  6807.   DMUS_FOURCC_SCRIPTVERSION_CHUNK  = DWORD(Byte('s') or (Byte('c') shl 8) or (Byte('v') shl 16) or (Byte('e') shl 24)); // mmioFOURCC('s','c','v','e')
  6808.   {$EXTERNALSYM DMUS_FOURCC_SCRIPTVERSION_CHUNK}
  6809.   DMUS_FOURCC_SCRIPTLANGUAGE_CHUNK = DWORD(Byte('s') or (Byte('c') shl 8) or (Byte('l') shl 16) or (Byte('a') shl 24)); // mmioFOURCC('s','c','l','a')
  6810.   {$EXTERNALSYM DMUS_FOURCC_SCRIPTLANGUAGE_CHUNK}
  6811.   DMUS_FOURCC_SCRIPTSOURCE_CHUNK   = DWORD(Byte('s') or (Byte('c') shl 8) or (Byte('s') shl 16) or (Byte('r') shl 24)); // mmioFOURCC('s','c','s','r')
  6812.   {$EXTERNALSYM DMUS_FOURCC_SCRIPTSOURCE_CHUNK}
  6813.  
  6814. type
  6815.   (* io structures: *)
  6816.  
  6817.   PDMusIoScriptHeader = ^TDMusIoScriptHeader;
  6818.   _DMUS_IO_SCRIPT_HEADER = packed record
  6819.     dwFlags: DWORD; // DMUS_SCRIPTIOF_ flags
  6820.   end;
  6821.   {$EXTERNALSYM _DMUS_IO_SCRIPT_HEADER}
  6822.   DMUS_IO_SCRIPT_HEADER = _DMUS_IO_SCRIPT_HEADER;
  6823.   {$EXTERNALSYM DMUS_IO_SCRIPT_HEADER}
  6824.   TDMusIoScriptHeader = _DMUS_IO_SCRIPT_HEADER;
  6825.  
  6826. const
  6827.   DMUS_SCRIPTIOF_LOAD_ALL_CONTENT       = (1 shl 0);
  6828.   {$EXTERNALSYM DMUS_SCRIPTIOF_LOAD_ALL_CONTENT}
  6829.     // If set, when the script loads it will also load all the content in its container.
  6830.   DMUS_SCRIPTIOF_DOWNLOAD_ALL_SEGMENTS  = (1 shl 1);
  6831.   {$EXTERNALSYM DMUS_SCRIPTIOF_DOWNLOAD_ALL_SEGMENTS}
  6832.     (* If set and LOAD_ALL_CONTENT is also set, when the script initializes it will also download all the segments in its container.
  6833.        If set and LOAD_ALL_CONTENT is not set, when the script calls segment.Load on a segment then the segment will also be downloaded.
  6834.        If not set, the script must manually download and unload by calling segment.DownloadSoundData and segment.UnloadSoundData. *)
  6835.  
  6836. (*
  6837. RIFF
  6838. (
  6839.     'DMSC'              // DirectMusic Script chunk
  6840.     <schd-ck>           // Script header chunk
  6841.     [<guid-ck>]         // GUID for script
  6842.     [<vers-ck>]         // Optional version info
  6843.     [<UNFO-list>]       // Name, author, copyright info., comments
  6844.     <scve-ck>           // Version of DirectMusic this script was authored to run against
  6845.     <DMCN-form>         // Container of content referenced by the script.
  6846.     <scla-ck>           // ActiveX scripting language in which the script is written
  6847.     <scsr-ck> or <DMRF> // The script's source code.
  6848.                         // If scsr-ck, the source is embedding in the chunk.
  6849.                         // If DMRF, it is a reference of where to find a text file with the source.
  6850.                         //    Class id (guidClassID in DMUS_IO_REFERENCE) must be GUID_NULL because
  6851.                         //    this text file is not a DirectMusic object in its own right.
  6852. )
  6853.  
  6854.     // <schd-ck>
  6855.     'schd'
  6856.     (
  6857.         <DMUS_FOURCC_SCRIPT_CHUNK>
  6858.     )
  6859.  
  6860.     // <guid-ck>
  6861.     'guid'
  6862.     (
  6863.         <GUID>
  6864.     )
  6865.  
  6866.     // <vers-ck>
  6867.     vers
  6868.     (
  6869.         <DMUS_IO_VERSION>
  6870.     )
  6871.  
  6872.     // <scve-ck>
  6873.     scve
  6874.     (
  6875.         <DMUS_IO_VERSION>
  6876.     )
  6877.  
  6878.     'scla'
  6879.     (
  6880.         // Language name, stored as NULL terminated string of WCHARs
  6881.     )
  6882.  
  6883.     'scsr'
  6884.     (
  6885.         // Source code, stored as NULL terminated string of WCHARs
  6886.     )
  6887. *)
  6888.  
  6889. const
  6890.   (* Signpost tracks *)
  6891.  
  6892.   DMUS_FOURCC_SIGNPOST_TRACK_CHUNK = DWORD(Byte('s') or (Byte('g') shl 8) or (Byte('n') shl 16) or (Byte('p') shl 24)); // mmioFOURCC('s','g','n','p')
  6893.   {$EXTERNALSYM DMUS_FOURCC_SIGNPOST_TRACK_CHUNK}
  6894.  
  6895.  
  6896. type
  6897.   PDMusIoSignPost = ^TDMusIoSignPost;
  6898.   _DMUS_IO_SIGNPOST = packed record
  6899.     mtTime: TMusicTime;
  6900.     dwChords: DWORD;
  6901.     wMeasure: Word;
  6902.   end;
  6903.   {$EXTERNALSYM _DMUS_IO_SIGNPOST}
  6904.   DMUS_IO_SIGNPOST = _DMUS_IO_SIGNPOST;
  6905.   {$EXTERNALSYM DMUS_IO_SIGNPOST}
  6906.   TDMusIoSignPost = _DMUS_IO_SIGNPOST;
  6907.  
  6908. (*
  6909.  
  6910.     // <sgnp-list>
  6911.     'sgnp'
  6912.     (
  6913.         //sizeof DMUS_IO_SIGNPOST: DWORD
  6914.         <DMUS_IO_SIGNPOST>...
  6915.     )
  6916.  
  6917. *)
  6918.  
  6919. const
  6920.   DMUS_FOURCC_MUTE_CHUNK = DWORD(Byte('m') or (Byte('u') shl 8) or (Byte('t') shl 16) or (Byte('e') shl 24)); // mmioFOURCC('m','u','t','e')
  6921.   {$EXTERNALSYM DMUS_FOURCC_MUTE_CHUNK}
  6922.  
  6923. type
  6924.   PDMusIoMute = ^TDMusIoMute;
  6925.   _DMUS_IO_MUTE = packed record
  6926.     mtTime: TMusicTime;
  6927.     dwPChannel: DWORD;
  6928.     dwPChannelMap: DWORD;
  6929.   end;
  6930.   {$EXTERNALSYM _DMUS_IO_MUTE}
  6931.   DMUS_IO_MUTE = _DMUS_IO_MUTE;
  6932.   {$EXTERNALSYM DMUS_IO_MUTE}
  6933.   TDMusIoMute = _DMUS_IO_MUTE;
  6934.  
  6935. (*
  6936.  
  6937.     // <mute-list>
  6938.     'mute'
  6939.     (
  6940.         //sizeof DMUS_IO_MUTE:DWORD
  6941.         <DMUS_IO_MUTE>...
  6942.     )
  6943.  
  6944.  
  6945. *)
  6946.  
  6947. const
  6948.   (* Used for both style and chord map tracks *)
  6949.  
  6950.   DMUS_FOURCC_TIME_STAMP_CHUNK = DWORD(Byte('s') or (Byte('t') shl 8) or (Byte('m') shl 16) or (Byte('p') shl 24)); // mmioFOURCC('s','t','m','p')
  6951.   {$EXTERNALSYM DMUS_FOURCC_TIME_STAMP_CHUNK}
  6952.  
  6953.   (* Style tracks *)
  6954.  
  6955.   DMUS_FOURCC_STYLE_TRACK_LIST = DWORD(Byte('s') or (Byte('t') shl 8) or (Byte('t') shl 16) or (Byte('r') shl 24)); // mmioFOURCC('s','t','t','r')
  6956.   {$EXTERNALSYM DMUS_FOURCC_STYLE_TRACK_LIST}
  6957.   DMUS_FOURCC_STYLE_REF_LIST = DWORD(Byte('s') or (Byte('t') shl 8) or (Byte('r') shl 16) or (Byte('f') shl 24)); // mmioFOURCC('s','t','r','f')
  6958.   {$EXTERNALSYM DMUS_FOURCC_STYLE_REF_LIST}
  6959.  
  6960. (*
  6961.  
  6962.     // <sttr-list>
  6963.     LIST('sttr'
  6964.     (
  6965.         <strf-list>...  // Array of Style references
  6966.     )
  6967.  
  6968.     // <strf-list>
  6969.     LIST('strf'
  6970.     (
  6971.         <stmp-ck>
  6972.         <DMRF>
  6973.     )
  6974.  
  6975.   // <stmp-ck>
  6976.   'stmp'
  6977.   (
  6978.     // time:DWORD
  6979.   )
  6980.  
  6981. *)
  6982.  
  6983. const
  6984.   (* Chord map tracks *)
  6985.  
  6986.   DMUS_FOURCC_PERS_TRACK_LIST = DWORD(Byte('p') or (Byte('f') shl 8) or (Byte('t') shl 16) or (Byte('r') shl 24)); // mmioFOURCC('p','f','t','r')
  6987.   {$EXTERNALSYM DMUS_FOURCC_PERS_TRACK_LIST}
  6988.   DMUS_FOURCC_PERS_REF_LIST   = DWORD(Byte('p') or (Byte('f') shl 8) or (Byte('r') shl 16) or (Byte('f') shl 24)); // mmioFOURCC('p','f','r','f')
  6989.   {$EXTERNALSYM DMUS_FOURCC_PERS_REF_LIST}
  6990.  
  6991. (*
  6992.  
  6993.     // <pftr-list>
  6994.     LIST('pftr'
  6995.     (
  6996.         <pfrf-list>...  // Array of Chord map references
  6997.     )
  6998.  
  6999.     // <pfrf-list>
  7000.     LIST('pfrf'
  7001.     (
  7002.         <stmp-ck>
  7003.         <DMRF>
  7004.     )
  7005.  
  7006.   // <stmp-ck>
  7007.   'stmp'
  7008.   (
  7009.     // time:DWORD
  7010.   )
  7011.  
  7012. *)
  7013.  
  7014.   DMUS_FOURCC_TEMPO_TRACK = DWORD(Byte('t') or (Byte('e') shl 8) or (Byte('t') shl 16) or (Byte('r') shl 24)); // mmioFOURCC('t','e','t','r')
  7015.   {$EXTERNALSYM DMUS_FOURCC_TEMPO_TRACK}
  7016.  
  7017. (*
  7018.     // tempo array
  7019.     'tetr'
  7020.     (
  7021.         // sizeof DMUS_IO_TEMPO_ITEM: DWORD
  7022.         <DMUS_IO_TEMPO_ITEM>...
  7023.     )
  7024.  *)
  7025.  
  7026.   DMUS_FOURCC_SEQ_TRACK  = DWORD(Byte('s') or (Byte('e') shl 8) or (Byte('q') shl 16) or (Byte('t') shl 24)); // mmioFOURCC('s','e','q','t')
  7027.   {$EXTERNALSYM DMUS_FOURCC_SEQ_TRACK}
  7028.   DMUS_FOURCC_SEQ_LIST   = DWORD(Byte('e') or (Byte('v') shl 8) or (Byte('t') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('e','v','t','l')
  7029.   {$EXTERNALSYM DMUS_FOURCC_SEQ_LIST}
  7030.   DMUS_FOURCC_CURVE_LIST = DWORD(Byte('c') or (Byte('u') shl 8) or (Byte('r') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('c','u','r','l')
  7031.   {$EXTERNALSYM DMUS_FOURCC_CURVE_LIST}
  7032.  
  7033. (*
  7034.     // sequence track
  7035.     'seqt'
  7036.     (
  7037.         // sequence array
  7038.         'evtl'
  7039.         (
  7040.             // sizeof DMUS_IO_SEQ_ITEM: DWORD
  7041.             <DMUS_IO_SEQ_ITEM>...
  7042.         )
  7043.         // curve array
  7044.         'curl'
  7045.         (
  7046.             // sizeof DMUS_IO_CURVE_ITEM: DWORD
  7047.             <DMUS_IO_CURVE_ITEM>...
  7048.         )
  7049.     )
  7050. *)
  7051.  
  7052.   DMUS_FOURCC_SYSEX_TRACK = DWORD(Byte('s') or (Byte('y') shl 8) or (Byte('e') shl 16) or (Byte('x') shl 24)); // mmioFOURCC('s','y','e','x')
  7053.   {$EXTERNALSYM DMUS_FOURCC_SYSEX_TRACK}
  7054.  
  7055. (*
  7056.     // sysex track
  7057.     'syex'
  7058.     (
  7059.         {
  7060.             <DMUS_IO_SYSEX_ITEM>
  7061.             <BYTE>...    // Array of bytes, length defined in the DMUS_IO_SYSEXITEM structure
  7062.         }...
  7063.     )
  7064. *)
  7065.  
  7066.   DMUS_FOURCC_TIMESIGNATURE_TRACK = DWORD(Byte('t') or (Byte('i') shl 8) or (Byte('m') shl 16) or (Byte('s') shl 24)); // mmioFOURCC('t','i','m','s')
  7067.   {$EXTERNALSYM DMUS_FOURCC_TIMESIGNATURE_TRACK}
  7068.  
  7069. type
  7070.   PDMusIoTimeSignatureItem = ^TDMusIoTimeSignatureItem;
  7071.   _DMUS_IO_TIMESIGNATURE_ITEM = packed record
  7072.     lTime: TMusicTime;
  7073.     bBeatsPerMeasure: Byte;   // beats per measure (top of time sig)
  7074.     bBeat: Byte;              // what note receives the beat (bottom of time sig.)
  7075.                               // we can assume that 0 means 256th note
  7076.     wGridsPerBeat: Word;      // grids per beat
  7077.   end;
  7078.   {$EXTERNALSYM _DMUS_IO_TIMESIGNATURE_ITEM}
  7079.   DMUS_IO_TIMESIGNATURE_ITEM = _DMUS_IO_TIMESIGNATURE_ITEM;
  7080.   {$EXTERNALSYM DMUS_IO_TIMESIGNATURE_ITEM}
  7081.   TDMusIoTimeSignatureItem = _DMUS_IO_TIMESIGNATURE_ITEM;
  7082.  
  7083. (*  DX6 time signature track
  7084.  
  7085.     'tims'
  7086.     (
  7087.         // size of DMUS_IO_TIMESIGNATURE_ITEM : DWORD
  7088.         <DMUS_IO_TIMESIGNATURE_ITEM>...
  7089.     )
  7090. *)
  7091.  
  7092. (*  DX8 Time signature track. The track has been updated from DX7 to support a list of
  7093.     RIFF chunks. This will allow the time signature track to expand in the future.
  7094. *)
  7095.  
  7096. const
  7097.   DMUS_FOURCC_TIMESIGTRACK_LIST = DWORD(Byte('T') or (Byte('I') shl 8) or (Byte('M') shl 16) or (Byte('S') shl 24)); // mmioFOURCC('T','I','M','S')
  7098.   {$EXTERNALSYM DMUS_FOURCC_TIMESIGTRACK_LIST}
  7099.   DMUS_FOURCC_TIMESIG_CHUNK     = DMUS_FOURCC_TIMESIGNATURE_TRACK;
  7100.   {$EXTERNALSYM DMUS_FOURCC_TIMESIG_CHUNK}
  7101.  
  7102. (*
  7103. LIST
  7104. (
  7105.     'TIMS'          // Time Signature Track list-type
  7106.     <tims-ck>       // Chunk containing an array of time signatures
  7107. )
  7108.  
  7109.     'tims'
  7110.     (
  7111.         // size of DMUS_IO_TIMESIGNATURE_ITEM : DWORD
  7112.         <DMUS_IO_TIMESIGNATURE_ITEM>...
  7113.     )
  7114.  
  7115. *)
  7116.  
  7117. (*  DX8 Marker track. This is used to store valid start points and other
  7118.     flow control parameters that may come later. For example, if we want
  7119.     to implement more sophisticated looping and branching constructs, they
  7120.     would live in this track.
  7121. *)
  7122.  
  7123. const
  7124.   DMUS_FOURCC_MARKERTRACK_LIST = DWORD(Byte('M') or (Byte('A') shl 8) or (Byte('R') shl 16) or (Byte('K') shl 24)); // mmioFOURCC('M','A','R','K')
  7125.   {$EXTERNALSYM DMUS_FOURCC_MARKERTRACK_LIST}
  7126.   DMUS_FOURCC_VALIDSTART_CHUNK = DWORD(Byte('v') or (Byte('a') shl 8) or (Byte('l') shl 16) or (Byte('s') shl 24)); // mmioFOURCC('v','a','l','s')
  7127.   {$EXTERNALSYM DMUS_FOURCC_VALIDSTART_CHUNK}
  7128.   DMUS_FOURCC_PLAYMARKER_CHUNK = DWORD(Byte('p') or (Byte('l') shl 8) or (Byte('a') shl 16) or (Byte('y') shl 24)); // mmioFOURCC('p','l','a','y')
  7129.   {$EXTERNALSYM DMUS_FOURCC_PLAYMARKER_CHUNK}
  7130.  
  7131. type
  7132.   (* io structures *)
  7133.   PDMusIoValidStart = ^TDMusIoValidStart;
  7134.   _DMUS_IO_VALID_START = packed record
  7135.     mtTime: TMusicTime;      // Time of a legal start.
  7136.   end;
  7137.   {$EXTERNALSYM _DMUS_IO_VALID_START}
  7138.   DMUS_IO_VALID_START = _DMUS_IO_VALID_START;
  7139.   {$EXTERNALSYM DMUS_IO_VALID_START}
  7140.   TDMusIoValidStart = _DMUS_IO_VALID_START;
  7141.  
  7142.   PDMusIoPlayMarker = ^TDMusIoPlayMarker;
  7143.   _DMUS_IO_PLAY_MARKER = packed record
  7144.     mtTime: TMusicTime;      // Time of a next legal play point marker.
  7145.   end;
  7146.   {$EXTERNALSYM _DMUS_IO_PLAY_MARKER}
  7147.   DMUS_IO_PLAY_MARKER = _DMUS_IO_PLAY_MARKER;
  7148.   {$EXTERNALSYM DMUS_IO_PLAY_MARKER}
  7149.   TDMusIoPlayMarker = _DMUS_IO_PLAY_MARKER;
  7150.  
  7151. (*
  7152. LIST
  7153. (
  7154.     'MARK'          // Marker Track list-type
  7155.     [<vals-ck>]     // Chunk containing an array of start points
  7156.     [<play-ck>]     // Chunk containing an array of play start markers
  7157. )
  7158.  
  7159.     'vals'
  7160.     (
  7161.         // size of DMUS_IO_VALID_START : DWORD
  7162.         <DMUS_IO_VALID_START>...
  7163.     )
  7164.  
  7165.     'play'
  7166.     (
  7167.         // size of DMUS_IO_PLAY_MARKER : DWORD
  7168.         <DMUS_IO_PLAY_MARKER>...
  7169.     )
  7170.  
  7171. *)
  7172.  
  7173. (* segment trigger tracks *)
  7174.  
  7175. const
  7176.   (* RIFF ids: *)
  7177.   DMUS_FOURCC_SEGTRACK_LIST = DWORD(Byte('s') or (Byte('e') shl 8) or (Byte('g') shl 16) or (Byte('t') shl 24)); // mmioFOURCC('s','e','g','t')
  7178.   {$EXTERNALSYM DMUS_FOURCC_SEGTRACK_LIST}
  7179.   DMUS_FOURCC_SEGTRACK_CHUNK = DWORD(Byte('s') or (Byte('g') shl 8) or (Byte('t') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('s','g','t','h')
  7180.   {$EXTERNALSYM DMUS_FOURCC_SEGTRACK_CHUNK}
  7181.   DMUS_FOURCC_SEGMENTS_LIST = DWORD(Byte('l') or (Byte('s') shl 8) or (Byte('g') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('l','s','g','l')
  7182.   {$EXTERNALSYM DMUS_FOURCC_SEGMENTS_LIST}
  7183.   DMUS_FOURCC_SEGMENT_LIST = DWORD(Byte('l') or (Byte('s') shl 8) or (Byte('e') shl 16) or (Byte('g') shl 24)); // mmioFOURCC('l','s','e','g')
  7184.   {$EXTERNALSYM DMUS_FOURCC_SEGMENT_LIST}
  7185.   DMUS_FOURCC_SEGMENTITEM_CHUNK = DWORD(Byte('s') or (Byte('g') shl 8) or (Byte('i') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('s','g','i','h')
  7186.   {$EXTERNALSYM DMUS_FOURCC_SEGMENTITEM_CHUNK}
  7187.   DMUS_FOURCC_SEGMENTITEMNAME_CHUNK = DWORD(Byte('s') or (Byte('n') shl 8) or (Byte('a') shl 16) or (Byte('m') shl 24)); // mmioFOURCC('s','n','a','m')
  7188.   {$EXTERNALSYM DMUS_FOURCC_SEGMENTITEMNAME_CHUNK}
  7189.  
  7190. type
  7191.   (* io structures *)
  7192.   PDMusIoSegmentTrackHeader = ^TDMusIoSegmentTrackHeader;
  7193.   _DMUS_IO_SEGMENT_TRACK_HEADER = packed record
  7194.     dwFlags: DWORD; // Reserved leave as 0.
  7195.   end;
  7196.   {$EXTERNALSYM _DMUS_IO_SEGMENT_TRACK_HEADER}
  7197.   DMUS_IO_SEGMENT_TRACK_HEADER = _DMUS_IO_SEGMENT_TRACK_HEADER;
  7198.   {$EXTERNALSYM DMUS_IO_SEGMENT_TRACK_HEADER}
  7199.   TDMusIoSegmentTrackHeader = _DMUS_IO_SEGMENT_TRACK_HEADER;
  7200.  
  7201.   PDMusIoSegmentItemHeader = ^TDMusIoSegmentItemHeader;
  7202.   _DMUS_IO_SEGMENT_ITEM_HEADER = packed record
  7203.     lTimeLogical: TMusicTime;    // Position in track list. Time in the music with which the event is associated.
  7204.     lTimePhysical: TMusicTime;   // Precise time event will be triggered. Should be close to logical time.
  7205.     dwPlayFlags: DWORD;           // Flags for PlaySegment().
  7206.     dwFlags: DWORD;               // Flags.
  7207.   end;
  7208.   {$EXTERNALSYM _DMUS_IO_SEGMENT_ITEM_HEADER}
  7209.   DMUS_IO_SEGMENT_ITEM_HEADER = _DMUS_IO_SEGMENT_ITEM_HEADER;
  7210.   {$EXTERNALSYM DMUS_IO_SEGMENT_ITEM_HEADER}
  7211.   TDMusIoSegmentItemHeader = _DMUS_IO_SEGMENT_ITEM_HEADER;
  7212.  
  7213. const
  7214.   (* values for dwflags field of DMUS_IO_SEGMENT_ITEM_HEADER *)
  7215.   DMUS_SEGMENTTRACKF_MOTIF = 1; // interpret DMRF as link to style, and use snam as the name of a motif within the style
  7216.   {$EXTERNALSYM DMUS_SEGMENTTRACKF_MOTIF}
  7217.  
  7218. (*
  7219. LIST
  7220. (
  7221.     'segt'          // DirectMusic Segment Trigger Track form-type
  7222.     [<sgth-ck>]     // Segment track header
  7223.     <lsgl-list>     // List of Segment Lists
  7224. )
  7225.  
  7226.     // <sgth-ck>
  7227.     'sgth'
  7228.     (
  7229.         <DMUS_IO_SEGMENT_TRACK_HEADER>
  7230.     )
  7231.  
  7232.     // <lsgl-list>
  7233.     LIST
  7234.     (
  7235.         'lsgl'          // Array of segments
  7236.         <lseg-list>...  // Each segment is encapsulated in a list (that way it can still be riff parsed.)
  7237.     )
  7238.  
  7239.         // <lseg-list>
  7240.         LIST
  7241.         (
  7242.             'lseg'
  7243.             <sgih-ck>
  7244.             <DMRF-list>    // Link to a segment or style file.
  7245.             [<snam-ck>]    // Name field.  Used with DMUS_SEGMENTTRACKF_MOTIF flag.
  7246.         )
  7247.  
  7248.             // <sgih-ck>            // segment item header
  7249.             (
  7250.                 <DMUS_IO_SEGMENT_ITEM_HEADER>  // Segment item header
  7251.             )
  7252.  
  7253.             // <snam-ck>
  7254.             (
  7255.                 // Name, stored as NULL terminated string of WCHARs
  7256.             )
  7257. *)
  7258.  
  7259. (* Script track. *)
  7260.  
  7261. const
  7262.   (* RIFF ids: *)
  7263.   DMUS_FOURCC_SCRIPTTRACK_LIST = DWORD(Byte('s') or (Byte('c') shl 8) or (Byte('r') shl 16) or (Byte('t') shl 24)); // mmioFOURCC('s','c','r','t')
  7264.   {$EXTERNALSYM DMUS_FOURCC_SCRIPTTRACK_LIST}
  7265.   DMUS_FOURCC_SCRIPTTRACKEVENTS_LIST = DWORD(Byte('s') or (Byte('c') shl 8) or (Byte('r') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('s','c','r','l')
  7266.   {$EXTERNALSYM DMUS_FOURCC_SCRIPTTRACKEVENTS_LIST}
  7267.   DMUS_FOURCC_SCRIPTTRACKEVENT_LIST = DWORD(Byte('s') or (Byte('c') shl 8) or (Byte('r') shl 16) or (Byte('e') shl 24)); // mmioFOURCC('s','c','r','e')
  7268.   {$EXTERNALSYM DMUS_FOURCC_SCRIPTTRACKEVENT_LIST}
  7269.   DMUS_FOURCC_SCRIPTTRACKEVENTHEADER_CHUNK = DWORD(Byte('s') or (Byte('c') shl 8) or (Byte('r') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('s','c','r','h')
  7270.   {$EXTERNALSYM DMUS_FOURCC_SCRIPTTRACKEVENTHEADER_CHUNK}
  7271.   DMUS_FOURCC_SCRIPTTRACKEVENTNAME_CHUNK = DWORD(Byte('s') or (Byte('c') shl 8) or (Byte('r') shl 16) or (Byte('n') shl 24)); // mmioFOURCC('s','c','r','n')
  7272.   {$EXTERNALSYM DMUS_FOURCC_SCRIPTTRACKEVENTNAME_CHUNK}
  7273.  
  7274. (* Flags for DMUS_IO_SCRIPTTRACK_TIMING
  7275.  *)
  7276.   DMUS_IO_SCRIPTTRACKF_PREPARE = (1 shl 0);  (* Fire event in advance of time stamp, at Prepare time.  This is the default because it leaves the script time to change the music happening at the target time. *)
  7277.   {$EXTERNALSYM DMUS_IO_SCRIPTTRACKF_PREPARE}
  7278.   DMUS_IO_SCRIPTTRACKF_QUEUE   = (1 shl 1);  (* Fire event just before time stamp, at Queue time. *)
  7279.   {$EXTERNALSYM DMUS_IO_SCRIPTTRACKF_QUEUE}
  7280.   DMUS_IO_SCRIPTTRACKF_ATTIME  = (1 shl 2);  (* Fire event right at the time stamp. *)
  7281.   {$EXTERNALSYM DMUS_IO_SCRIPTTRACKF_ATTIME}
  7282.  
  7283. type
  7284.   PDMusIoScriptTrackEventHeader = ^TDMusIoScriptTrackEventHeader;
  7285.   _DMUS_IO_SCRIPTTRACK_EVENTHEADER = packed record
  7286.     dwFlags: DWORD;              (* various bits ( see DMUS_IO_SCRIPTTRACKF_* ) *)
  7287.     lTimeLogical: TMusicTime;    (* Position in track list. Time in the music with which the event is associated. *)
  7288.     lTimePhysical: TMusicTime;   (* Precise time event will be triggered. Should be close to logical time. *)
  7289.   end;
  7290.   {$EXTERNALSYM _DMUS_IO_SCRIPTTRACK_EVENTHEADER}
  7291.   DMUS_IO_SCRIPTTRACK_EVENTHEADER = _DMUS_IO_SCRIPTTRACK_EVENTHEADER;
  7292.   {$EXTERNALSYM DMUS_IO_SCRIPTTRACK_EVENTHEADER}
  7293.   TDMusIoScriptTrackEventHeader = _DMUS_IO_SCRIPTTRACK_EVENTHEADER;
  7294.  
  7295. (*
  7296.     // Script Track
  7297.  
  7298.     // <scrt-list>
  7299.     LIST
  7300.     (
  7301.         <scrl-list>       // List of script events
  7302.     )
  7303.  
  7304.         // <scrl-list>
  7305.         LIST
  7306.         (
  7307.             <scre-list>...    // Array of event descriptions
  7308.         )
  7309.  
  7310.             // <scre-list>
  7311.             LIST
  7312.             (
  7313.                 <scrh-ck>         // Event header chunk
  7314.                 <DMRF>
  7315.                 <scrn-ck>         // Routine name
  7316.             )
  7317.  
  7318.                 'scrh'
  7319.                 (
  7320.                     <DMUS_IO_SCRIPTTRACK_EVENTHEADER>
  7321.                 )
  7322.  
  7323.                 'scrn'
  7324.                 (
  7325.                     // Name, stored as NULL terminated string of WCHARs
  7326.                 )
  7327. *)
  7328.  
  7329. (* Lyrics/Notification track. *)
  7330.  
  7331. const
  7332.   (* RIFF ids: *)
  7333.   DMUS_FOURCC_LYRICSTRACK_LIST             = DWORD(Byte('l') or (Byte('y') shl 8) or (Byte('r') shl 16) or (Byte('t') shl 24)); // mmioFOURCC('l','y','r','t')
  7334.   {$EXTERNALSYM DMUS_FOURCC_LYRICSTRACK_LIST}
  7335.   DMUS_FOURCC_LYRICSTRACKEVENTS_LIST       = DWORD(Byte('l') or (Byte('y') shl 8) or (Byte('r') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('l','y','r','l')
  7336.   {$EXTERNALSYM DMUS_FOURCC_LYRICSTRACKEVENTS_LIST}
  7337.   DMUS_FOURCC_LYRICSTRACKEVENT_LIST        = DWORD(Byte('l') or (Byte('y') shl 8) or (Byte('r') shl 16) or (Byte('e') shl 24)); // mmioFOURCC('l','y','r','e')
  7338.   {$EXTERNALSYM DMUS_FOURCC_LYRICSTRACKEVENT_LIST}
  7339.   DMUS_FOURCC_LYRICSTRACKEVENTHEADER_CHUNK = DWORD(Byte('l') or (Byte('y') shl 8) or (Byte('r') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('l','y','r','h')
  7340.   {$EXTERNALSYM DMUS_FOURCC_LYRICSTRACKEVENTHEADER_CHUNK}
  7341.   DMUS_FOURCC_LYRICSTRACKEVENTTEXT_CHUNK   = DWORD(Byte('l') or (Byte('y') shl 8) or (Byte('r') shl 16) or (Byte('n') shl 24)); // mmioFOURCC('l','y','r','n')
  7342.   {$EXTERNALSYM DMUS_FOURCC_LYRICSTRACKEVENTTEXT_CHUNK}
  7343.  
  7344. type
  7345.   PDMusIoLyricsTrackEventHeader = ^TDMusIoLyricStrackEventHeader;
  7346.   _DMUS_IO_LYRICSTRACK_EVENTHEADER = packed record
  7347.     dwFlags: DWORD;              (* Reserved leave as 0. *)
  7348.     dwTimingFlags: DWORD;        (* Combination DMUS_PMSGF_TOOL_* flags.  Determines the precise timing of when the notification happens. Invalid with the flag DMUS_PMSGF_REFTIME, DMUS_PMSGF_MUSICTIME, DMUS_PMSGF_TOOL_FLUSH, or DMUS_PMSGF_LOCKTOREFTIME. *)
  7349.     lTimeLogical: TMusicTime;    (* Position in track list. Time in the music with which the event is associated. *)
  7350.     lTimePhysical: TMusicTime;   (* Precise time event will be triggered. Should be close to logical time. *)
  7351.   end;
  7352.   {$EXTERNALSYM _DMUS_IO_LYRICSTRACK_EVENTHEADER}
  7353.   DMUS_IO_LYRICSTRACK_EVENTHEADER = _DMUS_IO_LYRICSTRACK_EVENTHEADER;
  7354.   {$EXTERNALSYM DMUS_IO_LYRICSTRACK_EVENTHEADER}
  7355.   TDMusIoLyricsTrackEventHeader = _DMUS_IO_LYRICSTRACK_EVENTHEADER;
  7356.  
  7357. (*
  7358.     // Lyrics/Notification Track
  7359.  
  7360.     // <lyrt-list>
  7361.     LIST
  7362.     (
  7363.         <lyrl-list>       // List of notification events
  7364.     )
  7365.  
  7366.         // <lyrl-list>
  7367.         LIST
  7368.         (
  7369.             <lyre-list>...    // Array of event descriptions
  7370.         )
  7371.  
  7372.             // <lyre-list>
  7373.             LIST
  7374.             (
  7375.                 <lyrh-ck>         // Event header chunk
  7376.                 <lyrn-ck>         // Notification text
  7377.             )
  7378.  
  7379.                 'lyrh'
  7380.                 (
  7381.                     <DMUS_IO_LYRICSTRACK_EVENTHEADER>
  7382.                 )
  7383.  
  7384.                 'lyrn'
  7385.                 (
  7386.                     // Name, stored as NULL terminated string of WCHARs
  7387.                 )
  7388. *)
  7389.  
  7390. (* Parameter control track *)
  7391.  
  7392. const
  7393.   (* RIFF ids: *)
  7394.   DMUS_FOURCC_PARAMCONTROLTRACK_TRACK_LIST = DWORD(Byte('p') or (Byte('r') shl 8) or (Byte('m') shl 16) or (Byte('t') shl 24)); // mmioFOURCC('p','r','m','t')
  7395.   {$EXTERNALSYM DMUS_FOURCC_PARAMCONTROLTRACK_TRACK_LIST}
  7396.   DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_LIST = DWORD(Byte('p') or (Byte('r') shl 8) or (Byte('o') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('p','r','o','l')
  7397.   {$EXTERNALSYM DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_LIST}
  7398.   DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_CHUNK = DWORD(Byte('p') or (Byte('r') shl 8) or (Byte('o') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('p','r','o','h')
  7399.   {$EXTERNALSYM DMUS_FOURCC_PARAMCONTROLTRACK_OBJECT_CHUNK}
  7400.   DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_LIST = DWORD(Byte('p') or (Byte('r') shl 8) or (Byte('p') shl 16) or (Byte('l') shl 24)); // mmioFOURCC('p','r','p','l')
  7401.   {$EXTERNALSYM DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_LIST}
  7402.   DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_CHUNK = DWORD(Byte('p') or (Byte('r') shl 8) or (Byte('p') shl 16) or (Byte('h') shl 24)); // mmioFOURCC('p','r','p','h')
  7403.   {$EXTERNALSYM DMUS_FOURCC_PARAMCONTROLTRACK_PARAM_CHUNK}
  7404.   DMUS_FOURCC_PARAMCONTROLTRACK_CURVES_CHUNK = DWORD(Byte('p') or (Byte('r') shl 8) or (Byte('c') shl 16) or (Byte('c') shl 24)); // mmioFOURCC('p','r','c','c')
  7405.   {$EXTERNALSYM DMUS_FOURCC_PARAMCONTROLTRACK_CURVES_CHUNK}
  7406.  
  7407. type
  7408.   PDMusIoParamControlTrackObjectHeader = ^TDMusIoParamControlTrackObjectHeader;
  7409.   _DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER = packed record
  7410.     dwFlags: DWORD;              (* Reserved.  Must be zero. *)
  7411.     guidTimeFormat: TGUID;        (* Time format to set the object to.  Must be GUID_TIME_REFERNCE or GUID_TIME_MUSIC from medparam.h. *)
  7412.     (* Path for finding the object. These fields correspond to the first five parameters of IDirectMusicSegmentState::GetObjectInPath. *)
  7413.     dwPChannel: DWORD;
  7414.     dwStage: DWORD;
  7415.     dwBuffer: DWORD;
  7416.     guidObject: TGUID;
  7417.     dwIndex: DWORD;
  7418.   end;
  7419.   {$EXTERNALSYM _DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER}
  7420.   DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER = _DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER;
  7421.   {$EXTERNALSYM DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER}
  7422.   TDMusIoParamControlTrackObjectHeader = _DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER;
  7423.  
  7424.   PDMusIoParamControlTrackParamHeader = ^TDMusIoParamControlTrackParamHeader;
  7425.   _DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER = packed record
  7426.     dwFlags: DWORD;              (* Reserved.  Must be zero. *)
  7427.     dwIndex: DWORD;              (* Index number of the parameter on the object *)
  7428.   end;
  7429.   {$EXTERNALSYM _DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER}
  7430.   DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER = _DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER;
  7431.   {$EXTERNALSYM DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER}
  7432.   TDMusIoParamControlTrackParamHeader = _DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER;
  7433.  
  7434.   PDMusIoParamControlTrackCurveInfo = ^TDMusIoParamControlTrackCurveInfo;
  7435.   _DMUS_IO_PARAMCONTROLTRACK_CURVEINFO = packed record
  7436.     mtStartTime: TMusicTime;
  7437.     mtEndTime: TMusicTime;
  7438.     fltStartValue: Single;
  7439.     fltEndValue: Single;
  7440.     dwCurveType: DWORD;   (* One of the items from the MP_CURVE_TYPE enum in medparam.h *)
  7441.     dwFlags: DWORD;       (* A combination of the MPF_ENVLP_* constants in medparam.h *)
  7442.   end;
  7443.   {$EXTERNALSYM _DMUS_IO_PARAMCONTROLTRACK_CURVEINFO}
  7444.   DMUS_IO_PARAMCONTROLTRACK_CURVEINFO = _DMUS_IO_PARAMCONTROLTRACK_CURVEINFO;
  7445.   {$EXTERNALSYM DMUS_IO_PARAMCONTROLTRACK_CURVEINFO}
  7446.   TDMusIoParamControlTrackCurveInfo = _DMUS_IO_PARAMCONTROLTRACK_CURVEINFO;
  7447.  
  7448. (*
  7449.     // <prmt-list>
  7450.     LIST
  7451.     (
  7452.         <prol-list>...   // one for each object
  7453.     )
  7454.  
  7455.         // <prol-list>
  7456.         LIST
  7457.         (
  7458.             <proh-ck>       // object header chunk
  7459.             <prpl-list>...  // one for each parameter
  7460.         )
  7461.  
  7462.             // <proh-ck>
  7463.             proh
  7464.             (
  7465.                 <DMUS_IO_PARAMCONTROLTRACK_OBJECTHEADER>
  7466.             )
  7467.  
  7468.             // <prpl-list>
  7469.             LIST
  7470.             (
  7471.                 <prph-ck>       // parameter header chunk
  7472.                 <prcc-ck>       // chunk containing an array of curves
  7473.             )
  7474.  
  7475.                 // <prph-ck>
  7476.                 prph
  7477.                 (
  7478.                     <DMUS_IO_PARAMCONTROLTRACK_PARAMHEADER>
  7479.                 )
  7480.  
  7481.                 // <prcc-ck>
  7482.                 prcc
  7483.                 (
  7484.                     // sizeof DMUS_IO_PARAMCONTROLTRACK_CURVEINFO:DWORD
  7485.                     <DMUS_IO_PARAMCONTROLTRACK_CURVEINFO>... // curves, sorted in order of mtTime
  7486.                 )
  7487. *)
  7488.  
  7489. (* DirectSoundBufferConfig FX Map *)
  7490.  
  7491. const
  7492.   (* RIFF ids: *)
  7493.   DMUS_FOURCC_DSBC_FORM  = DWORD(Byte('D') or (Byte('S') shl 8) or (Byte('B') shl 16) or (Byte('C') shl 24)); // mmioFOURCC('D','S','B','C')
  7494.   {$EXTERNALSYM DMUS_FOURCC_DSBC_FORM}
  7495.   DMUS_FOURCC_DSBD_CHUNK = DWORD(Byte('d') or (Byte('s') shl 8) or (Byte('b') shl 16) or (Byte('d') shl 24)); // mmioFOURCC('d','s','b','d')
  7496.   {$EXTERNALSYM DMUS_FOURCC_DSBD_CHUNK}
  7497.   DMUS_FOURCC_BSID_CHUNK = DWORD(Byte('b') or (Byte('s') shl 8) or (Byte('i') shl 16) or (Byte('d') shl 24)); // mmioFOURCC('b','s','i','d')
  7498.   {$EXTERNALSYM DMUS_FOURCC_BSID_CHUNK}
  7499.   DMUS_FOURCC_DS3D_CHUNK = DWORD(Byte('d') or (Byte('s') shl 8) or (Byte('3') shl 16) or (Byte('d') shl 24)); // mmioFOURCC('d','s','3','d')
  7500.   {$EXTERNALSYM DMUS_FOURCC_DS3D_CHUNK}
  7501.   DMUS_FOURCC_DSBC_LIST  = DWORD(Byte('f') or (Byte('x') shl 8) or (Byte('l') shl 16) or (Byte('s') shl 24)); // mmioFOURCC('f','x','l','s')
  7502.   {$EXTERNALSYM DMUS_FOURCC_DSBC_LIST}
  7503.   DMUS_FOURCC_DSFX_FORM  = DWORD(Byte('D') or (Byte('S') shl 8) or (Byte('F') shl 16) or (Byte('X') shl 24)); // mmioFOURCC('D','S','F','X')
  7504.   {$EXTERNALSYM DMUS_FOURCC_DSFX_FORM}
  7505.   DMUS_FOURCC_DSFX_CHUNK = DWORD(Byte('f') or (Byte('x') shl 8) or (Byte('h') shl 16) or (Byte('r') shl 24)); // mmioFOURCC('f','x','h','r')
  7506.   {$EXTERNALSYM DMUS_FOURCC_DSFX_CHUNK}
  7507.   DMUS_FOURCC_DSFX_DATA  = DWORD(Byte('d') or (Byte('a') shl 8) or (Byte('t') shl 16) or (Byte('a') shl 24)); // mmioFOURCC('d','a','t','a')
  7508.   {$EXTERNALSYM DMUS_FOURCC_DSFX_DATA}
  7509.  
  7510. (* io structures *)
  7511.  
  7512. type
  7513.   PDSoundIoDSBufferDesc = ^TDSoundIoDSBufferDesc;
  7514.   _DSOUND_IO_DSBUFFERDESC = packed record
  7515.     dwFlags: DWORD;        (* DirectSound buffer creation flags *)
  7516.     nChannels: Word;       (* No. of channels (rest of buffer format is determined by owning sink) *)
  7517.     lVolume: Longint;      (* Initial pan; only used if CTRLVOLUME is specified *)
  7518.     lPan: Longint;         (* Initial pan; only used if CTRLPAN is specified *)
  7519.     dwReserved: DWORD;     (* Reserved - must be 0 *)
  7520.   end;
  7521.   {$EXTERNALSYM _DSOUND_IO_DSBUFFERDESC}
  7522.   DSOUND_IO_DSBUFFERDESC = _DSOUND_IO_DSBUFFERDESC;
  7523.   {$EXTERNALSYM DSOUND_IO_DSBUFFERDESC}
  7524.   TDSoundIoDSBufferDesc = _DSOUND_IO_DSBUFFERDESC;
  7525.  
  7526.   PDSoundIoDSBusID = ^TDSoundIoDSBusID;
  7527.   _DSOUND_IO_DSBUSID = packed record
  7528.     busid: array[0..0] of DWORD;       (* Array size determined from chunk size *)
  7529.   end;
  7530.   {$EXTERNALSYM _DSOUND_IO_DSBUSID}
  7531.   DSOUND_IO_DSBUSID = _DSOUND_IO_DSBUSID;
  7532.   {$EXTERNALSYM DSOUND_IO_DSBUSID}
  7533.   TDSoundIoDSBusID = _DSOUND_IO_DSBUSID;
  7534.  
  7535.   PDSoundIo3D = ^TDSoundIo3D;
  7536.   _DSOUND_IO_3D = packed record
  7537.     guid3DAlgorithm: TGUID; (* GUID identifying the 3D algorithm to use (defined in dsound.h) *)
  7538.     ds3d: DS3DBUFFER;       (* Initial 3D parameters *)
  7539.   end;
  7540.   {$EXTERNALSYM _DSOUND_IO_3D}
  7541.   DSOUND_IO_3D = _DSOUND_IO_3D;
  7542.   {$EXTERNALSYM DSOUND_IO_3D}
  7543.   TDSoundIo3D = _DSOUND_IO_3D;
  7544.  
  7545.   PDSoundIoDXDMOHeader = ^TDSoundIoDXDMOHeader;
  7546.   _DSOUND_IO_DXDMO_HEADER = packed record
  7547.     dwEffectFlags: DWORD;  (* Effect creation flags - equivalent to DSEFFECTDESC::dwFlags *)
  7548.     guidDSFXClass: TGUID;   (* GUID identifying the effect to use - corresponds to a COM CLSID *)
  7549.     guidReserved: TGUID;    (* Reserved - must be the null GUID *)
  7550.     guidSendBuffer: TGUID;  (* GUID identifying the buffer to send to if this is a send effect *)
  7551.     dwReserved: DWORD;     (* Reserved - must be 0 *)
  7552.   end;
  7553.   {$EXTERNALSYM _DSOUND_IO_DXDMO_HEADER}
  7554.   DSOUND_IO_DXDMO_HEADER = _DSOUND_IO_DXDMO_HEADER;
  7555.   {$EXTERNALSYM DSOUND_IO_DXDMO_HEADER}
  7556.   TDSoundIoDXDMOHeader = _DSOUND_IO_DXDMO_HEADER;
  7557.  
  7558.   PDSoundIoDXDMOData = ^TDSoundIoDXDMOData;
  7559.   _DSOUND_IO_DXDMO_DATA= packed record
  7560.     data: array[0..0] of DWORD;      (* Array size determined by the DMO involved *)
  7561.   end;
  7562.   {$EXTERNALSYM _DSOUND_IO_DXDMO_DATA}
  7563.   DSOUND_IO_DXDMO_DATA = _DSOUND_IO_DXDMO_DATA;
  7564.   {$EXTERNALSYM DSOUND_IO_DXDMO_DATA}
  7565.   TDSoundIoDXDMOData = _DSOUND_IO_DXDMO_DATA;
  7566.  
  7567. (*
  7568. RIFF
  7569. (
  7570.     'DSBC'          // DirectSoundBufferConfig chunk
  7571.     [<guid-ck>]     // GUID identifier for this DirectSoundBufferConfig
  7572.     [<vers-ck>]     // Optional version info
  7573.     [<UNFO-list>]   // Name, author, copyright info., comments
  7574.     <dsbd-ck>       // DirectSound Buffer descriptor chunk
  7575.     [<bsid-ck>]     // Optional bus id array
  7576.     [<ds3d-ck>]     // Optional 3d Parameters
  7577.     [<fxls-list>]   // Optional list of FX descriptors
  7578. )
  7579.  
  7580.     // <guid-ck>
  7581.     'guid'
  7582.     (
  7583.         <GUID>
  7584.     )
  7585.  
  7586.     // <vers-ck>
  7587.     'vers'
  7588.     (
  7589.         <DMUS_IO_VERSION>
  7590.     )
  7591.  
  7592.     // <dsbd-ck>
  7593.     'dsbd'
  7594.     (
  7595.         <DSOUND_IO_DSBUFFERDESC>  // Creation parameters and initial settings for the buffer
  7596.     )
  7597.  
  7598.     // <bsid-ck>
  7599.     'bsid'
  7600.     (
  7601.         <DSOUND_IO_DSBUSID>  // The size of DSOUND_IO_DSBUSID is determined by the chunk size
  7602.     )
  7603.  
  7604.     // <ds3d-ck>
  7605.     'ds3d'
  7606.     (
  7607.         <DSOUND_IO_3D>  // Initial 3D buffer parameters: position, etc.
  7608.     )
  7609.  
  7610.     // <fx-list>
  7611.     LIST
  7612.     (
  7613.         'fxls'          // Array of DMO creation parameter blocks
  7614.         <DSFX-form>...  // Each DMO is encapsulated in a RIFF chunk
  7615.     )
  7616.  
  7617. // <DSFX-form>          // DMOs can be embedded in a buffer configuration or stored as separate files
  7618. RIFF
  7619. (
  7620.     'DSFX'
  7621.     <fxhr-ck>           // FX header chunk
  7622.     [<data-ck>]         // FX initial settings chunk
  7623. )
  7624.  
  7625.     // <fxhr-ck>
  7626.     'fxhr'
  7627.     (
  7628.         <DSOUND_IO_DXDMO_HEADER>
  7629.     )
  7630.  
  7631.     // <data-ck>
  7632.     'data'
  7633.     (
  7634.         <DSOUND_IO_DXDMO_DATA>  // Opaque data block used by the DMO to load itself.
  7635.         // For our standard included DMOs, this is simply the structure accepted by
  7636.         // the DMO's SetAllParameters() method - e.g. struct DSFXChorus for Chorus.
  7637.     )
  7638. *)
  7639.  
  7640.  
  7641.  
  7642. (***************************************************************************
  7643. *                                                                          *
  7644. *   DMusBuff.h -- This module defines the buffer format for DirectMusic    *
  7645. *                 Shared file between user mode and kernel mode components *
  7646. *                                                                          *
  7647. *   Copyright (c) 1998, Microsoft Corp. All rights reserved.               *
  7648. *                                                                          *
  7649. ***************************************************************************)
  7650.  
  7651. (* Format of DirectMusic events in a buffer
  7652.  *
  7653.  * A buffer contains 1 or more events, each with the following header.
  7654.  * Immediately following the header is the event data. The header+data
  7655.  * size is rounded to the nearest quadword (8 bytes).
  7656.  *)
  7657.  
  7658. type
  7659.   PDMusEventHeader = ^TDMusEventHeader;
  7660.   _DMUS_EVENTHEADER = packed record
  7661.     cbEvent: DWORD;                (* Unrounded bytes in event *)
  7662.     dwChannelGroup: DWORD;         (* Channel group of event *)
  7663.     rtDelta: TReferenceTime;       (* Delta from start time of entire buffer *)
  7664.     dwFlags: DWORD;                (* Flags DMUS_EVENT_xxx *)
  7665.   end;
  7666.   {$EXTERNALSYM _DMUS_EVENTHEADER}
  7667.   DMUS_EVENTHEADER = _DMUS_EVENTHEADER;
  7668.   {$EXTERNALSYM DMUS_EVENTHEADER}
  7669.   TDMusEventHeader = _DMUS_EVENTHEADER;
  7670.  
  7671. const
  7672.   DMUS_EVENT_STRUCTURED   = $00000001;  (* Unstructured data (SysEx, etc.) *)
  7673.   {$EXTERNALSYM DMUS_EVENT_STRUCTURED}
  7674.  
  7675. (* The number of bytes to allocate for an event with 'cb' data bytes.
  7676.  *)
  7677. // #define QWORD_ALIGN(x) (((x) + 7) & ~7)
  7678. function QWORD_ALIGN(x: DWORD): DWORD;
  7679. {$EXTERNALSYM QWORD_ALIGN}
  7680. // #define DMUS_EVENT_SIZE(cb) QWORD_ALIGN(sizeof(DMUS_EVENTHEADER) + cb)
  7681. function DMUS_EVENT_SIZE(cb: DWORD): DWORD;
  7682. {$EXTERNALSYM DMUS_EVENT_SIZE}
  7683.  
  7684.  
  7685. (************************************************************************
  7686. *                                                                       *
  7687. *   dmplugin.h -- This module contains the API for plugins for the      *
  7688. *                 DirectMusic performance layer                         *
  7689. *                                                                       *
  7690. *   Copyright (c) Microsoft Corporation.  All rights reserved.          *
  7691. *                                                                       *
  7692. ************************************************************************)
  7693. // Translator: only part of this header located below, other definitions
  7694. // can be found above
  7695.  
  7696. const
  7697.   // Registry location for tools
  7698.   DMUS_REGSTR_PATH_TOOLS  = 'Software\Microsoft\DirectMusic\Tools';
  7699.   {$EXTERNALSYM DMUS_REGSTR_PATH_TOOLS}
  7700.  
  7701. (*////////////////////////////////////////////////////////////////////
  7702. // IDirectMusicTool8 *)
  7703.  
  7704. type
  7705.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicTool8);'}
  7706.   {$EXTERNALSYM IDirectMusicTool8}
  7707.   IDirectMusicTool8 = interface(IDirectMusicTool)
  7708.     (*  IDirectMusicTool8 *)
  7709.     ['{0e674303-3b05-11d3-9bd1-f9e7f0a01536}']
  7710.     function Clone(out ppTool: IDirectMusicTool): HResult; stdcall;
  7711.   end;
  7712.  
  7713.  
  7714. (* The following flags are sent in the IDirectMusicTrack.Play() method *)
  7715. (* inside the dwFlags parameter *)
  7716. type
  7717.   enumDMUS_TRACKF_FLAGS = DWORD;
  7718.   DMUS_TRACKF_FLAGS = enumDMUS_TRACKF_FLAGS;
  7719.   {$EXTERNALSYM DMUS_TRACKF_FLAGS}
  7720.   TDMusTrackfFlags = DMUS_TRACKF_FLAGS;
  7721.   PDMusTrackfFlags = ^TDMusTrackfFlags;
  7722. const
  7723.   DMUS_TRACKF_SEEK            = 1;      (* set on a seek *)
  7724.   {$EXTERNALSYM DMUS_TRACKF_SEEK}
  7725.   DMUS_TRACKF_LOOP            = 2;      (* set on a loop (repeat) *)
  7726.   {$EXTERNALSYM DMUS_TRACKF_LOOP}
  7727.   DMUS_TRACKF_START           = 4;      (* set on first call to Play *)
  7728.   {$EXTERNALSYM DMUS_TRACKF_START}
  7729.   DMUS_TRACKF_FLUSH           = 8;      (* set when this call is in response to a flush on the perfomance *)
  7730.   {$EXTERNALSYM DMUS_TRACKF_FLUSH}
  7731.   DMUS_TRACKF_DIRTY           = $10;   (* set when the track should consider any cached values from a previous call to GetParam to be invalidated *)
  7732.   {$EXTERNALSYM DMUS_TRACKF_DIRTY}
  7733.   // The following flags are DX8 only.
  7734.   DMUS_TRACKF_NOTIFY_OFF      = $20;   (* tells track not to send notifications. *)
  7735.   {$EXTERNALSYM DMUS_TRACKF_NOTIFY_OFF}
  7736.   DMUS_TRACKF_PLAY_OFF        = $40;   (* tells track not to play anything (but can still send notifications.) *)
  7737.   {$EXTERNALSYM DMUS_TRACKF_PLAY_OFF}
  7738.   DMUS_TRACKF_LOOPEND         = $80;   (* set when the end of range is also a loop end. *)
  7739.   {$EXTERNALSYM DMUS_TRACKF_LOOPEND}
  7740.   DMUS_TRACKF_STOP            = $100;  (* set when the end of range is also end of playing this segment. *)
  7741.   {$EXTERNALSYM DMUS_TRACKF_STOP}
  7742.   DMUS_TRACKF_RECOMPOSE       = $200;  (* set to indicate the track should compose. *)
  7743.   {$EXTERNALSYM DMUS_TRACKF_RECOMPOSE}
  7744.   DMUS_TRACKF_CLOCK           = $400;  (* set when time parameters are in reference (clock) time. Only valid for PlayEx(). *)
  7745.   {$EXTERNALSYM DMUS_TRACKF_CLOCK}
  7746.  
  7747.   (* The following flags are sent in the IDirectMusicTrack8::GetParamEx() and SetParamEx() methods *)
  7748.   (* inside the dwFlags parameter *)
  7749.   DMUS_TRACK_PARAMF_CLOCK  = $01;       (* set when the time is measured is in reference (clock) time *)
  7750.   {$EXTERNALSYM DMUS_TRACK_PARAMF_CLOCK}
  7751.  
  7752.  
  7753. (*)///////////////////////////////////////////////////////////////////
  7754. // IDirectMusicTrack8 *)
  7755.  
  7756. type
  7757.   {$HPPEMIT 'DECLARE_DINTERFACE_TYPE(IDirectMusicTrack8);'}
  7758.   {$EXTERNALSYM IDirectMusicTrack8}
  7759.   IDirectMusicTrack8 = interface(IDirectMusicTrack)
  7760.     (* IDirectMusicTrack8 *)
  7761.     ['{0e674304-3b05-11d3-9bd1-f9e7f0a01536}']
  7762.     function PlayEx(pStateData: Pointer; rtStart, rtEnd, rtOffset: TReferenceTime;
  7763.       dwFlags: DWORD; pPerf: IDirectMusicPerformance;
  7764.       pSegSt: IDirectMusicSegmentState; dwVirtualID: DWORD): HResult; stdcall;
  7765.     function GetParamEx(const rguidType: TGUID; rtTime: TReferenceTime;
  7766.       out prtNext: TReferenceTime; pParam, pStateData: pointer; dwFlags: DWORD): HResult; stdcall;
  7767.     function SetParamEx(const rguidType: TGUID; rtTime: TReferenceTime;
  7768.       pParam, pStateData: pointer; dwFlags: DWORD): HResult; stdcall;
  7769.     function Compose(pContext: IUnknown; dwTrackGroup: DWORD;
  7770.       out ppResultTrack: IDirectMusicTrack): HResult; stdcall;
  7771.     function Join(pNewTrack: IDirectMusicTrack; mtJoin: TMusicTime;
  7772.       pContext: IUnknown; dwTrackGroup: DWORD;
  7773.       out ppResultTrack: IDirectMusicTrack): HResult; stdcall;
  7774.   end;
  7775.  
  7776. const
  7777.   (* CLSID's *)
  7778.   CLSID_DirectMusicTempoTrack    : TGUID = '{d2ac2885-b39b-11d1-8704-00600893b1bd}';
  7779.   {$EXTERNALSYM CLSID_DirectMusicTempoTrack}
  7780.   CLSID_DirectMusicSeqTrack      : TGUID = '{d2ac2886-b39b-11d1-8704-00600893b1bd}';
  7781.   {$EXTERNALSYM CLSID_DirectMusicSeqTrack}
  7782.   CLSID_DirectMusicSysExTrack    : TGUID = '{d2ac2887-b39b-11d1-8704-00600893b1bd}';
  7783.   {$EXTERNALSYM CLSID_DirectMusicSysExTrack}
  7784.   CLSID_DirectMusicTimeSigTrack  : TGUID = '{d2ac2888-b39b-11d1-8704-00600893b1bd}';
  7785.   {$EXTERNALSYM CLSID_DirectMusicTimeSigTrack}
  7786.   CLSID_DirectMusicChordTrack    : TGUID = '{d2ac288b-b39b-11d1-8704-00600893b1bd}';
  7787.   {$EXTERNALSYM CLSID_DirectMusicChordTrack}
  7788.   CLSID_DirectMusicCommandTrack  : TGUID = '{d2ac288c-b39b-11d1-8704-00600893b1bd}';
  7789.   {$EXTERNALSYM CLSID_DirectMusicCommandTrack}
  7790.   CLSID_DirectMusicStyleTrack    : TGUID = '{d2ac288d-b39b-11d1-8704-00600893b1bd}';
  7791.   {$EXTERNALSYM CLSID_DirectMusicStyleTrack}
  7792.   CLSID_DirectMusicMotifTrack    : TGUID = '{d2ac288e-b39b-11d1-8704-00600893b1bd}';
  7793.   {$EXTERNALSYM CLSID_DirectMusicMotifTrack}
  7794.   CLSID_DirectMusicSignPostTrack : TGUID = '{f17e8672-c3b4-11d1-870b-00600893b1bd}';
  7795.   {$EXTERNALSYM CLSID_DirectMusicSignPostTrack}
  7796.   CLSID_DirectMusicBandTrack     : TGUID = '{d2ac2894-b39b-11d1-8704-00600893b1bd}';
  7797.   {$EXTERNALSYM CLSID_DirectMusicBandTrack}
  7798.   CLSID_DirectMusicChordMapTrack : TGUID = '{d2ac2896-b39b-11d1-8704-00600893b1bd}';
  7799.   {$EXTERNALSYM CLSID_DirectMusicChordMapTrack}
  7800.   CLSID_DirectMusicMuteTrack     : TGUID = '{d2ac2898-b39b-11d1-8704-00600893b1bd}';
  7801.   {$EXTERNALSYM CLSID_DirectMusicMuteTrack}
  7802.  
  7803.   (* New CLSID's for DX8 *)
  7804.   CLSID_DirectMusicScriptTrack: TGUID = '{4108fa85-3586-11d3-8bd7-00600893b1b6}'; (* {4108FA85-3586-11d3-8BD7-00600893B1B6} *)
  7805.   {$EXTERNALSYM CLSID_DirectMusicScriptTrack}
  7806.   CLSID_DirectMusicMarkerTrack: TGUID = '{55a8fd00-4288-11d3-9bd1-8a0d61c88835}';
  7807.   {$EXTERNALSYM CLSID_DirectMusicMarkerTrack}
  7808.   CLSID_DirectMusicSegmentTriggerTrack: TGUID = '{bae4d665-4ea1-11d3-8bda-00600893b1b6}'; (* {BAE4D665-4EA1-11d3-8BDA-00600893B1B6} *)
  7809.   {$EXTERNALSYM CLSID_DirectMusicSegmentTriggerTrack}
  7810.   CLSID_DirectMusicLyricsTrack: TGUID = '{995c1cf5-54ff-11d3-8bda-00600893b1b6}'; (* {995C1CF5-54FF-11d3-8BDA-00600893B1B6} *)
  7811.   {$EXTERNALSYM CLSID_DirectMusicLyricsTrack}
  7812.   CLSID_DirectMusicParamControlTrack: TGUID = '{4be0537b-5c19-11d3-8bdc-00600893b1b6}'; (* {4BE0537B-5C19-11d3-8BDC-00600893B1B6} *)
  7813.   {$EXTERNALSYM CLSID_DirectMusicParamControlTrack}
  7814.   CLSID_DirectMusicWaveTrack: TGUID = '{eed36461-9ea5-11d3-9bd1-0080c7150a74}';
  7815.   {$EXTERNALSYM CLSID_DirectMusicWaveTrack}
  7816.  
  7817. type
  7818.   (* IID's *)
  7819.   IID_IDirectMusicTrack = IDirectMusicTrack;
  7820.   {$EXTERNALSYM IID_IDirectMusicTrack}
  7821.   IID_IDirectMusicTool = IDirectMusicTool;
  7822.   {$EXTERNALSYM IID_IDirectMusicTool}
  7823.  
  7824.   // Interface IDs for DX8
  7825.   // changed interfaces (GUID only)
  7826.   IID_IDirectMusicTool8 = IDirectMusicTool8;
  7827.   {$EXTERNALSYM IID_IDirectMusicTool8}
  7828.   IID_IDirectMusicTrack8 = IDirectMusicTrack8;
  7829.   {$EXTERNALSYM IID_IDirectMusicTrack8}
  7830.  
  7831.  
  7832. // Translator: Types below are declared to compatibility with previous -
  7833. // non borland compliant - conversions of DirectMusic.
  7834. type
  7835.   PDMus_Downloadinfo = PDMusDownloadInfo;
  7836.   TDMus_Downloadinfo = TDMusDownloadInfo;
  7837.   PDMus_Offsettable = PDMusOffsetTable;
  7838.   TDMus_Offsettable = TDMusOffsetTable;
  7839.   PDMus_Instrument = PDMusInstrument;
  7840.   TDMus_Instrument = TDMusInstrument;
  7841.   PDMus_Region = PDMusRegion;
  7842.   TDMus_Region = TDMusRegion;
  7843.   PDMus_Lfoparams = PDMusLFOParams;
  7844.   TDMus_Lfoparams = TDMusLFOParams;
  7845.   PDMus_Vegparams = PDMusVEGParams;
  7846.   TDMus_Vegparams = TDMusVEGParams;
  7847.   PDMus_Pegparams = PDMusPEGParams;
  7848.   TDMus_Pegparams = TDMusPEGParams;
  7849.   PDMus_Mscparams = PDMusMSCParams;
  7850.   TDMus_Mscparams = TDMusMSCParams;
  7851.   PDMus_Articparams = PDMusArticParams;
  7852.   TDMus_Articparams = TDMusArticParams;
  7853.   PDMus_Articulation = PDMusArticulation;
  7854.   TDMus_Articulation = TDMusArticulation;
  7855.   PDMus_Articulation2 = PDMusArticulation2;
  7856.   TDMus_Articulation2 = TDMusArticulation2;
  7857.   PDMus_Extensionchunk = PDMusExtensionChunk;
  7858.   TDMus_Extensionchunk = TDMusExtensionChunk;
  7859.   PDMus_Copyright = PDMusCopyright;
  7860.   TDMus_Copyright = TDMusCopyright;
  7861.   PDMus_Wavedata = PDMusWaveData;
  7862.   TDMus_Wavedata = TDMusWaveData;
  7863.   PDMus_Wave = PDMusWave;
  7864.   TDMus_Wave = TDMusWave;
  7865.   PDMus_Noterange = PDMusNoteRange;
  7866.   TDMus_Noterange = TDMusNoteRange;
  7867.   PDMus_Waveartdl = PDMusWaveArtDL;
  7868.   TDMus_Waveartdl = TDMusWaveArtDL;
  7869.   PDMus_Wavedl = PDMusWaveDL;
  7870.   TDMus_Wavedl = TDMusWaveDL;
  7871.   PDMus_Bufferdesc = PDMusBufferDesc;
  7872.   TDMus_Bufferdesc = TDMusBufferDesc;
  7873.   PDMus_Portcaps = PDMusPortCaps;
  7874.   TDMus_Portcaps = TDMusPortCaps;
  7875.   PDMus_Portparams = PDMusPortParams;
  7876.   TDMus_Portparams = TDMusPortParams;
  7877.   PDMus_Portparams8 = PDMusPortParams8;
  7878.   TDMus_Portparams8 = TDMusPortParams8;
  7879.   PDMus_Synthstats = PDMusSynthStats;
  7880.   TDMus_Synthstats = TDMusSynthStats;
  7881.   PDMus_Synthstats8 = PDMusSynthStats8;
  7882.   TDMus_Synthstats8 = TDMusSynthStats8;
  7883.   PDMus_Waves_Reverb_Params = PDMusWavesReverbParams;
  7884.   TDMus_Waves_Reverb_Params = TDMusWavesReverbParams;
  7885.   PDMus_Clockinfo7 = PDMusClockInfo7;
  7886.   TDMus_Clockinfo7 = TDMusClockInfo7;
  7887.   PDMus_Clockinfo8 = PDMusClockInfo8;
  7888.   TDMus_Clockinfo8 = TDMusClockInfo8;
  7889.   PDMus_Audioparams = PDMusAudioParams;
  7890.   TDMus_Audioparams = TDMusAudioParams;
  7891.   PDMus_Subchord = PDMusSubChord;
  7892.   TDMus_Subchord = TDMusSubChord;
  7893.   PDMus_Chord_Key = PDMusChordKey;
  7894.   TDMus_Chord_Key = TDMusChordKey;
  7895.   PDMus_Version = PDMusVersion;
  7896.   TDMus_Version = TDMusVersion;
  7897.   PDMus_Timesignature = PDMusTimeSignature;
  7898.   TDMus_Timesignature = TDMusTimeSignature;
  7899.   PDMus_Valid_Start_Param = PDMusValidStartParam;
  7900.   TDMus_Valid_Start_Param = TDMusValidStartParam;
  7901.   PDMus_Play_Marker_Param = PDMusPlayMarkerParam;
  7902.   TDMus_Play_Marker_Param = TDMusPlayMarkerParam;
  7903.   PDMus_Objectdesc = PDMusObjectDesc;
  7904.   TDMus_Objectdesc = TDMusObjectDesc;
  7905.   PDMus_Script_Errorinfo = PDMusScriptErrorInfo;
  7906.   TDMus_Script_Errorinfo = TDMusScriptErrorInfo;
  7907.   PDMus_Command_Param = PDMusCommandParam;
  7908.   TDMus_Command_Param = TDMusCommandParam;
  7909.   PDMus_Command_Param_2 = PDMusCommandParam2;
  7910.   TDMus_Command_Param_2 = TDMusCommandParam2;
  7911.   PDMus_Pmsg = PDMusPMsg;
  7912.   TDMus_Pmsg = TDMusPMsg;
  7913.   PDMus_Note_Pmsg = PDMusNotePMsg;
  7914.   TDMus_Note_Pmsg = TDMusNotePMsg;
  7915.   PDMus_Midi_Pmsg = PDMusMidiPMsg;
  7916.   TDMus_Midi_Pmsg = TDMusMidiPMsg;
  7917.   PDMus_Patch_Pmsg = PDMusPatchPMsg;
  7918.   TDMus_Patch_Pmsg = TDMusPatchPMsg;
  7919.   PDMus_Transpose_Pmsg = PDMusTransposePMsg;
  7920.   TDMus_Transpose_Pmsg = TDMusTransposePMsg;
  7921.   PDMus_Channel_Priority_Pmsg = PDMusChannelPriorityPMsg;
  7922.   TDMus_Channel_Priority_Pmsg = TDMusChannelPriorityPMsg;
  7923.   PDMus_Tempo_Pmsg = PDMusTempoPMsg;
  7924.   TDMus_Tempo_Pmsg = TDMusTempoPMsg;
  7925.   PDMus_Sysex_Pmsg = PDMusSysexPMsg;
  7926.   TDMus_Sysex_Pmsg = TDMusSysexPMsg;
  7927.   PDMus_Curve_Pmsg = PDMusCurvePMsg;
  7928.   TDMus_Curve_Pmsg = TDMusCurvePMsg;
  7929.   PDMus_Timesig_Pmsg = PDMusTimeSigPMsg;
  7930.   TDMus_Timesig_Pmsg = TDMusTimeSigPMsg;
  7931.   PDMus_Notification_Pmsg = PDMusNotificationPMsg;
  7932.   TDMus_Notification_Pmsg = TDMusNotificationPMsg;
  7933.   PDMus_Wave_Pmsg = PDMusWavePMsg;
  7934.   TDMus_Wave_Pmsg = TDMusWavePMsg;
  7935.   PDMus_Lyric_Pmsg = PDMusLyricPMsg;
  7936.   TDMus_Lyric_Pmsg = TDMusLyricPMsg;
  7937.   PDMus_Band_Param = PDMusBandParam;
  7938.   TDMus_Band_Param = TDMusBandParam;
  7939.   PDMus_Variations_Param = PDMusVariationsParam;
  7940.   TDMus_Variations_Param = TDMusVariationsParam;
  7941.   PDMus_Io_Seq_Item = PDMusIoSeqItem;
  7942.   TDMus_Io_Seq_Item = TDMusIoSeqItem;
  7943.   PDMus_Io_Curve_Item = PDMusIoCurveItem;
  7944.   TDMus_Io_Curve_Item = TDMusIoCurveItem;
  7945.   PDMus_Io_Tempo_Item = PDMusIoTempoItem;
  7946.   TDMus_Io_Tempo_Item = TDMusIoTempoItem;
  7947.   PDMus_Io_Sysex_Item = PDMusIoSysexItem;
  7948.   TDMus_Io_Sysex_Item = TDMusIoSysexItem;
  7949.   PDMus_Rhythm_Param = PDMusRhythmParam;
  7950.   TDMus_Rhythm_Param = TDMusRhythmParam;
  7951.   PDMus_Tempo_Param = PDMusTempoParam;
  7952.   TDMus_Tempo_Param = TDMusTempoParam;
  7953.   PDMus_Mute_Param = PDMusMuteParam;
  7954.   TDMus_Mute_Param = TDMusMuteParam;
  7955.   PDMus_Io_Timesig = PDMusIoTimesig;
  7956.   TDMus_Io_Timesig = TDMusIoTimesig;
  7957.   PDMus_Io_Style = PDMusIoStyle;
  7958.   TDMus_Io_Style = TDMusIoStyle;
  7959.   PDMus_Io_Version = PDMusIoVersion;
  7960.   TDMus_Io_Version = TDMusIoVersion;
  7961.   PDMus_Io_Pattern = PDMusIoPattern;
  7962.   TDMus_Io_Pattern = TDMusIoPattern;
  7963.   PDMus_Io_Stylepart = PDMusIoStylepart;
  7964.   TDMus_Io_Stylepart = TDMusIoStylepart;
  7965.   PDMus_Io_Partref = PDMusIoPartref;
  7966.   TDMus_Io_Partref = TDMusIoPartref;
  7967.   PDMus_Io_Stylenote = PDMusIoStyleNote;
  7968.   TDMus_Io_Stylenote = TDMusIoStyleNote;
  7969.   PDMus_Io_Stylecurve = PDMusIoStyleCurve;
  7970.   TDMus_Io_Stylecurve = TDMusIoStyleCurve;
  7971.   PDMus_Io_Stylemarker = PDMusIoStyleMarker;
  7972.   TDMus_Io_Stylemarker = TDMusIoStyleMarker;
  7973.   PDMus_Io_Styleresolution = PDMusIoStyleResolution;
  7974.   TDMus_Io_Styleresolution = TDMusIoStyleResolution;
  7975.   PDMus_Io_Style_Anticipation = PDMusIoStyleAnticipation;
  7976.   TDMus_Io_Style_Anticipation = TDMusIoStyleAnticipation;
  7977.   PDMus_Io_Motifsettings = PDMusIoMotifSettings;
  7978.   TDMus_Io_Motifsettings = TDMusIoMotifSettings;
  7979.   PDMus_Io_Chord = PDMusIoChord;
  7980.   TDMus_Io_Chord = TDMusIoChord;
  7981.   PDMus_Io_Subchord = PDMusIoSubChord;
  7982.   TDMus_Io_Subchord = TDMusIoSubChord;
  7983.   PDMus_Io_Command = PDMusIoCommand;
  7984.   TDMus_Io_Command = TDMusIoCommand;
  7985.   PDMus_Io_Tool_Header = PDMusIoToolHeader;
  7986.   TDMus_Io_Tool_Header = TDMusIoToolHeader;
  7987.   PDMus_Io_Portconfig_Header = PDMusIoPortconfigHeader;
  7988.   TDMus_Io_Portconfig_Header = TDMusIoPortconfigHeader;
  7989.   PDMus_Io_Pchanneltobuffer_Header = PDMusIoPchanneltobufferHeader;
  7990.   TDMus_Io_Pchanneltobuffer_Header = TDMusIoPchanneltobufferHeader;
  7991.   PDMus_Io_Buffer_Attributes_Header = PDMusIoBufferAttributesHeader;
  7992.   TDMus_Io_Buffer_Attributes_Header = TDMusIoBufferAttributesHeader;
  7993.   PDMus_Io_Band_Track_Header = PDMusIoBandTrackHeader;
  7994.   TDMus_Io_Band_Track_Header = TDMusIoBandTrackHeader;
  7995.   PDMus_Io_Band_Item_Header = PDMusIoBandItemHeader;
  7996.   TDMus_Io_Band_Item_Header = TDMusIoBandItemHeader;
  7997.   PDMus_Io_Band_Item_Header2 = PDMusIoBandItemHeader2;
  7998.   TDMus_Io_Band_Item_Header2 = TDMusIoBandItemHeader2;
  7999.   PDMus_Io_Instrument = PDMusIoInstrument;
  8000.   TDMus_Io_Instrument = TDMusIoInstrument;
  8001.   PDMus_Io_Wave_Header = PDMusIoWaveHeader;
  8002.   TDMus_Io_Wave_Header = TDMusIoWaveHeader;
  8003.   PDMus_Io_Wave_Track_Header = PDMusIoWaveTrackHeader;
  8004.   TDMus_Io_Wave_Track_Header = TDMusIoWaveTrackHeader;
  8005.   PDMus_Io_Wave_Part_Header = PDMusIoWavePartHeader;
  8006.   TDMus_Io_Wave_Part_Header = TDMusIoWavePartHeader;
  8007.   PDMus_Io_Wave_Item_Header = PDMusIoWaveItemHeader;
  8008.   TDMus_Io_Wave_Item_Header = TDMusIoWaveItemHeader;
  8009.   PDMus_Io_Container_Header = PDMusIoContainerHeader;
  8010.   TDMus_Io_Container_Header = TDMusIoContainerHeader;
  8011.   PDMus_Io_Contained_Object_Header = PDMusIoContainedObjectHeader;
  8012.   TDMus_Io_Contained_Object_Header = TDMusIoContainedObjectHeader;
  8013.   PDMus_Io_Segment_Header = PDMusIoSegmentHeader;
  8014.   TDMus_Io_Segment_Header = TDMusIoSegmentHeader;
  8015.   PDMus_Io_Track_Header = PDMusIoTrackHeader;
  8016.   TDMus_Io_Track_Header = TDMusIoTrackHeader;
  8017.   PDMus_Io_Track_Extras_Header = PDMusIoTrackExtrasHeader;
  8018.   TDMus_Io_Track_Extras_Header = TDMusIoTrackExtrasHeader;
  8019.   PDMus_Io_Reference = PDMusIoReference;
  8020.   TDMus_Io_Reference = TDMusIoReference;
  8021.   PDMus_Io_Chordmap = PDMusIoChordmap;
  8022.   TDMus_Io_Chordmap = TDMusIoChordmap;
  8023.   PDMus_Io_Chordmap_Subchord = PDMusIoChordmapSubChord;
  8024.   TDMus_Io_Chordmap_Subchord = TDMusIoChordmapSubChord;
  8025.   PDMus_Io_Chordentry = PDMusIoChordEntry;
  8026.   TDMus_Io_Chordentry = TDMusIoChordEntry;
  8027.   PDMus_Io_Nextchord = PDMusIoNextChord;
  8028.   TDMus_Io_Nextchord = TDMusIoNextChord;
  8029.   PDMus_Io_Chordmap_Signpost = PDMusIoChordMapSignPost;
  8030.   TDMus_Io_Chordmap_Signpost = TDMusIoChordMapSignPost;
  8031.   PDMus_Io_Script_Header = PDMusIoScriptHeader;
  8032.   TDMus_Io_Script_Header = TDMusIoScriptHeader;
  8033.   PDMus_Io_Signpost = PDMusIoSignPost;
  8034.   TDMus_Io_Signpost = TDMusIoSignPost;
  8035.   PDMus_Io_Mute = PDMusIoMute;
  8036.   TDMus_Io_Mute = TDMusIoMute;
  8037.   PDMus_Io_Timesignature_Item = PDMusIoTimesignatureItem;
  8038.   TDMus_Io_Timesignature_Item = TDMusIoTimesignatureItem;
  8039.   PDMus_Io_Valid_Start = PDMusIoValidStart;
  8040.   TDMus_Io_Valid_Start = TDMusIoValidStart;
  8041.   PDMus_Io_Play_Marker = PDMusIoPlayMarker;
  8042.   TDMus_Io_Play_Marker = TDMusIoPlayMarker;
  8043.   PDMus_Io_Segment_Track_Header = PDMusIoSegmentTrackHeader;
  8044.   TDMus_Io_Segment_Track_Header = TDMusIoSegmentTrackHeader;
  8045.   PDMus_Io_Segment_Item_Header = PDMusIoSegmentItemHeader;
  8046.   TDMus_Io_Segment_Item_Header = TDMusIoSegmentItemHeader;
  8047.   PDMus_Io_Scripttrack_Eventheader = PDMusIoScriptTrackEventHeader;
  8048.   TDMus_Io_Scripttrack_Eventheader = TDMusIoScriptTrackEventHeader;
  8049.   PDMus_Io_Lyricstrack_Eventheader = PDMusIoLyricsTrackEventHeader;
  8050.   TDMus_Io_Lyricstrack_Eventheader = TDMusIoLyricsTrackEventHeader;
  8051.   PDMus_Io_Paramcontroltrack_Objectheader = PDMusIoParamControlTrackObjectHeader;
  8052.   TDMus_Io_Paramcontroltrack_Objectheader = TDMusIoParamControlTrackObjectHeader;
  8053.   PDMus_Io_Paramcontroltrack_Paramheader = PDMusIoParamControlTrackParamHeader;
  8054.   TDMus_Io_Paramcontroltrack_Paramheader = TDMusIoParamControlTrackParamHeader;
  8055.   PDMus_Io_Paramcontroltrack_Curveinfo = PDMusIoParamControlTrackCurveInfo;
  8056.   TDMus_Io_Paramcontroltrack_Curveinfo = TDMusIoParamControlTrackCurveInfo;
  8057.   PDMus_Eventheader = PDMusEventHeader;
  8058.   TDMus_Eventheader = TDMusEventHeader;
  8059.   PDSound_Io_Dsbufferdesc = PDSoundIoDSBufferDesc;
  8060.   TDSound_Io_Dsbufferdesc = TDSoundIoDSBufferDesc;
  8061.   PDSound_Io_Dsbusid = PDSoundIoDSBusID;
  8062.   TDSound_Io_Dsbusid = TDSoundIoDSBusID;
  8063.   PDSound_Io_3d = PDSoundIo3D;
  8064.   TDSound_Io_3d = TDSoundIo3D;
  8065.   PDSound_Io_Dxdmo_Header = PDSoundIoDXDMOHeader;
  8066.   TDSound_Io_Dxdmo_Header = TDSoundIoDXDMOHeader;
  8067.   PDSound_Io_Dxdmo_Data = PDSoundIoDXDMOData;
  8068.   TDSound_Io_Dxdmo_Data = TDSoundIoDXDMOData;
  8069.  
  8070.  
  8071.  
  8072. implementation
  8073.  
  8074. // #define MAKE_DMHRESULTSUCCESS(code)     MAKE_HRESULT(0, FACILITY_DIRECTMUSIC, (DMUS_ERRBASE + (code)))
  8075. function MAKE_DMHRESULTSUCCESS(Code: DWord): DWord;
  8076. begin
  8077.   Result:= (0 shl 31) or (FACILITY_DIRECTMUSIC shl 16) or (DMUS_ERRBASE + Code);
  8078. end;
  8079.  
  8080. // #define MAKE_DMHRESULTERROR(code)       MAKE_HRESULT(1, FACILITY_DIRECTMUSIC, (DMUS_ERRBASE + (code)))
  8081. function MAKE_DMHRESULTERROR(Code: DWord): DWord;
  8082. begin
  8083.   Result:= DWORD((1 shl 31) or (FACILITY_DIRECTMUSIC shl 16)) or (DMUS_ERRBASE + Code);
  8084. end;
  8085.  
  8086. // #define DSBUSID_IS_SPKR_LOC(id) ( ((id) >= DSBUSID_FIRST_SPKR_LOC) && ((id) <= DSBUSID_LAST_SPKR_LOC) )
  8087. function DSBUSID_IS_SPKR_LOC(id: Integer): Boolean;
  8088. begin
  8089.   Result := (id >= DSBUSID_FIRST_SPKR_LOC) and (id <= DSBUSID_LAST_SPKR_LOC);
  8090. end;
  8091.  
  8092. function QWORD_ALIGN(x: DWORD): DWORD;
  8093. begin
  8094.   Result := (x + 7) and (not 7); //  (((x) + 7) & ~7)
  8095. end;
  8096.  
  8097. function DMUS_EVENT_SIZE(cb: DWORD): DWORD;
  8098. begin
  8099.   Result := QWORD_ALIGN(SizeOf(TDMusEventHeader) + cb); // QWORD_ALIGN(sizeof(DMUS_EVENTHEADER) + cb)
  8100. end;
  8101.  
  8102. end.
  8103.