dmusici.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:110k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /************************************************************************
  2. *                                                                       *
  3. *   dmusici.h -- This module contains the API for the                   *
  4. *                DirectMusic performance layer                          *
  5. *                                                                       *
  6. *   Copyright (c) 1998-1999 Microsoft Corporation
  7. *                                                                       *
  8. ************************************************************************/
  9. #ifndef _DMUSICI_
  10. #define _DMUSICI_
  11. #include <windows.h>
  12. #define COM_NO_WINDOWS_H
  13. #include <objbase.h>
  14. #include <mmsystem.h>
  15. #include <dmusicc.h>
  16. /* plugin (track and tool) interfaces.  This #include will eventually go away. */
  17. #include <dmplugin.h>
  18. #include <pshpack8.h>
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. typedef WORD            TRANSITION_TYPE;
  23. typedef __int64         REFERENCE_TIME;
  24. typedef long            MUSIC_TIME;
  25. #define MT_MIN          0x80000000  /* Minimum music time value. */
  26. #define MT_MAX          0x7FFFFFFF  /* Maximum music time value. */
  27. #define DMUS_PPQ        768     /* parts per quarter note */
  28. interface IDirectMusicTrack;
  29. interface IDirectMusicPerformance;
  30. interface IDirectMusicPerformance8;
  31. interface IDirectMusicTool;
  32. interface IDirectMusicSegment;
  33. interface IDirectMusicSegment8;
  34. interface IDirectMusicSegmentState;
  35. interface IDirectMusicSegmentState8;
  36. interface IDirectMusicGraph;
  37. interface IDirectMusicBuffer;
  38. interface IDirectMusicInstrument;
  39. interface IDirectMusicDownloadedInstrument;
  40. interface IDirectMusicBand;
  41. interface IDirectMusicChordMap;
  42. interface IDirectMusicLoader;
  43. interface IDirectMusicLoader8;
  44. interface IDirectMusicScript;
  45. interface IDirectMusicObject;
  46. interface IDirectMusicStyle8;
  47. interface IDirectMusicPatternTrack;
  48. interface IDirectMusicContainer;
  49. interface IDirectMusicTool8;
  50. interface IDirectMusicTrack8;
  51. interface IDirectMusicSong;
  52. interface IDirectMusicAudioPath;
  53. #ifndef __cplusplus 
  54. typedef interface IDirectMusicTrack IDirectMusicTrack;
  55. typedef interface IDirectMusicPerformance IDirectMusicPerformance;
  56. typedef interface IDirectMusicPerformance8 IDirectMusicPerformance8;
  57. typedef interface IDirectMusicTool IDirectMusicTool;
  58. typedef interface IDirectMusicSegment IDirectMusicSegment;
  59. typedef interface IDirectMusicSegment8 IDirectMusicSegment8;
  60. typedef interface IDirectMusicSegmentState IDirectMusicSegmentState;
  61. typedef interface IDirectMusicSegmentState8 IDirectMusicSegmentState8;
  62. typedef interface IDirectMusicGraph IDirectMusicGraph;
  63. typedef interface IDirectMusicBuffer IDirectMusicBuffer;
  64. typedef interface IDirectMusicInstrument IDirectMusicInstrument;
  65. typedef interface IDirectMusicDownloadedInstrument IDirectMusicDownloadedInstrument;
  66. typedef interface IDirectMusicBand IDirectMusicBand;
  67. typedef interface IDirectMusicChordMap IDirectMusicChordMap;
  68. typedef interface IDirectMusicObject IDirectMusicObject;
  69. typedef interface IDirectMusicLoader IDirectMusicLoader;
  70. typedef interface IDirectMusicLoader8 IDirectMusicLoader8;
  71. typedef interface IDirectMusicScript IDirectMusicScript;
  72. typedef interface IDirectMusicStyle8 IDirectMusicStyle8;
  73. typedef interface IDirectMusicPatternTrack IDirectMusicPatternTrack;
  74. typedef interface IDirectMusicContainer IDirectMusicContainer;
  75. typedef interface IDirectMusicTool8 IDirectMusicTool8;
  76. typedef interface IDirectMusicTrack8 IDirectMusicTrack8;
  77. typedef interface IDirectMusicSong IDirectMusicSong;
  78. typedef interface IDirectMusicAudioPath IDirectMusicAudioPath;
  79. #endif
  80. typedef enum enumDMUS_STYLET_TYPES
  81. {
  82.     DMUS_STYLET_PATTERN         = 0,
  83.     DMUS_STYLET_MOTIF           = 1,
  84.     DMUS_STYLET_FRAGMENT        = 2,
  85. } DMUS_STYLET_TYPES;
  86. typedef enum enumDMUS_COMMANDT_TYPES
  87. {
  88.     DMUS_COMMANDT_GROOVE            = 0,
  89.     DMUS_COMMANDT_FILL              = 1,
  90.     DMUS_COMMANDT_INTRO             = 2,
  91.     DMUS_COMMANDT_BREAK             = 3,
  92.     DMUS_COMMANDT_END               = 4,
  93.     DMUS_COMMANDT_ENDANDINTRO       = 5
  94. } DMUS_COMMANDT_TYPES;
  95. typedef enum enumDMUS_SHAPET_TYPES
  96. {
  97.     DMUS_SHAPET_FALLING             = 0,
  98.     DMUS_SHAPET_LEVEL               = 1,
  99.     DMUS_SHAPET_LOOPABLE            = 2,
  100.     DMUS_SHAPET_LOUD                = 3,
  101.     DMUS_SHAPET_QUIET               = 4,
  102.     DMUS_SHAPET_PEAKING             = 5,
  103.     DMUS_SHAPET_RANDOM              = 6,
  104.     DMUS_SHAPET_RISING              = 7,
  105.     DMUS_SHAPET_SONG                = 8
  106. }   DMUS_SHAPET_TYPES;
  107. typedef enum enumDMUS_COMPOSEF_FLAGS
  108. {       
  109.     DMUS_COMPOSEF_NONE              = 0,
  110.     DMUS_COMPOSEF_ALIGN             = 0x1,
  111.     DMUS_COMPOSEF_OVERLAP           = 0x2,
  112.     DMUS_COMPOSEF_IMMEDIATE         = 0x4,
  113.     DMUS_COMPOSEF_GRID              = 0x8,
  114.     DMUS_COMPOSEF_BEAT              = 0x10,
  115.     DMUS_COMPOSEF_MEASURE           = 0x20,
  116.     DMUS_COMPOSEF_AFTERPREPARETIME  = 0x40,
  117.     DMUS_COMPOSEF_VALID_START_BEAT  = 0x80,   /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any beat. */
  118.     DMUS_COMPOSEF_VALID_START_GRID  = 0x100,  /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any grid. */
  119.     DMUS_COMPOSEF_VALID_START_TICK  = 0x200,  /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur any time. */
  120.     DMUS_COMPOSEF_SEGMENTEND        = 0x400,  /* Play the transition at the end of the current segment. */
  121.     DMUS_COMPOSEF_MARKER            = 0x800,  /* Play the transition at the next marker in the current segment. */
  122.     DMUS_COMPOSEF_MODULATE          = 0x1000,
  123.     DMUS_COMPOSEF_LONG              = 0x2000,
  124.     DMUS_COMPOSEF_ENTIRE_TRANSITION = 0x4000,    /* play the entire transition pattern */
  125.     DMUS_COMPOSEF_1BAR_TRANSITION   = 0x8000,    /* play one bar of the transition pattern */
  126.     DMUS_COMPOSEF_ENTIRE_ADDITION   = 0x10000,   /* play the additional pattern in its entirety */
  127.     DMUS_COMPOSEF_1BAR_ADDITION     = 0x20000,   /* play one bar of the additional pattern */
  128.     DMUS_COMPOSEF_VALID_START_MEASURE = 0x40000, /* In conjunction with DMUS_COMPOSEF_ALIGN, allows the switch to occur on any bar. */
  129.     DMUS_COMPOSEF_DEFAULT           = 0x80000,   /* Use segment's default boundary */
  130.     DMUS_COMPOSEF_NOINVALIDATE      = 0x100000,  /* Play without invalidating the currently playing segment(s) */
  131.     DMUS_COMPOSEF_USE_AUDIOPATH     = 0x200000,  /* Uses the audio paths that are embedded in the segments */
  132.     DMUS_COMPOSEF_INVALIDATE_PRI    = 0x400000   /* Invalidate only the current primary seg state */
  133. }   DMUS_COMPOSEF_FLAGS;
  134. #define DMUS_PMSG_PART                                                                              
  135.     DWORD               dwSize;                                                                     
  136.     REFERENCE_TIME      rtTime;             /* real time (in 100 nanosecond increments) */          
  137.     MUSIC_TIME          mtTime;             /* music time */                                        
  138.     DWORD               dwFlags;            /* various bits (see DMUS_PMSGF_FLAGS enumeration) */    
  139.     DWORD               dwPChannel;         /* Performance Channel. The Performance can */          
  140.                                             /* use this to determine the port/channel. */           
  141.     DWORD               dwVirtualTrackID;   /* virtual track ID */                                  
  142.     IDirectMusicTool*   pTool;              /* tool interface pointer */                            
  143.     IDirectMusicGraph*  pGraph;             /* tool graph interface pointer */                      
  144.     DWORD               dwType;             /* PMSG type (see DMUS_PMSGT_TYPES defines) */              
  145.     DWORD               dwVoiceID;          /* unique voice id which allows synthesizers to */      
  146.                                             /* identify a specific event. For DirectX 6.0, */       
  147.                                             /* this field should always be 0. */                    
  148.     DWORD               dwGroupID;          /* Track group id */                                 
  149.     IUnknown*           punkUser;           /* user com pointer, auto released upon PMSG free */
  150. /* every DMUS_PMSG is based off of this structure. The Performance needs 
  151.    to access these members consistently in every PMSG that goes through it. */
  152. typedef struct _DMUS_PMSG
  153. {
  154.     /* begin DMUS_PMSG_PART */
  155.     DMUS_PMSG_PART
  156.     /* end DMUS_PMSG_PART */
  157. } DMUS_PMSG;
  158. #define DMUS_PCHANNEL_BROADCAST_PERFORMANCE 0xFFFFFFFF  /* PMsg is sent on all PChannels of the performance. */
  159. #define DMUS_PCHANNEL_BROADCAST_AUDIOPATH   0xFFFFFFFE  /* PMsg is sent on all PChannels of the audio path. */
  160. #define DMUS_PCHANNEL_BROADCAST_SEGMENT     0xFFFFFFFD  /* PMsg is sent on all PChannels of the segment. */
  161. #define DMUS_PCHANNEL_BROADCAST_GROUPS   0xFFFFFFFC  /* A duplicate PMsg is for each Channels Groups in the performance. */
  162. /*  The DMUS_PATH constants are used in conjunction with GetObjectInPath to find a requested
  163.     interface at a particular stage in the audio path. 
  164. */
  165. #define DMUS_PATH_SEGMENT          0x1000      /* Get the segment itself (from a segment state.) */
  166. #define DMUS_PATH_SEGMENT_TRACK    0x1100      /* Look in Track List of Segment. */
  167. #define DMUS_PATH_SEGMENT_GRAPH    0x1200      /* Get the segment's tool graph. */
  168. #define DMUS_PATH_SEGMENT_TOOL     0x1300      /* Look in Tool Graph of Segment. */
  169. #define DMUS_PATH_AUDIOPATH        0x2000      /* Get the audiopath itself (from a segment state.) */
  170. #define DMUS_PATH_AUDIOPATH_GRAPH  0x2200      /* Get the audiopath's tool graph. */
  171. #define DMUS_PATH_AUDIOPATH_TOOL   0x2300      /* Look in Tool Graph of Audio Path. */
  172. #define DMUS_PATH_PERFORMANCE      0x3000      /* Access the performance. */
  173. #define DMUS_PATH_PERFORMANCE_GRAPH 0x3200     /* Get the performance's tool graph. */
  174. #define DMUS_PATH_PERFORMANCE_TOOL 0x3300      /* Look in Tool Graph of Performance. */
  175. #define DMUS_PATH_PORT             0x4000      /* Access the synth. */
  176. #define DMUS_PATH_BUFFER           0x6000      /* Look in DirectSoundBuffer. */
  177. #define DMUS_PATH_BUFFER_DMO       0x6100      /* Access a DMO in the buffer. */
  178. #define DMUS_PATH_MIXIN_BUFFER     0x7000      /* Look in a global mixin buffer. */ 
  179. #define DMUS_PATH_MIXIN_BUFFER_DMO 0x7100      /* Access a DMO in a global mixin buffer. */ 
  180. #define DMUS_PATH_PRIMARY_BUFFER   0x8000      /* Access the primary buffer. */ 
  181. /*  To ignore PChannels when calling GetObjectInPath(), use the DMUS_PCHANNEL_ALL constant. */
  182. #define DMUS_PCHANNEL_ALL           0xFFFFFFFB      
  183. /*  The DMUS_APATH types are used in conjunction with CreateStandardAudioPath to
  184.     build default path types. _SHARED_ means the same buffer is shared across multiple
  185.     instantiations of the audiopath type. _DYNAMIC_ means a unique buffer is created
  186.     every time. 
  187. */
  188. #define DMUS_APATH_SHARED_STEREOPLUSREVERB   1       /* A standard music set up with stereo outs and reverb. */
  189. #define 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. */
  190. #define DMUS_APATH_DYNAMIC_MONO              7       /* An audio path with one dynamic bus from the synth feeding to a dynamic mono buffer. */
  191. #define DMUS_APATH_DYNAMIC_STEREO            8       /* An audio path with two dynamic buses from the synth feeding to a dynamic stereo buffer. */
  192. typedef struct _DMUS_AUDIOPARAMS
  193. {
  194.     DWORD   dwSize;             /* Size of this structure. */
  195.     BOOL    fInitNow;           /* If true, the sink and synth are created immediately and results returned in this structure. */
  196.     DWORD  dwValidData;        /* Flags indicating which fields below are valid. */
  197.     DWORD   dwFeatures;         /* Required DMUS_AUDIOF features. */
  198.     DWORD   dwVoices;           /* Required number of voices. */
  199.     DWORD   dwSampleRate;       /* Sample rate of synths and sink. */
  200.     CLSID   clsidDefaultSynth;  /* Class ID of default synthesizer. */
  201. } DMUS_AUDIOPARAMS;
  202. /* dwFeatures flags. These indicate which features are required for the audio environment. */
  203. #define DMUS_AUDIOF_3D          0x1   /* Require 3D buffers. */
  204. #define DMUS_AUDIOF_ENVIRON     0x2   /* Require environmental modeling. */
  205. #define DMUS_AUDIOF_EAX         0x4   /* Require use of EAX effects. */
  206. #define DMUS_AUDIOF_DMOS        0x8   /* Require use of additional DMOs. */
  207. #define DMUS_AUDIOF_STREAMING   0x10  /* Require support for streaming waves. */
  208. #define DMUS_AUDIOF_BUFFERS     0x20  /* Require support for multiple buffers (all above cases need this.) */
  209. #define DMUS_AUDIOF_ALL         0x3F  /* Requires everything. */
  210. /* dwValidData flags. These indicate which fields in DMUS_AUDIOPARAMS have been filled in. If fInitNow is set, these also return what was allocated. */
  211. #define DMUS_AUDIOPARAMS_FEATURES       0x00000001
  212. #define DMUS_AUDIOPARAMS_VOICES         0x00000002
  213. #define DMUS_AUDIOPARAMS_SAMPLERATE     0x00000004
  214. #define DMUS_AUDIOPARAMS_DEFAULTSYNTH   0x00000008
  215. /* DMUS_PMSGF_FLAGS fill the DMUS_PMSG's dwFlags member */
  216. typedef enum enumDMUS_PMSGF_FLAGS
  217. {
  218.     DMUS_PMSGF_REFTIME          = 1,      /* if rtTime is valid */
  219.     DMUS_PMSGF_MUSICTIME        = 2,      /* if mtTime is valid */
  220.     DMUS_PMSGF_TOOL_IMMEDIATE   = 4,      /* if PMSG should be processed immediately */ 
  221.     DMUS_PMSGF_TOOL_QUEUE       = 8,      /* if PMSG should be processed a little early, at Queue time */
  222.     DMUS_PMSGF_TOOL_ATTIME      = 0x10,   /* if PMSG should be processed at the time stamp */
  223.     DMUS_PMSGF_TOOL_FLUSH       = 0x20,   /* if PMSG is being flushed */
  224.     DMUS_PMSGF_LOCKTOREFTIME    = 0x40,   /* if rtTime can not be overriden by a tempo change. */
  225.     DMUS_PMSGF_DX8              = 0x80    /* if the message has DX8 or later extensions. */
  226.     /* The values of DMUS_TIME_RESOLVE_FLAGS may also be used inside the */
  227.     /* DMUS_PMSG's dwFlags member. */
  228. } DMUS_PMSGF_FLAGS;
  229. /* DMUS_PMSGT_TYPES fill the DMUS_PMSG's dwType member */
  230. typedef enum enumDMUS_PMSGT_TYPES
  231. {
  232.     DMUS_PMSGT_MIDI             = 0,      /* MIDI short message */
  233.     DMUS_PMSGT_NOTE             = 1,      /* Interactive Music Note */
  234.     DMUS_PMSGT_SYSEX            = 2,      /* MIDI long message (system exclusive message) */
  235.     DMUS_PMSGT_NOTIFICATION     = 3,      /* Notification message */
  236.     DMUS_PMSGT_TEMPO            = 4,      /* Tempo message */
  237.     DMUS_PMSGT_CURVE            = 5,      /* Control change / pitch bend, etc. curve */
  238.     DMUS_PMSGT_TIMESIG          = 6,      /* Time signature */
  239.     DMUS_PMSGT_PATCH            = 7,      /* Patch changes */
  240.     DMUS_PMSGT_TRANSPOSE        = 8,      /* Transposition messages */
  241.     DMUS_PMSGT_CHANNEL_PRIORITY = 9,      /* Channel priority */
  242.     DMUS_PMSGT_STOP             = 10,     /* Stop message */
  243.     DMUS_PMSGT_DIRTY            = 11,     /* Tells Tools that cache GetParam() info to refresh */
  244.     DMUS_PMSGT_WAVE             = 12,     /* Carries control information for playing a wave. */
  245.     DMUS_PMSGT_LYRIC            = 13,     /* Lyric message from lyric track. */
  246.     DMUS_PMSGT_SCRIPTLYRIC      = 14,     /* Lyric message sent by a script with the Trace function. */
  247.     DMUS_PMSGT_USER             = 255     /* User message */
  248. } DMUS_PMSGT_TYPES;
  249. /* DMUS_SEGF_FLAGS correspond to IDirectMusicPerformance::PlaySegment, and other API */
  250. typedef enum enumDMUS_SEGF_FLAGS
  251. {
  252.     DMUS_SEGF_REFTIME           = 1<<6,   /* 0x40 Time parameter is in reference time  */
  253.     DMUS_SEGF_SECONDARY         = 1<<7,   /* 0x80 Secondary segment */
  254.     DMUS_SEGF_QUEUE             = 1<<8,   /* 0x100 Queue at the end of the primary segment queue (primary only) */
  255.     DMUS_SEGF_CONTROL           = 1<<9,   /* 0x200 Play as a control track (secondary segments only) */
  256.     DMUS_SEGF_AFTERPREPARETIME  = 1<<10,  /* 0x400 Play after the prepare time (See IDirectMusicPerformance::GetPrepareTime) */
  257.     DMUS_SEGF_GRID              = 1<<11,  /* 0x800 Play on grid boundary */
  258.     DMUS_SEGF_BEAT              = 1<<12,  /* 0x1000 Play on beat boundary */
  259.     DMUS_SEGF_MEASURE           = 1<<13,  /* 0x2000 Play on measure boundary */
  260.     DMUS_SEGF_DEFAULT           = 1<<14,  /* 0x4000 Use segment's default boundary */
  261.     DMUS_SEGF_NOINVALIDATE      = 1<<15,  /* 0x8000 Play without invalidating the currently playing segment(s) */
  262.     DMUS_SEGF_ALIGN             = 1<<16,  /* 0x10000 Align segment with requested boundary, but switch at first valid point */
  263.     DMUS_SEGF_VALID_START_BEAT  = 1<<17,  /* 0x20000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any beat. */
  264.     DMUS_SEGF_VALID_START_GRID  = 1<<18,  /* 0x40000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any grid. */
  265.     DMUS_SEGF_VALID_START_TICK  = 1<<19,  /* 0x80000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur any time. */
  266.     DMUS_SEGF_AUTOTRANSITION    = 1<<20,  /* 0x100000 Compose and play a transition segment, using either the transition template or transition embedded in song. */
  267.     DMUS_SEGF_AFTERQUEUETIME    = 1<<21,  /* 0x200000 Make sure to play after the queue time. This is default for primary segments */
  268.     DMUS_SEGF_AFTERLATENCYTIME  = 1<<22,  /* 0x400000 Make sure to play after the latency time. This is true for all segments, so this is a nop */
  269.     DMUS_SEGF_SEGMENTEND        = 1<<23,  /* 0x800000 Play at the next end of segment. */
  270.     DMUS_SEGF_MARKER            = 1<<24,  /* 0x1000000 Play at next marker in the primary segment. If there are no markers, default to any other resolution requests. */
  271.     DMUS_SEGF_TIMESIG_ALWAYS    = 1<<25,  /* 0x2000000 Even if there is no primary segment, align start time with current time signature. */
  272.     DMUS_SEGF_USE_AUDIOPATH     = 1<<26,  /* 0x4000000 Uses the audio path that is embedded in the segment or song. */
  273.     DMUS_SEGF_VALID_START_MEASURE = 1<<27, /* 0x8000000 In conjunction with DMUS_SEGF_ALIGN, allows the switch to occur on any bar. */
  274.     DMUS_SEGF_INVALIDATE_PRI    = 1<<28   /* 0x10000000 invalidate only the current primary seg state */
  275. } DMUS_SEGF_FLAGS;
  276. #define DMUS_SEG_REPEAT_INFINITE    0xFFFFFFFF  /* For IDirectMusicSegment::SetRepeat*/
  277. #define DMUS_SEG_ALLTRACKS          0x80000000  /* For IDirectMusicSegment::SetParam() and SetTrackConfig() - selects all tracks instead on nth index. */
  278. #define DMUS_SEG_ANYTRACK           0x80000000  /* For IDirectMusicSegment::GetParam() - checks each track until it finds one that returns data (not DMUS_E_NOT_FOUND.) */
  279.                                                 
  280. /* DMUS_TIME_RESOLVE_FLAGS correspond to IDirectMusicPerformance::GetResolvedTime, and can */
  281. /* also be used interchangeably with the corresponding DMUS_SEGF_FLAGS, since their values */
  282. /* are intentionally the same */
  283. typedef enum enumDMUS_TIME_RESOLVE_FLAGS
  284. {
  285.     DMUS_TIME_RESOLVE_AFTERPREPARETIME  = DMUS_SEGF_AFTERPREPARETIME,
  286.     DMUS_TIME_RESOLVE_AFTERQUEUETIME    = DMUS_SEGF_AFTERQUEUETIME,
  287.     DMUS_TIME_RESOLVE_AFTERLATENCYTIME  = DMUS_SEGF_AFTERLATENCYTIME,
  288.     DMUS_TIME_RESOLVE_GRID              = DMUS_SEGF_GRID,
  289.     DMUS_TIME_RESOLVE_BEAT              = DMUS_SEGF_BEAT,
  290.     DMUS_TIME_RESOLVE_MEASURE           = DMUS_SEGF_MEASURE,
  291.     DMUS_TIME_RESOLVE_MARKER            = DMUS_SEGF_MARKER,
  292.     DMUS_TIME_RESOLVE_SEGMENTEND        = DMUS_SEGF_SEGMENTEND,
  293. } DMUS_TIME_RESOLVE_FLAGS;
  294. /* The following flags are sent inside the DMUS_CHORD_KEY.dwFlags parameter */
  295. typedef enum enumDMUS_CHORDKEYF_FLAGS
  296. {
  297.     DMUS_CHORDKEYF_SILENT            = 1,      /* is the chord silent? */
  298. } DMUS_CHORDKEYF_FLAGS;
  299. #define DMUS_MAXSUBCHORD 8
  300. typedef struct _DMUS_SUBCHORD
  301. {
  302.     DWORD   dwChordPattern;     /* Notes in the subchord */
  303.     DWORD   dwScalePattern;     /* Notes in the scale */
  304.     DWORD   dwInversionPoints;  /* Where inversions can occur */
  305.     DWORD   dwLevels;           /* Which levels are supported by this subchord */
  306.     BYTE    bChordRoot;         /* Root of the subchord */
  307.     BYTE    bScaleRoot;         /* Root of the scale */
  308. } DMUS_SUBCHORD;
  309. typedef struct _DMUS_CHORD_KEY
  310. {
  311.     WCHAR           wszName[16];        /* Name of the chord */
  312.     WORD            wMeasure;           /* Measure this falls on */
  313.     BYTE            bBeat;              /* Beat this falls on */
  314.     BYTE            bSubChordCount;     /* Number of chords in the list of subchords */
  315.     DMUS_SUBCHORD   SubChordList[DMUS_MAXSUBCHORD]; /* List of sub chords */
  316.     DWORD           dwScale;            /* Scale underlying the entire chord */
  317.     BYTE            bKey;               /* Key underlying the entire chord */
  318.     BYTE            bFlags;             /* Miscelaneous flags */
  319. } DMUS_CHORD_KEY;
  320. /* DMUS_NOTE_PMSG */
  321. typedef struct _DMUS_NOTE_PMSG
  322. {
  323.     /* begin DMUS_PMSG_PART */
  324.     DMUS_PMSG_PART
  325.     /* end DMUS_PMSG_PART */
  326.     MUSIC_TIME mtDuration;     /* duration */
  327.     WORD    wMusicValue;       /* Description of note in chord and key. */
  328.     WORD    wMeasure;          /* Measure in which this note occurs */
  329.     short   nOffset;           /* Offset from grid at which this note occurs */
  330.     BYTE    bBeat;             /* Beat (in measure) at which this note occurs */
  331.     BYTE    bGrid;             /* Grid offset from beat at which this note occurs */
  332.     BYTE    bVelocity;         /* Note velocity */
  333.     BYTE    bFlags;            /* see DMUS_NOTEF_FLAGS */
  334.     BYTE    bTimeRange;        /* Range to randomize time. */
  335.     BYTE    bDurRange;         /* Range to randomize duration. */
  336.     BYTE    bVelRange;         /* Range to randomize velocity. */
  337.     BYTE    bPlayModeFlags;    /* Play mode */
  338.     BYTE    bSubChordLevel;    /* Which subchord level this note uses.  */
  339.     BYTE    bMidiValue;        /* The MIDI note value, converted from wMusicValue */
  340.     char    cTranspose;        /* Transposition to add to midi note value after converted from wMusicValue. */
  341. } DMUS_NOTE_PMSG;
  342. typedef enum enumDMUS_NOTEF_FLAGS
  343. {
  344.     DMUS_NOTEF_NOTEON = 1,              /* Set if this is a MIDI Note On. Otherwise, it is MIDI Note Off */
  345.     /* DX8 flags: */
  346.     DMUS_NOTEF_NOINVALIDATE = 2,        /* Don't invalidate this note off. */
  347.     DMUS_NOTEF_NOINVALIDATE_INSCALE = 4,/* Don't invalidate if still within the scale. */
  348.     DMUS_NOTEF_NOINVALIDATE_INCHORD = 8,/* Don't invalidate if still within the chord. */
  349.     DMUS_NOTEF_REGENERATE = 0x10,       /* Regenerate the note on an invalidate. */
  350. } DMUS_NOTEF_FLAGS;
  351. /* The DMUS_PLAYMODE_FLAGS are used to determine how to convert wMusicValue
  352.    into the appropriate bMidiValue.
  353. */
  354. typedef enum enumDMUS_PLAYMODE_FLAGS
  355. {
  356.     DMUS_PLAYMODE_KEY_ROOT          = 1,  /* Transpose on top of the key root. */
  357.     DMUS_PLAYMODE_CHORD_ROOT        = 2,  /* Transpose on top of the chord root. */
  358.     DMUS_PLAYMODE_SCALE_INTERVALS   = 4,  /* Use scale intervals from scale pattern. */
  359.     DMUS_PLAYMODE_CHORD_INTERVALS   = 8,  /* Use chord intervals from chord pattern. */
  360.     DMUS_PLAYMODE_NONE              = 16, /* No mode. Indicates the parent part's mode should be used. */
  361. } DMUS_PLAYMODE_FLAGS;
  362. /* The following are playback modes that can be created by combining the DMUS_PLAYMODE_FLAGS
  363.    in various ways:
  364. */
  365. /* Fixed. wMusicValue holds final MIDI note value. This is used for drums, sound effects, and sequenced
  366.    notes that should not be transposed by the chord or scale.
  367. */
  368. #define DMUS_PLAYMODE_FIXED             0  
  369. /* In fixed to key, the musicvalue is again a fixed MIDI value, but it
  370.    is transposed on top of the key root. 
  371. */
  372. #define DMUS_PLAYMODE_FIXEDTOKEY        DMUS_PLAYMODE_KEY_ROOT
  373. /* In fixed to chord, the musicvalue is also a fixed MIDI value, but it
  374.    is transposed on top of the chord root. 
  375. */
  376. #define DMUS_PLAYMODE_FIXEDTOCHORD      DMUS_PLAYMODE_CHORD_ROOT
  377. /* In Pedalpoint, the key root is used and the notes only track the intervals in
  378.    the scale. The chord root and intervals are completely ignored. This is useful
  379.    for melodic lines that play relative to the key root.
  380. */
  381. #define DMUS_PLAYMODE_PEDALPOINT        (DMUS_PLAYMODE_KEY_ROOT | DMUS_PLAYMODE_SCALE_INTERVALS)
  382. /* In the Melodic mode, the chord root is used but the notes only track the intervals in
  383.    the scale. The key root and chord intervals are completely ignored. This is useful
  384.    for melodic lines that play relative to the chord root. 
  385. */
  386. #define DMUS_PLAYMODE_MELODIC           (DMUS_PLAYMODE_CHORD_ROOT | DMUS_PLAYMODE_SCALE_INTERVALS)
  387. /* Normal chord mode is the prevalent playback mode. 
  388.    The notes track the intervals in the chord, which is based on the chord root. 
  389.    If there is a scale component to the MusicValue, the additional intervals 
  390.    are pulled from the scale and added.
  391.    If the chord does not have an interval to match the chord component of
  392.    the MusicValue, the note is silent.
  393. */
  394. #define DMUS_PLAYMODE_NORMALCHORD       (DMUS_PLAYMODE_CHORD_ROOT | DMUS_PLAYMODE_CHORD_INTERVALS)
  395. /* If it is desirable to play a note that is above the top of the chord, the
  396.    always play mode (known as "purpleized" in a former life) finds a position
  397.    for the note by using intervals from the scale. Essentially, this mode is
  398.    a combination of the Normal and Melodic playback modes, where a failure
  399.    in Normal causes a second try in Melodic mode.
  400. */
  401. #define DMUS_PLAYMODE_ALWAYSPLAY        (DMUS_PLAYMODE_MELODIC | DMUS_PLAYMODE_NORMALCHORD)
  402. /* These playmodes are new for dx8. */
  403. /* In PedalpointChord, the key root is used and the notes only track the intervals in
  404.    the chord. The chord root and scale intervals are completely ignored. This is useful
  405.    for chordal lines that play relative to the key root.
  406. */
  407. #define DMUS_PLAYMODE_PEDALPOINTCHORD   (DMUS_PLAYMODE_KEY_ROOT | DMUS_PLAYMODE_CHORD_INTERVALS)
  408. /* For completeness, here's a mode that tries for pedalpointchord, but if it fails
  409.    uses scale intervals
  410. */
  411. #define DMUS_PLAYMODE_PEDALPOINTALWAYS  (DMUS_PLAYMODE_PEDALPOINT | DMUS_PLAYMODE_PEDALPOINTCHORD)
  412. /*  Legacy names for modes... */
  413. #define DMUS_PLAYMODE_PURPLEIZED        DMUS_PLAYMODE_ALWAYSPLAY
  414. #define DMUS_PLAYMODE_SCALE_ROOT        DMUS_PLAYMODE_KEY_ROOT
  415. #define DMUS_PLAYMODE_FIXEDTOSCALE      DMUS_PLAYMODE_FIXEDTOKEY
  416. /* DMUS_MIDI_PMSG */
  417. typedef struct _DMUS_MIDI_PMSG
  418. {
  419.     /* begin DMUS_PMSG_PART */
  420.     DMUS_PMSG_PART
  421.     /* end DMUS_PMSG_PART */
  422.     BYTE    bStatus;
  423.     BYTE    bByte1;
  424.     BYTE    bByte2;
  425.     BYTE    bPad[1];
  426. } DMUS_MIDI_PMSG;
  427. /* DMUS_PATCH_PMSG */
  428. typedef struct _DMUS_PATCH_PMSG
  429. {
  430.     /* begin DMUS_PMSG_PART */
  431.     DMUS_PMSG_PART
  432.     /* end DMUS_PMSG_PART */
  433.     BYTE    byInstrument;
  434.     BYTE    byMSB;
  435.     BYTE    byLSB;
  436.     BYTE    byPad[1];
  437. } DMUS_PATCH_PMSG;
  438. /* DMUS_TRANSPOSE_PMSG */
  439. typedef struct _DMUS_TRANSPOSE_PMSG
  440. {
  441.     /* begin DMUS_PMSG_PART */
  442.     DMUS_PMSG_PART
  443.     /* end DMUS_PMSG_PART */
  444.     short   nTranspose;
  445.     /* Following exists only under DX8 and on (check dwFlags for DMUS_PMSGF_DX8) */
  446.     WORD            wMergeIndex;     /* Allows multiple parameters to be merged (pitchbend, volume, and expression.)*/
  447. } DMUS_TRANSPOSE_PMSG;
  448. /* DMUS_CHANNEL_PRIORITY_PMSG */
  449. typedef struct _DMUS_CHANNEL_PRIORITY_PMSG
  450. {
  451.     /* begin DMUS_PMSG_PART */
  452.     DMUS_PMSG_PART
  453.     /* end DMUS_PMSG_PART */
  454.     DWORD   dwChannelPriority;
  455. } DMUS_CHANNEL_PRIORITY_PMSG;
  456. /* DMUS_TEMPO_PMSG */
  457. typedef struct _DMUS_TEMPO_PMSG
  458. {
  459.     /* begin DMUS_PMSG_PART */
  460.     DMUS_PMSG_PART
  461.     /* end DMUS_PMSG_PART */
  462.     double  dblTempo;                       /* the tempo */
  463. } DMUS_TEMPO_PMSG;
  464. #define DMUS_TEMPO_MAX          1000
  465. #define DMUS_TEMPO_MIN          1
  466. #define DMUS_MASTERTEMPO_MAX    100.0f
  467. #define DMUS_MASTERTEMPO_MIN    0.01f
  468. /* DMUS_SYSEX_PMSG */
  469. typedef struct _DMUS_SYSEX_PMSG
  470. {
  471.     /* begin DMUS_PMSG_PART */
  472.     DMUS_PMSG_PART
  473.     /* end DMUS_PMSG_PART */
  474.     DWORD   dwLen;          /* length of the data */
  475.     BYTE    abData[1];      /* array of data, length equal to dwLen */
  476. } DMUS_SYSEX_PMSG;
  477. /* DMUS_CURVE_PMSG */
  478. typedef struct _DMUS_CURVE_PMSG
  479. {
  480.     /* begin DMUS_PMSG_PART */
  481.     DMUS_PMSG_PART
  482.     /* end DMUS_PMSG_PART */
  483.     MUSIC_TIME      mtDuration;      /* how long this curve lasts */
  484.     MUSIC_TIME      mtOriginalStart; /* must be set to either zero when this PMSG is created or to the original mtTime of the curve */
  485.     MUSIC_TIME      mtResetDuration; /* how long after the curve is finished to allow a flush or
  486.                                         invalidation to reset to the reset value, nResetValue */
  487.     short           nStartValue;     /* curve's start value */
  488.     short           nEndValue;       /* curve's end value */
  489.     short           nResetValue;     /* curve's reset value, set when a flush or invalidation
  490.                                         occurs within mtDuration + mtResetDuration */
  491.     WORD            wMeasure;        /* Measure in which this curve occurs */
  492.     short           nOffset;         /* Offset from grid at which this curve occurs */
  493.     BYTE            bBeat;           /* Beat (in measure) at which this curve occurs */
  494.     BYTE            bGrid;           /* Grid offset from beat at which this curve occurs */
  495.     BYTE            bType;           /* type of curve */
  496.     BYTE            bCurveShape;     /* shape of curve */
  497.     BYTE            bCCData;         /* CC# if this is a control change type */
  498.     BYTE            bFlags;          /* Curve reset and start from current value flags. */
  499.     /* Following exists only under DX8 and on (check dwFlags for DMUS_PMSGF_DX8) */
  500.     WORD            wParamType;      /* RPN or NRPN parameter number. */
  501.     WORD            wMergeIndex;     /* Allows multiple parameters to be merged (pitchbend, volume, and expression.)*/
  502. } DMUS_CURVE_PMSG;
  503. typedef enum enumDMUS_CURVE_FLAGS
  504. {
  505.     DMUS_CURVE_RESET = 1,            /* When set, the nResetValue must be sent when the 
  506.                                         time is reached or an invalidate occurs because
  507.                                         of a transition. If not set, the curve stays
  508.                                         permanently stuck at the new value. */
  509.     DMUS_CURVE_START_FROM_CURRENT = 2/* Ignore Start, start the curve at the current value. 
  510.                                         This only works for volume, expression, and pitchbend. */
  511. } DMUS_CURVE_FLAGS;
  512. #define DMUS_CURVE_RESET    1        
  513. /* Curve shapes */
  514. enum
  515.     DMUS_CURVES_LINEAR  = 0,
  516.     DMUS_CURVES_INSTANT = 1,
  517.     DMUS_CURVES_EXP     = 2,
  518.     DMUS_CURVES_LOG     = 3,
  519.     DMUS_CURVES_SINE    = 4
  520. };
  521. /* curve types */
  522. #define DMUS_CURVET_PBCURVE      0x03   /* Pitch bend curve. */
  523. #define DMUS_CURVET_CCCURVE      0x04   /* Control change curve. */
  524. #define DMUS_CURVET_MATCURVE     0x05   /* Mono aftertouch curve. */
  525. #define DMUS_CURVET_PATCURVE     0x06   /* Poly aftertouch curve. */
  526. #define DMUS_CURVET_RPNCURVE     0x07   /* RPN curve with curve type in wParamType. */
  527. #define DMUS_CURVET_NRPNCURVE    0x08   /* NRPN curve with curve type in wParamType. */
  528. /* DMUS_TIMESIG_PMSG */
  529. typedef struct _DMUS_TIMESIG_PMSG
  530. {
  531.     /* begin DMUS_PMSG_PART */
  532.     DMUS_PMSG_PART
  533.     /* end DMUS_PMSG_PART */
  534.     /* Time signatures define how many beats per measure, which note receives */
  535.     /* the beat, and the grid resolution. */
  536.     BYTE    bBeatsPerMeasure;       /* beats per measure (top of time sig) */
  537.     BYTE    bBeat;                  /* what note receives the beat (bottom of time sig.) */
  538.                                     /* we can assume that 0 means 256th note */
  539.     WORD    wGridsPerBeat;          /* grids per beat */
  540. } DMUS_TIMESIG_PMSG;
  541. /* notification type values */
  542. /* The following correspond to GUID_NOTIFICATION_SEGMENT */
  543. #define DMUS_NOTIFICATION_SEGSTART       0
  544. #define DMUS_NOTIFICATION_SEGEND         1
  545. #define DMUS_NOTIFICATION_SEGALMOSTEND   2
  546. #define DMUS_NOTIFICATION_SEGLOOP        3
  547. #define DMUS_NOTIFICATION_SEGABORT       4
  548. /* The following correspond to GUID_NOTIFICATION_PERFORMANCE */
  549. #define DMUS_NOTIFICATION_MUSICSTARTED   0
  550. #define DMUS_NOTIFICATION_MUSICSTOPPED   1
  551. #define DMUS_NOTIFICATION_MUSICALMOSTEND 2
  552. /* The following corresponds to GUID_NOTIFICATION_MEASUREANDBEAT */
  553. #define DMUS_NOTIFICATION_MEASUREBEAT    0
  554. /* The following corresponds to GUID_NOTIFICATION_CHORD */
  555. #define DMUS_NOTIFICATION_CHORD          0
  556. /* The following correspond to GUID_NOTIFICATION_COMMAND */
  557. #define DMUS_NOTIFICATION_GROOVE         0
  558. #define DMUS_NOTIFICATION_EMBELLISHMENT  1
  559. /* The following corresponds to GUID_NOTIFICATION_RECOMPOSE */
  560. #define DMUS_NOTIFICATION_RECOMPOSE          0
  561. /* DMUS_NOTIFICATION_PMSG */
  562. typedef struct _DMUS_NOTIFICATION_PMSG
  563. {
  564.     /* begin DMUS_PMSG_PART */
  565.     DMUS_PMSG_PART
  566.     /* end DMUS_PMSG_PART */
  567.     GUID    guidNotificationType;
  568.     DWORD   dwNotificationOption;
  569.     DWORD   dwField1;
  570.     DWORD   dwField2;
  571. } DMUS_NOTIFICATION_PMSG;
  572. /* DMUS_WAVE_PMSG */
  573. typedef struct _DMUS_WAVE_PMSG
  574. {
  575.     /* begin DMUS_PMSG_PART */
  576.     DMUS_PMSG_PART
  577.     /* end DMUS_PMSG_PART */
  578.     
  579.     REFERENCE_TIME rtStartOffset;   /* How far into the wave to start, in reference time units only. */
  580.     REFERENCE_TIME rtDuration;      /* Duration of the wave, in either reference time or music time. */  
  581.     long    lOffset;                /* Offset from actual time to logical time, in music or ref time. */
  582.     long    lVolume;         /* Initial volume, in 100ths of a dB. */
  583.     long    lPitch;         /* Initial pitch, in 100ths of a semitone. */
  584.     BYTE    bFlags;                 /* Flags, including DMUS_WAVEF_OFF... */
  585. } DMUS_WAVE_PMSG;
  586. #define DMUS_WAVEF_OFF           1       /* If wave is playing and this is the off message. */
  587. #define DMUS_WAVEF_STREAMING     2       /* If wave is streaming. */
  588. #define DMUS_WAVEF_NOINVALIDATE  4       /* Don't invalidate this wave. */
  589. #define DMUS_WAVEF_NOPREROLL     8       /* Don't preroll any wave data. */   
  590. /* DMUS_LYRIC_PMSG */
  591. typedef struct _DMUS_LYRIC_PMSG
  592. {
  593.     /* begin DMUS_PMSG_PART */
  594.     DMUS_PMSG_PART
  595.     /* end DMUS_PMSG_PART */
  596.     
  597.     WCHAR    wszString[1];      /* null-terminated Unicode lyric string (structure is actually larger than size 1) */
  598. } DMUS_LYRIC_PMSG;
  599. #define DMUS_MAX_NAME           64         /* Maximum object name length. */
  600. #define DMUS_MAX_CATEGORY       64         /* Maximum object category name length. */
  601. #define DMUS_MAX_FILENAME       MAX_PATH
  602. typedef struct _DMUS_VERSION {
  603.   DWORD    dwVersionMS;
  604.   DWORD    dwVersionLS;
  605. }DMUS_VERSION, FAR *LPDMUS_VERSION;
  606. /* Time Signature structure, used by IDirectMusicStyle */
  607. /* Also used as a parameter for GetParam() and SetParam */
  608. typedef struct _DMUS_TIMESIGNATURE
  609. {
  610.     MUSIC_TIME mtTime;
  611.     BYTE    bBeatsPerMeasure;       /* beats per measure (top of time sig) */
  612.     BYTE    bBeat;                  /* what note receives the beat (bottom of time sig.) */
  613.                                     /* we can assume that 0 means 256th note */
  614.     WORD    wGridsPerBeat;          /* grids per beat */
  615. } DMUS_TIMESIGNATURE;
  616. typedef struct _DMUS_VALID_START_PARAM
  617. {
  618.     MUSIC_TIME mtTime;                      /* Time of the first legal start 
  619.                                                point after (or including) the requested time. 
  620.                                                This is a returned value.
  621.                                                Time format is the relative offset from requested time. */
  622. } DMUS_VALID_START_PARAM;
  623. typedef struct _DMUS_PLAY_MARKER_PARAM
  624. {
  625.     MUSIC_TIME mtTime;                      /* Time of the first legal segment play 
  626.                                                marker before (or including) the requested time. 
  627.                                                This is a returned value.
  628.                                                Time format is the relative offset from requested time. */
  629. } DMUS_PLAY_MARKER_PARAM;
  630. /*      The DMUSOBJECTDESC structure is used to communicate everything you could */
  631. /*      possibly use to describe a DirectMusic object.  */
  632. typedef struct _DMUS_OBJECTDESC
  633. {
  634.     DWORD          dwSize;                 /* Size of this structure. */
  635.     DWORD          dwValidData;            /* Flags indicating which fields below are valid. */
  636.     GUID           guidObject;             /* Unique ID for this object. */
  637.     GUID           guidClass;              /* GUID for the class of object. */
  638.     FILETIME       ftDate;                 /* Last edited date of object. */
  639.     DMUS_VERSION   vVersion;               /* Version. */
  640.     WCHAR          wszName[DMUS_MAX_NAME]; /* Name of object. */
  641.     WCHAR          wszCategory[DMUS_MAX_CATEGORY]; /* Category for object (optional). */
  642.     WCHAR          wszFileName[DMUS_MAX_FILENAME]; /* File path. */
  643.     LONGLONG       llMemLength;            /* Size of Memory data. */
  644.     LPBYTE         pbMemData;              /* Memory pointer for data. */
  645.     IStream *      pStream;                /* Stream with data. */
  646. } DMUS_OBJECTDESC;
  647. typedef DMUS_OBJECTDESC *LPDMUS_OBJECTDESC;
  648. /*      Flags for dwValidData. When set, a flag indicates that the  */
  649. /*      corresponding field in DMUSOBJECTDESC holds valid data. */
  650. #define DMUS_OBJ_OBJECT         (1 << 0)     /* Object GUID is valid. */
  651. #define DMUS_OBJ_CLASS          (1 << 1)     /* Class GUID is valid. */
  652. #define DMUS_OBJ_NAME           (1 << 2)     /* Name is valid. */
  653. #define DMUS_OBJ_CATEGORY       (1 << 3)     /* Category is valid. */
  654. #define DMUS_OBJ_FILENAME       (1 << 4)     /* File path is valid. */
  655. #define DMUS_OBJ_FULLPATH       (1 << 5)     /* Path is full path. */
  656. #define DMUS_OBJ_URL            (1 << 6)     /* Path is URL. */
  657. #define DMUS_OBJ_VERSION        (1 << 7)     /* Version is valid. */
  658. #define DMUS_OBJ_DATE           (1 << 8)     /* Date is valid. */
  659. #define DMUS_OBJ_LOADED         (1 << 9)     /* Object is currently loaded in memory. */
  660. #define DMUS_OBJ_MEMORY         (1 << 10)    /* Object is pointed to by pbMemData. */
  661. #define DMUS_OBJ_STREAM         (1 << 11)    /* Object is stored in pStream. */
  662. /*      The DMUS_SCRIPT_ERRORINFO structure describes an error that occurred in a script.
  663.         It is returned by methods in IDirectMusicScript. */
  664. typedef struct _DMUS_SCRIPT_ERRORINFO
  665. {
  666.     DWORD dwSize; /* Size of this structure. */
  667.     HRESULT hr;
  668.     ULONG ulLineNumber;
  669.     LONG ichCharPosition;
  670.     WCHAR wszSourceFile[DMUS_MAX_FILENAME];
  671.     WCHAR wszSourceComponent[DMUS_MAX_FILENAME];
  672.     WCHAR wszDescription[DMUS_MAX_FILENAME];
  673.     WCHAR wszSourceLineText[DMUS_MAX_FILENAME];
  674. } DMUS_SCRIPT_ERRORINFO;
  675. /*  Track configuration flags, used with IDirectMusicSegment8::SetTrackConfig() */
  676. #define DMUS_TRACKCONFIG_OVERRIDE_ALL           1   /* This track should get parameters from this segment before controlling and primary tracks. */
  677. #define DMUS_TRACKCONFIG_OVERRIDE_PRIMARY       2   /* This track should get parameters from this segment before the primary segment tracks. */
  678. #define DMUS_TRACKCONFIG_FALLBACK               4     /* This track should get parameters from this segment if the primary and controlling segments don't succeed. */
  679. #define DMUS_TRACKCONFIG_CONTROL_ENABLED        8     /* GetParam() enabled for this track. */
  680. #define DMUS_TRACKCONFIG_PLAY_ENABLED           0x10  /* Play() enabled for this track. */
  681. #define DMUS_TRACKCONFIG_NOTIFICATION_ENABLED 0x20  /* Notifications enabled for this track. */
  682. #define DMUS_TRACKCONFIG_PLAY_CLOCKTIME         0x40  /* This track plays in clock time, not music time. */
  683. #define DMUS_TRACKCONFIG_PLAY_COMPOSE          0x80  /* This track should regenerate data each time it starts playing. */
  684. #define DMUS_TRACKCONFIG_LOOP_COMPOSE           0x100 /* This track should regenerate data each time it repeats. */
  685. #define DMUS_TRACKCONFIG_COMPOSING              0x200 /* This track is used to compose other tracks. */
  686. #define DMUS_TRACKCONFIG_CONTROL_PLAY           0x10000 /* This track, when played in a controlling segment, overrides playback of primary segment tracks. */
  687. #define DMUS_TRACKCONFIG_CONTROL_NOTIFICATION   0x20000 /* This track, when played in a controlling segment, overrides notification of primary segment tracks. */
  688. /* Additional track config flags for composing transitions */
  689. #define DMUS_TRACKCONFIG_TRANS1_FROMSEGSTART    0x400  /* Get track info from start of From segment */
  690. #define DMUS_TRACKCONFIG_TRANS1_FROMSEGCURRENT  0x800  /* Get track info from current place in From segment */
  691. #define DMUS_TRACKCONFIG_TRANS1_TOSEGSTART      0x1000 /* Get track info from start of To segment */
  692. #define DMUS_TRACKCONFIG_DEFAULT    (DMUS_TRACKCONFIG_CONTROL_ENABLED | DMUS_TRACKCONFIG_PLAY_ENABLED | DMUS_TRACKCONFIG_NOTIFICATION_ENABLED)
  693. /* #defines for melody fragments */
  694. /* Note: Melody formulation is not supported in DX8. */
  695. #define DMUS_MAX_FRAGMENTLABEL 20
  696. #define DMUS_FRAGMENTF_USE_REPEAT      0x1
  697. #define DMUS_FRAGMENTF_REJECT_REPEAT   (0x1 << 1)
  698. #define DMUS_FRAGMENTF_USE_LABEL       (0x1 << 2)
  699. #define DMUS_CONNECTIONF_INTERVALS     (0x1 << 1) /* Use transition intervals */
  700. #define DMUS_CONNECTIONF_OVERLAP       (0x1 << 2) /* Use overlapping notes for transitions */
  701. /* Get/SetParam structs for commands */
  702. /* PARAM structures, used by GetParam() and SetParam() */
  703. typedef struct _DMUS_COMMAND_PARAM
  704. {
  705.     BYTE bCommand;
  706.     BYTE bGrooveLevel;
  707.     BYTE bGrooveRange;
  708.     BYTE bRepeatMode;
  709. } DMUS_COMMAND_PARAM;
  710. typedef struct _DMUS_COMMAND_PARAM_2
  711. {
  712. MUSIC_TIME mtTime;
  713.     BYTE bCommand;
  714.     BYTE bGrooveLevel;
  715.     BYTE bGrooveRange;
  716.     BYTE bRepeatMode;
  717. } DMUS_COMMAND_PARAM_2;
  718. /* Get/SetParam structs for melody fragments */
  719. /* Note: Melody formulation is not supported in DX8. */
  720. typedef struct _DMUS_CONNECTION_RULE
  721. {
  722.     DWORD       dwFlags;      /* DMUS_CONNECTIONF_ flags */
  723.     DWORD       dwIntervals;  /* Legal transition intervals (first 24 bits; two-octave range) */
  724. } DMUS_CONNECTION_RULE;
  725. typedef struct _DMUS_MELODY_FRAGMENT
  726. {
  727.     MUSIC_TIME  mtTime;
  728.     DWORD       dwID;                   /* This fragment's ID */
  729.     WCHAR       wszVariationLabel[DMUS_MAX_FRAGMENTLABEL]; /* Each style translates this into a set of variations (held in part ref) */
  730.     DWORD       dwVariationFlags;       /* A set of variations */
  731.     DWORD       dwRepeatFragmentID;     /* ID of a fragment to repeat */
  732.     DWORD       dwFragmentFlags;        /* DMUS_FRAGMENTF_ flags */
  733.     DWORD       dwPlayModeFlags;        /* NOT CURRENTLY USED - MUST BE 0 */
  734.     DWORD       dwTransposeIntervals;   /* Legal transposition intervals (first 24 bits; two-octave range) */
  735.     DMUS_COMMAND_PARAM      Command;
  736.     DMUS_CONNECTION_RULE    ConnectionArc;
  737. } DMUS_MELODY_FRAGMENT;
  738. typedef IDirectMusicObject __RPC_FAR *LPDMUS_OBJECT;
  739. typedef IDirectMusicLoader __RPC_FAR *LPDMUS_LOADER;
  740. typedef IDirectMusicBand __RPC_FAR *LPDMUS_BAND;
  741. #define DMUSB_LOADED    (1 << 0)        /* Set when band has been loaded */
  742. #define DMUSB_DEFAULT   (1 << 1)        /* Set when band is default band for a style */
  743. /*////////////////////////////////////////////////////////////////////
  744. // IDirectMusicBand */
  745. #undef  INTERFACE
  746. #define INTERFACE  IDirectMusicBand
  747. DECLARE_INTERFACE_(IDirectMusicBand, IUnknown)
  748. {
  749.     /* IUnknown */
  750.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  751.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  752.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  753.     /* IDirectMusicBand */
  754.     STDMETHOD(CreateSegment)        (THIS_ IDirectMusicSegment** ppSegment) PURE;
  755.     STDMETHOD(Download)             (THIS_ IDirectMusicPerformance* pPerformance) PURE;     
  756.     STDMETHOD(Unload)               (THIS_ IDirectMusicPerformance* pPerformance) PURE;     
  757. };
  758. typedef IDirectMusicBand IDirectMusicBand8;
  759. /*////////////////////////////////////////////////////////////////////
  760. // IDirectMusicObject */
  761. #undef  INTERFACE
  762. #define INTERFACE  IDirectMusicObject
  763. DECLARE_INTERFACE_(IDirectMusicObject, IUnknown)
  764. {
  765.     /* IUnknown */
  766.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  767.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  768.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  769.     /* IDirectMusicObject */
  770.     STDMETHOD(GetDescriptor)        (THIS_ LPDMUS_OBJECTDESC pDesc) PURE;
  771.     STDMETHOD(SetDescriptor)        (THIS_ LPDMUS_OBJECTDESC pDesc) PURE;
  772.     STDMETHOD(ParseDescriptor)      (THIS_ LPSTREAM pStream, 
  773.                                            LPDMUS_OBJECTDESC pDesc) PURE;
  774. };
  775. typedef IDirectMusicObject IDirectMusicObject8;
  776. /*////////////////////////////////////////////////////////////////////
  777. // IDirectMusicLoader */
  778. #undef  INTERFACE
  779. #define INTERFACE  IDirectMusicLoader
  780. DECLARE_INTERFACE_(IDirectMusicLoader, IUnknown)
  781. {
  782.     /* IUnknown */
  783.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  784.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  785.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  786.     /* IDirectMusicLoader */
  787.     STDMETHOD(GetObject)            (THIS_ LPDMUS_OBJECTDESC pDesc,
  788.                                            REFIID riid,
  789.                                            LPVOID FAR *ppv) PURE;
  790.     STDMETHOD(SetObject)            (THIS_ LPDMUS_OBJECTDESC pDesc) PURE;
  791.     STDMETHOD(SetSearchDirectory)   (THIS_ REFGUID rguidClass, 
  792.                                            WCHAR *pwzPath, 
  793.                                            BOOL fClear) PURE;
  794.     STDMETHOD(ScanDirectory)        (THIS_ REFGUID rguidClass, 
  795.                                            WCHAR *pwzFileExtension, 
  796.                                            WCHAR *pwzScanFileName) PURE;
  797.     STDMETHOD(CacheObject)          (THIS_ IDirectMusicObject * pObject) PURE;
  798.     STDMETHOD(ReleaseObject)        (THIS_ IDirectMusicObject * pObject) PURE;
  799.     STDMETHOD(ClearCache)           (THIS_ REFGUID rguidClass) PURE;
  800.     STDMETHOD(EnableCache)          (THIS_ REFGUID rguidClass, 
  801.                                            BOOL fEnable) PURE;
  802.     STDMETHOD(EnumObject)           (THIS_ REFGUID rguidClass, 
  803.                                            DWORD dwIndex, 
  804.                                            LPDMUS_OBJECTDESC pDesc) PURE;
  805. };                                  
  806. /*////////////////////////////////////////////////////////////////////
  807. // IDirectMusicLoader8 */
  808. #undef  INTERFACE
  809. #define INTERFACE  IDirectMusicLoader8
  810. DECLARE_INTERFACE_(IDirectMusicLoader8, IDirectMusicLoader)
  811. {
  812.     /* IUnknown */
  813.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  814.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  815.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  816.     /* IDirectMusicLoader */
  817.     STDMETHOD(GetObject)            (THIS_ LPDMUS_OBJECTDESC pDesc,
  818.                                            REFIID riid,
  819.                                            LPVOID FAR *ppv) PURE;
  820.     STDMETHOD(SetObject)            (THIS_ LPDMUS_OBJECTDESC pDesc) PURE;
  821.     STDMETHOD(SetSearchDirectory)   (THIS_ REFGUID rguidClass, 
  822.                                            WCHAR *pwzPath, 
  823.                                            BOOL fClear) PURE;
  824.     STDMETHOD(ScanDirectory)        (THIS_ REFGUID rguidClass, 
  825.                                            WCHAR *pwzFileExtension, 
  826.                                            WCHAR *pwzScanFileName) PURE;
  827.     STDMETHOD(CacheObject)          (THIS_ IDirectMusicObject * pObject) PURE;
  828.     STDMETHOD(ReleaseObject)        (THIS_ IDirectMusicObject * pObject) PURE;
  829.     STDMETHOD(ClearCache)           (THIS_ REFGUID rguidClass) PURE;
  830.     STDMETHOD(EnableCache)          (THIS_ REFGUID rguidClass, 
  831.                                            BOOL fEnable) PURE;
  832.     STDMETHOD(EnumObject)           (THIS_ REFGUID rguidClass, 
  833.                                            DWORD dwIndex, 
  834.                                            LPDMUS_OBJECTDESC pDesc) PURE;
  835.     /* IDirectMusicLoader8 */
  836.     STDMETHOD_(void, CollectGarbage)                (THIS) PURE;
  837.     STDMETHOD(ReleaseObjectByUnknown)               (THIS_ IUnknown *pObject) PURE;
  838.     STDMETHOD(LoadObjectFromFile)                   (THIS_ REFGUID rguidClassID, 
  839.                                                            REFIID iidInterfaceID, 
  840.                                                            WCHAR *pwzFilePath, 
  841.                                                            void ** ppObject) PURE;
  842. };
  843. /*  Stream object supports IDirectMusicGetLoader interface to access loader while file parsing. */
  844. #undef  INTERFACE
  845. #define INTERFACE  IDirectMusicGetLoader
  846. DECLARE_INTERFACE_(IDirectMusicGetLoader, IUnknown)
  847. {
  848.     /* IUnknown */
  849.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  850.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  851.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  852.     /* IDirectMusicGetLoader */
  853.     STDMETHOD(GetLoader)            (THIS_ IDirectMusicLoader ** ppLoader) PURE;
  854. };
  855. typedef IDirectMusicGetLoader IDirectMusicGetLoader8;
  856. /*////////////////////////////////////////////////////////////////////
  857. // IDirectMusicSegment */
  858. #undef  INTERFACE
  859. #define INTERFACE  IDirectMusicSegment
  860. DECLARE_INTERFACE_(IDirectMusicSegment, IUnknown)
  861. {
  862.     /*  IUnknown */
  863.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  864.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  865.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  866.     /*  IDirectMusicSegment */
  867.     STDMETHOD(GetLength)                (THIS_ MUSIC_TIME* pmtLength) PURE;
  868.     STDMETHOD(SetLength)                (THIS_ MUSIC_TIME mtLength) PURE;
  869.     STDMETHOD(GetRepeats)               (THIS_ DWORD* pdwRepeats) PURE;
  870.     STDMETHOD(SetRepeats)               (THIS_ DWORD  dwRepeats) PURE;
  871.     STDMETHOD(GetDefaultResolution)     (THIS_ DWORD* pdwResolution) PURE;
  872.     STDMETHOD(SetDefaultResolution)     (THIS_ DWORD  dwResolution) PURE;
  873.     STDMETHOD(GetTrack)                 (THIS_ REFGUID rguidType, 
  874.                                                DWORD dwGroupBits, 
  875.                                                DWORD dwIndex, 
  876.                                                IDirectMusicTrack** ppTrack) PURE;
  877.     STDMETHOD(GetTrackGroup)            (THIS_ IDirectMusicTrack* pTrack, 
  878.                                                DWORD* pdwGroupBits) PURE;
  879.     STDMETHOD(InsertTrack)              (THIS_ IDirectMusicTrack* pTrack, 
  880.                                                DWORD dwGroupBits) PURE;
  881.     STDMETHOD(RemoveTrack)              (THIS_ IDirectMusicTrack* pTrack) PURE;
  882.     STDMETHOD(InitPlay)                 (THIS_ IDirectMusicSegmentState** ppSegState, 
  883.                                                IDirectMusicPerformance* pPerformance,
  884.                                                DWORD dwFlags) PURE;
  885.     STDMETHOD(GetGraph)                 (THIS_ IDirectMusicGraph** ppGraph) PURE;
  886.     STDMETHOD(SetGraph)                 (THIS_ IDirectMusicGraph* pGraph) PURE;
  887.     STDMETHOD(AddNotificationType)      (THIS_ REFGUID rguidNotificationType) PURE;
  888.     STDMETHOD(RemoveNotificationType)   (THIS_ REFGUID rguidNotificationType) PURE;
  889.     STDMETHOD(GetParam)                 (THIS_ REFGUID rguidType, 
  890.                                                DWORD dwGroupBits, 
  891.                                                DWORD dwIndex, 
  892.                                                MUSIC_TIME mtTime, 
  893.                                                MUSIC_TIME* pmtNext, 
  894.                                                void* pParam) PURE; 
  895.     STDMETHOD(SetParam)                 (THIS_ REFGUID rguidType, 
  896.                                                DWORD dwGroupBits, 
  897.                                                DWORD dwIndex, 
  898.                                                MUSIC_TIME mtTime, 
  899.                                                void* pParam) PURE;
  900.     STDMETHOD(Clone)                    (THIS_ MUSIC_TIME mtStart, 
  901.                                                MUSIC_TIME mtEnd, 
  902.                                                IDirectMusicSegment** ppSegment) PURE;
  903.     STDMETHOD(SetStartPoint)            (THIS_ MUSIC_TIME mtStart) PURE;
  904.     STDMETHOD(GetStartPoint)            (THIS_ MUSIC_TIME* pmtStart) PURE;
  905.     STDMETHOD(SetLoopPoints)            (THIS_ MUSIC_TIME mtStart, 
  906.                                                MUSIC_TIME mtEnd) PURE;
  907.     STDMETHOD(GetLoopPoints)            (THIS_ MUSIC_TIME* pmtStart, 
  908.                                                MUSIC_TIME* pmtEnd) PURE;
  909.     STDMETHOD(SetPChannelsUsed)         (THIS_ DWORD dwNumPChannels, 
  910.                                                DWORD* paPChannels) PURE;
  911. };
  912. /*////////////////////////////////////////////////////////////////////
  913. // IDirectMusicSegment8 */
  914. #undef  INTERFACE
  915. #define INTERFACE  IDirectMusicSegment8
  916. DECLARE_INTERFACE_(IDirectMusicSegment8, IDirectMusicSegment)
  917. {
  918.     /*  IUnknown */
  919.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  920.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  921.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  922.     /*  IDirectMusicSegment */
  923.     STDMETHOD(GetLength)                (THIS_ MUSIC_TIME* pmtLength) PURE;
  924.     STDMETHOD(SetLength)                (THIS_ MUSIC_TIME mtLength) PURE;
  925.     STDMETHOD(GetRepeats)               (THIS_ DWORD* pdwRepeats) PURE;
  926.     STDMETHOD(SetRepeats)               (THIS_ DWORD  dwRepeats) PURE;
  927.     STDMETHOD(GetDefaultResolution)     (THIS_ DWORD* pdwResolution) PURE;
  928.     STDMETHOD(SetDefaultResolution)     (THIS_ DWORD  dwResolution) PURE;
  929.     STDMETHOD(GetTrack)                 (THIS_ REFGUID rguidType, 
  930.                                                DWORD dwGroupBits, 
  931.                                                DWORD dwIndex, 
  932.                                                IDirectMusicTrack** ppTrack) PURE;
  933.     STDMETHOD(GetTrackGroup)            (THIS_ IDirectMusicTrack* pTrack, 
  934.                                                DWORD* pdwGroupBits) PURE;
  935.     STDMETHOD(InsertTrack)              (THIS_ IDirectMusicTrack* pTrack, 
  936.                                                DWORD dwGroupBits) PURE;
  937.     STDMETHOD(RemoveTrack)              (THIS_ IDirectMusicTrack* pTrack) PURE;
  938.     STDMETHOD(InitPlay)                 (THIS_ IDirectMusicSegmentState** ppSegState, 
  939.                                                IDirectMusicPerformance* pPerformance,
  940.                                                DWORD dwFlags) PURE;
  941.     STDMETHOD(GetGraph)                 (THIS_ IDirectMusicGraph** ppGraph) PURE;
  942.     STDMETHOD(SetGraph)                 (THIS_ IDirectMusicGraph* pGraph) PURE;
  943.     STDMETHOD(AddNotificationType)      (THIS_ REFGUID rguidNotificationType) PURE;
  944.     STDMETHOD(RemoveNotificationType)   (THIS_ REFGUID rguidNotificationType) PURE;
  945.     STDMETHOD(GetParam)                 (THIS_ REFGUID rguidType, 
  946.                                                DWORD dwGroupBits, 
  947.                                                DWORD dwIndex, 
  948.                                                MUSIC_TIME mtTime, 
  949.                                                MUSIC_TIME* pmtNext, 
  950.                                                void* pParam) PURE; 
  951.     STDMETHOD(SetParam)                 (THIS_ REFGUID rguidType, 
  952.                                                DWORD dwGroupBits, 
  953.                                                DWORD dwIndex, 
  954.                                                MUSIC_TIME mtTime, 
  955.                                                void* pParam) PURE;
  956.     STDMETHOD(Clone)                    (THIS_ MUSIC_TIME mtStart, 
  957.                                                MUSIC_TIME mtEnd, 
  958.                                                IDirectMusicSegment** ppSegment) PURE;
  959.     STDMETHOD(SetStartPoint)            (THIS_ MUSIC_TIME mtStart) PURE;
  960.     STDMETHOD(GetStartPoint)            (THIS_ MUSIC_TIME* pmtStart) PURE;
  961.     STDMETHOD(SetLoopPoints)            (THIS_ MUSIC_TIME mtStart, 
  962.                                                MUSIC_TIME mtEnd) PURE;
  963.     STDMETHOD(GetLoopPoints)            (THIS_ MUSIC_TIME* pmtStart, 
  964.                                                MUSIC_TIME* pmtEnd) PURE;
  965.     STDMETHOD(SetPChannelsUsed)         (THIS_ DWORD dwNumPChannels, 
  966.                                                DWORD* paPChannels) PURE;
  967.     /*  IDirectMusicSegment8 */
  968.     STDMETHOD(SetTrackConfig)           (THIS_ REFGUID rguidTrackClassID,   /* Class ID of the type of track on which to set the configuration flags. */
  969.                                                DWORD dwGroupBits,           /* Group bits. */
  970.                                                DWORD dwIndex,               /* Nth track (or DMUS_SEG_ALLTRACKS) that matches class id and group id. */
  971.                                                DWORD dwFlagsOn,             /* DMUS_TRACKCONFIG_ flags to enable. */
  972.                                                DWORD dwFlagsOff) PURE;      /* DMUS_TRACKCONFIG_ flags to disable. */
  973.     STDMETHOD(GetAudioPathConfig)       (THIS_ IUnknown ** ppAudioPathConfig) PURE;
  974.     STDMETHOD(Compose)                  (THIS_ MUSIC_TIME mtTime,
  975.                                                IDirectMusicSegment* pFromSegment,
  976.                                                IDirectMusicSegment* pToSegment,
  977.                                                IDirectMusicSegment** ppComposedSegment) PURE;
  978.     STDMETHOD(Download)                 (THIS_ IUnknown *pAudioPath) PURE;
  979.     STDMETHOD(Unload)                   (THIS_ IUnknown *pAudioPath) PURE;
  980. };
  981. /*/////////////////////////////////////////////////////////////////////
  982. // IDirectMusicSegmentState */
  983. #undef  INTERFACE
  984. #define INTERFACE  IDirectMusicSegmentState
  985. DECLARE_INTERFACE_(IDirectMusicSegmentState, IUnknown)
  986. {
  987.     /*  IUnknown */
  988.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  989.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  990.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  991.     /*  IDirectMusicSegmentState */
  992.     STDMETHOD(GetRepeats)           (THIS_ DWORD* pdwRepeats) PURE;
  993.     STDMETHOD(GetSegment )          (THIS_ IDirectMusicSegment** ppSegment) PURE;
  994.     STDMETHOD(GetStartTime)         (THIS_ MUSIC_TIME* pmtStart) PURE;
  995.     STDMETHOD(GetSeek)              (THIS_ MUSIC_TIME* pmtSeek) PURE;
  996.     STDMETHOD(GetStartPoint)        (THIS_ MUSIC_TIME* pmtStart) PURE;
  997. };
  998. /*/////////////////////////////////////////////////////////////////////
  999. // IDirectMusicSegmentState8 */
  1000. #undef  INTERFACE
  1001. #define INTERFACE  IDirectMusicSegmentState8
  1002. DECLARE_INTERFACE_(IDirectMusicSegmentState8, IDirectMusicSegmentState)
  1003. {
  1004.     /*  IUnknown */
  1005.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  1006.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1007.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1008.     /*  IDirectMusicSegmentState */
  1009.     STDMETHOD(GetRepeats)           (THIS_ DWORD* pdwRepeats) PURE;
  1010.     STDMETHOD(GetSegment )          (THIS_ IDirectMusicSegment** ppSegment) PURE;
  1011.     STDMETHOD(GetStartTime)         (THIS_ MUSIC_TIME* pmtStart) PURE;
  1012.     STDMETHOD(GetSeek)              (THIS_ MUSIC_TIME* pmtSeek) PURE;
  1013.     STDMETHOD(GetStartPoint)        (THIS_ MUSIC_TIME* pmtStart) PURE;
  1014.     /* IDirectMusicSegmentState8 */
  1015.     STDMETHOD(SetTrackConfig)       (THIS_ REFGUID rguidTrackClassID,   /* Class ID of the type of track on which to set the configuration flags. */
  1016.                                            DWORD dwGroupBits,           /* Group bits. */
  1017.                                            DWORD dwIndex,               /* Nth track (or DMUS_SEG_ALLTRACKS) that matches class id and group id. */
  1018.                                            DWORD dwFlagsOn,             /* DMUS_TRACKCONFIG_ flags to enable. */
  1019.                                            DWORD dwFlagsOff) PURE;      /* DMUS_TRACKCONFIG_ flags to disable. */
  1020.     STDMETHOD(GetObjectInPath)      (THIS_ DWORD dwPChannel,    /* PChannel to search. */
  1021.                                            DWORD dwStage,       /* Which stage in the path. */
  1022.                                            DWORD dwBuffer,      /* Which buffer to address, if more than one. */
  1023.                                            REFGUID guidObject,  /* ClassID of object. */
  1024.                                            DWORD dwIndex,       /* Which object of that class. */
  1025.                                            REFGUID iidInterface,/* Requested COM interface. */
  1026.                                            void ** ppObject) PURE; /* Pointer to interface. */
  1027. };
  1028. /*////////////////////////////////////////////////////////////////////
  1029. // IDirectMusicAudioPath */
  1030. #undef  INTERFACE
  1031. #define INTERFACE  IDirectMusicAudioPath
  1032. DECLARE_INTERFACE_(IDirectMusicAudioPath, IUnknown)
  1033. {
  1034.     /*  IUnknown */
  1035.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  1036.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1037.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1038.     /*  IDirectMusicAudioPath */
  1039.     STDMETHOD(GetObjectInPath)      (THIS_ DWORD dwPChannel,    /* PChannel to search. */
  1040.                                            DWORD dwStage,       /* Which stage in the path. */
  1041.                                            DWORD dwBuffer,      /* Which buffer to address, if more than one. */
  1042.                                            REFGUID guidObject,  /* ClassID of object. */
  1043.                                            DWORD dwIndex,       /* Which object of that class. */
  1044.                                            REFGUID iidInterface,/* Requested COM interface. */
  1045.                                            void ** ppObject) PURE; /* Pointer to interface. */
  1046.     STDMETHOD(Activate)             (THIS_ BOOL fActivate) PURE;/* True to activate, False to deactivate. */
  1047.     STDMETHOD(SetVolume)            (THIS_ long lVolume,        /* Gain, in 100ths of a dB. This must be negative (0 represents full volume.) */
  1048.                                            DWORD dwDuration) PURE;/* Duration of volume ramp in  milliseconds. Note that 0 is more efficient. */
  1049.     STDMETHOD(ConvertPChannel)      (THIS_ DWORD dwPChannelIn,   /* Pchannel of source. */
  1050.                                            DWORD *pdwPChannelOut) PURE; /* Equivalent pchannel on performance. */
  1051. };
  1052. typedef IDirectMusicAudioPath IDirectMusicAudioPath8;
  1053. /*////////////////////////////////////////////////////////////////////
  1054. // IDirectMusicPerformance */
  1055. #undef  INTERFACE
  1056. #define INTERFACE  IDirectMusicPerformance
  1057. DECLARE_INTERFACE_(IDirectMusicPerformance, IUnknown)
  1058. {
  1059.     /*  IUnknown */
  1060.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  1061.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1062.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1063.     /*  IDirectMusicPerformance */
  1064.     STDMETHOD(Init)                 (THIS_ IDirectMusic** ppDirectMusic,
  1065.                                            LPDIRECTSOUND pDirectSound,
  1066.                                            HWND hWnd) PURE;
  1067.     STDMETHOD(PlaySegment)          (THIS_ IDirectMusicSegment* pSegment, 
  1068.                                            DWORD dwFlags, 
  1069.                                            __int64 i64StartTime, 
  1070.                                            IDirectMusicSegmentState** ppSegmentState) PURE;
  1071.     STDMETHOD(Stop)                 (THIS_ IDirectMusicSegment* pSegment, 
  1072.                                            IDirectMusicSegmentState* pSegmentState, 
  1073.                                            MUSIC_TIME mtTime, 
  1074.                                            DWORD dwFlags) PURE;
  1075.     STDMETHOD(GetSegmentState)      (THIS_ IDirectMusicSegmentState** ppSegmentState, 
  1076.                                            MUSIC_TIME mtTime) PURE;
  1077.     STDMETHOD(SetPrepareTime)       (THIS_ DWORD dwMilliSeconds) PURE;
  1078.     STDMETHOD(GetPrepareTime)       (THIS_ DWORD* pdwMilliSeconds) PURE;
  1079.     STDMETHOD(SetBumperLength)      (THIS_ DWORD dwMilliSeconds) PURE;
  1080.     STDMETHOD(GetBumperLength)      (THIS_ DWORD* pdwMilliSeconds) PURE;
  1081.     STDMETHOD(SendPMsg)             (THIS_ DMUS_PMSG* pPMSG) PURE;
  1082.     STDMETHOD(MusicToReferenceTime) (THIS_ MUSIC_TIME mtTime, 
  1083.                                            REFERENCE_TIME* prtTime) PURE;
  1084.     STDMETHOD(ReferenceToMusicTime) (THIS_ REFERENCE_TIME rtTime, 
  1085.                                            MUSIC_TIME* pmtTime) PURE;
  1086.     STDMETHOD(IsPlaying)            (THIS_ IDirectMusicSegment* pSegment, 
  1087.                                            IDirectMusicSegmentState* pSegState) PURE;
  1088.     STDMETHOD(GetTime)              (THIS_ REFERENCE_TIME* prtNow, 
  1089.                                            MUSIC_TIME* pmtNow) PURE;
  1090.     STDMETHOD(AllocPMsg)            (THIS_ ULONG cb, 
  1091.                                            DMUS_PMSG** ppPMSG) PURE;
  1092.     STDMETHOD(FreePMsg)             (THIS_ DMUS_PMSG* pPMSG) PURE;
  1093.     STDMETHOD(GetGraph)             (THIS_ IDirectMusicGraph** ppGraph) PURE;
  1094.     STDMETHOD(SetGraph)             (THIS_ IDirectMusicGraph* pGraph) PURE;
  1095.     STDMETHOD(SetNotificationHandle)(THIS_ HANDLE hNotification, 
  1096.                                            REFERENCE_TIME rtMinimum) PURE;
  1097.     STDMETHOD(GetNotificationPMsg)  (THIS_ DMUS_NOTIFICATION_PMSG** ppNotificationPMsg) PURE;
  1098.     STDMETHOD(AddNotificationType)  (THIS_ REFGUID rguidNotificationType) PURE;
  1099.     STDMETHOD(RemoveNotificationType)(THIS_ REFGUID rguidNotificationType) PURE;
  1100.     STDMETHOD(AddPort)              (THIS_ IDirectMusicPort* pPort) PURE;
  1101.     STDMETHOD(RemovePort)           (THIS_ IDirectMusicPort* pPort ) PURE;
  1102.     STDMETHOD(AssignPChannelBlock)  (THIS_ DWORD dwBlockNum, 
  1103.                                            IDirectMusicPort* pPort, 
  1104.                                            DWORD dwGroup ) PURE;
  1105.     STDMETHOD(AssignPChannel)       (THIS_ DWORD dwPChannel, 
  1106.                                            IDirectMusicPort* pPort, 
  1107.                                            DWORD dwGroup, 
  1108.                                            DWORD dwMChannel ) PURE;
  1109.     STDMETHOD(PChannelInfo)         (THIS_ DWORD dwPChannel, 
  1110.                                            IDirectMusicPort** ppPort, 
  1111.                                            DWORD* pdwGroup, 
  1112.                                            DWORD* pdwMChannel ) PURE;
  1113.     STDMETHOD(DownloadInstrument)   (THIS_ IDirectMusicInstrument* pInst, 
  1114.                                            DWORD dwPChannel, 
  1115.                                            IDirectMusicDownloadedInstrument** ppDownInst, 
  1116.                                            DMUS_NOTERANGE* pNoteRanges, 
  1117.                                            DWORD dwNumNoteRanges, 
  1118.                                            IDirectMusicPort** ppPort, 
  1119.                                            DWORD* pdwGroup, 
  1120.                                            DWORD* pdwMChannel ) PURE;
  1121.     STDMETHOD(Invalidate)           (THIS_ MUSIC_TIME mtTime, 
  1122.                                            DWORD dwFlags) PURE;
  1123.     STDMETHOD(GetParam)             (THIS_ REFGUID rguidType, 
  1124.                                            DWORD dwGroupBits, 
  1125.                                            DWORD dwIndex, 
  1126.                                            MUSIC_TIME mtTime, 
  1127.                                            MUSIC_TIME* pmtNext, 
  1128.                                            void* pParam) PURE; 
  1129.     STDMETHOD(SetParam)             (THIS_ REFGUID rguidType, 
  1130.                                            DWORD dwGroupBits, 
  1131.                                            DWORD dwIndex, 
  1132.                                            MUSIC_TIME mtTime, 
  1133.                                            void* pParam) PURE;
  1134.     STDMETHOD(GetGlobalParam)       (THIS_ REFGUID rguidType, 
  1135.                                            void* pParam, 
  1136.                                            DWORD dwSize) PURE;
  1137.     STDMETHOD(SetGlobalParam)       (THIS_ REFGUID rguidType, 
  1138.                                            void* pParam, 
  1139.                                            DWORD dwSize) PURE;
  1140.     STDMETHOD(GetLatencyTime)       (THIS_ REFERENCE_TIME* prtTime) PURE;
  1141.     STDMETHOD(GetQueueTime)         (THIS_ REFERENCE_TIME* prtTime) PURE;
  1142.     STDMETHOD(AdjustTime)           (THIS_ REFERENCE_TIME rtAmount) PURE;
  1143.     STDMETHOD(CloseDown)            (THIS) PURE;
  1144.     STDMETHOD(GetResolvedTime)      (THIS_ REFERENCE_TIME rtTime,
  1145.                                            REFERENCE_TIME* prtResolved,
  1146.                                            DWORD dwTimeResolveFlags) PURE;
  1147.     STDMETHOD(MIDIToMusic)          (THIS_ BYTE bMIDIValue,
  1148.                                            DMUS_CHORD_KEY* pChord,
  1149.                                            BYTE bPlayMode,
  1150.                                            BYTE bChordLevel,
  1151.                                            WORD *pwMusicValue) PURE;
  1152.     STDMETHOD(MusicToMIDI)          (THIS_ WORD wMusicValue,
  1153.                                            DMUS_CHORD_KEY* pChord,
  1154.                                            BYTE bPlayMode,
  1155.                                            BYTE bChordLevel,
  1156.                                            BYTE *pbMIDIValue) PURE;
  1157.     STDMETHOD(TimeToRhythm)         (THIS_ MUSIC_TIME mtTime,
  1158.                                            DMUS_TIMESIGNATURE *pTimeSig,
  1159.                                            WORD *pwMeasure,
  1160.                                            BYTE *pbBeat,
  1161.                                            BYTE *pbGrid,
  1162.                                            short *pnOffset) PURE;
  1163.     STDMETHOD(RhythmToTime)         (THIS_ WORD wMeasure,
  1164.                                            BYTE bBeat,
  1165.                                            BYTE bGrid,
  1166.                                            short nOffset,
  1167.                                            DMUS_TIMESIGNATURE *pTimeSig,
  1168.                                            MUSIC_TIME *pmtTime) PURE;                                        
  1169. };
  1170. /*////////////////////////////////////////////////////////////////////
  1171. // IDirectMusicPerformance8 */
  1172. #undef  INTERFACE
  1173. #define INTERFACE  IDirectMusicPerformance8
  1174. DECLARE_INTERFACE_(IDirectMusicPerformance8, IDirectMusicPerformance)
  1175. {
  1176.     /*  IUnknown */
  1177.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  1178.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1179.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1180.     /*  IDirectMusicPerformance */
  1181.     STDMETHOD(Init)                 (THIS_ IDirectMusic** ppDirectMusic,
  1182.                                            LPDIRECTSOUND pDirectSound,
  1183.                                            HWND hWnd) PURE;
  1184.     STDMETHOD(PlaySegment)          (THIS_ IDirectMusicSegment* pSegment, 
  1185.                                            DWORD dwFlags, 
  1186.                                            __int64 i64StartTime, 
  1187.                                            IDirectMusicSegmentState** ppSegmentState) PURE;
  1188.     STDMETHOD(Stop)                 (THIS_ IDirectMusicSegment* pSegment, 
  1189.                                            IDirectMusicSegmentState* pSegmentState, 
  1190.                                            MUSIC_TIME mtTime, 
  1191.                                            DWORD dwFlags) PURE;
  1192.     STDMETHOD(GetSegmentState)      (THIS_ IDirectMusicSegmentState** ppSegmentState, 
  1193.                                            MUSIC_TIME mtTime) PURE;
  1194.     STDMETHOD(SetPrepareTime)       (THIS_ DWORD dwMilliSeconds) PURE;
  1195.     STDMETHOD(GetPrepareTime)       (THIS_ DWORD* pdwMilliSeconds) PURE;
  1196.     STDMETHOD(SetBumperLength)      (THIS_ DWORD dwMilliSeconds) PURE;
  1197.     STDMETHOD(GetBumperLength)      (THIS_ DWORD* pdwMilliSeconds) PURE;
  1198.     STDMETHOD(SendPMsg)             (THIS_ DMUS_PMSG* pPMSG) PURE;
  1199.     STDMETHOD(MusicToReferenceTime) (THIS_ MUSIC_TIME mtTime, 
  1200.                                            REFERENCE_TIME* prtTime) PURE;
  1201.     STDMETHOD(ReferenceToMusicTime) (THIS_ REFERENCE_TIME rtTime, 
  1202.                                            MUSIC_TIME* pmtTime) PURE;
  1203.     STDMETHOD(IsPlaying)            (THIS_ IDirectMusicSegment* pSegment, 
  1204.                                            IDirectMusicSegmentState* pSegState) PURE;
  1205.     STDMETHOD(GetTime)              (THIS_ REFERENCE_TIME* prtNow, 
  1206.                                            MUSIC_TIME* pmtNow) PURE;
  1207.     STDMETHOD(AllocPMsg)            (THIS_ ULONG cb, 
  1208.                                            DMUS_PMSG** ppPMSG) PURE;
  1209.     STDMETHOD(FreePMsg)             (THIS_ DMUS_PMSG* pPMSG) PURE;
  1210.     STDMETHOD(GetGraph)             (THIS_ IDirectMusicGraph** ppGraph) PURE;
  1211.     STDMETHOD(SetGraph)             (THIS_ IDirectMusicGraph* pGraph) PURE;
  1212.     STDMETHOD(SetNotificationHandle)(THIS_ HANDLE hNotification, 
  1213.                                            REFERENCE_TIME rtMinimum) PURE;
  1214.     STDMETHOD(GetNotificationPMsg)  (THIS_ DMUS_NOTIFICATION_PMSG** ppNotificationPMsg) PURE;
  1215.     STDMETHOD(AddNotificationType)  (THIS_ REFGUID rguidNotificationType) PURE;
  1216.     STDMETHOD(RemoveNotificationType)(THIS_ REFGUID rguidNotificationType) PURE;
  1217.     STDMETHOD(AddPort)              (THIS_ IDirectMusicPort* pPort) PURE;
  1218.     STDMETHOD(RemovePort)           (THIS_ IDirectMusicPort* pPort ) PURE;
  1219.     STDMETHOD(AssignPChannelBlock)  (THIS_ DWORD dwBlockNum, 
  1220.                                            IDirectMusicPort* pPort, 
  1221.                                            DWORD dwGroup ) PURE;
  1222.     STDMETHOD(AssignPChannel)       (THIS_ DWORD dwPChannel, 
  1223.                                            IDirectMusicPort* pPort, 
  1224.                                            DWORD dwGroup, 
  1225.                                            DWORD dwMChannel ) PURE;
  1226.     STDMETHOD(PChannelInfo)         (THIS_ DWORD dwPChannel, 
  1227.                                            IDirectMusicPort** ppPort, 
  1228.                                            DWORD* pdwGroup, 
  1229.                                            DWORD* pdwMChannel ) PURE;
  1230.     STDMETHOD(DownloadInstrument)   (THIS_ IDirectMusicInstrument* pInst, 
  1231.                                            DWORD dwPChannel, 
  1232.                                            IDirectMusicDownloadedInstrument** ppDownInst, 
  1233.                                            DMUS_NOTERANGE* pNoteRanges, 
  1234.                                            DWORD dwNumNoteRanges, 
  1235.                                            IDirectMusicPort** ppPort, 
  1236.                                            DWORD* pdwGroup, 
  1237.                                            DWORD* pdwMChannel ) PURE;
  1238.     STDMETHOD(Invalidate)           (THIS_ MUSIC_TIME mtTime, 
  1239.                                            DWORD dwFlags) PURE;
  1240.     STDMETHOD(GetParam)             (THIS_ REFGUID rguidType, 
  1241.                                            DWORD dwGroupBits, 
  1242.                                            DWORD dwIndex, 
  1243.                                            MUSIC_TIME mtTime, 
  1244.                                            MUSIC_TIME* pmtNext, 
  1245.                                            void* pParam) PURE; 
  1246.     STDMETHOD(SetParam)             (THIS_ REFGUID rguidType, 
  1247.                                            DWORD dwGroupBits, 
  1248.                                            DWORD dwIndex, 
  1249.                                            MUSIC_TIME mtTime, 
  1250.                                            void* pParam) PURE;
  1251.     STDMETHOD(GetGlobalParam)       (THIS_ REFGUID rguidType, 
  1252.                                            void* pParam, 
  1253.                                            DWORD dwSize) PURE;
  1254.     STDMETHOD(SetGlobalParam)       (THIS_ REFGUID rguidType, 
  1255.                                            void* pParam, 
  1256.                                            DWORD dwSize) PURE;
  1257.     STDMETHOD(GetLatencyTime)       (THIS_ REFERENCE_TIME* prtTime) PURE;
  1258.     STDMETHOD(GetQueueTime)         (THIS_ REFERENCE_TIME* prtTime) PURE;
  1259.     STDMETHOD(AdjustTime)           (THIS_ REFERENCE_TIME rtAmount) PURE;
  1260.     STDMETHOD(CloseDown)            (THIS) PURE;
  1261.     STDMETHOD(GetResolvedTime)      (THIS_ REFERENCE_TIME rtTime,
  1262.                                            REFERENCE_TIME* prtResolved,
  1263.                                            DWORD dwTimeResolveFlags) PURE;
  1264.     STDMETHOD(MIDIToMusic)          (THIS_ BYTE bMIDIValue,
  1265.                                            DMUS_CHORD_KEY* pChord,
  1266.                                            BYTE bPlayMode,
  1267.                                            BYTE bChordLevel,
  1268.                                            WORD *pwMusicValue) PURE;
  1269.     STDMETHOD(MusicToMIDI)          (THIS_ WORD wMusicValue,
  1270.                                            DMUS_CHORD_KEY* pChord,
  1271.                                            BYTE bPlayMode,
  1272.                                            BYTE bChordLevel,
  1273.                                            BYTE *pbMIDIValue) PURE;
  1274.     STDMETHOD(TimeToRhythm)         (THIS_ MUSIC_TIME mtTime,
  1275.                                            DMUS_TIMESIGNATURE *pTimeSig,
  1276.                                            WORD *pwMeasure,
  1277.                                            BYTE *pbBeat,
  1278.                                            BYTE *pbGrid,
  1279.                                            short *pnOffset) PURE;
  1280.     STDMETHOD(RhythmToTime)         (THIS_ WORD wMeasure,
  1281.                                            BYTE bBeat,
  1282.                                            BYTE bGrid,
  1283.                                            short nOffset,
  1284.                                            DMUS_TIMESIGNATURE *pTimeSig,
  1285.                                            MUSIC_TIME *pmtTime) PURE;  
  1286.     /*  IDirectMusicPerformance8 */
  1287.     STDMETHOD(InitAudio)            (THIS_ IDirectMusic** ppDirectMusic,            /* Optional DMusic pointer. */
  1288.                                            IDirectSound** ppDirectSound,            /* Optional DSound pointer. */
  1289.                                            HWND hWnd,                               /* HWND for DSound. */
  1290.                                            DWORD dwDefaultPathType,                 /* Requested default audio path type, also optional. */
  1291.                                            DWORD dwPChannelCount,                   /* Number of PChannels, if default audio path to be created. */
  1292.                                            DWORD dwFlags,                           /* DMUS_AUDIOF flags, if no pParams structure. */
  1293.                                            DMUS_AUDIOPARAMS *pParams) PURE;         /* Optional initialization structure, defining required voices, buffers, etc. */
  1294.     STDMETHOD(PlaySegmentEx)        (THIS_ IUnknown* pSource,                       /* Segment to play. Alternately, could be an IDirectMusicSong (not supported in DX8.) */
  1295.                                            WCHAR *pwzSegmentName,                   /* If song, which segment in the song (not supported in DX8.) */
  1296.                                            IUnknown* pTransition,                   /* Optional template segment to compose transition with. */
  1297.                                            DWORD dwFlags,                           /* DMUS_SEGF_ flags. */ 
  1298.                                            __int64 i64StartTime,                    /* Time to start playback. */
  1299.                                            IDirectMusicSegmentState** ppSegmentState, /* Returned Segment State. */
  1300.                                            IUnknown *pFrom,                         /* Optional segmentstate or audiopath to replace. */
  1301.                                            IUnknown *pAudioPath) PURE;              /* Optional audioPath to play on. */
  1302.     STDMETHOD(StopEx)               (THIS_ IUnknown *pObjectToStop,                 /* Segstate, AudioPath, Segment, or Song. */ 
  1303.                                            __int64 i64StopTime, 
  1304.                                            DWORD dwFlags) PURE;
  1305.     STDMETHOD(ClonePMsg)            (THIS_ DMUS_PMSG* pSourcePMSG,
  1306.                                            DMUS_PMSG** ppCopyPMSG) PURE;
  1307.     STDMETHOD(CreateAudioPath)      (THIS_ IUnknown *pSourceConfig,                 /* Source configuration, from AudioPathConfig file. */
  1308.                                            BOOL fActivate,                          /* TRUE to activate on creation. */
  1309.                                            IDirectMusicAudioPath **ppNewPath) PURE; /* Returns created audiopath. */                                           
  1310.     STDMETHOD(CreateStandardAudioPath)(THIS_ DWORD dwType,                          /* Type of path to create. */
  1311.                                            DWORD dwPChannelCount,                   /* How many PChannels to allocate for it. */
  1312.                                            BOOL fActivate,                          /* TRUE to activate on creation. */
  1313.                                            IDirectMusicAudioPath **ppNewPath) PURE; /* Returns created audiopath. */
  1314.     STDMETHOD(SetDefaultAudioPath)  (THIS_ IDirectMusicAudioPath *pAudioPath) PURE;
  1315.     STDMETHOD(GetDefaultAudioPath)  (THIS_ IDirectMusicAudioPath **ppAudioPath) PURE;
  1316.     STDMETHOD(GetParamEx)           (THIS_ REFGUID rguidType,                       /* GetParam command ID. */
  1317.                                            DWORD dwTrackID,                         /* Virtual track ID of caller. */
  1318.                                            DWORD dwGroupBits,                       /* Group bits of caller. */
  1319.                                            DWORD dwIndex,                           /* Index to Nth parameter. */
  1320.                                            MUSIC_TIME mtTime,                       /* Time of requested parameter. */
  1321.                                            MUSIC_TIME* pmtNext,                     /* Returned delta to next parameter. */
  1322.                                            void* pParam) PURE;                      /* Data structure to fill with parameter. */
  1323. };
  1324. /*////////////////////////////////////////////////////////////////////
  1325. // IDirectMusicGraph */
  1326. #undef  INTERFACE
  1327. #define INTERFACE  IDirectMusicGraph
  1328. DECLARE_INTERFACE_(IDirectMusicGraph, IUnknown)
  1329. {
  1330.     /*  IUnknown */
  1331.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  1332.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1333.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1334.     /*  IDirectMusicGraph */
  1335.     STDMETHOD(StampPMsg)            (THIS_ DMUS_PMSG* pPMSG) PURE;
  1336.     STDMETHOD(InsertTool)           (THIS_ IDirectMusicTool* pTool, 
  1337.                                            DWORD* pdwPChannels, 
  1338.                                            DWORD cPChannels, 
  1339.                                            LONG lIndex) PURE;
  1340.     STDMETHOD(GetTool)              (THIS_ DWORD dwIndex, 
  1341.                                            IDirectMusicTool** ppTool) PURE;
  1342.     STDMETHOD(RemoveTool)           (THIS_ IDirectMusicTool* pTool) PURE;
  1343. };
  1344. typedef IDirectMusicGraph IDirectMusicGraph8;
  1345. /*/////////////////////////////////////////////////////////////////////
  1346. // IDirectMusicStyle */
  1347. #undef  INTERFACE
  1348. #define INTERFACE  IDirectMusicStyle
  1349. DECLARE_INTERFACE_(IDirectMusicStyle, IUnknown)
  1350. {
  1351.     /*  IUnknown */
  1352.     STDMETHOD(QueryInterface)         (THIS_ REFIID, LPVOID FAR *) PURE;
  1353.     STDMETHOD_(ULONG,AddRef)          (THIS) PURE;
  1354.     STDMETHOD_(ULONG,Release)         (THIS) PURE;
  1355.     /*  IDirectMusicStyle */
  1356.     STDMETHOD(GetBand)                (THIS_ WCHAR* pwszName, 
  1357.                                              IDirectMusicBand** ppBand) PURE;
  1358.     STDMETHOD(EnumBand)               (THIS_ DWORD dwIndex, 
  1359.                                              WCHAR *pwszName) PURE;
  1360.     STDMETHOD(GetDefaultBand)         (THIS_ IDirectMusicBand** ppBand) PURE;
  1361.     STDMETHOD(EnumMotif)              (THIS_ DWORD dwIndex, 
  1362.                                              WCHAR* pwszName) PURE;
  1363.     STDMETHOD(GetMotif)               (THIS_ WCHAR* pwszName, 
  1364.                                              IDirectMusicSegment** ppSegment) PURE;
  1365.     STDMETHOD(GetDefaultChordMap)     (THIS_ IDirectMusicChordMap** ppChordMap) PURE;
  1366.     STDMETHOD(EnumChordMap)           (THIS_ DWORD dwIndex, 
  1367.                                              WCHAR *pwszName) PURE;
  1368.     STDMETHOD(GetChordMap)            (THIS_ WCHAR* pwszName, 
  1369.                                              IDirectMusicChordMap** ppChordMap) PURE;
  1370.     STDMETHOD(GetTimeSignature)       (THIS_ DMUS_TIMESIGNATURE* pTimeSig) PURE;
  1371.     STDMETHOD(GetEmbellishmentLength) (THIS_ DWORD dwType, 
  1372.                                              DWORD dwLevel, 
  1373.                                              DWORD* pdwMin, 
  1374.                                              DWORD* pdwMax) PURE;
  1375.     STDMETHOD(GetTempo)               (THIS_ double* pTempo) PURE;
  1376. };
  1377. /*/////////////////////////////////////////////////////////////////////
  1378. // IDirectMusicStyle8 */
  1379. #undef  INTERFACE
  1380. #define INTERFACE  IDirectMusicStyle8
  1381. DECLARE_INTERFACE_(IDirectMusicStyle8, IDirectMusicStyle)
  1382. {
  1383.     /*  IUnknown */
  1384.     STDMETHOD(QueryInterface)               (THIS_ REFIID, LPVOID FAR *) PURE;
  1385.     STDMETHOD_(ULONG,AddRef)                (THIS) PURE;
  1386.     STDMETHOD_(ULONG,Release)               (THIS) PURE;
  1387.     /*  IDirectMusicStyle */
  1388.     STDMETHOD(GetBand)                (THIS_ WCHAR* pwszName, 
  1389.                                              IDirectMusicBand** ppBand) PURE;
  1390.     STDMETHOD(EnumBand)               (THIS_ DWORD dwIndex, 
  1391.                                              WCHAR *pwszName) PURE;
  1392.     STDMETHOD(GetDefaultBand)         (THIS_ IDirectMusicBand** ppBand) PURE;
  1393.     STDMETHOD(EnumMotif)              (THIS_ DWORD dwIndex, 
  1394.                                              WCHAR* pwszName) PURE;
  1395.     STDMETHOD(GetMotif)               (THIS_ WCHAR* pwszName, 
  1396.                                              IDirectMusicSegment** ppSegment) PURE;
  1397.     STDMETHOD(GetDefaultChordMap)     (THIS_ IDirectMusicChordMap** ppChordMap) PURE;
  1398.     STDMETHOD(EnumChordMap)           (THIS_ DWORD dwIndex, 
  1399.                                              WCHAR *pwszName) PURE;
  1400.     STDMETHOD(GetChordMap)            (THIS_ WCHAR* pwszName, 
  1401.                                              IDirectMusicChordMap** ppChordMap) PURE;
  1402.     STDMETHOD(GetTimeSignature)       (THIS_ DMUS_TIMESIGNATURE* pTimeSig) PURE;
  1403.     STDMETHOD(GetEmbellishmentLength) (THIS_ DWORD dwType, 
  1404.                                              DWORD dwLevel, 
  1405.                                              DWORD* pdwMin, 
  1406.                                              DWORD* pdwMax) PURE;
  1407.     STDMETHOD(GetTempo)               (THIS_ double* pTempo) PURE;
  1408.     /*  IDirectMusicStyle8 */
  1409.     STDMETHOD(EnumPattern)            (THIS_ DWORD dwIndex, 
  1410.                                              DWORD dwPatternType,
  1411.                                              WCHAR* pwszName) PURE;
  1412. };
  1413. /*/////////////////////////////////////////////////////////////////////
  1414. // IDirectMusicChordMap */
  1415. #undef  INTERFACE
  1416. #define INTERFACE  IDirectMusicChordMap
  1417. DECLARE_INTERFACE_(IDirectMusicChordMap, IUnknown)
  1418. {
  1419.     /*  IUnknown */
  1420.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  1421.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1422.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1423.     /*  IDirectMusicChordMap */
  1424.     STDMETHOD(GetScale)             (THIS_ DWORD* pdwScale) PURE;
  1425. };
  1426. typedef IDirectMusicChordMap IDirectMusicChordMap8;
  1427. /*/////////////////////////////////////////////////////////////////////
  1428. // IDirectMusicComposer */
  1429. #undef  INTERFACE
  1430. #define INTERFACE  IDirectMusicComposer
  1431. DECLARE_INTERFACE_(IDirectMusicComposer, IUnknown)
  1432. {
  1433.     /*  IUnknown */
  1434.     STDMETHOD(QueryInterface)               (THIS_ REFIID, LPVOID FAR *) PURE;
  1435.     STDMETHOD_(ULONG,AddRef)                (THIS) PURE;
  1436.     STDMETHOD_(ULONG,Release)               (THIS) PURE;
  1437.     /*  IDirectMusicComposer */
  1438.     STDMETHOD(ComposeSegmentFromTemplate)   (THIS_ IDirectMusicStyle* pStyle, 
  1439.                                                    IDirectMusicSegment* pTemplate, 
  1440.                                                    WORD wActivity, 
  1441.                                                    IDirectMusicChordMap* pChordMap, 
  1442.                                                    IDirectMusicSegment** ppSegment) PURE;
  1443.     STDMETHOD(ComposeSegmentFromShape)      (THIS_ IDirectMusicStyle* pStyle, 
  1444.                                                    WORD wNumMeasures, 
  1445.                                                    WORD wShape, 
  1446.                                                    WORD wActivity, 
  1447.                                                    BOOL fIntro, 
  1448.                                                    BOOL fEnd, 
  1449.                                                    IDirectMusicChordMap* pChordMap, 
  1450.                                                    IDirectMusicSegment** ppSegment ) PURE;
  1451.     STDMETHOD(ComposeTransition)            (THIS_ IDirectMusicSegment* pFromSeg, 
  1452.                                                    IDirectMusicSegment* pToSeg, 
  1453.                                                    MUSIC_TIME mtTime, 
  1454.                                                    WORD wCommand, 
  1455.                                                    DWORD dwFlags, 
  1456.                                                    IDirectMusicChordMap* pChordMap, 
  1457.                                                    IDirectMusicSegment** ppTransSeg) PURE;
  1458.     STDMETHOD(AutoTransition)               (THIS_ IDirectMusicPerformance* pPerformance, 
  1459.                                                    IDirectMusicSegment* pToSeg, 
  1460.                                                    WORD wCommand, 
  1461.                                                    DWORD dwFlags, 
  1462.                                                    IDirectMusicChordMap* pChordMap, 
  1463.                                                    IDirectMusicSegment** ppTransSeg, 
  1464.                                                    IDirectMusicSegmentState** ppToSegState, 
  1465.                                                    IDirectMusicSegmentState** ppTransSegState) PURE;
  1466.     STDMETHOD(ComposeTemplateFromShape)     (THIS_ WORD wNumMeasures, 
  1467.                                                    WORD wShape, 
  1468.                                                    BOOL fIntro, 
  1469.                                                    BOOL fEnd, 
  1470.                                                    WORD wEndLength, 
  1471.                                                    IDirectMusicSegment** ppTemplate) PURE;
  1472.     STDMETHOD(ChangeChordMap)            (THIS_ IDirectMusicSegment* pSegment, 
  1473.                                                    BOOL fTrackScale, 
  1474.                                                    IDirectMusicChordMap* pChordMap) PURE;
  1475. };
  1476. typedef IDirectMusicComposer IDirectMusicComposer8;
  1477. /*/////////////////////////////////////////////////////////////////////
  1478. // IDirectMusicPatternTrack */
  1479. #undef  INTERFACE
  1480. #define INTERFACE  IDirectMusicPatternTrack
  1481. DECLARE_INTERFACE_(IDirectMusicPatternTrack, IUnknown)
  1482. {
  1483.     /*  IUnknown */
  1484.     STDMETHOD(QueryInterface)               (THIS_ REFIID, LPVOID FAR *) PURE;
  1485.     STDMETHOD_(ULONG,AddRef)                (THIS) PURE;
  1486.     STDMETHOD_(ULONG,Release)               (THIS) PURE;
  1487.     /*  IDirectMusicPatternTrack */
  1488.     STDMETHOD(CreateSegment)             (THIS_ IDirectMusicStyle* pStyle,
  1489.                                                 IDirectMusicSegment** ppSegment) PURE;
  1490.     STDMETHOD(SetVariation)              (THIS_ IDirectMusicSegmentState* pSegState,
  1491.                                                 DWORD dwVariationFlags,
  1492.                                                 DWORD dwPart) PURE;
  1493.     STDMETHOD(SetPatternByName)          (THIS_ IDirectMusicSegmentState* pSegState,
  1494.                                                 WCHAR* wszName,
  1495.                                                 IDirectMusicStyle* pStyle,
  1496.                                                 DWORD dwPatternType,
  1497.                                                 DWORD* pdwLength) PURE;
  1498. };
  1499. typedef IDirectMusicPatternTrack IDirectMusicPatternTrack8;
  1500. /*/////////////////////////////////////////////////////////////////////
  1501. // IDirectMusicScript */
  1502. #undef  INTERFACE
  1503. #define INTERFACE  IDirectMusicScript
  1504. DECLARE_INTERFACE_(IDirectMusicScript, IUnknown)
  1505. {
  1506.     /*  IUnknown */
  1507.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  1508.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1509.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1510.     /*  IDirectMusicScript */
  1511.     STDMETHOD(Init)                     (THIS_ IDirectMusicPerformance *pPerformance,
  1512.                                                DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE;
  1513.     STDMETHOD(CallRoutine)              (THIS_ WCHAR *pwszRoutineName,
  1514.                                                DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE;
  1515.     STDMETHOD(SetVariableVariant)       (THIS_ WCHAR *pwszVariableName,
  1516.                                                VARIANT varValue,
  1517.                                                BOOL fSetRef,
  1518.                                                DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE;
  1519.     STDMETHOD(GetVariableVariant)       (THIS_ WCHAR *pwszVariableName,
  1520.                                                VARIANT *pvarValue,
  1521.                                                DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE;
  1522.     STDMETHOD(SetVariableNumber)        (THIS_ WCHAR *pwszVariableName,
  1523.                                                LONG lValue,
  1524.                                                DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE;
  1525.     STDMETHOD(GetVariableNumber)        (THIS_ WCHAR *pwszVariableName,
  1526.                                                LONG *plValue,
  1527.                                                DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE;
  1528.     STDMETHOD(SetVariableObject)        (THIS_ WCHAR *pwszVariableName,
  1529.                                                IUnknown *punkValue,
  1530.                                                DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE;
  1531.     STDMETHOD(GetVariableObject)        (THIS_ WCHAR *pwszVariableName,
  1532.                                                REFIID riid,
  1533.                                                LPVOID FAR *ppv,
  1534.                                                DMUS_SCRIPT_ERRORINFO *pErrorInfo) PURE;
  1535.     STDMETHOD(EnumRoutine)              (THIS_ DWORD dwIndex, 
  1536.                                                WCHAR *pwszName) PURE;
  1537.     STDMETHOD(EnumVariable)             (THIS_ DWORD dwIndex, 
  1538.                                                WCHAR *pwszName) PURE;
  1539. };
  1540. typedef IDirectMusicScript IDirectMusicScript8;
  1541. /*/////////////////////////////////////////////////////////////////////
  1542. // IDirectMusicContainer */
  1543. #undef  INTERFACE
  1544. #define INTERFACE  IDirectMusicContainer
  1545. DECLARE_INTERFACE_(IDirectMusicContainer, IUnknown)
  1546. {
  1547.     /*  IUnknown */
  1548.     STDMETHOD(QueryInterface)               (THIS_ REFIID, LPVOID FAR *) PURE;
  1549.     STDMETHOD_(ULONG,AddRef)                (THIS) PURE;
  1550.     STDMETHOD_(ULONG,Release)               (THIS) PURE;
  1551.     /*  IDirectMusicContainer */
  1552.     STDMETHOD(EnumObject)           (THIS_ REFGUID rguidClass, 
  1553.                                            DWORD dwIndex, 
  1554.                                            LPDMUS_OBJECTDESC pDesc,
  1555.                                            WCHAR *pwszAlias) PURE;
  1556. };
  1557. typedef IDirectMusicContainer IDirectMusicContainer8;
  1558. /*/////////////////////////////////////////////////////////////////////
  1559. // IDirectMusicSong */
  1560. /* Note: Songs are not supported in DX8. */
  1561. #undef  INTERFACE
  1562. #define INTERFACE  IDirectMusicSong
  1563. DECLARE_INTERFACE_(IDirectMusicSong, IUnknown)
  1564. {
  1565.     /* IUnknown */
  1566.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  1567.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  1568.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  1569.     /* IDirectMusicSong */
  1570.     STDMETHOD(Compose)               (THIS) PURE;
  1571.     STDMETHOD(GetParam)              (THIS_ REFGUID rguidType, 
  1572.                                             DWORD dwGroupBits, 
  1573.                                             DWORD dwIndex, 
  1574.                                             MUSIC_TIME mtTime, 
  1575.                                             MUSIC_TIME* pmtNext, 
  1576.                                             void* pParam) PURE;
  1577.     STDMETHOD(GetSegment)            (THIS_ WCHAR *pwzName,                         /* Retrieve a specific segment by name. */
  1578.                                             IDirectMusicSegment **ppSegment) PURE;  /* Returned segment. */
  1579.     STDMETHOD(GetAudioPathConfig)    (THIS_ IUnknown ** ppAudioPathConfig) PURE;    /* Retrieve embedded audiopath configuration. */
  1580.     STDMETHOD(Download)              (THIS_ IUnknown *pAudioPath) PURE;             /* Download entire song to ports on performance or audiopath. */
  1581.     STDMETHOD(Unload)                (THIS_ IUnknown *pAudioPath) PURE;             /* Unload entire song from port on performance or audiopath. */
  1582.     STDMETHOD(EnumSegment)           (THIS_ DWORD dwIndex,                          /* Nth segment to retrieve. */
  1583.                                     IDirectMusicSegment **ppSegment) PURE;  /* Pointer to segment. */
  1584. };
  1585. typedef IDirectMusicSong IDirectMusicSong8;
  1586. /* CLSID's */
  1587. DEFINE_GUID(CLSID_DirectMusicPerformance,0xd2ac2881, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1588. DEFINE_GUID(CLSID_DirectMusicSegment,0xd2ac2882, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1589. DEFINE_GUID(CLSID_DirectMusicSegmentState,0xd2ac2883, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1590. DEFINE_GUID(CLSID_DirectMusicGraph,0xd2ac2884, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1591. DEFINE_GUID(CLSID_DirectMusicStyle,0xd2ac288a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1592. DEFINE_GUID(CLSID_DirectMusicChordMap,0xd2ac288f, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1593. DEFINE_GUID(CLSID_DirectMusicComposer,0xd2ac2890, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1594. DEFINE_GUID(CLSID_DirectMusicLoader,0xd2ac2892, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1595. DEFINE_GUID(CLSID_DirectMusicBand,0x79ba9e00, 0xb6ee, 0x11d1, 0x86, 0xbe, 0x0, 0xc0, 0x4f, 0xbf, 0x8f, 0xef);
  1596. /* New CLSID's for DX8 */
  1597. DEFINE_GUID(CLSID_DirectMusicPatternTrack,0xd2ac2897, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1598. DEFINE_GUID(CLSID_DirectMusicScript,0x810b5013, 0xe88d, 0x11d2, 0x8b, 0xc1, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6); /* {810B5013-E88D-11d2-8BC1-00600893B1B6} */
  1599. DEFINE_GUID(CLSID_DirectMusicContainer,0x9301e380, 0x1f22, 0x11d3, 0x82, 0x26, 0xd2, 0xfa, 0x76, 0x25, 0x5d, 0x47);
  1600. DEFINE_GUID(CLSID_DirectSoundWave,0x8a667154, 0xf9cb, 0x11d2, 0xad, 0x8a, 0x0, 0x60, 0xb0, 0x57, 0x5a, 0xbc);
  1601. /* Note: Songs are not supported in DX8. */
  1602. DEFINE_GUID(CLSID_DirectMusicSong, 0xaed5f0a5, 0xd972, 0x483d, 0xa3, 0x84, 0x64, 0x9d, 0xfe, 0xb9, 0xc1, 0x81);
  1603. DEFINE_GUID(CLSID_DirectMusicAudioPathConfig,0xee0b9ca0, 0xa81e, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74);
  1604. /* Special GUID for all object types. This is used by the loader. */
  1605. DEFINE_GUID(GUID_DirectMusicAllTypes,0xd2ac2893, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1606. /* Notification guids */
  1607. DEFINE_GUID(GUID_NOTIFICATION_SEGMENT,0xd2ac2899, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1608. DEFINE_GUID(GUID_NOTIFICATION_PERFORMANCE,0x81f75bc5, 0x4e5d, 0x11d2, 0xbc, 0xc7, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
  1609. DEFINE_GUID(GUID_NOTIFICATION_MEASUREANDBEAT,0xd2ac289a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1610. DEFINE_GUID(GUID_NOTIFICATION_CHORD,0xd2ac289b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1611. DEFINE_GUID(GUID_NOTIFICATION_COMMAND,0xd2ac289c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1612. DEFINE_GUID(GUID_NOTIFICATION_RECOMPOSE, 0xd348372b, 0x945b, 0x45ae, 0xa5, 0x22, 0x45, 0xf, 0x12, 0x5b, 0x84, 0xa5);
  1613. /* Track param type guids */
  1614. /* Use to get/set a DMUS_COMMAND_PARAM param in the Command track */
  1615. DEFINE_GUID(GUID_CommandParam,0xd2ac289d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1616. /* Use to get a DMUS_COMMAND_PARAM_2 param in the Command track */
  1617. DEFINE_GUID(GUID_CommandParam2, 0x28f97ef7, 0x9538, 0x11d2, 0x97, 0xa9, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58);
  1618. /* Use to get/set a DMUS_COMMAND_PARAM_2 param to be used as the command following all commands in
  1619. the Command track (this information can't be saved) */
  1620. DEFINE_GUID(GUID_CommandParamNext, 0x472afe7a, 0x281b, 0x11d3, 0x81, 0x7d, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58);
  1621. /* Use to get/set a DMUS_CHORD_PARAM param in the Chord track */
  1622. DEFINE_GUID(GUID_ChordParam,0xd2ac289e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1623. /* Use to get a DMUS_RHYTHM_PARAM param in the Chord track */
  1624. DEFINE_GUID(GUID_RhythmParam,0xd2ac289f, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1625. /* Use to get/set an IDirectMusicStyle param in the Style track */
  1626. DEFINE_GUID(GUID_IDirectMusicStyle,0xd2ac28a1, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1627. /* Use to get a DMUS_TIMESIGNATURE param in the Style and TimeSig tracks */
  1628. DEFINE_GUID(GUID_TimeSignature,0xd2ac28a4, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1629. /* Use to get/set a DMUS_TEMPO_PARAM param in the Tempo track */
  1630. DEFINE_GUID(GUID_TempoParam,0xd2ac28a5, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1631. /* Use to get the next valid point in a segment at which it may start */
  1632. DEFINE_GUID(GUID_Valid_Start_Time,0x7f6b1760, 0x1fdb, 0x11d3, 0x82, 0x26, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  1633. /* Use to get the next point in the currently playing primary segment at which a new segment may start */
  1634. DEFINE_GUID(GUID_Play_Marker,0xd8761a41, 0x801a, 0x11d3, 0x9b, 0xd1, 0xda, 0xf7, 0xe1, 0xc3, 0xd8, 0x34);
  1635. /* Use to get (GetParam) or add (SetParam) bands in the Band track */
  1636. DEFINE_GUID(GUID_BandParam,0x2bb1938, 0xcb8b, 0x11d2, 0x8b, 0xb9, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xb6);
  1637. typedef struct _DMUS_BAND_PARAM
  1638. {
  1639.     MUSIC_TIME  mtTimePhysical; /* 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. */
  1640.     IDirectMusicBand *pBand;
  1641. } DMUS_BAND_PARAM;
  1642. /* Obsolete -- doesn't distinguish physical and logical time.  Use GUID_BandParam instead. */
  1643. DEFINE_GUID(GUID_IDirectMusicBand,0xd2ac28ac, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1644. /* Use to get/set an IDirectMusicChordMap param in the ChordMap track */
  1645. DEFINE_GUID(GUID_IDirectMusicChordMap,0xd2ac28ad, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1646. /* Use to get/set a DMUS_MUTE_PARAM param in the Mute track */
  1647. DEFINE_GUID(GUID_MuteParam,0xd2ac28af, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1648. /* These guids are used in IDirectMusicSegment::SetParam to tell the band track to perform various actions.
  1649.    Some of these guids (where noted) also apply to wave tracks.
  1650.  */
  1651. /* Download bands/waves for the IDirectMusicSegment */
  1652. DEFINE_GUID(GUID_Download,0xd2ac28a7, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1653. /* Unload bands/waves for the IDirectMusicSegment */
  1654. DEFINE_GUID(GUID_Unload,0xd2ac28a8, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1655. /* Connect segment's bands to an IDirectMusicCollection */
  1656. DEFINE_GUID(GUID_ConnectToDLSCollection, 0x1db1ae6b, 0xe92e, 0x11d1, 0xa8, 0xc5, 0x0, 0xc0, 0x4f, 0xa3, 0x72, 0x6e);
  1657. /* Enable/disable autodownloading of bands/waves */
  1658. DEFINE_GUID(GUID_Enable_Auto_Download,0xd2ac28a9, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1659. DEFINE_GUID(GUID_Disable_Auto_Download,0xd2ac28aa, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1660. /* Clear all bands */
  1661. DEFINE_GUID(GUID_Clear_All_Bands,0xd2ac28ab, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1662. /* Set segment to manage all program changes, bank selects, etc. for simple playback of a standard MIDI file */
  1663. DEFINE_GUID(GUID_StandardMIDIFile, 0x6621075, 0xe92e, 0x11d1, 0xa8, 0xc5, 0x0, 0xc0, 0x4f, 0xa3, 0x72, 0x6e);
  1664. /* For compatibility with beta releases... */
  1665. #define GUID_IgnoreBankSelectForGM  GUID_StandardMIDIFile
  1666. /* Disable/enable param guids. Use these in SetParam calls to disable or enable sending
  1667.  * specific PMsg types.
  1668.  */
  1669. DEFINE_GUID(GUID_DisableTimeSig, 0x45fc707b, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
  1670. DEFINE_GUID(GUID_EnableTimeSig, 0x45fc707c, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
  1671. DEFINE_GUID(GUID_DisableTempo, 0x45fc707d, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
  1672. DEFINE_GUID(GUID_EnableTempo, 0x45fc707e, 0x1db4, 0x11d2, 0xbc, 0xac, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
  1673. /* Used in SetParam calls for pattern-based tracks.  A nonzero value seeds the random number 
  1674. generator for variation selection; a value of zero reverts to the default behavior of 
  1675. getting the seed from the system clock.
  1676. */
  1677. DEFINE_GUID(GUID_SeedVariations, 0x65b76fa5, 0xff37, 0x11d2, 0x81, 0x4e, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58);
  1678. /* Used to get/set melody fragments (pParam points to a DMUS_MELODY_FRAGMENT) */
  1679. /* Note: Melody formulation is not supported in DX8. */
  1680. DEFINE_GUID(GUID_MelodyFragment, 0xb291c7f2, 0xb616, 0x11d2, 0x97, 0xfa, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58);
  1681. /* Used to clear all melody fragments */
  1682. /* Note: Melody formulation is not supported in DX8. */
  1683. DEFINE_GUID(GUID_Clear_All_MelodyFragments, 0x8509fee6, 0xb617, 0x11d2, 0x97, 0xfa, 0x0, 0xc0, 0x4f, 0xa3, 0x6e, 0x58);
  1684. /* Used to get the variations currently in effect across PChannels */
  1685. DEFINE_GUID(GUID_Variations, 0x11f72cce, 0x26e6, 0x4ecd, 0xaf, 0x2e, 0xd6, 0x68, 0xe6, 0x67, 0x7, 0xd8);
  1686. typedef struct _DMUS_VARIATIONS_PARAM
  1687. {
  1688.     DWORD   dwPChannelsUsed; /* number of PChannels in use */
  1689.     DWORD*  padwPChannels;   /* array of PChannels in use */
  1690.     DWORD*  padwVariations;  /* array of variations in effect for each PChannel */
  1691. } DMUS_VARIATIONS_PARAM;
  1692. /* Download bands/waves for the IDirectMusicSegment, passed an IDirectMusicAudioPath instead of an IDirectMusicPerformance */
  1693. DEFINE_GUID(GUID_DownloadToAudioPath,0x9f2c0341, 0xc5c4, 0x11d3, 0x9b, 0xd1, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  1694. /* Unload bands/waves for the IDirectMusicSegment, passed an IDirectMusicAudioPath instead of an IDirectMusicPerformance */
  1695. DEFINE_GUID(GUID_UnloadFromAudioPath,0x9f2c0342, 0xc5c4, 0x11d3, 0x9b, 0xd1, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  1696. /* Global data guids */
  1697. DEFINE_GUID(GUID_PerfMasterTempo,0xd2ac28b0, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1698. DEFINE_GUID(GUID_PerfMasterVolume,0xd2ac28b1, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1699. DEFINE_GUID(GUID_PerfMasterGrooveLevel,0xd2ac28b2, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1700. DEFINE_GUID(GUID_PerfAutoDownload, 0xfb09565b, 0x3631, 0x11d2, 0xbc, 0xb8, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
  1701. /* GUID for default GM/GS dls collection. */
  1702. DEFINE_GUID(GUID_DefaultGMCollection, 0xf17e8673, 0xc3b4, 0x11d1, 0x87, 0xb, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1703. /* GUID to define default synth, placed in AudioPath configuration file. */
  1704. DEFINE_GUID(GUID_Synth_Default,0x26bb9432, 0x45fe, 0x48d3, 0xa3, 0x75, 0x24, 0x72, 0xc5, 0xe3, 0xe7, 0x86);
  1705. /* GUIDs to define default buffer configurations to place in AudioPath configuration file. */
  1706. DEFINE_GUID(GUID_Buffer_Reverb,0x186cc541, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74);
  1707. DEFINE_GUID(GUID_Buffer_EnvReverb,0x186cc542, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74);
  1708. DEFINE_GUID(GUID_Buffer_Stereo,0x186cc545, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74);
  1709. DEFINE_GUID(GUID_Buffer_3D_Dry,0x186cc546, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74);
  1710. DEFINE_GUID(GUID_Buffer_Mono,0x186cc547, 0xdb29, 0x11d3, 0x9b, 0xd1, 0x0, 0x80, 0xc7, 0x15, 0xa, 0x74);
  1711. /* IID's */
  1712. DEFINE_GUID(IID_IDirectMusicLoader, 0x2ffaaca2, 0x5dca, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
  1713. DEFINE_GUID(IID_IDirectMusicGetLoader,0x68a04844, 0xd13d, 0x11d1, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
  1714. DEFINE_GUID(IID_IDirectMusicObject,0xd2ac28b5, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1715. DEFINE_GUID(IID_IDirectMusicSegment, 0xf96029a2, 0x4282, 0x11d2, 0x87, 0x17, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1716. DEFINE_GUID(IID_IDirectMusicSegmentState, 0xa3afdcc7, 0xd3ee, 0x11d1, 0xbc, 0x8d, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
  1717. DEFINE_GUID(IID_IDirectMusicPerformance,0x7d43d03, 0x6523, 0x11d2, 0x87, 0x1d, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1718. DEFINE_GUID(IID_IDirectMusicGraph,0x2befc277, 0x5497, 0x11d2, 0xbc, 0xcb, 0x0, 0xa0, 0xc9, 0x22, 0xe6, 0xeb);
  1719. DEFINE_GUID(IID_IDirectMusicStyle,0xd2ac28bd, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1720. DEFINE_GUID(IID_IDirectMusicChordMap,0xd2ac28be, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1721. DEFINE_GUID(IID_IDirectMusicComposer,0xd2ac28bf, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1722. DEFINE_GUID(IID_IDirectMusicBand,0xd2ac28c0, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1723. /* Alternate interface IDs, available in DX7 release and after. */
  1724. DEFINE_GUID(IID_IDirectMusicPerformance2,0x6fc2cae0, 0xbc78, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
  1725. DEFINE_GUID(IID_IDirectMusicSegment2, 0xd38894d1, 0xc052, 0x11d2, 0x87, 0x2f, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  1726. /* Interface IDs for DX8 */
  1727. /* changed interfaces (GUID only) */
  1728. DEFINE_GUID(IID_IDirectMusicLoader8, 0x19e7c08c, 0xa44, 0x4e6a, 0xa1, 0x16, 0x59, 0x5a, 0x7c, 0xd5, 0xde, 0x8c);
  1729. DEFINE_GUID(IID_IDirectMusicPerformance8, 0x679c4137, 0xc62e, 0x4147, 0xb2, 0xb4, 0x9d, 0x56, 0x9a, 0xcb, 0x25, 0x4c);
  1730. DEFINE_GUID(IID_IDirectMusicSegment8,0xc6784488, 0x41a3, 0x418f, 0xaa, 0x15, 0xb3, 0x50, 0x93, 0xba, 0x42, 0xd4);
  1731. DEFINE_GUID(IID_IDirectMusicSegmentState8, 0xa50e4730, 0xae4, 0x48a7, 0x98, 0x39, 0xbc, 0x4, 0xbf, 0xe0, 0x77, 0x72);
  1732. DEFINE_GUID(IID_IDirectMusicStyle8, 0xfd24ad8a, 0xa260, 0x453d, 0xbf, 0x50, 0x6f, 0x93, 0x84, 0xf7, 0x9, 0x85);
  1733. /* new interfaces (GUID + alias) */
  1734. DEFINE_GUID(IID_IDirectMusicPatternTrack, 0x51c22e10, 0xb49f, 0x46fc, 0xbe, 0xc2, 0xe6, 0x28, 0x8f, 0xb9, 0xed, 0xe6);
  1735. #define IID_IDirectMusicPatternTrack8 IID_IDirectMusicPatternTrack
  1736. DEFINE_GUID(IID_IDirectMusicScript, 0x2252373a, 0x5814, 0x489b, 0x82, 0x9, 0x31, 0xfe, 0xde, 0xba, 0xf1, 0x37); /* {2252373A-5814-489b-8209-31FEDEBAF137} */
  1737. #define IID_IDirectMusicScript8 IID_IDirectMusicScript
  1738. DEFINE_GUID(IID_IDirectMusicContainer, 0x9301e386, 0x1f22, 0x11d3, 0x82, 0x26, 0xd2, 0xfa, 0x76, 0x25, 0x5d, 0x47);
  1739. #define IID_IDirectMusicContainer8 IID_IDirectMusicContainer
  1740. /* Note: Songs are not supported in DX8. */
  1741. DEFINE_GUID(IID_IDirectMusicSong, 0xa862b2ec, 0x3676, 0x4982, 0x85, 0xa, 0x78, 0x42, 0x77, 0x5e, 0x1d, 0x86);
  1742. #define IID_IDirectMusicSong8 IID_IDirectMusicSong
  1743. DEFINE_GUID(IID_IDirectMusicAudioPath,0xc87631f5, 0x23be, 0x4986, 0x88, 0x36, 0x5, 0x83, 0x2f, 0xcc, 0x48, 0xf9);
  1744. #define IID_IDirectMusicAudioPath8 IID_IDirectMusicAudioPath
  1745. /* unchanged interfaces (alias only) */
  1746. #define IID_IDirectMusicGetLoader8 IID_IDirectMusicGetLoader
  1747. #define IID_IDirectMusicChordMap8 IID_IDirectMusicChordMap
  1748. #define IID_IDirectMusicGraph8 IID_IDirectMusicGraph
  1749. #define IID_IDirectMusicBand8 IID_IDirectMusicBand
  1750. #define IID_IDirectMusicObject8 IID_IDirectMusicObject
  1751. #define IID_IDirectMusicComposer8 IID_IDirectMusicComposer
  1752. #ifdef __cplusplus
  1753. }; /* extern "C" */
  1754. #endif
  1755. #include <poppack.h>
  1756. #endif /* #ifndef _DMUSICI_ */