MMDMusic.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:124k
- {========================================================================}
- {= (c) 1995-98 SwiftSoft Ronald Dittrich =}
- {========================================================================}
- {= All Rights Reserved =}
- {========================================================================}
- {= D 01099 Dresden = Fax.: +49(0)351-8037944 =}
- {= Loewenstr.7a = info@swiftsoft.de =}
- {========================================================================}
- {= Actual versions on http://www.swiftsoft.de/index.html =}
- {========================================================================}
- {= This code is for reference purposes only and may not be copied or =}
- {= distributed in any format electronic or otherwise except one copy =}
- {= for backup purposes. =}
- {= =}
- {= No Delphi Component Kit or Component individually or in a collection=}
- {= subclassed or otherwise from the code in this unit, or associated =}
- {= .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed =}
- {= without express permission from SwiftSoft. =}
- {= =}
- {= For more licence informations please refer to the associated =}
- {= HelpFile. =}
- {========================================================================}
- {= $Date: 27.01.98 - 18:28:27 $ =}
- {========================================================================}
- unit MMDMusic;
- interface
- {$Z4}
- {$A+}
- {$IFDEF DELPHI3}
- {$WEAKPACKAGEUNIT}
- {$ENDIF}
- uses Windows,MMSystem,ActiveX;
- (***************************************************************************
- *
- * dls1.h
- *
- *
- * Description:
- *
- * class defines and structures for the Instrument Collection Form
- * RIFF DLS.
- *
- *
- * Written by Sonic Foundry 1996. Released for public use.
- *
- ***************************************************************************)
- (***************************************************************************
- *
- *
- * Layout of an instrument collection:
- *
- *
- * RIFF [] 'DLS ' [dlid,colh,INSTLIST,WAVEPOOL,INFOLIST]
- *
- * INSTLIST
- * LIST [] 'lins'
- * LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
- * LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
- * LIST [] 'ins ' [dlid,insh,RGNLIST,ARTLIST,INFOLIST]
- *
- * RGNLIST
- * LIST [] 'lrgn'
- * LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
- * LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
- * LIST [] 'rgn ' [rgnh,wsmp,wlnk,ARTLIST]
- *
- * ARTLIST
- * LIST [] 'lart'
- * 'art1' level 1 Articulation connection graph
- * 'art2' level 2 Articulation connection graph
- * '3rd1' Possible 3rd party articulation structure 1
- * '3rd2' Possible 3rd party articulation structure 2 .... and so on
- *
- * WAVEPOOL
- * ptbl [] [pool table]
- * LIST [] 'wvpl'
- * [path],
- * [path],
- * LIST [] 'wave' [dlid,RIFFWAVE]
- * LIST [] 'wave' [dlid,RIFFWAVE]
- * LIST [] 'wave' [dlid,RIFFWAVE]
- * LIST [] 'wave' [dlid,RIFFWAVE]
- * LIST [] 'wave' [dlid,RIFFWAVE]
- *
- * INFOLIST
- * LIST [] 'INFO'
- * 'icmt' 'One of those crazy comments.'
- * 'icop' 'Copyright (C) 1996 Sonic Foundry'
- *
- **************************************************************************)
- (**************************************************************************
- * FOURCC's used in the DLS file
- *************************************************************************)
- const
- FOURCC_DLS = $20534C44; //mmioFOURCC('D','L','S',' ')
- FOURCC_DLID = $64696C64; //mmioFOURCC('d','l','i','d')
- FOURCC_COLH = $686C6F63; //mmioFOURCC('c','o','l','h')
- FOURCC_WVPL = $6C707677; //mmioFOURCC('w','v','p','l')
- FOURCC_PTBL = $6C627470; //mmioFOURCC('p','t','b','l')
- FOURCC_PATH = $68746170; //mmioFOURCC('p','a','t','h')
- FOURCC_wave = $65766177; //mmioFOURCC('w','a','v','e')
- FOURCC_LINS = $736E696C; //mmioFOURCC('l','i','n','s')
- FOURCC_INS = $20736E69; //mmioFOURCC('i','n','s',' ')
- FOURCC_INSH = $68736E69; //mmioFOURCC('i','n','s','h')
- FOURCC_LRGN = $6E67726C; //mmioFOURCC('l','r','g','n')
- FOURCC_RGN = $206E6772; //mmioFOURCC('r','g','n',' ')
- FOURCC_RGNH = $686E6772; //mmioFOURCC('r','g','n','h')
- FOURCC_LART = $7472616C; //mmioFOURCC('l','a','r','t')
- FOURCC_ART1 = $31747261; //mmioFOURCC('a','r','t','1')
- FOURCC_WLNK = $6B6E6C77; //mmioFOURCC('w','l','n','k')
- FOURCC_WSMP = $706D7377; //mmioFOURCC('w','s','m','p')
- FOURCC_VERS = $73726576; //mmioFOURCC('v','e','r','s')
- (**************************************************************************
- * Articulation connection graph definitions
- **************************************************************************)
- const
- { Generic Sources }
- CONN_SRC_NONE = $0000;
- CONN_SRC_LFO = $0001;
- CONN_SRC_KEYONVELOCITY = $0002;
- CONN_SRC_KEYNUMBER = $0003;
- CONN_SRC_EG1 = $0004;
- CONN_SRC_EG2 = $0005;
- CONN_SRC_PITCHWHEEL = $0006;
- { Midi Controllers 0-127 }
- CONN_SRC_CC1 = $0081;
- CONN_SRC_CC7 = $0087;
- CONN_SRC_CC10 = $008a;
- CONN_SRC_CC11 = $008b;
- { Generic Destinations }
- CONN_DST_NONE = $0000;
- CONN_DST_ATTENUATION = $0001;
- CONN_DST_PITCH = $0003;
- CONN_DST_PAN = $0004;
- { LFO Destinations }
- CONN_DST_LFO_FREQUENCY = $0104;
- CONN_DST_LFO_STARTDELAY = $0105;
- { EG1 Destinations }
- CONN_DST_EG1_ATTACKTIME = $0206;
- CONN_DST_EG1_DECAYTIME = $0207;
- CONN_DST_EG1_RELEASETIME = $0209;
- CONN_DST_EG1_SUSTAINLEVEL = $020a;
- { EG2 Destinations }
- CONN_DST_EG2_ATTACKTIME = $030a;
- CONN_DST_EG2_DECAYTIME = $030b;
- CONN_DST_EG2_RELEASETIME = $030d;
- CONN_DST_EG2_SUSTAINLEVEL = $030e;
- CONN_TRN_NONE = $0000;
- CONN_TRN_CONCAVE = $0001;
- type
- PDLSID = ^TDLSID;
- TDLSID = record
- ulData1: DWORD;
- usData2: Word;
- usData3: Word;
- abData4: array[0..7] of Byte;
- end;
- PDLSVERSION = ^TDLSVERSION;
- TDLSVERSION = record
- dwVersionMS: DWORD;
- dwVersionLS: DWORD;
- end;
- PCONNECTION = ^TCONNECTION;
- TCONNECTION = record
- usSource : Word;
- usControl : Word;
- usDestination: Word;
- usTransform : Word;
- lScale : DWORD;
- end;
- { Level 1 Articulation Data }
- PCONNECTIONLIST = ^TCONNECTIONLIST;
- TCONNECTIONLIST = record
- cbSize : DWORD; // size of the connection list structure
- cConnections: DWORD; // count of connections in the list
- end;
- (**************************************************************************
- * Generic type defines for regions and instruments
- *************************************************************************)
- type
- PRGNRANGE = ^TRGNRANGE;
- TRGNRANGE = record
- usLow : Word;
- usHigh: Word;
- end;
- const
- F_INSTRUMENT_DRUMS = $80000000;
- type
- PMIDILOCALE = ^TMIDILOCALE;
- TMIDILOCALE = record
- ulBank : DWORD;
- ulInstrument: DWORD;
- end;
- (**************************************************************************
- * Header structures found in an DLS file for collection, instruments, and
- * regions.
- *************************************************************************)
- const
- F_RGN_OPTION_SELFNONEXCLUSIVE = $0001;
- type
- PRGNHEADER = ^TRGNHEADER;
- TRGNHEADER = record
- RangeKey : TRGNRANGE; // Key range
- RangeVelocity: TRGNRANGE; // Velocity Range
- fusOptions : Word; // Synthesis options for this range
- usKeyGroup : Word; // Key grouping for non simultaneous play
- // 0 = no group, 1 up is group
- // for Level 1 only groups 1-15 are allowed
- end;
- PINSTHEADER = ^TINSTHEADER;
- TINSTHEADER = record
- cRegions: DWORD; // Count of regions in this instrument
- Locale : TMIDILOCALE; // Intended MIDI locale of this instrument
- end;
- PDLSHEADER = ^TDLSHEADER;
- TDLSHEADER = record
- cInstruments: DWORD; // Count of instruments in the collection
- end;
- (*****************************************************************************
- * definitions for the Wave link structure
- *****************************************************************************)
- (***** For level 1 only WAVELINK_CHANNEL_MONO is valid ******************
- * ulChannel allows for up to 32 channels of audio with each bit position
- * specifiying a channel of playback
- **************************************************************************)
- const
- WAVELINK_CHANNEL_LEFT = $0001;
- WAVELINK_CHANNEL_RIGHT = $0002;
- F_WAVELINK_PHASE_MASTER = $0001;
- type
- PWAVELINK = ^TWAVELINK;
- TWAVELINK = record // any paths or links are stored right after struct
- fusOptions : WORD; // options flags for this wave
- usPhaseGroup: WORD; // Phase grouping for locking channels
- ulChannel : DWORD; // channel placement
- ulTableIndex: DWORD; // index into the wave pool table, 0 based
- end;
- const
- POOL_CUE_NULL = $ffffffff;
- type
- PPOOLCUE = ^TPOOLCUE;
- TPOOLCUE = record
- // ulEntryIndex: DWORD; // Index entry in the list
- ulOffset: DWORD; // Offset to the entry in the list
- end;
- PPOOLTABLE = ^TPOOLTABLE;
- TPOOLTABLE = record
- cbSize: DWORD; // size of the pool table structure
- cCues : DWORD; // count of cues in the list
- end;
- (*****************************************************************************
- * Structures for the "wsmp" chunk
- *****************************************************************************)
- const
- F_WSMP_NO_TRUNCATION = $0001;
- F_WSMP_NO_COMPRESSION = $0002;
- type
- PWSMPL = ^TWSMPL;
- TWSMPL = record
- cbSize : DWORD;
- usUnityNote : Word; // MIDI Unity Playback Note
- sFineTune : Smallint; // Fine Tune in log tuning
- lAttenuation: DWORD; // Overall Attenuation to be applied to data
- fulOptions : DWORD; // Flag options
- cSampleLoops: DWORD; // Count of Sample loops, 0 loops is one shot
- end;
- (* This loop type is a normal forward playing loop which is continually *)
- (* played until the envelope reaches an off threshold in the release *)
- (* portion of the volume envelope *)
- const
- WLOOP_TYPE_FORWARD = 0;
- type
- PWLOOP = ^TWLOOP;
- TWLOOP = record
- cbSize : DWORD;
- ulType : DWORD; // Loop Type
- ulStart : DWORD; // Start of loop in samples
- ulLength: DWORD; // Length of loop in samples
- end;
- (************************************************************************
- * *
- * dmusicc.h -- This module defines the DirectMusic core API's *
- * *
- * Copyright (c) 1998, Microsoft Corp. All rights reserved. *
- * *
- ************************************************************************)
- (* TODO: Diese Deklarationen sind nun in dmerror.h zu finden
- const
- FACILITY_DIRECTMUSIC = $878; // Shared with DirectSound
- DMUS_ERRBASE = $1000; // Make error codes human readable in hex
- DMUS_S_ALREADY_DOWNLOADED = $08781090;
- DMUS_S_PARTIALLOAD = $08781091;
- DMUS_S_REQUEUE = $08781200;
- DMUS_S_FREE = $08781201;
- DMUS_S_END = $08781202;
- DMUS_E_NO_DRIVER = $88781100;
- DMUS_E_DRIVER_FAILED = $88781101;
- DMUS_E_PORTS_OPEN = $88781102;
- DMUS_E_DEVICE_IN_USE = $88781103;
- DMUS_E_INSUFFICIENTBUFFER = $88781104;
- DMUS_E_BUFFERNOTSET = $88781105;
- DMUS_E_BUFFERNOTAVAILABLE = $88781106;
- DMUS_E_NOTINITED = $88781107;
- DMUS_E_NOTADLSCOL = $88781108;
- DMUS_E_INVALIDOFFSET = $88781109;
- DMUS_E_INVALIDID = $88781110;
- DMUS_E_ALREADY_LOADED = $88781111;
- DMUS_E_INVALIDPOS = $88781113;
- DMUS_E_INVALIDPATCH = $88781114;
- DMUS_E_CANNOTSEEK = $88781115;
- DMUS_E_CANNOTWRITE = $88781116;
- DMUS_E_CHUNKNOTFOUND = $88781117;
- DMUS_E_INVALID_DOWNLOADID = $88781119;
- DMUS_E_NOT_DOWNLOADED_TO_PORT = $88781120;
- DMUS_E_ALREADY_DOWNLOADED = $88781121;
- DMUS_E_UNKNOWN_PROPERTY = $88781122;
- DMUS_E_SET_UNSUPPORTED = $88781123;
- DMUS_E_GET_UNSUPPORTED = $88781124;
- DMUS_E_NOTMONO = $88781125;
- DMUS_E_BADARTICULATION = $88781126;
- DMUS_E_BADINSTRUMENT = $88781127;
- DMUS_E_BADWAVELINK = $88781128;
- DMUS_E_NOARTICULATION = $88781129;
- DMUS_E_NOTPCM = $8878112A;
- DMUS_E_BADWAVE = $8878112B;
- DMUS_E_BADOFFSETTABLE = $8878112C;
- DMUS_E_UNKNOWNDOWNLOAD = $8878112D;
- DMUS_E_NOSYNTHSINK = $8878112E;
- DMUS_E_ALREADYOPEN = $8878112F;
- DMUS_E_ALREADYCLOSED = $88781130;
- DMUS_E_SYNTHNOTCONFIGURED = $88781131;
- DMUS_E_SYNTHACTIVE = $88781132;
- DMUS_E_UNSUPPORTED_STREAM = $88781150;
- DMUS_E_ALREADY_INITED = $88781151;
- DMUS_E_INVALID_BAND = $88781152;
- DMUS_E_CANNOT_ADD_AFTER_INITED = $88781153;
- DMUS_E_NOT_INITED = $88781154;
- DMUS_E_TRACK_HDR_NOT_FIRST_CK = $88781155;
- DMUS_E_TOOL_HDR_NOT_FIRST_CK = $88781156;
- DMUS_E_INVALID_TRACK_HDR = $88781157;
- DMUS_E_INVALID_TOOL_HDR = $88781158;
- DMUS_E_ALL_TOOLS_FAILED = $88781159;
- DMUS_E_ALL_TRACKS_FAILED = $88781160;
- DMUS_E_NOT_FOUND = $88781161;
- DMUS_E_NOT_INIT = $88781162;
- DMUS_E_NO_MASTER_CLOCK = $88781170;
- DMUS_E_LOADER_NOCLASSID = $88781180;
- DMUS_E_LOADER_BADPATH = $88781181;
- DMUS_E_LOADER_FAILEDOPEN = $88781182;
- DMUS_E_LOADER_FORMATNOTSUPPORTED = $88781183;
- *)
- const
- DMUS_MAX_DESCRIPTION = 128;
- DMUS_MAX_DRIVER = 128;
- // For DMUS_PORTCAPS dwClass
- DMUS_PC_INPUTCLASS = 0;
- DMUS_PC_OUTPUTCLASS = 1;
- // DMUS_EFFECT_ flags are used in the dwEffectFlags fields of both DMUS_PORTCAPS and DMUS_PORTPARAMS.
- DMUS_EFFECT_NONE = $00000000;
- DMUS_EFFECT_REVERB = $00000001;
- DMUS_EFFECT_CHORUS = $00000002;
- // For DMUS_PORTCAPS dwFlags
- DMUS_PC_DLS = $00000001;
- DMUS_PC_EXTERNAL = $00000002;
- DMUS_PC_SOFTWARESYNTH = $00000004;
- DMUS_PC_MEMORYSIZEFIXED = $00000008;
- DMUS_PC_GMINHARDWARE = $00000010;
- DMUS_PC_GSINHARDWARE = $00000020;
- DMUS_PC_XGINHARDWARE = $00000040;
- DMUS_PC_DIRECTSOUND = $00000080;
- DMUS_PC_SHAREABLE = $00000100;
- DMUS_PC_SYSTEMMEMORY = $7FFFFFFF;
- type
- PDMUS_BUFFERDESC = ^TDMUS_BUFFERDESC;
- TDMUS_BUFFERDESC = record
- dwSize: DWORD;
- dwFlags: DWORD;
- guidBufferFormat: TGUID;
- cbBuffer: DWORD;
- end;
- PDMUS_PORTCAPS = ^TDMUS_PORTCAPS;
- TDMUS_PORTCAPS = record
- dwSize : DWORD;
- dwFlags: DWORD;
- guidPort: TGUID;
- dwClass: DWORD;
- dwType: DWORD;
- dwMemorySize: DWORD;
- dwMaxChannelGroups: DWORD;
- dwMaxVoices: DWORD;
- dwMaxAudioChannels: DWORD;
- dwEffectFlags: DWORD;
- wszDescription: array[0..DMUS_MAX_DESCRIPTION-1] of WCHAR;
- end;
- PDMUS_PORTPARAMS = ^TDMUS_PORTPARAMS;
- TDMUS_PORTPARAMS = record
- dwSize: DWORD;
- dwValidParams: DWORD;
- dwVoices: DWORD;
- dwChannelGroups: DWORD;
- dwAudioChannels: DWORD;
- dwSampleRate: DWORD;
- dwEffectFlags: DWORD;
- fShare: BOOL;
- end;
- const
- // Values for DMUS_PORTCAPS dwType. This field indicates the underlying
- // driver type of the port.
- DMUS_PORT_WINMM_DRIVER = 0;
- DMUS_PORT_USER_MODE_SYNTH = 1;
- DMUS_PORT_KERNEL_MODE = 2;
- (* These flags (set in dwValidParams) indicate which other members of the *)
- (* DMUS_PORTPARAMS are valid. *)
- const
- DMUS_PORTPARAMS_VOICES = $00000001;
- DMUS_PORTPARAMS_CHANNELGROUPS = $00000002;
- DMUS_PORTPARAMS_AUDIOCHANNELS = $00000004;
- DMUS_PORTPARAMS_SAMPLERATE = $00000008;
- DMUS_PORTPARAMS_EFFECTS = $00000020;
- DMUS_PORTPARAMS_SHARE = $00000040;
- type
- PDMUS_SYNTHSTATS = ^TDMUS_SYNTHSTATS;
- TDMUS_SYNTHSTATS = record
- dwSize : DWORD; // Size in bytes of the structure
- dwValidStats : DWORD; // Flags indicating which fields below are valid.
- dwVoices : DWORD; // Average number of voices playing.
- dwTotalCPU : DWORD; // Total CPU usage as percent * 100.
- dwCPUPerVoice: DWORD; // CPU per voice as percent * 100.
- dwLostNotes : DWORD; // Number of notes lost in 1 second.
- dwFreeMemory : DWORD; // Free memory in bytes
- lPeakVolume : DWORD; // Decibel level * 100.
- end;
- const
- DMUS_SYNTHSTATS_VOICES = (1 shl 0);
- DMUS_SYNTHSTATS_TOTAL_CPU = (1 shl 1);
- DMUS_SYNTHSTATS_CPU_PER_VOICE = (1 shl 2);
- DMUS_SYNTHSTATS_LOST_NOTES = (1 shl 3);
- DMUS_SYNTHSTATS_PEAK_VOLUME = (1 shl 4);
- DMUS_SYNTHSTATS_FREE_MEMORY = (1 shl 5);
- DMUS_SYNTHSTATS_SYSTEMMEMORY = DMUS_PC_SYSTEMMEMORY;
- type
- PDMUS_WAVES_REVERB_PARAMS = ^TDMUS_WAVES_REVERB_PARAMS;
- TDMUS_WAVES_REVERB_PARAMS = record
- fInGain: SINGLE; // Input gain in dB (to avoid output overflows) */
- fReverbMix: SINGLE; // Reverb mix in dB. 0dB means 100% wet reverb (no direct signal)
- // Negative values gives less wet signal.
- // The coeficients are calculated so that the overall output level stays
- // (approximately) constant regardless of the ammount of reverb mix. */
- fReverbTime: SINGLE; // The reverb decay time, in milliseconds. */
- fHighFreqRTRatio: SINGLE; // The ratio of the high frequencies to the global reverb time.
- // Unless very 'splashy-bright' reverbs are wanted, this should be set to
- // a value < 1.0.
- // For example if dRevTime==1000ms and dHighFreqRTRatio=0.1 than the
- // decay time for high frequencies will be 100ms.*/
- end;
- { Note: Default values for Reverb are:
- fInGain = 0.0dB (no change in level)
- fReverbMix = -10.0dB (a reasonable reverb mix)
- fReverbTime = 1000.0ms (one second global reverb time)
- fHighFreqRTRatio = 0.001 (the ratio of the high frequencies to the global reverb time)
- }
- type
- TDMUS_CLOCKTYPE = (DMUS_CLOCK_SYSTEM,DMUS_CLOCK_WAVE);
- PDMUS_CLOCKINFO = ^TDMUS_CLOCKINFO;
- TDMUS_CLOCKINFO = record
- dwSize: DWORD;
- ctType: TDMUS_CLOCKTYPE;
- guidClock: TGUID; // Identifies this time source
- wszDescription: array[0..DMUS_MAX_DESCRIPTION-1] of WCHAR;
- end;
- // TODO: ab hier scheint entfernt worden zu sein
- PREFERENCE_TIME = ^TREFERENCE_TIME;
- TREFERENCE_TIME = LONGLONG;
- const
- DMUS_EVENTCLASS_CHANNELMSG = $00000000;
- DMUS_EVENTCLASS_SYSEX = $00000001;
- type
- PCENT = DWORD; // Pitch cents
- GCENT = DWORD; // Gain cents
- TCENT = DWORD; // Time cents
- PERCENT= DWORD; // Per.. cent!
- PDMUS_DOWNLOADINFO = ^TDMUS_DOWNLOADINFO;
- TDMUS_DOWNLOADINFO = record
- dwDLType: DWORD;
- dwDLId: DWORD;
- dwNumOffsetTableEntries: DWORD;
- cbSizeData: DWORD;
- end;
- const
- DMUS_DOWNLOADINFO_INSTRUMENT = 1;
- DMUS_DOWNLOADINFO_WAVE = 2;
- DMUS_DEFAULT_SIZE_OFFSETTABLE = 1;
- // Flags for DMUS_INSTRUMENT's ulFlags member
- DMUS_INSTRUMENT_GM_INSTRUMENT = (1 shl 0);
- type
- PDMUS_OFFSETTABLE = ^TDMUS_OFFSETTABLE;
- TDMUS_OFFSETTABLE = record
- ulOffsetTable: array[0..DMUS_DEFAULT_SIZE_OFFSETTABLE-1] of DWORD;
- end;
- PDMUS_INSTRUMENT = ^TDMUS_INSTRUMENT;
- TDMUS_INSTRUMENT = record
- ulPatch: DWORD;
- ulFirstRegionIdx: DWORD;
- ulGlobalArtIdx: DWORD; // If zero the instrument does not have an articulation */
- ulFirstExtCkIdx: DWORD; // If zero no 3rd party entenstion chunks associated with the instrument */
- ulCopyrightIdx: DWORD; // If zero no Copyright information associated with the instrument */
- ulFlags: DWORD;
- end;
- PDMUS_REGION = ^TDMUS_REGION;
- TDMUS_REGION = record
- RangeKey : TRGNRANGE;
- RangeVelocity: TRGNRANGE;
- fusOptions : WORD;
- usKeyGroup : WORD;
- ulRegionArtIdx: DWORD; // If zero the region does not have an articulation */
- ulNextRegionIdx: DWORD; // If zero no more regions */
- ulFirstExtCkIdx: DWORD; // If zero no 3rd party entenstion chunks associated with the region */
- WaveLink: TWAVELINK;
- WSMP: TWSMPL; // If WSMP.cSampleLoops > 1 then a WLOOP is included */
- WLOOP: TWLOOP;
- end;
- PDMUS_LFOPARAMS = ^TDMUS_LFOPARAMS;
- TDMUS_LFOPARAMS = record
- pcFrequency: PCENT;
- tcDelay: TCENT;
- gcVolumeScale: GCENT;
- pcPitchScale: PCENT;
- gcMWToVolume: GCENT;
- pcMWToPitch: PCENT;
- end;
- PDMUS_VEGPARAMS = ^TDMUS_VEGPARAMS;
- TDMUS_VEGPARAMS = record
- tcAttack: TCENT;
- tcDecay: TCENT;
- ptSustain: PERCENT;
- tcRelease: TCENT;
- tcVel2Attack: TCENT;
- tcKey2Decay: TCENT;
- end;
- PDMUS_PEGPARAMS = ^TDMUS_PEGPARAMS;
- TDMUS_PEGPARAMS = record
- tcAttack: TCENT;
- tcDecay: TCENT;
- ptSustain: PERCENT;
- tcRelease: TCENT;
- tcVel2Attack: TCENT;
- tcKey2Decay: TCENT;
- pcRange: PCENT;
- end;
- PDMUS_MSCPARAMS = ^TDMUS_MSCPARAMS;
- TDMUS_MSCPARAMS = record
- ptDefaultPan: PERCENT;
- end;
- PDMUS_ARTICPARAMS = ^TDMUS_ARTICPARAMS;
- TDMUS_ARTICPARAMS = record
- LFO : TDMUS_LFOPARAMS;
- VolEG : TDMUS_VEGPARAMS;
- PitchEG: TDMUS_PEGPARAMS;
- Misc : TDMUS_MSCPARAMS;
- end;
- PDMUS_ARTICULATION = ^TDMUS_ARTICULATION;
- TDMUS_ARTICULATION = record
- ulArt1Idx : DWORD; // If zero no DLS Level 1 articulation chunk */
- ulFirstExtCkIdx: DWORD; // If zero no 3rd party entenstion chunks associated with the articulation */
- end;
- const
- DMUS_MIN_DATA_SIZE = 4;
- // The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK
- type
- PDMUS_EXTENSIONCHUNK = ^TDMUS_EXTENSIONCHUNK;
- TDMUS_EXTENSIONCHUNK = record
- cbSize : DWORD; // Size of extension chunk */
- ulNextExtCkIdx: DWORD; // If zero no more 3rd party entenstion chunks */
- ExtCkID : FOURCC;
- byExtCk: array[0..DMUS_MIN_DATA_SIZE-1] of byte;// The actual number that follows is determined by cbSize */
- end;
- // The actual number is determined by cbSize of struct _DMUS_COPYRIGHT */
- PDMUS_COPYRIGHT = ^TDMUS_COPYRIGHT;
- TDMUS_COPYRIGHT = record
- cbSize: DWORD; // Size of copyright information */
- byCopyright: array[0..DMUS_MIN_DATA_SIZE-1] of Byte; // The actual number that follows is determined by cbSize */
- end;
- PDMUS_WAVEDATA = ^TDMUS_WAVEDATA;
- TDMUS_WAVEDATA = record
- cbSize: DWORD;
- byData: array[0..DMUS_MIN_DATA_SIZE-1] of Byte;
- end;
- PDMUS_WAVE = ^TDMUS_WAVE;
- TDMUS_WAVE = record
- ulFirstExtCkIdx: DWORD; // If zero no 3rd party entenstion chunks associated with the wave */
- ulCopyrightIdx : DWORD; // If zero no Copyright information associated with the wave */
- WaveformatEx : TWaveFormatEx;
- WaveData : TDMUS_WAVEDATA; // Wave data
- end;
- PDMUS_NOTERANGE = ^TDMUS_NOTERANGE;
- TDMUS_NOTERANGE = record
- dwLowNote : DWORD; // Sets the low note for the range of MIDI note events to which the instrument responds.*/
- dwHighNote : DWORD; // Sets the high note for the range of MIDI note events to which the instrument responds.*/
- end;
- // Software synths are enumerated from under this registry key.
- const
- REGSTR_PATH_DIRECTMUSIC = 'SoftwareMicrosoftDirectMusic';
- REGSTR_PATH_SOFTWARESYNTHS = 'SoftwareMicrosoftDirectMusicSoftwareSynths';
- type
- IDirectMusicBuffer = interface;
- IDirectMusicPort = interface;
- // IDirectMusicThru = interface;
- IReferenceClock = interface;
- IDirectMusicSynth = interface;
- IDirectMusicSynthSink = interface;
- PIDirectMusic = ^IDirectMusic;
- TFreeHandle = function(dw1,dw2: THANDLE): THANDLE;
- IDirectMusicSynth = interface(IUnknown)
- ['{f69b9165-bb60-11d1-afa6-00aa0024d8b6}']
- function Open(var pPortParams: TDMUS_PORTPARAMS): HRESULT; stdcall;
- function Close: HRESULT; stdcall;
- function SetNumChannelGroups(dwGroups: DWORD): HRESULT; stdcall;
- function Download(var phDownload: THANDLE; pvData: Pointer; var pbFree: BOOL): HRESULT; stdcall;
- function Unload(hDownload: THandle; lpFreeHandle: TFreeHandle; hUserData: THandle): HRESULT; stdcall;
- function PlayBuffer(rt: TREFERENCE_TIME; pbBuffer: PByte; cbBuffer: DWORD): HRESULT; stdcall;
- function GetRunningStats(var pStats: TDMUS_SYNTHSTATS): HRESULT; stdcall;
- function GetPortCaps(var pCaps: TDMUS_PORTCAPS): HRESULT; stdcall;
- function SetMasterClock(pClock: IReferenceClock): HRESULT; stdcall;
- function GetLatencyClock(var pClock: IReferenceClock): HRESULT; stdcall;
- function Activate(hWnd: HWND; fEnable: BOOL): HRESULT; stdcall;
- function SetSynthSink(pSynthSink: IDirectMusicSynthSink): HRESULT; stdcall;
- function Render(pBuffer: PChar; dwLength, dwPosition: DWORD): HRESULT; stdcall;
- end;
- IDirectMusicSynthSink = interface(IUnknown)
- ['{d2ac2880-b39b-11d1-8704-00600893b1bd}']
- function Init(pSynth: IDirectMusicSynth): HRESULT; stdcall;
- function SetFormat(pWaveFormat: PWAVEFORMATEX): HRESULT; stdcall;
- function SetMasterClock(pClock: IReferenceClock): HRESULT; stdcall;
- function GetLatencyClock(var pClock: IReferenceClock): HRESULT; stdcall;
- function Activate(hwnd: HWND; fEnable: BOOL): HRESULT; stdcall;
- function SampleToRefTime(dwSampleTime: DWORD; var prfTime: TREFERENCE_TIME): HRESULT; stdcall;
- function RefTimeToSample(rfTime: TREFERENCE_TIME; var pdwSampleTime: DWORD): HRESULT; stdcall;
- end;
- IDirectMusic = interface(IUnknown)
- ['{d2ac2876-b39b-11d1-8704-00600893b1bd}']
- function EnumPort(dwIndex: DWORD; var pPortCaps: TDMUS_PORTCAPS): HRESULT; stdcall;
- function CreateMusicBuffer(pBufferDesc: PDMUS_BUFFERDESC;
- var ppBuffer: IDIRECTMUSICBUFFER;
- pUnkOuter: IUnknown): HRESULT; stdcall;
- function CreatePort(const rguidPort: TGUID;
- const pPortParams: TDMUS_PORTPARAMS;
- var ppPort: IDIRECTMUSICPORT;
- pUnkOuter: IUnknown): HRESULT; stdcall;
- function EnumMasterClock(dwIndex: DWORD; var lpClockInfo: TDMUS_CLOCKINFO): HRESULT; stdcall;
- function GetMasterClock(var pguidClock: TGUID; var ppReferenceClock: IReferenceClock): HRESULT; stdcall;
- function SetMasterClock(const rguidClock: TGUID): HRESULT; stdcall;
- function Activate(fEnable: BOOL): HRESULT; stdcall;
- function GetDefaultPort(var pguidPort: TGUID): HRESULT; stdcall;
- function SetDirectSound(const pDirectSound: {LPDIRECTSOUND:} Pointer; hWnd: HWND): HRESULT; stdcall;
- end;
- IDirectMusicBuffer = interface(IUnknown)
- ['{d2ac2878-b39b-11d1-8704-00600893b1bd}']
- function Flush: HRESULT; stdcall;
- function TotalTime(var prtTime: TREFERENCE_TIME): HRESULT; stdcall;
- function PackStructured(rt: TREFERENCE_TIME; dwChannelGroup,dwChannelMessage: DWORD): HRESULT; stdcall;
- function PackUnstructured(rt: TREFERENCE_TIME;dwChannelGroup,cd: DWORD; lpb: PBYTE): HRESULT; stdcall;
- function ResetReadPtr: HRESULT; stdcall;
- function GetNextEvent(var prt: TREFERENCE_TIME;var pdwChannelGroup,pdwLength: DWORD;
- var ppData: PByte): HRESULT; stdcall;
- function GetRawBufferPtr(var ppData: PByte): HRESULT; stdcall;
- function GetStartTime(var prt: TREFERENCE_TIME): HRESULT; stdcall;
- function GetUsedBytes(var pcb: DWORD): HRESULT; stdcall;
- function GetMaxBytes(var pcb: DWORD): HRESULT; stdcall;
- function GetBufferFormat(var pGuidFormat: TGUID): HRESULT; stdcall;
- function SetStartTime(rt: TREFERENCE_TIME): HRESULT; stdcall;
- function SetUsedBytes(cb: DWORD): HRESULT; stdcall;
- end;
- IDirectMusicInstrument = interface(IUnknown)
- ['{d2ac287d-b39b-11d1-8704-00600893b1bd}']
- function GetPatch(var pdwPatch: DWORD): HRESULT; stdcall;
- function SetPatch(dwPatch: DWORD): HRESULT; stdcall;
- end;
- IDirectMusicDownloadedInstrument = interface(IUnknown)
- ['{d2ac287e-b39b-11d1-8704-00600893b1bd}']
- // None at this time */
- end;
- IDirectMusicCollection = interface(IUnknown)
- ['{d2ac287c-b39b-11d1-8704-00600893b1bd}']
- function GetInstrument(dwPatch: DWORD;
- var ppInstrument: IDirectMusicInstrument): HRESULT; stdcall;
- function EnumInstrument(dwIndex: DWORD; var pdwPatch: DWORD; pwszName: PWCHAR; dwNameLen: DWORD): HRESULT; stdcall;
- end;
- IDirectMusicDownload = interface(IUnknown)
- ['{d2ac287b-b39b-11d1-8704-00600893b1bd}']
- function GetBuffer(var ppvBuffer: Pointer;var pdwSize: DWORD): HRESULT; stdcall;
- end;
- IDirectMusicPortDownload = interface(IUnknown)
- ['{d2ac287a-b39b-11d1-8704-00600893b1bd}']
- function GetBuffer(dwDLId: DWORD; var ppIDMDownload: IDirectMusicDownload): HRESULT; stdcall;
- function AllocateBuffer(dwSize: DWORD; var ppIDMDownload: IDirectMusicDownload): HRESULT; stdcall;
- function GetDLId(var pdwStartDLId: DWORD; dwCount: DWORD): HRESULT; stdcall;
- function GetAppend(var pdwAppend: DWORD): HRESULT; stdcall;
- function Download(pIDMDownloads: IDirectMusicDownload): HRESULT; stdcall;
- function Unload(pIDMDownload: IDirectMusicDownload): HRESULT; stdcall;
- end;
- IDirectMusicPort = interface(IUnknown)
- ['{55e2edd8-cd7c-11d1-a76f-0000f875ac12}']
- function PlayBuffer(const pBuffer: IDIRECTMUSICBUFFER): HRESULT; stdcall;
- function SetReadNotificationHandle(hEvent: THANDLE): HRESULT; stdcall;
- function Read(var pBuffer: IDIRECTMUSICBUFFER): HRESULT; stdcall;
- function DownloadInstrument(pInstrument: IDirectMusicInstrument;
- var ppDownloadedInstrument: IDirectMusicDownloadedInstrument;
- pNoteRanges: PDMUS_NOTERANGE; dwNumNoteRanges: DWORD): HRESULT; stdcall;
- function UnloadInstrument(pDownloadedInstrument: IDirectMusicDownloadedInstrument): HRESULT; stdcall;
- function GetLatencyClock(var ppClock: IReferenceClock): HRESULT; stdcall;
- function GetRunningStats(var pStats: TDMUS_SYNTHSTATS): HRESULT; stdcall;
- function Compact: HRESULT; stdcall;
- function GetCaps(var pPortCaps: TDMUS_PORTCAPS): HRESULT; stdcall;
- function DeviceIoControl(dwIoControlCode: DWORD; lpInBuffer: Pointer; nInBufferSize: DWORD;
- lpOutBuffer: Pointer; nOutBufferSize: DWORD;
- var lpBytesReturned: DWORD;
- var lpOverlapped: TOVERLAPPED): HRESULT; stdcall;
- function SetNumChannelGroups(dwChannelGroups: DWORD): HRESULT; stdcall;
- function GetNumChannelGroups(var pdwChannelGroups: DWORD): HRESULT; stdcall;
- function Activate(fActive: BOOL): HRESULT; stdcall;
- function SetChannelPriority(dwChannelGroup, dwChannel, dwPriority: DWORd): HRESULT; stdcall;
- function GetChannelPriority(dwChannelGroup, dwChannel: DWORD; var pdwPriority: DWORD): HRESULT; stdcall;
- function SetDirectSound(pDirectSound:{LPDIRECTSOUND} Pointer; pDirectSoundBuffer: {LPDIRECTSOUNDBUFFER} Pointer): HRESULT; stdcall;
- function GetFormat(pWaveFormatEx: PWAVEFORMATEX; var pdwWaveFormatExSize,pdwBufferSize: DWORd): HRESULT; stdcall;
- end;
- IReferenceClock = interface(IUnknown)
- ['{56a86897-0ad4-11ce-b03a-0020af0ba770}']
- function GetTime(var pTime: TREFERENCE_TIME): HRESULT; stdcall;
- // ask for an async notification that a time has elapsed */
- function AdviseTime(baseTime: TREFERENCE_TIME; // base time */
- streamTime: TREFERENCE_TIME; // stream offset time */
- hEvent: Thandle; // advise via this event */
- var pdwAdviseCookie: DWORD // where your cookie goes */
- ): HRESULT; stdcall;
- // ask for an async periodic notification that a time has elapsed */
- function AdvisePeriodic(startTime: TREFERENCE_TIME; // starting at this time */
- periodTime: TREFERENCE_TIME;// time between notifications */
- hSemaphore: Thandle; // advise via a semaphore */
- var pdwAdviseCookie: DWORD // where your cookie goes */
- ): HRESULT; stdcall;
- // cancel a request for notification */
- function Unadvise(dwAdviseCookie: DWORD): HRESULT; stdcall;
- end;
- const
- IID_IKsControl : TGUID =
- (D1:$28F54685;D2:$06FD;D3:$11D2;D4:($B2,$7A,$00,$A0,$C9,$22,$31,$96));
- IID_IReferenceClock : TGUID =
- (D1:$56a86897;D2:$0ad4;D3:$11ce;D4:($b0,$3a,$00,$20,$af,$0b,$a7,$70));
- CLSID_DirectMusic : TGUID =
- (D1:$636b9f10;D2:$0c7d;D3:$11d1;D4:($95,$b2,$00,$20,$af,$dc,$74,$21));
- CLSID_DirectMusicCollection : TGUID =
- (D1:$480ff4b0;D2:$28b2;D3:$11d1;D4:($be,$f7,$00,$c0,$4f,$bf,$8f,$ef));
- CLSID_DirectMusicSynth : TGUID =
- (D1:$58C2B4D0;D2:$46E7;D3:$11D1;D4:($89,$AC,$00,$A0,$C9,$05,$41,$29));
- CLSID_DirectMusicSynthSink : TGUID =
- (D1:$aec17ce3;D2:$a514;D3:$11d1;D4:($af,$a6,$00,$aa,$00,$24,$d8,$b6));
- IID_IDirectMusic : TGUID =
- //(D1:$d2ac2876;D2:$b39b;D3:$11d1;D4:($87,$04,$00,$60,$08,$93,$b1,$bd));
- (D1:$6536115a;D2:$7b2d;D3:$11d2;D4:($ba,$18,$00,$00,$f8,$75,$ac,$12));
- IID_IDirectMusicBuffer : TGUID =
- (D1:$d2ac2878;D2:$b39b;D3:$11d1;D4:($87,$04,$00,$60,$08,$93,$b1,$bd));
- IID_IDirectMusicPort : TGUID =
- (D1:$08f2d8c9;D2:$37c2;D3:$11d2;D4:($b9,$f9,$00,$00,$f8,$75,$ac,$12));
- IID_IDirectMusicPortDownload : TGUID =
- (D1:$d2ac287a;D2:$b39b;D3:$11d1;D4:($87,$04,$00,$60,$8,$93,$b1,$bd));
- IID_IDirectMusicDownload : TGUID =
- (D1:$d2ac287b;D2:$b39b;D3:$11d1;D4:($87,$04,$00,$60,$08,$93,$b1,$bd));
- IID_IDirectMusicCollection : TGUID =
- (D1:$d2ac287c;D2:$b39b;D3:$11d1;D4:($87,$04,$00,$60,$08,$93,$b1,$bd));
- IID_IDirectMusicInstrument : TGUID =
- (D1:$d2ac287d;D2:$b39b;D3:$11d1;D4:($87,$04,$00,$60,$08,$93,$b1,$bd));
- IID_IDirectMusicDownloadedInstrument : TGUID =
- (D1:$d2ac287e;D2:$b39b;D3:$11d1;D4:($87,$04,$00,$60,$08,$93,$b1,$bd));
- IID_IDirectMusicSynth : TGUID =
- (D1:$f69b9165;D2:$bb60;D3:$11d1;D4:($af,$a6,$00,$aa,$00,$24,$d8,$b6));
- IID_IDirectMusicSynthSink : TGUID =
- (D1:$d2ac2880;D2:$b39b;D3:$11d1;D4:($87,$04,$00,$60,$08,$93,$b1,$bd));
- (* Property Query GUID_DMUS_PROP_GM_Hardware
- * Property Query GUID_DMUS_PROP_GS_Hardware
- * Property Query GUID_DMUS_PROP_XG_Hardware
- * Property Query GUID_DMUS_PROP_DLS1_Hardware
- * Property Query GUID_DMUS_PROP_SynthSink_DSOUND
- * Property Query GUID_DMUS_PROP_SynthSink_WAVE
- *
- * Item 0: Supported
- * Returns a DWORD which is non-zero if the feature is supported
- *)
- GUID_DMUS_PROP_GM_Hardware : TGUID =
- (D1:$178f2f24;D2:$c364;D3:$11d1;D4:($a7,$60,$00,$00,$f8,$75,$ac,$12));
- GUID_DMUS_PROP_GS_Hardware : TGUID =
- (D1:$178f2f25;D2:$c364;D3:$11d1;D4:($a7,$60,$00,$00,$f8,$75,$ac,$12));
- GUID_DMUS_PROP_XG_Hardware : TGUID =
- (D1:$178f2f26;D2:$c364;D3:$11d1;D4:($a7,$60,$00,$00,$f8,$75,$ac,$12));
- GUID_DMUS_PROP_DLS1 : TGUID =
- (D1:$178f2f27;D2:$c364;D3:$11d1;D4:($a7,$60,$00,$00,$f8,$75,$ac,$12));
- GUID_DMUS_PROP_SynthSink_DSOUND : TGUID =
- (D1:$aa97844;D2:$c877;D3:$11d1;D4:($87,$c,$0,$60,$8,$93,$b1,$bd));
- GUID_DMUS_PROP_SynthSink_WAVE : TGUID =
- (D1:$aa97845;D2:$c877;D3:$11d1;D4:($87,$c,$0,$60,$8,$93,$b1,$bd));
- (* Property Get GUID_DMUS_PROP_MemorySize
- *
- * Item 0: Memory size
- * Returns a DWORD containing the total number of bytes of sample RAM
- *)
- GUID_DMUS_PROP_MemorySize : TGUID =
- (D1:$178f2f28;D2:$c364;D3:$11d1;D4:($a7,$60,$00,$00,$f8,$75,$ac,$12));
- (* Property Set GUID_DMUS_PROP_SetDSound
- *
- * Item 0: IDirectSound class
- * Sets the IDirectMusicSynthSink to use the specified DSound object.
- *)
- GUID_DMUS_PROP_SetDSound : TGUID =
- (D1:$aa97842;D2:$c877;D3:$11d1;D4:($87,$c,$0,$60,$8,$93,$b1,$bd));
- (* Property Set GUID_DMUS_PROP_WriteBufferZone
- *
- * Item 0: Distance in milliseconds from the write pointer to the synth write.
- * Sets the IDirectMusicSynthSink to write this far behind the pointer.
- *)
- GUID_DMUS_PROP_WriteBufferZone : TGUID =
- (D1:$aa97843;D2:$c877;D3:$11d1;D4:($87,$c,$0,$60,$8,$93,$b1,$bd));
- (* Property Set GUID_DMUS_PROP_LegacyCaps
- *
- * Item 0: The MIDINCAPS or MIDIOUTCAPS which describes the port's underlying WinMM device. This property is only supported
- * by ports which wrap WinMM devices.
- *)
- GUID_DMUS_PROP_LegacyCaps :TGUID =
- (D1:$cfa7cdc2;D2:$00a1;D3:$11d2;D4:($aa,$d5,$00,$00,$f8,$75,$ac,$12));
- (************************************************************************
- * *
- * dmusici.h -- This module defines the DirectMusic interative API's *
- * *
- * Copyright (c) 1998, Microsoft Corp. All rights reserved. *
- * *
- ************************************************************************)
- type
- TTRANSITION_TYPE = WORD;
- TMUSIC_TIME = DWORD;
- const
- DMUS_PPQ = 768; // parts per quarter note
- const
- DMUS_COMPOSEF_NONE = 0;
- DMUS_COMPOSEF_ALIGN = $1;
- DMUS_COMPOSEF_OVERLAP = $2;
- DMUS_COMPOSEF_IMMEDIATE = $4;
- DMUS_COMPOSEF_GRID = $8;
- DMUS_COMPOSEF_BEAT = $10;
- DMUS_COMPOSEF_MEASURE = $20;
- DMUS_COMPOSEF_AFTERPREPARETIME = $40;
- DMUS_COMPOSEF_MODULATE = $1000;
- DMUS_COMPOSEF_LONG = $2000;
- (* DMUS_PMSGF_FLAGS fill the DMUS_PMSG's dwFlags member *)
- const
- DMUS_PMSGF_REFTIME = 1; // if rtTime is valid
- DMUS_PMSGF_MUSICTIME = 2; // if mtTime is valid
- DMUS_PMSGF_TOOL_IMMEDIATE = 4; // if PMSG should be processed immediately
- DMUS_PMSGF_TOOL_QUEUE = 8; // if PMSG should be processed a little early, at Queue time
- DMUS_PMSGF_TOOL_ATTIME = 16; // if PMSG should be processed at the time stamp
- DMUS_PMSGF_TOOL_FLUSH = 32; // if PMSG is being flushed
- (* DMUS_PMSGT_TYPES fill the DMUS_PMSG's dwType member *)
- const
- DMUS_PMSGT_MIDI = 0; // MIDI short message
- DMUS_PMSGT_NOTE = 1; // Interactive Music Note
- DMUS_PMSGT_SYSEX = 2; // MIDI long message (system exclusive message)
- DMUS_PMSGT_NOTIFICATION = 3; // Notification message
- DMUS_PMSGT_TEMPO = 4; // Tempo message
- DMUS_PMSGT_CURVE = 5; // Control change / pitch bend, etc. curve
- DMUS_PMSGT_TIMESIG = 6; // Time signature
- DMUS_PMSGT_PATCH = 7; // Patch changes
- DMUS_PMSGT_TRANSPOSE = 8; // Transposition messages
- DMUS_PMSGT_USER = 255; // User message
- (* DMUS_SEGF_FLAGS correspond to IDirectMusicPerformance::PlaySegment, and other API *)
- const
- DMUS_SEGF_AFTERQUEUETIME = 1; // play after the queue time (See IDirectMusicPerformance::GetQueueTime)
- DMUS_SEGF_AFTERPREPARETIME = 2; // play after the prepare time (See IDirectMusicPerformance::GetPrepareTime)
- DMUS_SEGF_GRID = 4; // play on grid boundary
- DMUS_SEGF_BEAT = 8; // play on beat boundary
- DMUS_SEGF_MEASURE = 16; // play on measure boundary
- DMUS_SEGF_DEFAULT = 32; // use segment's default boundary
- DMUS_SEGF_REFTIME = 64; // time parameter is in reference time
- DMUS_SEGF_SECONDARY = 128; // secondary segment
- DMUS_SEGF_QUEUE = 256; // queue at the end of the primary segment queue (primary only)
- DMUS_SEGF_CONTROL = 512; // play as a control track (secondary segments only)
- (* The following flags are sent in the IDirectMusicTrack::Play() method *)
- (* inside the dwFlags parameter *)
- const
- DMUS_TRACKF_SEEK = 1; // set on a seek
- DMUS_TRACKF_LOOP = 2; // set on a loop (repeat)
- DMUS_TRACKF_START = 4; // set on first call to Play
- DMUS_TRACKF_FLUSH = 8; // set when this call is in response to a flush on the perfomance
- DMUS_MAXSUBCHORD = 8;
- DMUS_NOTEF_NOTEON = 1; // Set if this is a MIDI Note On. Otherwise, it is MIDI Note Off
- const
- DMUS_TEMPO_MAX = 350;
- DMUS_TEMPO_MIN = 10;
- DMUS_MASTERTEMPO_MAX = 2.0;
- DMUS_MASTERTEMPO_MIN = 0.25;
- DMUS_MASTERVOLUME_MAX = 6;
- DMUS_MASTERVOLUME_MIN = -100;
- const
- (* Curve shapes *)
- DMUS_CURVES_LINEAR = 0;
- DMUS_CURVES_INSTANT = 1;
- DMUS_CURVES_EXP = 2;
- DMUS_CURVES_LOG = 3;
- DMUS_CURVES_SINE = 4;
- (* curve types *)
- DMUS_CURVET_PBCURVE = $03;
- DMUS_CURVET_CCCURVE = $04;
- DMUS_CURVET_MATCURVE = $05;
- DMUS_CURVET_PATCURVE = $06;
- (* notification type values *)
- (* The following correspond to GUID_NOTIFICATION_SEGMENT *)
- const
- DMUS_NOTIFICATION_SEGSTART = 0;
- DMUS_NOTIFICATION_SEGEND = 1;
- DMUS_NOTIFICATION_SEGALMOSTEND = 2;
- DMUS_NOTIFICATION_MUSICSTOPPED = 3;
- DMUS_NOTIFICATION_SEGLOOP = 4;
- // The following corresponds to GUID_NOTIFICATION_MEASUREANDBEAT
- DMUS_NOTIFICATION_MEASUREBEAT = 0;
- // The following corresponds to GUID_NOTIFICATION_CHORD
- DMUS_NOTIFICATION_CHORD = 0;
- // The following correspond to GUID_NOTIFICATION_COMMAND
- DMUS_NOTIFICATION_GROOVE = 0;
- DMUS_NOTIFICATION_EMBELLISHMENT = 1;
- const
- DMUS_MAX_NAME = 64; // Maximum object name length.
- DMUS_MAX_CATEGORY = 64; // Maximum object category name length.
- DMUS_MAX_FILENAME = MAX_PATH;
- (* Flags for dwValidData. When set, a flag indicates that the *)
- (* corresponding field in DMUSOBJECTDESC holds valid data. *)
- const
- DMUS_OBJ_OBJECT = (1 shl 0); // Object GUID is valid.
- DMUS_OBJ_CLASS = (1 shl 1); // Class GUID is valid.
- DMUS_OBJ_NAME = (1 shl 2); // Name is valid.
- DMUS_OBJ_CATEGORY = (1 shl 3); // Category is valid.
- DMUS_OBJ_FILENAME = (1 shl 4); // File path is valid.
- DMUS_OBJ_FULLPATH = (1 shl 5); // Path is full path.
- DMUS_OBJ_URL = (1 shl 6); // Path is URL.
- DMUS_OBJ_VERSION = (1 shl 7); // Version is valid.
- DMUS_OBJ_DATE = (1 shl 8); // Date is valid.
- DMUS_OBJ_LOADED = (1 shl 9); // Object is currently loaded in memory.
- DMUS_OBJ_MEMORY = (1 shl 10); // Object is pointed to by pbMemData.
- const
- DMUSB_LOADED = (1 shl 0); // Set when band has been loaded
- DMUSB_DEFAULT = (1 shl 1); // Set when band is default band for a style
- type
- IDirectMusicTrack = interface;
- IDirectMusicPerformance = interface;
- IDirectMusicTool = interface;
- IDirectMusicSegment = interface;
- IDirectMusicSegmentState = interface;
- IDirectMusicGraph = interface;
- IDirectMusicBand = interface;
- IDirectMusicChordMap = interface;
- IDirectMusicLoader = interface;
- IDirectMusicObject = interface;
- PIDirectMusicSegmentState = ^IDirectMusicSegmentState;
- TDMUS_COMMANDT_TYPES = (DMUS_COMMANDT_GROOVE,
- DMUS_COMMANDT_FILL,
- DMUS_COMMANDT_INTRO,
- DMUS_COMMANDT_BREAK,
- DMUS_COMMANDT_END,
- DMUS_COMMANDT_ENDANDINTRO);
- TDMUS_SHAPET_TYPES = (DMUS_SHAPET_FALLING,
- DMUS_SHAPET_LEVEL,
- DMUS_SHAPET_LOOPABLE,
- DMUS_SHAPET_LOUD,
- DMUS_SHAPET_QUIET,
- DMUS_SHAPET_PEAKING,
- DMUS_SHAPET_RANDOM,
- DMUS_SHAPET_RISING,
- DMUS_SHAPET_SONG);
- (* every DMUS_PMSG is based off of this structure. The Performance needs *)
- (* to access these members consistently in every PMSG that goes through it. *)
- PDMUS_PMSG = ^TDMUS_PMSG;
- TDMUS_PMSG = packed record
- dwSize: DWORD;
- rtTime: TREFERENCE_TIME; // real time (in 100 nanosecond increments)
- mtTime: TMUSIC_TIME; // music time
- dwFlags: DWORD; // various bits (see DMUS_PMSG_FLAGS enumeration)
- dwPChannel: DWORD; // Performance Channel. The Performance can
- // use this to determine the port/channel.
- dwVirtualTrackID: DWORD; // virtual track ID
- pTool: IDirectMusicTool; // tool class pointer
- pGraph: IDirectMusicGraph; // tool graph class pointer
- dwType: DWORD; // PMSG type (see DMUS_PM_TYPE defines)
- punkUser: IUnknown; // user com pointer, auto released upon PMSG free
- end;
- (* DMUS_NOTE_PMSG *)
- PDMUS_NOTE_PMSG = ^TDMUS_NOTE_PMSG;
- TDMUS_NOTE_PMSG = packed record
- dwSize: DWORD;
- rtTime: TREFERENCE_TIME; // real time (in 100 nanosecond increments)
- mtTime: TMUSIC_TIME; // music time
- dwFlags: DWORD; // various bits (see DMUS_PMSG_FLAGS enumeration)
- dwPChannel: DWORD; // Performance Channel. The Performance can
- // use this to determine the port/channel.
- dwVirtualTrackID: DWORD; // virtual track ID
- pTool: IDirectMusicTool; // tool class pointer
- pGraph: IDirectMusicGraph; // tool graph class pointer
- dwType: DWORD; // PMSG type (see DMUS_PM_TYPE defines)
- punkUser: IUnknown; // user com pointer, auto released upon PMSG free
- mtDuration: TMUSIC_TIME; // duration
- wMusicValue: WORD; // Description of note in chord and key.
- wMeasure: WORD; // Measure in which this note occurs
- nOffset: Smallint; // Offset from grid at which this note occurs
- bBeat: BYTE; // Beat (in measure) at which this note occurs
- bGrid: BYTE; // Grid offset from beat at which this note occurs
- bVelocity: BYTE; // Note velocity
- bFlags: BYTE; // see DMUS_NOTE_FLAGS
- bTimeRange: BYTE; // Range to randomize time.
- bDurRange: BYTE; // Range to randomize duration.
- bVelRange: BYTE; // Range to randomize velocity.
- bInversionID: BYTE; // Identifies inversion group to which this note belongs
- bPlayModeFlags: BYTE; // Play mode
- bMidiValue: BYTE; // The MIDI note value, converted from wMusicValue
- end;
- (* DMUS_MIDI_PMSG *)
- PDMUS_MIDI_PMSG = ^TDMUS_MIDI_PMSG;
- TDMUS_MIDI_PMSG = packed record
- dwSize: DWORD;
- rtTime: TREFERENCE_TIME; // real time (in 100 nanosecond increments)
- mtTime: TMUSIC_TIME; // music time
- dwFlags: DWORD; // various bits (see DMUS_PMSG_FLAGS enumeration)
- dwPChannel: DWORD; // Performance Channel. The Performance can
- // use this to determine the port/channel.
- dwVirtualTrackID: DWORD; // virtual track ID
- pTool: IDirectMusicTool; // tool class pointer
- pGraph: IDirectMusicGraph; // tool graph class pointer
- dwType: DWORD; // PMSG type (see DMUS_PM_TYPE defines)
- punkUser: IUnknown; // user com pointer, auto released upon PMSG free
- bStatus: BYTE;
- bByte1: BYTE;
- bByte2: BYTE;
- bPad: BYTE;
- end;
- (* DMUS_PATCH_PMSG *)
- PDMUS_PATCH_PMSG = ^TDMUS_PATCH_PMSG;
- TDMUS_PATCH_PMSG = packed record
- dwSize: DWORD;
- rtTime: TREFERENCE_TIME; // real time (in 100 nanosecond increments)
- mtTime: TMUSIC_TIME; // music time
- dwFlags: DWORD; // various bits (see DMUS_PMSG_FLAGS enumeration)
- dwPChannel: DWORD; // Performance Channel. The Performance can
- // use this to determine the port/channel.
- dwVirtualTrackID: DWORD; // virtual track ID
- pTool: IDirectMusicTool; // tool class pointer
- pGraph: IDirectMusicGraph; // tool graph class pointer
- dwType: DWORD; // PMSG type (see DMUS_PM_TYPE defines)
- punkUser: IUnknown; // user com pointer, auto released upon PMSG free
- byInstrument: BYTE;
- byMSB: BYTE;
- byLSB: BYTE;
- byPad: BYTE;
- dwGroup: DWORD;
- dwMChannel: DWORD;
- end;
- (* DMUS_TRANSPOSE_PMSG *)
- PDMUS_TRANSPOSE_PMSG = ^TDMUS_TRANSPOSE_PMSG;
- TDMUS_TRANSPOSE_PMSG = packed record
- dwSize: DWORD;
- rtTime: TREFERENCE_TIME; // real time (in 100 nanosecond increments)
- mtTime: TMUSIC_TIME; // music time
- dwFlags: DWORD; // various bits (see DMUS_PMSG_FLAGS enumeration)
- dwPChannel: DWORD; // Performance Channel. The Performance can
- // use this to determine the port/channel.
- dwVirtualTrackID: DWORD; // virtual track ID
- pTool: IDirectMusicTool; // tool class pointer
- pGraph: IDirectMusicGraph; // tool graph class pointer
- dwType: DWORD; // PMSG type (see DMUS_PM_TYPE defines)
- punkUser: IUnknown; // user com pointer, auto released upon PMSG free
- nTranspose: Smallint;
- end;
- (* DMUS_TEMPO_PMSG *)
- PDMUS_TEMPO_PMSG = ^TDMUS_TEMPO_PMSG;
- TDMUS_TEMPO_PMSG = packed record
- dwSize: DWORD;
- rtTime: TREFERENCE_TIME; // real time (in 100 nanosecond increments)
- mtTime: TMUSIC_TIME; // music time
- dwFlags: DWORD; // various bits (see DMUS_PMSG_FLAGS enumeration)
- dwPChannel: DWORD; // Performance Channel. The Performance can
- // use this to determine the port/channel.
- dwVirtualTrackID: DWORD; // virtual track ID
- pTool: IDirectMusicTool; // tool class pointer
- pGraph: IDirectMusicGraph; // tool graph class pointer
- dwType: DWORD; // PMSG type (see DMUS_PM_TYPE defines)
- punkUser: IUnknown; // user com pointer, auto released upon PMSG free
- dblTempo: DOUBLE; // the tempo
- end;
- (* DMUS_SYSEX_PMSG *)
- PDMUS_SYSEX_PMSG = ^TDMUS_SYSEX_PMSG;
- TDMUS_SYSEX_PMSG = packed record
- dwSize: DWORD;
- rtTime: TREFERENCE_TIME; // real time (in 100 nanosecond increments)
- mtTime: TMUSIC_TIME; // music time
- dwFlags: DWORD; // various bits (see DMUS_PMSG_FLAGS enumeration)
- dwPChannel: DWORD; // Performance Channel. The Performance can
- // use this to determine the port/channel.
- dwVirtualTrackID: DWORD; // virtual track ID
- pTool: IDirectMusicTool; // tool class pointer
- pGraph: IDirectMusicGraph; // tool graph class pointer
- dwType: DWORD; // PMSG type (see DMUS_PM_TYPE defines)
- punkUser: IUnknown; // user com pointer, auto released upon PMSG free
- dwLen: DWORD; // length of the data
- abData: Byte; // array of data, length equal to dwLen
- end;
- (* DMUS_CURVE_PMSG *)
- PDMUS_CURVE_PMSG = ^TDMUS_CURVE_PMSG;
- TDMUS_CURVE_PMSG = packed record
- dwSize: DWORD;
- rtTime: TREFERENCE_TIME; // real time (in 100 nanosecond increments)
- mtTime: TMUSIC_TIME; // music time
- dwFlags: DWORD; // various bits (see DMUS_PMSG_FLAGS enumeration)
- dwPChannel: DWORD; // Performance Channel. The Performance can
- // use this to determine the port/channel.
- dwVirtualTrackID: DWORD; // virtual track ID
- pTool: IDirectMusicTool; // tool class pointer
- pGraph: IDirectMusicGraph; // tool graph class pointer
- dwType: DWORD; // PMSG type (see DMUS_PM_TYPE defines)
- punkUser: IUnknown; // user com pointer, auto released upon PMSG free
- mtDuration: TMUSIC_TIME; // how long this curve lasts
- mtOriginalStart: TMUSIC_TIME; // must be set to either zero when this PMSG is created or to the original mtTime of the curve
- mtResetDuration: TMUSIC_TIME; // how long after the curve is finished to reset to the
- // reset value, nResetValue
- nStartValue: WORD; // curve's start value
- nEndValue: WORD; // curve's end value
- nResetValue: WORD; // curve's reset value, sent after mtResetDuration or
- // upon a flush or invalidation
- wMeasure: WORD; // Measure in which this curve occurs
- nOffset: WORD; // Offset from grid at which this curve occurs
- bBeat: BYTE; // Beat (in measure) at which this curve occurs
- bGrid: BYTE; // Grid offset from beat at which this curve occurs
- bType: BYTE; // type of curve
- bCurveShape: BYTE; // shape of curve
- bCCData: BYTE; // CC# if this is a control change type
- bFlags: BYTE; // set to 1 if the nResetValue must be sent when the
- // time is reached or an invalidate occurs because
- // of a transition. If 0, the curve stays
- // permanently stuck at the new value. All bits besides
- // 1 are reserved.
- end;
- (* DMUS_TIMESIG_PMSG *)
- PDMUS_TIMESIG_PMSG = ^TDMUS_TIMESIG_PMSG;
- TDMUS_TIMESIG_PMSG = packed record
- dwSize: DWORD;
- rtTime: TREFERENCE_TIME; // real time (in 100 nanosecond increments)
- mtTime: TMUSIC_TIME; // music time
- dwFlags: DWORD; // various bits (see DMUS_PMSG_FLAGS enumeration)
- dwPChannel: DWORD; // Performance Channel. The Performance can
- // use this to determine the port/channel.
- dwVirtualTrackID: DWORD; // virtual track ID
- pTool: IDirectMusicTool; // tool class pointer
- pGraph: IDirectMusicGraph; // tool graph class pointer
- dwType: DWORD; // PMSG type (see DMUS_PM_TYPE defines)
- punkUser: IUnknown; // user com pointer, auto released upon PMSG free
- // Time signatures define how many beats per measure, which note receives
- // the beat, and the grid resolution.
- bBeatsPerMeasure: BYTE; // beats per measure (top of time sig)
- bBeat: BYTE; // what note receives the beat (bottom of time sig.)
- // we can assume that 0 means 256th note
- wGridsPerBeat: WORD; // grids per beat
- end;
- (* DMUS_NOTIFICATION_PMSG *)
- PDMUS_NOTIFICATION_PMSG = ^TDMUS_NOTIFICATION_PMSG;
- TDMUS_NOTIFICATION_PMSG = packed record
- dwSize: DWORD;
- rtTime: TREFERENCE_TIME; // real time (in 100 nanosecond increments)
- mtTime: TMUSIC_TIME; // music time
- dwFlags: DWORD; // various bits (see DMUS_PMSG_FLAGS enumeration)
- dwPChannel: DWORD; // Performance Channel. The Performance can
- // use this to determine the port/channel.
- dwVirtualTrackID: DWORD; // virtual track ID
- pTool: IDirectMusicTool; // tool class pointer
- pGraph: IDirectMusicGraph; // tool graph class pointer
- dwType: DWORD; // PMSG type (see DMUS_PM_TYPE defines)
- punkUser: IUnknown; // user com pointer, auto released upon PMSG free
- guidNotificationType: TGUID;
- dwNotificationOption: DWORD;
- dwField1: DWORD;
- dwField2: DWORD;
- end;
- (* Time Signature structure, used by IDirectMusicStyle *)
- PDMUS_TIMESIGNATURE = ^TDMUS_TIMESIGNATURE;
- TDMUS_TIMESIGNATURE = packed record
- lTime: DWORD;
- bBeatsPerMeasure: BYTE; // beats per measure (top of time sig)
- bBeat: BYTE; // what note receives the beat (bottom of time sig.)
- // we can assume that 0 means 256th note
- wGridsPerBeat: WORD; // grids per beat
- end;
- PDMUS_VERSION = ^TDMUS_VERSION;
- TDMUS_VERSION = record
- dwVersionMS: DWORD;
- dwVersionLS: DWORD;
- end;
- (* The DMUSOBJECTDESC structure is used to communicate everything you could *)
- (* possibly use to describe a DirectMusic object. *)
- PDMUS_OBJECTDESC = ^TDMUS_OBJECTDESC;
- TDMUS_OBJECTDESC = record
- dwSize: DWORD; // Size of this structure.
- dwValidData: DWORD; // Flags indicating which fields below are valid.
- guidObject: TGUID; // Unique ID for this object.
- guidClass: TGUID; // GUID for the class of object.
- ftData: TFILETIME; // Last edited date of object.
- vVersion: TDMUS_VERSION; // Version.
- wszName: array[0..DMUS_MAX_NAME-1] of WCHAR; // Name of object.
- wszCategory: array[0..DMUS_MAX_CATEGORY-1] of WCHAR; // Category for object (optional).
- wszFileName: array[0..DMUS_MAX_FILENAME-1] of WCHAR; // File path.
- llMemLength: LONGLONG; // Size of Memory data.
- pbMemData: PBYTE; // Memory pointer for data.
- Dummy: DWORD;
- end;
- IDirectMusicBand = interface(IUnknown)
- ['{d2ac28c0-b39b-11d1-8704-00600893b1bd}']
- function CreateSegment(var ppSegment: IDirectMusicSegment): HRESULT; stdcall;
- function Download(pPerformance: IDirectMusicPerformance): HRESULT; stdcall;
- function Unload(pPerformance: IDirectMusicPerformance): HRESULT; stdcall;
- end;
- IDirectMusicObject = interface(IUnknown)
- ['{d2ac28b5-b39b-11d1-8704-00600893b1bd}']
- function GetDescriptor(pDesc: PDMUS_OBJECTDESC): HRESULT; stdcall;
- function SetDescriptor(pDesc: PDMUS_OBJECTDESC): HRESULT; stdcall;
- function ParseDescriptor(pStream: ISTREAM; pDesc: PDMUS_OBJECTDESC): HRESULT; stdcall;
- end;
- PPointer = ^Pointer;
- IDirectMusicLoader = interface(IUnknown)
- ['{f0b49495-0bac-11d2-bca1-00a0c922e6eb}']
- function GetObject(pDesc: PDMUS_OBJECTDESC; const riid: TIID; out ppv): HRESULT; stdcall;
- function SetObject(pDesc: PDMUS_OBJECTDESC): HRESULT; stdcall;
- function SetSearchDirectory(const rguidClass: TGUID; pwzPath: PWCHAR; fClear: BOOL): HRESULT; stdcall;
- function ScanDirectory(const rguidClass: TGUID; pwzFileExtension,pwzScanFileName: PWCHAR): HRESULT; stdcall;
- function CacheObject(pObject: IDirectMusicObject): HRESULT; stdcall;
- function ReleaseObject(pObject: IDirectMusicObject): HRESULT; stdcall;
- function ClearCache(const rguidClass: TGUID): HRESULT; stdcall;
- function EnableCache(const rguidClass: TGUID; fEnable: BOOL): HRESULT; stdcall;
- function EnumObject(const rguidClass: TGUID;dwIndex: DWORD; pDesc: PDMUS_OBJECTDESC): HRESULT; stdcall;
- end;
- // Stream object supports IDirectMusicGetLoader class to access loader while file parsing.
- IDirectMusicGetLoader = interface(IUnknown)
- ['{68a04844-d13d-11d1-afa6-00aa0024d8b6}']
- function GetLoader(var ppLoader: IDirectMusicLoader): HRESULT; stdcall;
- end;
- IDirectMusicSegment = interface(IUnknown)
- ['{70e3bd5d-f118-11d1-bc92-00a0c922e6eb}']
- function GetLength(var pmtLength: TMUSIC_TIME): HRESULT; stdcall;
- function SetLength(mtLength: TMUSIC_TIME): HRESULT; stdcall;
- function GetRepeats(var pdwRepeats: DWORD): HRESULT; stdcall;
- function SetRepeats(dwRepeats: DWORD): HRESULT; stdcall;
- function GetDefaultResolution(var pdwResolution: DWORD): HRESULT; stdcall;
- function SetDefaultResolution(dwResolution: DWORD): HRESULT; stdcall;
- function GetTrack(const rguidType: TGUID; dwGroupBits,dwIndex: DWORD; var ppTrack: IDirectMusicTrack): HRESULT; stdcall;
- function GetTrackGroup(pTrack: IDirectMusicTrack;var pdwGroupBits: DWORD): HRESULT; stdcall;
- function InsertTrack(pTrack: IDirectMusicTrack; dwGroupBits: DWORD): HRESULT; stdcall;
- function RemoveTrack(pTrack: IDirectMusicTrack): HRESULT; stdcall;
- function InitPlay(var ppSegState: IDirectMusicSegmentState; pPerformance: IDirectMusicPerformance; dwFlags: DWORD): HRESULT; stdcall;
- function GetGraph(var ppGraph: IDirectMusicGraph): HRESULT; stdcall;
- function SetGraph(pGraph: IDirectMusicGraph): HRESULT; stdcall;
- function AddNotificationType(const rguidNotificationType: TGUID): HRESULT; stdcall;
- function RemoveNotificationType(const rguidNotificationType: TGUID): HRESULT; stdcall;
- function GetParam(const rguidType: TGUID;dwGroupBits, dwIndex: DWORD; mtTime: TMUSIC_TIME;
- var pmtNext: TMUSIC_TIME; pParam: Pointer): HRESULT; stdcall;
- function SetParam(const rguidType: TGUID; dwGroupBits, dwIndex: DWORD; mtTime: TMUSIC_TIME;
- pParam: Pointer): HRESULT; stdcall;
- function Clone(mtStart,mtEnd: TMUSIC_TIME; var ppSegment: IDirectMusicSegment): HRESULT; stdcall;
- function SetStartPoint(mtStart: TMUSIC_TIME): HRESULT; stdcall;
- function GetStartPoint(var pmtStart: TMUSIC_TIME): HRESULT; stdcall;
- function SetLoopPoints(mtStart,mtEnd: TMUSIC_TIME): HRESULT; stdcall;
- function GetLoopPoints(var pmtStart, pmtEnd: TMUSIC_TIME): HRESULT; stdcall;
- function SetPChannelsUsed(dwNumPChannels: DWORD; var paPChannels: DWORD): HRESULT; stdcall;
- end;
- IDirectMusicSegmentState = interface(IUnknown)
- ['{a3afdcc7-d3ee-11d1-bc8d-00a0c922e6eb}']
- function GetRepeats(var pdwRepeats: DWORD): HRESULT; stdcall;
- function GetSegment(var ppSegment: IDirectMusicSegment): HRESULT; stdcall;
- function GetStartTime(var pmStart: TMUSIC_TIME): HRESULT; stdcall;
- function GetSeek(var pmtSeek: TMUSIC_TIME): HRESULT; stdcall;
- function GetStartPoint(var pmtStart: TMUSIC_TIME): HRESULT; stdcall;
- end;
- IDirectMusicTrack = interface(IUnknown)
- ['{de5e3a32-d31b-11d1-bc8b-00a0c922e6eb}']
- function Init(pSegment: IDirectMusicSegment): HRESULT; stdcall;
- function InitPlay(pSegmentState: IDirectMusicSegmentState;
- pPerformance: IDirectMusicPerformance;
- var ppStateData: Pointer;
- dwVirtualTrackID,dwFlags: DWORD): HRESULT; stdcall;
- function EndPlay(pStateData: Pointer): HRESULT; stdcall;
- function Play(pStateData: Pointer; mtStart,mtEnd, mtOffset: TMUSIC_TIME;
- dwFlags: DWORD; pPerf: IDirectMusicPerformance;
- pSegSt: IDirectMusicSegmentState;dwVirtualID: DWORD): HRESULT; stdcall;
- function GetParam(const rguidType: TGUID; mtTime: TMUSIC_TIME; var pmtNext: TMUSIC_TIME; pParam: Pointer): HRESULT; stdcall;
- function SetParam(const rguidType: TGUID; mtTime: TMUSIC_TIME; pParam: Pointer): HRESULT; stdcall;
- function IsParamSupported(const rguidType: TGUID): HRESULT; stdcall;
- function AddNotificationType(const rguidNotificationType: TGUID): HRESULT; stdcall;
- function RemoveNotificationType(const rguidNotificationType: TGUID): HRESULT; stdcall;
- function Clone(mtStart, mtEnd: TMUSIC_TIME; var ppTrack: IDirectMusicTrack): HRESULT; stdcall;
- end;
- IDirectMusicPerformance = interface(IUnknown)
- ['{de5e3a33-d31b-11d1-bc8b-00a0c922e6eb}']
- function Init(ppDirectMusic: PIDirectMusic;
- pDirectSound: {PDIRECTSOUND} Pointer;
- hWnd: HWND): HRESULT; stdcall;
- function PlaySegment(pSegment: IDirectMusicSegment; dwFlags: DWORD; i64StartTime: LONGLONG;
- ppSegmentState: PIDirectMusicSegmentState): HRESULT; stdcall;
- function Stop(pSegment: IDirectMusicSegment;
- pSegmentState: IDirectMusicSegmentState;
- mtTime: TMUSIC_TIME; dwFlags: DWORD): HRESULT; stdcall;
- function GetSegmentState(var ppSegmentState: IDirectMusicSegmentState;
- mtTime: TMUSIC_TIME): HRESULT; stdcall;
- function SetPrepareTime(dwMilliSeconds: DWORD): HRESULT; stdcall;
- function GetPrepareTime(var pdwMilliSeconds: DWORD): HRESULT; stdcall;
- function SetBumperLength(dwMilliSeconds: DWORD): HRESULT; stdcall;
- function GetBumperLength(var pdwMilliSeconds: DWORD): HRESULT; stdcall;
- function SendPMsg(pPMSG: PDMUS_PMSG): HRESULT; stdcall;
- function MusicToReferenceTime(mtTime: TMUSIC_TIME; var prtTime: TREFERENCE_TIME): HRESULT; stdcall;
- function ReferenceToMusicTime(rtTime: TREFERENCE_TIME; var pmtTime: TMUSIC_TIME): HRESULT; stdcall;
- function IsPlaying(pSegment: IDirectMusicSegment; pSegState: IDirectMusicSegmentState): HRESULT; stdcall;
- function GetTime(var prtNow: TREFERENCE_TIME; var pmtNow: TMUSIC_TIME): HRESULT; stdcall;
- function AllocPMsg(cb: ULONG; var ppPMSG: PDMUS_PMSG): HRESULT; stdcall;
- function FreePMsg(pPMSG: PDMUS_PMSG): HRESULT; stdcall;
- function GetGraph(var ppGraph: IDirectMusicGraph): HRESULT; stdcall;
- function SetGraph(pGraph: IDirectMusicGraph): HRESULT; stdcall;
- function SetNotificationHandle(hNotification: THANDLE; rtMinimum: TREFERENCE_TIME): HRESULT; stdcall;
- function GetNotificationPMsg(var ppNotificationPMsg: PDMUS_NOTIFICATION_PMSG): HRESULT; stdcall;
- function AddNotificationType(const rguidNotificationType: TGUID): HRESULT; stdcall;
- function RemoveNotificationType(const rguidNotificationType: TGUID): HRESULT; stdcall;
- function AddPort(pPort: IDirectMusicPort): HRESULT; stdcall;
- function RemovePort(pPort: IDirectMusicPort): HRESULT; stdcall;
- function AssignPChannelBlock(dwBlockNum: DWORD; pPort: IDirectMusicPort; dwGroup: DWORD): HRESULT; stdcall;
- function AssignPChannel(dwPChannel: DWORD; pPort: IDirectMusicPort; dwGroup, dwMChannel: DWORD): HRESULT; stdcall;
- function PChannelInfo(dwPChannel: DWORD; var ppPort: IDirectMusicPort; var pdwGroup, pdwMChannel: DWORD): HRESULT; stdcall;
- function DownloadInstrument(pInst: IDirectMusicInstrument; dwPChannel: DWORD;
- var ppDownInst: IDirectMusicDownloadedInstrument;
- pNoteRanges: PDMUS_NOTERANGE; dwNumNoteRanges: DWORD;
- var ppPort: IDirectMusicPort; var pdwGroup, pdwMChannel: DWORD): HRESULT; stdcall;
- function Invalidate(mtTime: TMUSIC_TIME;dwFlags: DWORD): HRESULT; stdcall;
- function GetParam(const rguidType: TGUID; dwGroupBits,dwIndex: DWORD;
- mtTime: TMUSIC_TIME; var pmtNext: TMUSIC_TIME; pParam: Pointer): HRESULT; stdcall;
- function SetParam(rguidType: TGUID; dwGroupBits, dwIndex: DWORD;
- mtTime: TMUSIC_TIME; pParam: Pointer): HRESULT; stdcall;
- function GetGlobalParam(const rguidType: TGUID; pParam: Pointer; dwSize: DWORD): HRESULT; stdcall;
- function SetGlobalParam(const rguidType: TGUID; pParam: Pointer; dwSize: DWORD): HRESULT; stdcall;
- function GetLatencyTime(var prtTime: TREFERENCE_TIME): HRESULT; stdcall;
- function GetQueueTime(var prtTime: TREFERENCE_TIME): HRESULT; stdcall;
- function AdjustTime(rtAmount: TREFERENCE_TIME): HRESULT; stdcall;
- function CloseDown: HRESULT; stdcall;
- function GetResolvedTime(rtTime: TREFERENCE_TIME; var prtResolved: TREFERENCE_TIME; dwTimeResolveFlags: DWORD): HRESULT; stdcall;
- function MIDIToMusic(bMIDIValue: Byte; var pChord: Word{muss TDMUS_CHORD_KEY sein}; bPlayMode, bChordLevel: Byte; var pwMusicValue: WORD): HRESULT; stdcall;
- function MusicToMIDI(wMusicValue: WORD; var pChord: Word{muss TDMUS_CHORD_KEY sein}; bPlayMode, bChordLevel: Byte; var pwMidiValue: WORD): HRESULT; stdcall;
- function TimeToRhythm(mtTime: TMUSIC_TIME; var pTimeSig: TDMUS_TIMESIGNATURE; var pwMeasure: WORD; var pbBeat, pbGrid: BYTE; var pnOffset: Smallint): HRESULT; stdcall;
- function RhythmToTime(wMeasure: WORD; bBeat, bGrid: BYTE; nOffset: Smallint; var pTimeSig: TDMUS_TIMESIGNATURE; var pmtTime: TMUSIC_TIME): HRESULT; stdcall;
- end;
- IDirectMusicTool = interface(IUnknown)
- ['{d2ac28ba-b39b-11d1-8704-00600893b1bd}']
- function Init(pGraph: IDirectMusicGraph): HRESULT; stdcall;
- function GetMsgDeliveryType(var pdwDeliveryType: DWORD): HRESULT; stdcall;
- function GetMediaTypeArraySize(var pdwNumElements: DWORD): HRESULT; stdcall;
- function GetMediaTypes(var padwMediaTypes: PDWORD; dwNumElements: DWORD): HRESULT; stdcall;
- function ProcessPMsg(pPerf: IDirectMusicPerformance; pPMSG: PDMUS_PMSG): HRESULT; stdcall;
- function Flush(pPerf: IDirectMusicPerformance; pPMSG: PDMUS_PMSG; rtTime: TREFERENCE_TIME): HRESULT; stdcall;
- end;
- IDirectMusicGraph = interface(IUnknown)
- ['{1ee21dc8-c370-11d1-bc84-00a0c922e6eb}']
- function StampPMsg(pPMSG: PDMUS_PMSG): HRESULT; stdcall;
- function InsertTool(pTool: IDirectMusicTool; pdwPChannels: PDWORD; cPChannels, lIndex: DWORD): HRESULT; stdcall;
- function GetTool(dwIndex: DWORD; var ppTool: IDirectMusicTool): HRESULT; stdcall;
- function RemoveTool(pTool: IDirectMusicTool): HRESULT; stdcall;
- end;
- IDirectMusicStyle = interface(IUnknown)
- ['{d2ac28bd-b39b-11d1-8704-00600893b1bd}']
- function GetBand(pwszName: PWCHAR; var ppBand: IDirectMusicBand): HRESULT; stdcall;
- function EnumBand(dwIndex: DWORD; pwszName: PWCHAR): HRESULT; stdcall;
- function GetDefaultBand(var ppBand: IDirectMusicBand): HRESULT; stdcall;
- function EnumMotif(dwIndex: DWORD; pwszName: PWCHAR): HRESULT; stdcall;
- function GetMotif(pwszName: PWCHAR; var ppSegment: IDirectMusicSegment): HRESULT; stdcall;
- function GetDefaultChordMap(var ppChordMap: IDirectMusicChordMap): HRESULT; stdcall;
- function EnumChordMap(dwIndex: DWORD; pwszName: PWCHAR): HRESULT; stdcall;
- function GetChordMap(pwszName: PWCHAR; var ppChordMap: IDirectMusicChordMap): HRESULT; stdcall;
- function GetTimeSignature(var pTimeSig: TDMUS_TIMESIGNATURE): HRESULT; stdcall;
- function GetEmbellishmentLength(dwType, dwLevel: DWORD; var pdwMin, pdwMax: DWORD): HRESULT; stdcall;
- function GetTempo(var pTempo: Double): HRESULT; stdcall;
- end;
- IDirectMusicChordMap = interface(IUnknown)
- ['{d2ac28be-b39b-11d1-8704-00600893b1bd}']
- function GetScale(var pdwScale: DWORD): HRESULT; stdcall;
- end;
- IDirectMusicComposer = interface(IUnknown)
- ['{d2ac28bf-b39b-11d1-8704-00600893b1bd}']
- function ComposeSegmentFromTemplate(pStyle: IDirectMusicStyle;
- pTempSeg: IDirectMusicSegment;
- wActivity: WORD;
- pChordMap: IDirectMusicChordMap;
- var ppSectionSeg: IDirectMusicSegment): HRESULT; stdcall;
- function ComposeSegmentFromShape(pStyle: IDirectMusicStyle; wNumMeasures,wShape,wActivity: WORD;
- fIntro, fEnd: BOOL; pChordMap: IDirectMusicChordMap;
- var ppSectionSeg: IDirectMusicSegment): HRESULT; stdcall;
- function ComposeTransition(pFromSeg,pToSeg: IDirectMusicSegment;
- mtTime: TMUSIC_TIME; wCommand: WORD; dwFlags: DWORD;
- pChordMap: IDirectMusicChordMap;
- var ppSectionSeg: IDirectMusicSegment): HRESULT; stdcall;
- function AutoTransition(pPerformance: IDirectMusicPerformance;
- pToSeg: IDirectMusicSegment; wCommand: WORD; dwFlags: DWORD;
- pChordMap: IDirectMusicChordMap;
- var ppTransSeg: IDirectMusicSegment;
- var ppToSegState: IDirectMusicSegmentState;
- var ppTransSegState: IDirectMusicSegmentState): HRESULT; stdcall;
- function ComposeTemplateFromShape(wNumMeasures, wShape: WORD; fIntro, fEnd: BOOL; wEndLength: WORD;
- var ppTempSeg: IDirectMusicSegment): HRESULT; stdcall;
- function ChangeChordMap(pSectionSeg: IDirectMusicSegment; fTrackScale: BOOL;
- pChordMap: IDirectMusicChordMap): HRESULT; stdcall;
- end;
- const
- CLSID_DirectMusicPerformance : TGUID =
- (D1:$d2ac2881;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicSegment : TGUID =
- (D1:$d2ac2882;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicSegmentState : TGUID =
- (D1:$d2ac2883;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicGraph : TGUID =
- (D1:$d2ac2884;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicTempoTrack : TGUID =
- (D1:$d2ac2885;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicSeqTrack : TGUID =
- (D1:$d2ac2886;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicSysExTrack : TGUID =
- (D1:$d2ac2887;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicTimeSigTrack : TGUID =
- (D1:$d2ac2888;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicStyle : TGUID =
- (D1:$d2ac288a;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicChordTrack : TGUID =
- (D1:$d2ac288b;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicCommandTrack: TGUID =
- (D1:$d2ac288c;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicStyleTrack : TGUID =
- (D1:$d2ac288d;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicMotifTrack : TGUID =
- (D1:$d2ac288e;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicChordMap : TGUID =
- (D1:$d2ac288f;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicComposer : TGUID =
- (D1:$d2ac2890;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicSignPostTrack : TGUID =
- (D1:$f17e8672;D2:$c3b4;D3:$11d1;D4:($87,$b,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicLoader : TGUID =
- (D1:$d2ac2892;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicBandTrack :TGUID =
- (D1:$d2ac2894;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicBand : TGUID =
- (D1:$79ba9e00;D2:$b6ee;D3:$11d1;D4:($86,$be,$0,$c0,$4f,$bf,$8f,$ef));
- CLSID_DirectMusicChordMapTrack : TGUID =
- (D1:$d2ac2896;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- CLSID_DirectMusicMuteTrack : TGUID =
- (D1:$d2ac2898;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- // Special GUID for all object types. This is used by the loader.
- GUID_DirectMusicAllTypes : TGUID =
- (D1:$d2ac2893;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- // Notification guids
- GUID_NOTIFICATION_SEGMENT : TGUID =
- (D1:$d2ac2899;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_NOTIFICATION_PERFORMANCE : TGUID =
- (D1: $81f75bc5;D2:$4e5d;D3:$11d2;D4:($bc,$c7,$0,$a0,$c9,$22,$e6,$eb));
- GUID_NOTIFICATION_MEASUREANDBEAT : TGUID =
- (D1:$d2ac289a;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_NOTIFICATION_CHORD : TGUID =
- (D1:$d2ac289b;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_NOTIFICATION_COMMAND : TGUID =
- (D1:$d2ac289c;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- // Track param type guids
- GUID_CommandTrack : TGUID =
- (D1:$d2ac289d;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_ChordTrackChord : TGUID =
- (D1:$d2ac289e;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_ChordTrackRhythm : TGUID =
- (D1:$d2ac289f;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_StyleTrackRepeats : TGUID =
- (D1:$d2ac28a0;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_StyleTrackStyle : TGUID =
- (D1:$d2ac28a1;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_MotifTrack : TGUID =
- (D1:$d2ac28a2;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_TimeSigTrack : TGUID =
- (D1:$d2ac28a4;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_TempoTrack : TGUID =
- (D1:$d2ac28a5;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_BandTrack : TGUID =
- (D1:$d2ac28a6;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_BandTrack_Download : TGUID =
- (D1:$d2ac28a7;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_BandTrack_Unload : TGUID =
- (D1:$d2ac28a8;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_BandTrack_Enable_Auto_Download : TGUID =
- (D1:$d2ac28a9;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_BandTrack_Disable_Auto_Download :TGUID =
- (D1:$d2ac28aa;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_BandTrack_Clear_All_Bands : TGUID =
- (D1:$d2ac28ab;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_BandTrack_AddBand : TGUID =
- (D1:$d2ac28ac;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_BandTrack_SetGMOnly : TGUID =
- (D1:$6621075;D2:$e92e;D3:$11d1;D4:($a8,$c5,$0,$c0,$4f,$a3,$72,$6e));
- GUID_BandTrack_ConnectToDLSCollection : TGUID =
- (D1:$1db1ae6b;D2:$e92e;D3:$11d1;D4:($a8,$c5,$0,$c0,$4f,$a3,$72,$6e));
- GUID_PersonalityTrack : TGUID =
- (D1:$d2ac28ad;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_AuditionTrack : TGUID =
- (D1:$d2ac28ae;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_MuteTrack : TGUID =
- (D1:$d2ac28af;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- // Global data guids
- GUID_PerfMasterTempo : TGUID =
- (D1:$d2ac28b0;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_PerfMasterVolume : TGUID =
- (D1:$d2ac28b1;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_PerfMasterGrooveLevel : TGUID =
- (D1:$d2ac28b2;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- GUID_PerfAutoDownload : TGUID =
- (D1:$fb09565b;D2:$3631;D3:$11d2;D4:($bc,$b8,$0,$a0,$c9,$22,$e6,$eb));
- // GUID for default GM/GS dls collection.
- GUID_DefaultGMCollection : TGUID =
- (D1:$f17e8673;D2:$c3b4;D3:$11d1;D4:($87,$b,$0,$60,$8,$93,$b1,$bd));
- // These guids are used in IDirectMusicSegment::SetParam to tell the band track to perform various actions.
- // Download bands for the IDirectMusicSegment
- GUID_Download : TGUID =
- (D1:$d2ac28a7;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- // Unload bands for the IDirectMusicSegment
- GUID_Unload : TGUID =
- (D1:$d2ac28a8;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- // Set segment to manage all program changes, bank selects, etc. for simple playback of a standard MIDI file
- GUID_StandardMIDIFile : TGUID =
- (D1:$6621075;D2:$e92e;D3:$11d1;D4:($a8,$c5,$0,$c0,$4f,$a3,$72,$6e));
- // IID's
- IID_IDirectMusicLoader : TGUID =
- (D1:$2ffaaca2;D2:$5dca;D3:$11d2;D4:($af,$a6,$0,$aa,$0,$24,$d8,$b6));
- IID_IDirectMusicGetLoader : TGUID =
- (D1:$68a04844;D2:$d13d;D3:$11d1;D4:($af,$a6,$0,$aa,$0,$24,$d8,$b6));
- IID_IDirectMusicObject : TGUID =
- (D1:$d2ac28b5;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- IID_IDirectMusicSegment : TGUID =
- (D1:$f96029a2;D2:$4282;D3:$11d2;D4:($87,$17,$0,$60,$8,$93,$b1,$bd));
- IID_IDirectMusicSegmentState : TGUID =
- (D1:$a3afdcc7;D2:$d3ee;D3:$11d1;D4:($bc,$8d,$0,$a0,$c9,$22,$e6,$eb));
- IID_IDirectMusicTrack : TGUID =
- (D1:$f96029a1;D2:$4282;D3:$11d2;D4:($87,$17,$0,$60,$8,$93,$b1,$bd));
- IID_IDirectMusicPerformance : TGUID =
- (D1:$7d43d03;D2:$6523;D3:$11d2;D4:($87,$1d,$0,$60,$8,$93,$b1,$bd));
- IID_IDirectMusicTool : TGUID =
- (D1:$d2ac28ba;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- IID_IDirectMusicGraph : TGUID =
- (D1:$2befc277;D2:$5497;D3:$11d2;D4:($bc,$cb,$0,$a0,$c9,$22,$e6,$eb));
- IID_IDirectMusicStyle : TGUID =
- (D1:$d2ac28bd;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- IID_IDirectMusicChordMap : TGUID =
- (D1:$d2ac28be;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- IID_IDirectMusicComposer : TGUID =
- (D1:$d2ac28bf;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- IID_IDirectMusicBand : TGUID =
- (D1:$d2ac28c0;D2:$b39b;D3:$11d1;D4:($87,$4,$0,$60,$8,$93,$b1,$bd));
- (************************************************************************
- * *
- * dmusicf.h -- This module defines the DirectMusic file formats *
- * *
- * Copyright (c) 1998, Microsoft Corp. All rights reserved. *
- * *
- ************************************************************************)
- const
- // Common chunks
- DMUS_FOURCC_GUID_CHUNK = $64697567; // mmioFOURCC('g','u','i','d')
- DMUS_FOURCC_INFO_LIST = $4F464E49; // mmioFOURCC('I','N','F','O')
- DMUS_FOURCC_UNFO_LIST = $4F464E55; // mmioFOURCC('U','N','F','O')
- DMUS_FOURCC_CATEGORY_CHUNK = $67746163; // mmioFOURCC('c','a','t','g')
- DMUS_FOURCC_VERSION_CHUNK = $73726576; // mmioFOURCC('v','e','r','s')
- type
- PDMUS_COMMAND_PARAM =^TDMUS_COMMAND_PARAM;
- TDMUS_COMMAND_PARAM = record
- bCommand : BYTE;
- bGrooveLevel: BYTE;
- bGrooveRange: BYTE;
- end;
- // The following structures are used by the Tracks, and are the packed structures
- // that are passed to the Tracks inside the IStream.
- PDMUS_IO_SEQ_ITEM = ^TDMUS_IO_SEQ_ITEM;
- TDMUS_IO_SEQ_ITEM = record
- lTime: DWORD;
- lDuration: DWORD;
- bEventType: BYTE;
- bStatus: BYTE;
- bByte1: BYTE;
- bByte2: BYTE;
- bType: BYTE;
- bPad: array[0..2] of BYTE;
- end;
- PDMUS_IO_CURVE_ITEM = ^TDMUS_IO_CURVE_ITEM;
- TDMUS_IO_CURVE_ITEM = record
- mtStart: TMUSIC_TIME;
- mtDuration: TMUSIC_TIME;
- mtResetDuration: TMUSIC_TIME;
- dwPChannel: DWORD;
- nStartValue: Smallint;
- nEndValue: Smallint;
- nResetValue: Smallint;
- bType: BYTE;
- bCurveShape: BYTE;
- bCCData: BYTE;
- bFlags: BYTE;
- bPad: array[0..1] of BYTE;
- end;
- PDMUS_IO_TEMPO_ITEM = ^TDMUS_IO_TEMPO_ITEM;
- TDMUS_IO_TEMPO_ITEM = record
- lTime: DWORD;
- dblTempo: DOUBLE;
- end;
- PDMUS_IO_SYSEX_ITEM = ^TDMUS_IO_SYSEX_ITEM;
- TDMUS_IO_SYSEX_ITEM = record
- lTime: DWORD;
- dwSysExLength: DWORD;
- pbSysExData: PByte;
- end;
- PDMUS_IO_BANKSELECT_ITEM = ^TDMUS_IO_BANKSELECT_ITEM;
- TDMUS_IO_BANKSELECT_ITEM = record
- byLSB: BYTE;
- byMSB: BYTE;
- byPad: array[0..1] of BYTE;
- end;
- PDMUS_IO_PATCH_ITEM = ^TDMUS_IO_PATCH_ITEM;
- TDMUS_IO_PATCH_ITEM = record
- lTime: DWORD;
- byStatus: BYTE;
- byByte1: BYTE;
- byByte2: BYTE;
- byMSB: BYTE;
- byLSB: BYTE;
- byPad: array[0..2] of BYTE;
- dwFlags: DWORD;
- pIDMCollection: IDirectMusicCollection;
- pNext: PDMUS_IO_PATCH_ITEM;
- end;
- PDMUS_IO_TIMESIGNATURE_ITEM = ^TDMUS_IO_TIMESIGNATURE_ITEM;
- TDMUS_IO_TIMESIGNATURE_ITEM = record
- lTime: DWORD;
- bBeatsPerMeasure: BYTE; // beats per measure (top of time sig)
- bBeat: BYTE; // what note receives the beat (bottom of time sig.)
- // we can assume that 0 means 256th note
- wGridsPerBeat: WORD; // grids per beat
- end;
- PDMUS_SUBCHORD = ^TDMUS_SUBCHORD;
- TDMUS_SUBCHORD = record
- dwChordPattern: DWORD; // Notes in the subchord
- dwScalePattern: DWORD; // Notes in the scale
- dwInversionPoints: DWORD; // Where inversions can occur
- dwLevels: DWORD; // Which levels are supported by this subchord
- bChordRoot: BYTE; // Root of the subchord
- bScaleRoot: BYTE; // Root of the scale
- end;
- PDMUS_CHORD_PARAM = ^TDMUS_CHORD_PARAM;
- TDMUS_CHORD_PARAM = record
- wszName: array[0..15] of WCHAR;// Name of the chord
- wMeasure: WORd; // Measure this falls on
- bBeat: BYTE; // Beat this falls on
- bSubChordCount: BYTE; // Number of chords in the list of subchords
- SubChordList: array[0..DMUS_MAXSUBCHORD-1] of TDMUS_SUBCHORD; // List of sub chords
- end;
- PDMUS_RHYTHM_PARAM = ^TDMUS_RHYTHM_PARAM;
- TDMUS_RHYTHM_PARAM = record
- TimeSig: TDMUS_TIMESIGNATURE;
- dwRhythmPattern: DWORD;
- end;
- PDMUS_TEMPO_PARAM = ^TDMUS_TEMPO_PARAM;
- TDMUS_TEMPO_PARAM = record
- mtTime: TMUSIC_TIME;
- dblTempo: DOUBLE;
- end;
- PDMUS_MUTE_PARAM = ^TDMUS_MUTE_PARAM;
- TDMUS_MUTE_PARAM = record
- dwPChannel: DWORD;
- dwPChannelMap: DWORD;
- end;
- const
- // Style chunks
- DMUS_FOURCC_STYLE_FORM = 1414745412; //mmioFOURCC('D','M','S','T')
- DMUS_FOURCC_STYLE_CHUNK = 1752790131; //mmioFOURCC('s','t','y','h')
- DMUS_FOURCC_PART_LIST = 1953653104; //mmioFOURCC('p','a','r','t')
- DMUS_FOURCC_PART_CHUNK = 1752461936; //mmioFOURCC('p','r','t','h')
- DMUS_FOURCC_NOTE_CHUNK = 1702129518; //mmioFOURCC('n','o','t','e')
- DMUS_FOURCC_CURVE_CHUNK = 1702261347; //mmioFOURCC('c','r','v','e')
- DMUS_FOURCC_PATTERN_LIST = 1853125744; //mmioFOURCC('p','t','t','n')
- DMUS_FOURCC_PATTERN_CHUNK = 1752069232; //mmioFOURCC('p','t','n','h')
- DMUS_FOURCC_RHYTHM_CHUNK = 1836345458; //mmioFOURCC('r','h','t','m')
- DMUS_FOURCC_PARTREF_LIST = 1717924464; //mmioFOURCC('p','r','e','f')
- DMUS_FOURCC_PARTREF_CHUNK = 1667658352; //mmioFOURCC('p','r','f','c')
- DMUS_PLAYMODE_SCALE_ROOT = 1;
- DMUS_PLAYMODE_CHORD_ROOT = 2;
- DMUS_PLAYMODE_SCALE_INTERVALS = 4;
- DMUS_PLAYMODE_CHORD_INTERVALS = 8;
- DMUS_PLAYMODE_NONE = 16;
- DMUS_PLAYMODE_FIXED = 0;
- DMUS_PLAYMODE_FIXEDTOSCALE = DMUS_PLAYMODE_SCALE_ROOT;
- DMUS_PLAYMODE_FIXEDTOCHORD = DMUS_PLAYMODE_CHORD_ROOT;
- DMUS_PLAYMODE_PEDALPOINT = (DMUS_PLAYMODE_SCALE_ROOT or DMUS_PLAYMODE_SCALE_INTERVALS);
- DMUS_PLAYMODE_PURPLEIZED = (DMUS_PLAYMODE_SCALE_INTERVALS or DMUS_PLAYMODE_CHORD_INTERVALS or DMUS_PLAYMODE_CHORD_ROOT);
- DMUS_PLAYMODE_NORMALCHORD = (DMUS_PLAYMODE_CHORD_ROOT or DMUS_PLAYMODE_CHORD_INTERVALS);
- type
- PDMUS_IO_TIMESIG = ^TDMUS_IO_TIMESIG;
- TDMUS_IO_TIMESIG = record
- // Time signatures define how many beats per measure, which note receives
- // the beat, and the grid resolution.
- bBeatsPerMeasure: BYTE; // beats per measure (top of time sig)
- bBeat: BYTE; // what note receives the beat (bottom of time sig.)
- // we can assume that 0 means 256th note
- wGridsPerBeat: WORD; // grids per beat
- end;
- PDMUS_IO_STYLE = ^TDMUS_IO_STYLE;
- TDMUS_IO_STYLE = record
- timeSig: TDMUS_IO_TIMESIG; // Styles have a default Time Signature
- dblTempo: DOUBLE;
- end;
- PDMUS_IO_VERSION = ^TDMUS_IO_VERSION;
- TDMUS_IO_VERSION = record
- dwVersionMS: DWORD; // Version # high-order 32 bits
- dwVersionLS: DWORD; // Version # low-order 32 bits
- end;
- PDMUS_IO_PATTERN = ^TDMUS_IO_PATTERN;
- TDMUS_IO_PATTERN = record
- timeSig: TDMUS_IO_TIMESIG;// Patterns can override the Style's Time sig.
- bGrooveBottom: BYTE; // bottom of groove range
- bGrooveTop: BYTE; // top of groove range
- wEmbellishment: WORD; // Fill, Break, Intro, End, Normal, Motif
- wNbrMeasures: WORD; // length in measures
- end;
- PDMUS_IO_STYLEPART = ^TDMUS_IO_STYLEPART;
- TDMUS_IO_STYLEPART = record
- tieSig: TDMUS_IO_TIMESIG; // can override pattern's
- dwVariationChoices: array[0..31] of DWORD; // MOAW choice bitfield
- guidPartID: TGUID; // identifies the part
- wNbrMeasures: WORD; // length of the Part
- bPlayModeFlags: BYTE; // see PLAYMODE flags
- bInvertUpper: BYTE; // inversion upper limit
- bInvertLower: BYTE; // inversion lower limit
- end;
- PDMUS_IO_PARTREF = ^TDMUS_IO_PARTREF;
- TDMUS_IO_PARTREF = record
- guidPartID: TGUID; // unique ID for matching up with parts
- wLogicalPartID: WORD; // corresponds to port/device/midi channel
- bVariationLockID: BYTE; // parts with the same ID lock variations.
- // high bit is used to identify master Part
- bSubChordLevel: BYTE; // tells which sub chord level this part wants
- bPriority: BYTE; // 256 priority levels. Parts with lower priority
- // aren't played first when a device runs out of
- // notes
- bRandomVariation: BYTE; // when set, matching variations play in random order
- // when clear, matching variations play sequentially
- end;
- PDMUS_IO_STYLENOTE = ^TDMUS_IO_STYLENOTE;
- TDMUS_IO_STYLENOTE = record
- mtGridStart: TMUSIC_TIME; // when this note occurs
- dwVariation: DWORD; // variation bits
- mtDuration: TMUSIC_TIME; // how long this note lasts
- nTimeOffset: Smallint; // offset from mtGridStart
- wMusicValue: WORD; // Position in scale.
- bVelocity: BYTE; // Note velocity.
- bTimeRange: BYTE; // Range to randomize start time.
- bDurRange: BYTE; // Range to randomize duration.
- bVelRange: BYTE; // Range to randomize velocity.
- bInversionID: BYTE; // Identifies inversion group to which this note belongs
- bPlayModeFlags: BYTE; // Can override part
- end;
- PDMUS_IO_STYLECURVE = ^TDMUS_IO_STYLECURVE;
- TDMUS_IO_STYLECURVE = record
- mtGridStart: TMUSIC_TIME; // when this curve occurs
- dwVariation: DWORd; // variation bits
- mtDuration: TMUSIC_TIME; // how long this curve lasts
- mtResetDuration: TMUSIC_TIME;// how long after the end of the curve to reset the curve
- nTimeOffset: Smallint; // offset from mtGridStart
- nStartValue: Smallint; // curve's start value
- nEndValue: Smallint; // curve's end value
- nResetValue: Smallint; // the value to which to reset the curve
- bEventType: BYTE; // type of curve
- bCurveShape: BYTE; // shape of curve
- bCCData: BYTE; // CC#
- bFlags: BYTE; // Bit 1=TRUE means to send nResetValue. Otherwise, don't.
- // Other bits are reserved.
- end;
- (*******************************************************************************
- RIFF
- (
- 'STYL' // Style
- <styh-ck> // Style header chunk
- <guid-ck> // Every Style has a GUID
- [<INFO-list>] // Name, author, copyright info., comments
- [<vers-ck>] // version chunk
- <part-list>... // List of parts in the Style, used by patterns
- <pttn-list>... // List of patterns in the Style
- <DMBD-form>... // List of bands in the Style
- [<motf-list>] // List of motifs in the Style
- )
- // <styh-ck>
- styh
- (
- <DMUS_IO_STYLE>
- )
- // <guid-ck>
- guid
- (
- <GUID>
- )
- // <vers-ck>
- vers
- (
- <DMUS_IO_VERSION>
- )
- // <part-list>
- LIST
- (
- 'part'
- <prth-ck> // Part header chunk
- [<INFO-list>]
- [<note-ck>] // List of notes in Part
- [<crve-ck>] // List of curves in Part
- )
- // <orth-ck>
- prth
- (
- <DMUS_IO_STYLEPART>
- )
- // <note-ck>
- 'note'
- (
- // sizeof DMUS_IO_STYLENOTE:DWORD
- <DMUS_IO_STYLENOTE>...
- )
- // <crve-ck>
- 'crve'
- (
- // sizeof DMUS_IO_STYLECURVE:DWORD
- <DMUS_IO_STYLECURVE>...
- )
- // <pttn-list>
- LIST
- (
- 'pttn'
- <ptnh-ck> // Pattern header chunk
- <rhtm-ck> // List of rhythms for chord matching
- [<INFO-list>]
- <pref-list>... // List of part reference id's
- )
- // <ptnh-ck>
- ptnh
- (
- <DMUS_IO_PATTERN>
- )
- // <rhtm-ck>
- 'rhtm'
- (
- // DWORD's representing rhythms for chord matching based on number
- // of measures in the pattern
- )
- // pref-list
- LIST
- (
- 'pref'
- <prfc-ck> // part ref chunk
- )
- // <prfc-ck>
- prfc
- (
- <DMUS_IO_PARTREF>
- )
- *******************************************************************************)
- const
- // Chord and command file formats
- DMUS_FOURCC_CHORDTRACK_LIST = 1685221219; // mmioFOURCC('c','o','r','d')
- DMUS_FOURCC_CHORDTRACKHEADER_CHUNK = 1751413347; // mmioFOURCC('c','r','d','h')
- DMUS_FOURCC_CHORDTRACKBODY_CHUNK = 1650750051; // mmioFOURCC('c','r','d','b')
- DMUS_FOURCC_COMMANDTRACK_CHUNK = 1684958563; // mmioFOURCC('c','m','n','d')
- type
- PDMUS_IO_CHORD = ^TDMUS_IO_CHORD;
- TDMUS_IO_CHORD = record
- wszName: array[0..15]of WCHAR;// Name of the chord
- mtTime: TMUSIC_TIME; // Time of this chord
- wMeasure: WORD; // Measure this falls on
- bBeat: BYTE; // Beat this falls on
- end;
- PDMUS_IO_SUBCHORD = ^TDMUS_IO_SUBCHORD;
- TDMUS_IO_SUBCHORD = record
- dwChordPattern: DWORD; // Notes in the subchord
- dwScalePattern: DWORD; // Notes in the scale
- dwInversionPoints: DWORD; // Where inversions can occur
- dwLevels: DWORD; // Which levels are supported by this subchord
- bChordRoot: BYTE; // Root of the subchord
- bScaleRoot: BYTE; // Root of the scale
- end;
- PDMUS_IO_COMMAND = ^TDMUS_IO_COMMAND;
- TDMUS_IO_COMMAND = record
- mtTime: TMUSIC_TIME; // Time of this command
- wMeasure: WORD; // Measure this falls on
- bBeat: BYTE; // Beat this falls on
- bCommand: BYTE; // Command type (see #defines below)
- bGrooveLevel: BYTE; // Groove level (0 if command is not a groove)
- bGrooveRange: BYTE; // Groove range
- end;
- (*******************************************************************************
- // <chrd-list>
- LIST
- (
- 'chrd'
- <crdh-ck>
- <crdb-ck> // Chord body chunk
- )
- // <crdh-ck>
- crdh
- (
- // Scale: dword (upper 8 bits for root, lower 24 for scale)
- )
- // <crdb-ck>
- crdb
- (
- // sizeof DMUS_IO_CHORD:dword
- <DMUS_IO_CHORD>
- // # of DMUS_IO_SUBCHORDS:dword
- // sizeof DMUS_IO_SUBCHORDS:dword
- // a number of <DMUS_IO_SUBCHORD>
- )
- // <cmnd-list>
- 'cmnd'
- (
- //sizeof DMUS_IO_COMMAND: DWORD
- <DMUS_IO_COMMAND>...
- )
- *******************************************************************************)
- (*******************************************************************************
- RIFF
- (
- 'DMPF' // DirectMusic Performance chunk
- [<prfh-ck>] // Performance header chunk
- [<guid-ck>] // GUID for performance
- [<vers-ck>] // Optional version info
- [<INFO-list>] // Name, author, copyright info., comments
- [<ptgl-list>] // List of Port groups, which are lists of desired port properties and
- // the PChannels to assign the Port.
- [<ntfl-list>] // List of notifications
- [<glbl-list>] // List of global data
- [<DMTG-form>] // Optional ToolGraph
- )
- // <prfh-ck>
- 'prfh' // Performance header
- (
- <DMUS_IO_PERFORMANCE_HEADER>
- )
- // <guid-ck>
- 'guid'
- (
- <GUID>
- )
- // <vers-ck>
- vers
- (
- <DMUS_IO_VERSION>
- )
- // <ptgl-list>
- LIST
- (
- 'ptgl' // List of Port groups
- <pspl-list> // List of support items for this group
- )
- // <ntfl-list>
- LIST
- (
- 'ntfl' // List of notifications
- <guid-ck> // Notification guid
- )
- // <glbl-list>
- LIST
- (
- 'glbl' // List of global data
- <glbd-ck> // The data.
- )
- // <glbd-ck>
- 'glbd'
- (
- <DMUS_IO_GLOBAL_DATA>
- )
- // <pspl-list>
- LIST
- (
- 'pspl' // List of port support items
- <psph-ck> // Port support item header chunk
- <pchn-ck> // PChannels that want this Port
- )
- // <pchn-ck>
- 'pchn'
- (
- <DMUS_IO_PCHANNELS>
- )
- // <psph-ck> // Port support item header chunk
- (
- 'psph' // Port support item header
- <DMUS_IO_PORT_SUPPORT_HEADER>
- )
- *******************************************************************************)
- // File io for DirectMusic Tool and ToolGraph objects
- const
- // RIFF ids:
- DMUS_FOURCC_TOOLGRAPH_FORM = 1196707140; // mmioFOURCC('D','M','T','G')
- DMUS_FOURCC_TOOL_LIST = 1819045748; // mmioFOURCC('t','o','l','l')
- DMUS_FOURCC_TOOL_FORM = 1280593220; // mmioFOURCC('D','M','T','L')
- DMUS_FOURCC_TOOL_CHUNK = 1751936884; // mmioFOURCC('t','o','l','h')
- // io structures:
- type
- PDMUS_IO_TOOL_HEADER = ^TDMUS_IO_TOOL_HEADER;
- TDMUS_IO_TOOL_HEADER = record
- guidClassID: TGUID; // Class id of tool.
- lIndex: DWORD; // Position in graph.
- cPChannels: DWORD; // Number of items in channels array.
- ckid: FOURCC; // chunk ID of tool's data chunk if 0 fccType valid.
- fccType: FOURCC; // list type if NULL ckid valid.
- dwPChannels: array[0..0] of DWORD; // Array of PChannels, size determined by cPChannels.
- end;
- (*******************************************************************************
- RIFF
- (
- 'DMTG' // DirectMusic ToolGraph chunk
- [<guid-ck>] // GUID for ToolGraph
- [<vers-ck>] // Optional version info
- [<INFO-list>] // Name, author, copyright info., comments
- <toll-list> // List of Tools
- )
- // <guid-ck>
- 'guid'
- (
- <GUID>
- )
- // <vers-ck>
- vers
- (
- <DMUS_IO_VERSION>
- )
- // <toll-list>
- LIST
- (
- 'toll' // List of tools
- <DMTL-form>... // Each tool is encapsulated in a RIFF chunk
- )
- // <DMTL-form> // Tools can be embedded in a graph or stored as separate files.
- RIFF
- (
- 'DMTL'
- <tolh-ck>
- [<guid-ck>] // Optional GUID for tool object instance (not to be confused with Class id in track header)
- [<vers-ck>] // Optional version info
- [<INFO-list>] // Optional name, author, copyright info., comments
- [<data>] // Tool data. Must be a RIFF readable chunk.
- )
- // <tolh-ck> // Tool header chunk
- (
- 'tolh'
- <DMUS_IO_TOOL_HEADER> // Tool header
- )
- *******************************************************************************)
- // File io for DirectMusic Band Track object
- const
- // RIFF ids:
- DMUS_FOURCC_BANDTRACK_FORM = 1413631300; // mmioFOURCC('D','M','B','T')
- DMUS_FOURCC_BANDTRACK_CHUNK = 1752458338; // mmioFOURCC('b','d','t','h')
- DMUS_FOURCC_BANDS_LIST = 1818518124; // mmioFOURCC('l','b','d','l')
- DMUS_FOURCC_BAND_LIST = 1684955756; // mmioFOURCC('l','b','n','d')
- DMUS_FOURCC_BANDITEM_CHUNK = 1751737442; // mmioFOURCC('b','d','i','h')
- // io structures
- type
- PDMUS_IO_BAND_TRACK_HEADER = ^TDMUS_IO_BAND_TRACK_HEADER;
- TDMUS_IO_BAND_TRACK_HEADER = record
- bAutoDownload: BOOL; // Determines if Auto-Download is enabled.
- end;
- PDMUS_IO_BAND_ITEM_HEADER = ^TDMUS_IO_BAND_ITEM_HEADER;
- TDMUS_IO_BAND_ITEM_HEADER = record
- lBandTime: TMUSIC_TIME; // Position in track list.
- end;
- (*******************************************************************************
- RIFF
- (
- 'DMBT' // DirectMusic Band Track form-type
- [<bdth-ck>] // Band track header
- [<guid-ck>] // GUID for band track
- [<vers-ck>] // Optional version info
- [<INFO-list>] // Name, author, copyright info., comments
- <lbdl-list> // List of Band Lists
- )
- // <bnth-ck>
- 'bdth'
- (
- <DMUS_IO_BAND_TRACK_HEADER>
- )
- // <guid-ck>
- 'guid'
- (
- <GUID>
- )
- // <vers-ck>
- vers
- (
- <DMUS_IO_VERSION>
- )
- // <lbdl-list>
- LIST
- (
- 'lbdl' // List of bands
- <lbnd-list> // Each band is encapsulated in a list
- )
- // <lbnd-list>
- LIST
- (
- 'lbnd'
- <bdih-ck>
- <DMBD-form> // Band
- )
- // <bdih-ck> // band item header
- (
- <DMUS_IO_BAND_ITEM_HEADER> // Band item header
- )
- *******************************************************************************)
- // File io for DirectMusic Band object
- const
- // RIFF ids:
- DMUS_FOURCC_BAND_FORM = 1145195844; // mmioFOURCC('D','M','B','D')
- DMUS_FOURCC_INSTRUMENTS_LIST = 1818845804; // mmioFOURCC('l','b','i','l')
- DMUS_FOURCC_INSTRUMENT_LIST = 1852400236; // mmioFOURCC('l','b','i','n')
- DMUS_FOURCC_INSTRUMENT_CHUNK = 1936615778; // mmioFOURCC('b','i','n','s')
- const
- // Flags for DMUS_IO_INSTRUMENT
- DMUS_IO_INST_PATCH = (1 shl 0); // dwPatch is valid.
- DMUS_IO_INST_BANKSELECT_MSB = (1 shl 1); // dwPatch contains a valid Bank Select MSB part
- DMUS_IO_INST_BANKSELECT_LSB = (1 shl 2); // dwPatch contains a valid Bank Select LSB part
- DMUS_IO_INST_ASSIGN_PATCH = (1 shl 3); // dwAssignPatch is valid
- DMUS_IO_INST_NOTERANGES = (1 shl 4); // dwNoteRanges is valid
- DMUS_IO_INST_PAN = (1 shl 5); // bPan is valid
- DMUS_IO_INST_VOLUME = (1 shl 6); // bVolume is valid
- DMUS_IO_INST_TRANSPOSE = (1 shl 7); // nTranspose is valid
- DMUS_IO_INST_GM = (1 shl 8); // Instrument is from GM collection
- DMUS_IO_INST_GS = (1 shl 9); // Instrument is from GS collection
- DMUS_IO_INST_VPATCH = (1 shl 10); // Instrument dwPatch is a virtual patch
- // io structures
- type
- PDMUS_IO_INSTRUMENT = ^TDMUS_IO_INSTRUMENT;
- TDMUS_IO_INSTRUMENT = record
- dwPatch: DWORD; // MSB, LSB and Program change to define instrument
- dwAssignPatch: DWORD; // MSB, LSB and Program change to assign to instrument when downloading
- dwNoteRanges: array[0..3] of DWORD;// 128 bits; one for each MIDI note instrument needs to able to play
- dwPChannel: DWORD; // PChannel instrument plays on
- dwFlags: DWORD; // DMUS_IO_INST_ flags
- bPan: Byte; // Pan for instrument
- bVolume: Byte; // Volume for instrument
- nTranspose: Smallint; // Number of semitones to transpose notes
- end;
- (*******************************************************************************
- // <DMBD-form> bands can be embedded in other forms
- RIFF
- (
- 'DMBD' // DirectMusic Band chunk
- [<guid-ck>] // GUID for band
- [<vers-ck>] // Optional version info
- [<INFO-list>] // Name, author, copyright info., comments
- <lbil-list> // List of Instruments
- )
- // <guid-ck>
- 'guid'
- (
- <GUID>
- )
- // <vers-ck>
- vers
- (
- <DMUS_IO_VERSION>
- )
- // <lbil-list>
- LIST
- (
- 'lbil' // List of instruments
- <lbin-list> // Each instrument is encapsulated in a list
- )
- // <lbin-list>
- LIST
- (
- 'lbin'
- <bins-ck>
- [<DMRF-list>] // Optional reference to DLS Collection file.
- )
- // <bins-ck> // Instrument chunk
- (
- 'bins'
- <DMUS_IO_INSTRUMENT> // Instrument header
- )
- *******************************************************************************)
- // File io for DirectMusic Segment object
- const
- // RIFF ids:
- DMUS_FOURCC_SEGMENT_FORM = 1196641604; // mmioFOURCC('D','M','S','G')
- DMUS_FOURCC_SEGMENT_CHUNK = 1751606643; // mmioFOURCC('s','e','g','h')
- DMUS_FOURCC_TRACK_LIST = 1818980980; // mmioFOURCC('t','r','k','l')
- DMUS_FOURCC_TRACK_FORM = 1263816004; // mmioFOURCC('D','M','T','K')
- DMUS_FOURCC_TRACK_CHUNK = 1751872116; // mmioFOURCC('t','r','k','h')
- // io structures:
- type
- PDMUS_IO_SEGMENT_HEADER = ^TDMUS_IO_SEGMENT_HEADER;
- TDMUS_IO_SEGMENT_HEADER = record
- dwRepeats: DWORD; // Number of repeats. By default, 0.
- mtLength: TMUSIC_TIME; // Length, in music time.
- mtPlayStart: TMUSIC_TIME; // Start of playback. By default, 0.
- mtLoopStart: TMUSIC_TIME; // Start of looping portion. By default, 0.
- mtLoopEnd : TMUSIC_TIME; // End of loop. Must be greater than dwPlayStart. By default equal to length.
- dwResolution: DWORD; // Default resolution.
- end;
- PDMUS_IO_TRACK_HEADER = ^TDMUS_IO_TRACK_HEADER;
- TDMUS_IO_TRACK_HEADER = record
- guidClassID: TGUID; //* Class id of track.
- dwPosition: DWORD; // Position in track list.
- dwGroup: DWORD; // Group bits for track.
- ckid: FOURCC; // chunk ID of track's data chunk if 0 fccType valid.
- fccType: FOURCC; // list type if NULL ckid valid
- end;
- (*******************************************************************************
- RIFF
- (
- 'DMSG' // DirectMusic Segment chunk
- <segh-ck> // Segment header chunk
- [<guid-ck>] // GUID for segment
- [<vers-ck>] // Optional version info
- [<INFO-list>] // Name, author, copyright info., comments
- <trkl-list> // List of Tracks
- [<DMTG-form>] // Optional ToolGraph
- )
- // <segh-ck>
- 'segh'
- (
- <DMUS_IO_SEGMENT_HEADER>
- )
-
- // <guid-ck>
- 'guid'
- (
- <GUID>
- )
- // <vers-ck>
- vers
- (
- <DMUS_IO_VERSION>
- )
- // <trkl-list>
- LIST
- (
- 'trkl' // List of tracks
- <DMTK-form>... // Each track is encapsulated in a RIFF chunk
- )
- // <DMTK-form> // Tracks can be embedded in a segment or stored as separate files.
- RIFF
- (
- 'DMTK'
- <trkh-ck>
- [<guid-ck>] // Optional GUID for track object instance (not to be confused with Class id in track header)
- [<vers-ck>] // Optional version info
- [<INFO-list>] // Optional name, author, copyright info., comments
- [<data>] // Track data. Must be a RIFF readable chunk.
- )
- // <trkh-ck> // Track header chunk
- (
- 'trkh'
- <DMUS_IO_TRACK_HEADER> // Track header
- )
- *******************************************************************************)
- // File io for DirectMusic reference chunk.
- // This is used to embed a reference to an object.
- const
- // RIFF ids:
- DMUS_FOURCC_REF_LIST = 1179798852; // mmioFOURCC('D','M','R','F')
- DMUS_FOURCC_REF_CHUNK = 1751541106; // mmioFOURCC('r','e','f','h')
- DMUS_FOURCC_DATE_CHUNK = 1702125924; // mmioFOURCC('d','a','t','e')
- DMUS_FOURCC_NAME_CHUNK = 1701667182; // mmioFOURCC('n','a','m','e')
- DMUS_FOURCC_FILE_CHUNK = 1701603686; // mmioFOURCC('f','i','l','e')
- type
- PDMUS_IO_REFERENCE = ^TDMUS_IO_REFERENCE;
- TDMUS_IO_REFERENCE = record
- guidClassID: TGUID; // Class id is always required.
- dwValidData: DWORD; // Flags.
- end;
- (*******************************************************************************
- LIST
- (
- 'DMRF' // DirectMusic Reference chunk
- <refh-ck> // Reference header chunk
- [<guid-ck>] // Optional object GUID.
- [<date-ck>] // Optional file date.
- [<name-ck>] // Optional name.
- [<file-ck>] // Optional file name.
- [<catg-ck>] // Optional category name.
- [<vers-ck>] // Optional version info.
- )
- // <refh-ck>
- 'refh'
- (
- <DMUS_IO_REFERENCE>
- )
- // <guid-ck>
- 'guid'
- (
- <GUID>
- )
- // <date-ck>
- date
- (
- <FILETIME>
- )
- // <name-ck>
- name
- (
- // Name, stored as NULL terminated string of WCHARs
- )
- // <file-ck>
- file
- (
- // File name, stored as NULL terminated string of WCHARs
- )
- // <catg-ck>
- catg
- (
- // Category name, stored as NULL terminated string of WCHARs
- )
- // <vers-ck>
- vers
- (
- <DMUS_IO_VERSION>
- )
- *******************************************************************************)
- // File i/o for DirectMusic Performance object
- const
- // RIFF ids:
- DMUS_FOURCC_PERFORMANCE_FORM = 1179667780; //mmioFOURCC('D','M','P','F')
- DMUS_FOURCC_PERFORMANCE_CHUNK = 1751544432; //mmioFOURCC('p','r','f','h')
- DMUS_FOURCC_PERF_PORTGROUP_LIST = 1818719344; //mmioFOURCC('p','t','g','l')
- DMUS_FOURCC_PERF_NOTIFICATION_LIST = 1818653806; //mmioFOURCC('n','t','f','l')
- DMUS_FOURCC_PERF_GLOBAL_DATA_LIST = 1818389607; //mmioFOURCC('g','l','b','l')
- DMUS_FOURCC_PERF_SUPPORT_LIST = 1819308912; //mmioFOURCC('p','s','p','l')
- DMUS_FOURCC_PERF_SUPPORT_CHUNK = 1752200048; //mmioFOURCC('p','s','p','h')
- DMUS_FOURCC_PERF_PCHANNELS_CHUNK = 1852334960; //mmioFOURCC('p','c','h','n')
- // io structures:
- type
- PDMUS_IO_PERFORMANCE_HEADER = ^TDMUS_IO_PERFORMANCE_HEADER;
- TDMUS_IO_PERFORMANCE_HEADER = record
- dwPrepareTime: DWORD; // time ahead, in ms, to transport
- dwPrePlayTime: DWORD; // time ahead, in ms, of latency clock to pack events
- end;
- // identifies the type of data in DMUS_IO_USSupportData
- TDMUS_SUPPORTTYPE = (DMUS_ST_BOOL,DMUS_ST_DWORD,DMUS_ST_LONG);
- PDMUS_IO_SUPPORT_DATA = ^TDMUS_IO_SUPPORT_DATA;
- TDMUS_IO_SUPPORT_DATA = record // data used in DMUS_IO_USPortSupportHeader
- typ: TDMUS_SUPPORTTYPE; // identifies which member of the union is valid
- case integer of
- 0: (fVal: BOOL);
- 1: (dwVal: DWORD);
- 2: (lVal: LONGINT);
- end;
- PDMUS_IO_PORT_SUPPORT_HEADER = ^TDMUS_IO_PORT_SUPPORT_HEADER;
- TDMUS_IO_PORT_SUPPORT_HEADER = record // identifies desired port properties
- guidID : TGUID; // Support ID.
- lowData : TDMUS_IO_SUPPORT_DATA; // Low range of data, inclusive. If BOOL type,
- // ignore highData. Otherwise, combine lowData
- // and highData into a range.
- highData: TDMUS_IO_SUPPORT_DATA // High range of data, inclusive
- end;
- PDMUS_IO_PCHANNELS = ^TDMUS_IO_PCHANNELS;
- TDMUS_IO_PCHANNELS = record // Holds the PChannels to assign to a Port
- cPChannels: DWORD; // Number of items in channels array.
- adwPChannels: array[0..0] of DWORD; // Array of PChannels, size determined by cPChannels.
- end;
- PDMUS_IO_GLOBAL_DATA = ^TDMUS_IO_GLOBAL_DATA;
- TDMUS_IO_GLOBAL_DATA = record // Holds the global data information
- guid: TGUID; // The global data guid
- dwSize: DWORD; // The size of the data
- acData: array[0..0]of Char;// Holds the data of the global data, size determine by dwSize
- end;
- // personalities
- const
- // runtime chunks
- DMUS_FOURCC_PERSONALITY_FORM = 1380994372; //mmioFOURCC('D','M','P','R')
- DMUS_FOURCC_IOPERSONALITY_CHUNK = 1752327536; //mmioFOURCC('p','e','r','h')
- DMUS_FOURCC_SUBCHORD_CHUNK = 1952737379; //mmioFOURCC('c','h','d','t')
- DMUS_FOURCC_CHORDENTRY_CHUNK = 1751476323; //mmioFOURCC('c','h','e','h')
- DMUS_FOURCC_SUBCHORDID_CHUNK = 1852007027; //mmioFOURCC('s','b','c','n')
- DMUS_FOURCC_IONEXTCHORD_CHUNK = 1685218158; //mmioFOURCC('n','c','r','d')
- DMUS_FOURCC_NEXTCHORDSEQ_CHUNK = 1903387502; //mmioFOURCC('n','c','s','q')
- DMUS_FOURCC_IOSIGNPOST_CHUNK = 1752395891; //mmioFOURCC('s','p','s','h')
- DMUS_FOURCC_CHORDNAME_CHUNK = 1296125513; //mmioFOURCC('I','N','A','M')
- // runtime list chunks
- DMUS_FOURCC_CHORDENTRY_LIST = 1701800035; //mmioFOURCC('c','h','o','e')
- DMUS_FOURCC_CHORDMAP_LIST = 1885433187; //mmioFOURCC('c','m','a','p')
- DMUS_FOURCC_CHORD_LIST = 1685219427; //mmioFOURCC('c','h','r','d')
- DMUS_FOURCC_CHORDPALETTE_LIST = 1819306083; //mmioFOURCC('c','h','p','l')
- DMUS_FOURCC_CADENCE_LIST = 1701077347; //mmioFOURCC('c','a','d','e')
- DMUS_FOURCC_SIGNPOSTITEM_LIST = 1953722483; //mmioFOURCC('s','p','s','t')
- DMUS_FOURCC_SIGNPOST_LIST = 1903390835; //mmioFOURCC('s','p','s','q')
- // run time data structs
- type
- PDMUS_IO_PERSONALITY = ^TDMUS_IO_PERSONALITY;
- TDMUS_IO_PERSONALITY = record
- wszLoadName: array[0..19] of WCHAR;
- dwScalePattern: DWORD;
- dwFlags: DWORD;
- end;
- PDMUS_IO_PERS_SUBCHORD = ^TDMUS_IO_PERS_SUBCHORD;
- TDMUS_IO_PERS_SUBCHORD = record
- dwChordPattern: DWORD;
- dwScalePattern: DWORD;
- dwInvertPattern: DWORD;
- bChordRoot: BYTE;
- bScaleRoot: BYTE;
- wCFlags: WORD;
- dwLevels: DWORD;// parts or which subchord levels this chord supports
- end;
- PDMUS_IO_CHORDENTRY = ^TDMUS_IO_CHORDENTRY;
- TDMUS_IO_CHORDENTRY = record
- dwFlags: DWORD;
- wConnectionID: WORD; // replaces runtime "pointer to this"
- end;
- PDMUS_IO_NEXTCHORD = ^TDMUS_IO_NEXTCHORD;
- TDMUS_IO_NEXTCHORD = record
- dwFlags: DWORD;
- nWeight: WORD;
- wMinBeats: WORD;
- wMaxBeats: WORd;
- wConnectionID: WORD; // points to an ioChordEntry
- end;
- PDMUS_IO_PERS_SIGNPOST = ^TDMUS_IO_PERS_SIGNPOST;
- TDMUS_IO_PERS_SIGNPOST = record
- dwChords: DWORD; // 1bit per group
- dwFlags: DWORD;
- end;
- (*******************************************************************************
- RIFF
- (
- 'DMPR'
- <perh-ck> // Personality header chunk
- [<guid-ck>] // guid chunk
- [<vers-ck>] // version chunk (two DWORDS)
- <INFO-list> // standard MS Info chunk
- <chdt-ck> // subchord database
- <chpl-list> // chord palette
- <cmap-list> // chord map
- <spst-list> // signpost list
- )
- <chdt> ::= chdt(<cbChordSize::WORD> <ioSubChord> ... )
- <chpl-list> ::= LIST('chpl'
- <chrd-list> ... // chord definition
- )
- <chrd-list> ::= LIST('chrd'
- <INAM-ck> // name of chord in wide char format
- <sbcn-ck> // list of subchords composing chord
- [<ched-ck>] // optional chord edit flags
- )
- <cmap-list> ::= LIST('cmap' <choe-list> )
- <choe-list> ::= LIST('choe'
- <cheh-ck> // chord entry data
- <chrd-list> // chord definition
- <ncsq-ck> // connecting(next) chords
- )
- <spst-list> ::= LIST('spst'
- <spsh-ck>
- <chrd-list>
- [<cade-list>]
- )
- <cade-list> ::= LIST('cade' <chrd-list> ...)
- <sbcn-ck> ::= sbcn(<cSubChordID:WORD>)
- <cheh-ck> ::= cheh(i<DMUS_IO_CHORDENTRY>)
- <ncrd-ck> ::= ncrd(<DMUS_IO_NEXTCHORD>)
- <ncsq-ck> ::= ncsq(<wNextChordSize:WORD> <DMUS_IO_NEXTCHORD>...)
- <spsh-ck> ::= spsh(<DMUS_IO_PERS_SIGNPOST>)
- *******************************************************************************)
- const
- // Signpost tracks
- DMUS_FOURCC_SIGNPOST_TRACK_CHUNK = 1886283635; // mmioFOURCC( 's', 'g', 'n', 'p' )
- type
- PDMUS_IO_SIGNPOST = ^TDMUS_IO_SIGNPOST;
- TDMUS_IO_SIGNPOST = record
- mtTime: TMUSIC_TIME;
- dwChords: DWORD;
- wMeasure: WORD;
- end;
- (*******************************************************************************
- // <sgnp-list>
- 'sgnp'
- (
- //sizeof DMUS_IO_SIGNPOST: DWORD
- <DMUS_IO_SIGNPOST>...
- )
- *******************************************************************************)
- const
- DMUS_FOURCC_MUTE_CHUNK = 1702131053; // mmioFOURCC('m','u','t','e')
- type
- PDMUS_IO_MUTE = ^TDMUS_IO_MUTE;
- TDMUS_IO_MUTE = record
- mtTime: TMUSIC_TIME;
- dwPChannel: DWORD;
- dwPChannelMap: DWORD;
- end;
- (*******************************************************************************
- // <mute-list>
- 'mute'
- (
- //sizeof DMUS_IO_MUTE:DWORD
- <DMUS_IO_MUTE>...
- )
- *******************************************************************************)
- // Used for both style and personality tracks
- const
- DMUS_FOURCC_TIME_STAMP_CHUNK = 1886221427; // mmioFOURCC('s', 't', 'm', 'p')
- // Style tracks
- DMUS_FOURCC_STYLE_TRACK_LIST = 1920234611; // mmioFOURCC('s', 't', 't', 'r')
- DMUS_FOURCC_STYLE_REF_LIST = 1718776947; // mmioFOURCC('s', 't', 'r', 'f')
- (*******************************************************************************
- // <sttr-list>
- LIST('sttr'
- (
- // some number of <strf-list>
- )
- // <strf-list>
- LIST('strf'
- (
- <stmp-ck>
- <DMRF>
- )
- // <stmp-ck> defined in ..dmcomposdmcompp.h
- *******************************************************************************)
- const
- // Personality tracks
- DMUS_FOURCC_PERS_TRACK_LIST = 1920231024; //mmioFOURCC('p', 'f', 't', 'r')
- DMUS_FOURCC_PERS_REF_LIST = 1718773360; //mmioFOURCC('p', 'f', 'r', 'f')
- (*
- // <pftr-list>
- LIST('pftr'
- (
- // some number of <pfrf-list>
- )
- // <pfrf-list>
- LIST('pfrf'
- (
- <stmp-ck>
- <DMRF>
- )
- // <stmp-ck>
- 'stmp'
- (
- // time:DWORD
- )
- *******************************************************************************)
- const
- DMUS_FOURCC_TEMPO_TRACK = 1920230772; // mmioFOURCC('t','e','t','r')
- (*******************************************************************************
- // tempo list
- 'tetr'
- (
- // sizeof DMUS_IO_TEMPO_ITEM: DWORD
- <DMUS_IO_TEMPO_ITEM>...
- )
- *******************************************************************************)
- const
- DMUS_FOURCC_SEQ_TRACK = 1920233843;// mmioFOURCC('s','q','t','r')
- (*******************************************************************************
- // sequence track
- 'sqtr'
- (
- // sizeof DMUS_IO_SEQ_ITEM: DWORD
- <DMUS_IO_SEQ_ITEM>...
- )
- *******************************************************************************)
- const
- DMUS_FOURCC_CURVE_TRACK = 1920235107;// mmioFOURCC('c','v','t','r')
- (*******************************************************************************
- // curve track
- 'cvtr'
- (
- // sizeof DMUS_IO_CURVE_ITEM: DWORD
- <DMUS_IO_CURVE_ITEM>...
- )
- *******************************************************************************)
- const
- DMUS_FOURCC_SYSEX_TRACK = 2020833651;// mmioFOURCC('s','y','s','x')
- (*******************************************************************************
- // sysex track
- 'sysx'
- (
- // list of:
- // {
- // time of the sys-ex message: long
- // length of the sys-ex data: DWORD
- // sys-ex: data
- // }...
- )
- *******************************************************************************)
- const
- DMUS_FOURCC_TIMESIGNATURE_TRACK = 1936550260; //mmioFOURCC('t','i','m','s');
- (*******************************************************************************
- // time signature track
- 'tims'
- (
- // size of DMUS_IO_TIMESIGNATURE_ITEM : DWORD
- <DMUS_IO_TIMESIGNATURE_ITEM>...
- )
- *)
- implementation
- end.