⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 directmusic.pas

📁 3D GameStudio 的Delphi开发包
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    ulCopyrightIdx: Cardinal;         // If zero no Copyright information associated with the instrument
    ulFlags: Cardinal;
  end;
  {$EXTERNALSYM _DMUS_INSTRUMENT}
  DMUS_INSTRUMENT = _DMUS_INSTRUMENT;
  {$EXTERNALSYM DMUS_INSTRUMENT}
  TDMusInstrument = _DMUS_INSTRUMENT;

  PDMusRegion = ^TDMusRegion;
  _DMUS_REGION = record
    RangeKey: TRGNRange;
    RangeVelocity: TRGNRange;
    fusOptions: Word;
    usKeyGroup: Word;
    ulRegionArtIdx: Cardinal;         // If zero the region does not have an articulation
    ulNextRegionIdx: Cardinal;        // If zero no more regions
    ulFirstExtCkIdx: Cardinal;        // 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: array [0..0] of TWLoop;
  end;
  {$EXTERNALSYM _DMUS_REGION}
  DMUS_REGION = _DMUS_REGION;
  {$EXTERNALSYM DMUS_REGION}
  TDMusRegion = _DMUS_REGION;

  PDMusLFOParams = ^TDMusLFOParams;
  _DMUS_LFOPARAMS = record
    pcFrequency: PCENT;
    tcDelay: TCENT;
    gcVolumeScale: GCENT;
    pcPitchScale: PCENT;
    gcMWToVolume: GCENT;
    pcMWToPitch: PCENT;
  end;
  {$EXTERNALSYM _DMUS_LFOPARAMS}
  DMUS_LFOPARAMS = _DMUS_LFOPARAMS;
  {$EXTERNALSYM DMUS_LFOPARAMS}
  TDMusLFOParams = _DMUS_LFOPARAMS;

  PDMusVEGParams = ^TDMusVEGParams;
  _DMUS_VEGPARAMS = record
    tcAttack: TCENT;
    tcDecay: TCENT;
    ptSustain: PERCENT;
    tcRelease: TCENT;
    tcVel2Attack: TCENT;
    tcKey2Decay: TCENT;
  end;
  {$EXTERNALSYM _DMUS_VEGPARAMS}
  DMUS_VEGPARAMS = _DMUS_VEGPARAMS;
  {$EXTERNALSYM DMUS_VEGPARAMS}
  TDMusVEGParams = _DMUS_VEGPARAMS;

  PDMusPEGParams = ^TDMusPEGParams;
  _DMUS_PEGPARAMS = record
    tcAttack: TCENT;
    tcDecay: TCENT;
    ptSustain: PERCENT;
    tcRelease: TCENT;
    tcVel2Attack: TCENT;
    tcKey2Decay: TCENT;
    pcRange: PCENT;
  end;
  {$EXTERNALSYM _DMUS_PEGPARAMS}
  DMUS_PEGPARAMS = _DMUS_PEGPARAMS;
  {$EXTERNALSYM DMUS_PEGPARAMS}
  TDMusPEGParams = _DMUS_PEGPARAMS;

  PDMusMSCParams = ^TDMusMSCParams;
  _DMUS_MSCPARAMS = record
    ptDefaultPan: PERCENT;
  end;
  {$EXTERNALSYM _DMUS_MSCPARAMS}
  DMUS_MSCPARAMS = _DMUS_MSCPARAMS;
  {$EXTERNALSYM DMUS_MSCPARAMS}
  TDMusMSCParams = _DMUS_MSCPARAMS;

  PDMusArticParams = ^TDMusArticParams;
  _DMUS_ARTICPARAMS = record
    LFO: TDMusLFOParams;
    VolEG: TDMusVEGParams;
    PitchEG: TDMusPEGParams;
    Misc: TDMusMSCParams;
  end;
  {$EXTERNALSYM _DMUS_ARTICPARAMS}
  DMUS_ARTICPARAMS = _DMUS_ARTICPARAMS;
  {$EXTERNALSYM DMUS_ARTICPARAMS}
  TDMusArticParams = _DMUS_ARTICPARAMS;

  PDMusArticulation = ^TDMusArticulation;
  _DMUS_ARTICULATION = record (* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT format. *)
    ulArt1Idx: Cardinal;              // DLS Level 1 articulation chunk
    ulFirstExtCkIdx: Cardinal;        // 3rd party extenstion chunks associated with the articulation
  end;
  {$EXTERNALSYM _DMUS_ARTICULATION}
  DMUS_ARTICULATION = _DMUS_ARTICULATION;
  {$EXTERNALSYM DMUS_ARTICULATION}
  TDMusArticulation = _DMUS_ARTICULATION;

  PDMusArticulation2 = ^TDMusArticulation2;
  _DMUS_ARTICULATION2 = record (* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT2 format. *)
    ulArtIdx: Cardinal;               (* DLS Level 1/2 articulation chunk *)
    ulFirstExtCkIdx: Cardinal;        (* 3rd party extenstion chunks associated with the articulation *)
    ulNextArtIdx: Cardinal;           (* Additional articulation chunks *)
  end;
  {$EXTERNALSYM _DMUS_ARTICULATION2}
  DMUS_ARTICULATION2 = _DMUS_ARTICULATION2;
  {$EXTERNALSYM DMUS_ARTICULATION2}
  TDMusArticulation2 = _DMUS_ARTICULATION2;

const
  DMUS_MIN_DATA_SIZE = 4;
  {$EXTERNALSYM DMUS_MIN_DATA_SIZE}

type
  (*  The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK *)

  PDMusExtensionChunk = ^TDMusExtensionChunk;
  _DMUS_EXTENSIONCHUNK = record
    cbSize: Cardinal;                      (*  Size of extension chunk  *)
    ulNextExtCkIdx: Cardinal;              (*  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;
  {$EXTERNALSYM _DMUS_EXTENSIONCHUNK}
  DMUS_EXTENSIONCHUNK = _DMUS_EXTENSIONCHUNK;
  {$EXTERNALSYM DMUS_EXTENSIONCHUNK}
  TDMusExtensionChunk = _DMUS_EXTENSIONCHUNK;

  (*  The actual number is determined by cbSize of struct _DMUS_COPYRIGHT *)

  PDMusCopyright = ^TDMusCopyright;
  _DMUS_COPYRIGHT = record
    cbSize: Cardinal;                             (*  Size of copyright information *)
    byCopyright: array[0..DMUS_MIN_DATA_SIZE-1] of Byte;    (*  The actual number that follows is determined by cbSize *)
  end;
  {$EXTERNALSYM _DMUS_COPYRIGHT}
  DMUS_COPYRIGHT = _DMUS_COPYRIGHT;
  {$EXTERNALSYM DMUS_COPYRIGHT}
  TDMusCopyright = _DMUS_COPYRIGHT;

  PDMusWaveData = ^TDMusWaveData;
  _DMUS_WAVEDATA = record
    cbSize:           Cardinal;
    byData: array[0..DMUS_MIN_DATA_SIZE-1] of Byte;
  end;
  {$EXTERNALSYM _DMUS_WAVEDATA}
  DMUS_WAVEDATA = _DMUS_WAVEDATA;
  {$EXTERNALSYM DMUS_WAVEDATA}
  TDMusWaveData = _DMUS_WAVEDATA;

  PDMusWave = ^TDMusWave;
  _DMUS_WAVE = record
    ulFirstExtCkIdx: Cardinal;    (* If zero no 3rd party entenstion chunks associated with the wave *)
    ulCopyrightIdx: Cardinal;     (* If zero no Copyright information associated with the wave *)
    ulWaveDataIdx: Cardinal;      (* Location of actual wave data. *)
    WaveformatEx: tWAVEFORMATEX;
  end;
  {$EXTERNALSYM _DMUS_WAVE}
  DMUS_WAVE = _DMUS_WAVE;
  {$EXTERNALSYM DMUS_WAVE}
  TDMusWave = _DMUS_WAVE;

  PDMusNoteRange = ^TDMusNoteRange;
  _DMUS_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;
  {$EXTERNALSYM _DMUS_NOTERANGE}
  DMUS_NOTERANGE = _DMUS_NOTERANGE;
  {$EXTERNALSYM DMUS_NOTERANGE}
  TDMusNoteRange = _DMUS_NOTERANGE;

  PDMusWaveArtDL = ^TDMusWaveArtDL;
  _DMUS_WAVEARTDL = record
    ulDownloadIdIdx: Cardinal;    (* Download ID's of each buffer *)
    ulBus: Cardinal;              (* Playback bus *)
    ulBuffers: Cardinal;          (* Buffers *)
    ulMasterDLId: Cardinal;       (* Download ID of master voice of slave group *)
    usOptions: Word;              (* Same as DLS2 region options *)
  end;
  {$EXTERNALSYM _DMUS_WAVEARTDL}
  DMUS_WAVEARTDL = _DMUS_WAVEARTDL;
  {$EXTERNALSYM DMUS_WAVEARTDL}
  TDMusWaveArtDL = _DMUS_WAVEARTDL;

  PDMusWaveDL = ^TDMusWaveDL;
  _DMUS_WAVEDL = record
    cbWaveData: Cardinal;         (* Bytes of wave data *)
  end;
  {$EXTERNALSYM _DMUS_WAVEDL}
  DMUS_WAVEDL = _DMUS_WAVEDL;
  {$EXTERNALSYM DMUS_WAVEDL}
  TDMusWaveDL = _DMUS_WAVEDL;





(************************************************************************
*                                                                       *
*   dmerror.h -- Error codes returned by DirectMusic API's              *
*                                                                       *
*   Copyright (c) Microsoft Corporation.  All rights reserved.          *
*                                                                       *
************************************************************************)

const
  FACILITY_DIRECTMUSIC      = $878;       (* Shared with DirectSound *)
  {$EXTERNALSYM FACILITY_DIRECTMUSIC}
  DMUS_ERRBASE              = $1000;      (* Make error codes human readable in hex *)
  {$EXTERNALSYM DMUS_ERRBASE}

// #define MAKE_DMHRESULTSUCCESS(code)     MAKE_HRESULT(0, FACILITY_DIRECTMUSIC, (DMUS_ERRBASE + (code)))
function MAKE_DMHRESULTSUCCESS(Code: DWord): DWord;{$IFDEF SUPPORTS_INLINE} inline;{$ENDIF}
{$EXTERNALSYM MAKE_DMHRESULTSUCCESS}
// #define MAKE_DMHRESULTERROR(code)       MAKE_HRESULT(1, FACILITY_DIRECTMUSIC, (DMUS_ERRBASE + (code)))
function MAKE_DMHRESULTERROR(Code: DWord): DWord;{$IFDEF SUPPORTS_INLINE} inline;{$ENDIF}
{$EXTERNALSYM MAKE_DMHRESULTERROR}


const
  MAKE_DMHRESULTSUCCESS_R = (0 shl 31) or (FACILITY_DIRECTMUSIC shl 16) or DMUS_ERRBASE;
  MAKE_DMHRESULTERROR_R =   (1 shl 31) or (FACILITY_DIRECTMUSIC shl 16) or DMUS_ERRBASE;

(* DMUS_S_PARTIALLOAD
 *
 * The object could only load partially. This can happen if some components are
 * not registered properly, such as embedded tracks and tools. This can also happen
 * if some content is missing. For example, if a segment uses a DLS collection that
 * is not in the loader's current search directory.
 *)
  DMUS_S_PARTIALLOAD               = (MAKE_DMHRESULTSUCCESS_R + $091);
  {$EXTERNALSYM DMUS_S_PARTIALLOAD}

(* DMUS_S_PARTIALDOWNLOAD
 *
 * Return value from IDirectMusicBand::Download() which indicates that
 * some of the instruments safely downloaded, but others failed. This usually
 * occurs when some instruments are on PChannels not supported by the performance
 * or port.
 *)
  DMUS_S_PARTIALDOWNLOAD           = (MAKE_DMHRESULTSUCCESS_R + $092);
  {$EXTERNALSYM DMUS_S_PARTIALDOWNLOAD}

(* DMUS_S_REQUEUE
 *
 * Return value from IDirectMusicTool::ProcessPMsg() which indicates to the
 * performance that it should cue the PMsg again automatically.
 *)
  DMUS_S_REQUEUE                   = (MAKE_DMHRESULTSUCCESS_R + $200);
  {$EXTERNALSYM DMUS_S_REQUEUE}

(* DMUS_S_FREE
 *
 * Return value from IDirectMusicTool::ProcessPMsg() which indicates to the
 * performance that it should free the PMsg automatically.
 *)
  DMUS_S_FREE                      = (MAKE_DMHRESULTSUCCESS_R + $201);
  {$EXTERNALSYM DMUS_S_FREE}

(* DMUS_S_END
 *
 * Return value from IDirectMusicTrack::Play() which indicates to the
 * segment that the track has no more data after mtEnd.
 *)
  DMUS_S_END                       = (MAKE_DMHRESULTSUCCESS_R + $202);
  {$EXTERNALSYM DMUS_S_END}

(* DMUS_S_STRING_TRUNCATED
 *
 * Returned string has been truncated to fit the buffer size.
 *)
  DMUS_S_STRING_TRUNCATED          = (MAKE_DMHRESULTSUCCESS_R + $210);
  {$EXTERNALSYM DMUS_S_STRING_TRUNCATED}

(* DMUS_S_LAST_TOOL
 *
 * Returned from IDirectMusicGraph::StampPMsg(), this indicates that the PMsg
 * is already stamped with the last tool in the graph. The returned PMsg's
 * tool pointer is now NULL.
 *)
  DMUS_S_LAST_TOOL                 = (MAKE_DMHRESULTSUCCESS_R + $211);
  {$EXTERNALSYM DMUS_S_LAST_TOOL}

(* DMUS_S_OVER_CHORD
 *
 * Returned from IDirectMusicPerformance::MusicToMIDI(), this indicates
 * that no note has been calculated because the music value has the note
 * at a position higher than the top note of the chord. This applies only
 * to DMUS_PLAYMODE_NORMALCHORD play mode. This success code indicates
 * that the caller should not do anything with the note. It is not meant
 * to be played against this chord.
 *)
  DMUS_S_OVER_CHORD                = (MAKE_DMHRESULTSUCCESS_R + $212);
  {$EXTERNALSYM DMUS_S_OVER_CHORD}

(* DMUS_S_UP_OCTAVE
 *
 * Returned from IDirectMusicPerformance::MIDIToMusic(),  and
 * IDirectMusicPerformance::MusicToMIDI(), this indicates
 * that the note conversion generated a note value that is below 0,
 * so it has been bumped up one or more octaves to be in the proper
 * MIDI range of 0 through 127.
 * Note that this is valid for MIDIToMusic() when using play modes
 * DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of
 * which store MIDI values in wMusicValue. With MusicToMIDI(), it is
 * valid for all play modes.
 * Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.
 *)
  DMUS_S_UP_OCTAVE                 = (MAKE_DMHRESULTSUCCESS_R + $213);
  {$EXTERNALSYM DMUS_S_UP_OCTAVE}

(* DMUS_S_DOWN_OCTAVE
 *
 * Returned from IDirectMusicPerformance::MIDIToMusic(),  and
 * IDirectMusicPerformance::MusicToMIDI(), this indicates
 * that the note conversion generated a note value that is above 127,
 * so it has been bumped down one or more octaves to be in the proper
 * MIDI range of 0 through 127.
 * Note that this is valid for MIDIToMusic() when using play modes
 * DMUS_PLAYMODE_FIXEDTOCHORD and DMUS_PLAYMODE_FIXEDTOKEY, both of
 * which store MIDI values in wMusicValue. With MusicToMIDI(), it is
 * valid for all play modes.
 * Ofcourse, DMUS_PLAYMODE_FIXED will never return this success code.
 *)
  DMUS_S_DOWN_OCTAVE               = (MAKE_DMHRESULTSUCCESS_R + $214);
  {$EXTERNALSYM DMUS_S_DOWN_OCTAVE}

(* DMUS_S_NOBUFFERCONTROL
 *
 * Although the audio output from the port will be routed to the
 * same device as the given DirectSound buffer, buffer controls
 * such as pan and volume will not affect the output.
 *
 *)
  DMUS_S_NOBUFFERCONTROL           = (MAKE_DMHRESULTSUCCESS_R + $215);
  {$EXTERNALSYM DMUS_S_NOBUFFERCONTROL}

(* DMUS_S_GARBAGE_COLLECTED
 *
 * The requested operation was not performed because during CollectGarbage
 * the loader determined that the object had been released.
 *)
  DMUS_S_GARBAGE_COLLECTED         = (MAKE_DMHRESULTSUCCESS_R + $216);
  {$EXTERNALSYM DMUS_S_GARBAGE_COLLECTED}

(* DMUS_E_DRIVER_FAILED
 *
 * An unexpected error was returned from a device driver, indicating
 * possible failure of the driver or hardware.
 *)
  DMUS_E_DRIVER_FAILED            = (MAKE_DMHRESULTERROR_R + $0101);
  {$EXTERNALSYM DMUS_E_DRIVER_FAILED}

(* DMUS_E_PORTS_OPEN
 *
 * The requested operation cannot be performed while there are
 * instantiated ports in any process in the system.
 *)
  DMUS_E_PORTS_OPEN               = (MAKE_DMHRESULTERROR_R + $0102);
  {$EXTERNALSYM DMUS_E_PORTS_OPEN}

(* DMUS_E_DEVICE_IN_USE
 *
 * The requested device is already in use (possibly by a non-DirectMusic
 * client) and cannot be opened again.
 *)
  DMUS_E_DEVICE_IN_USE            = (MAKE_DMHRESULTERROR_R + $0103);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -