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

📄 directmusic.pas

📁 3D GameStudio 的Delphi开发包
💻 PAS
📖 第 1 页 / 共 5 页
字号:
{******************************************************************************}
{*                                                                            *}
{*  Copyright (C) Microsoft Corporation.  All Rights Reserved.                *}
{*                                                                            *}
{*  Files:      dls1.h dls2.h dmdls.h dmerror.h dmksctrl.h dmplugin.h         *}
{*              dmusicc.h dmusici.h dmusicf.h dmusbuff.h                      *}
{*  Content:    DirectMusic include files                                     *}
{*                                                                            *}
{*  DirectX 9.0 Delphi / FreePascal adaptation by Alexey Barkovoy             *}
{*  E-Mail: directx@clootie.ru                                                *}
{*                                                                            *}
{*  Based upon :                                                              *}
{*    DirectX 7.0 Delphi adaptation by Erik Unger                             *}
{*    DirectX 8.0 Delphi adaptation by Ivo Steinmann                          *}
{*                                                                            *}
{*  Latest version can be downloaded from:                                    *}
{*    http://clootie.ru                                                       *}
{*    http://sourceforge.net/projects/delphi-dx9sdk                           *}
{*                                                                            *}
{*----------------------------------------------------------------------------*}
{*  $Id: DirectMusic.pas,v 1.5 2006/10/24 19:58:49 clootie Exp $ }
{******************************************************************************}
{                                                                              }
{ The contents of this file are used with permission, subject to the Mozilla   }
{ Public License Version 1.1 (the "License"); you may not use this file except }
{ in compliance with the License. You may obtain a copy of the License at      }
{ http://www.mozilla.org/MPL/MPL-1.1.html                                      }
{                                                                              }
{ Software distributed under the License is distributed on an "AS IS" basis,   }
{ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
{ the specific language governing rights and limitations under the License.    }
{                                                                              }
{ Alternatively, the contents of this file may be used under the terms of the  }
{ GNU Lesser General Public License (the  "LGPL License"), in which case the   }
{ provisions of the LGPL License are applicable instead of those above.        }
{ If you wish to allow use of your version of this file only under the terms   }
{ of the LGPL License and not to allow others to use your version of this file }
{ under the MPL, indicate your decision by deleting  the provisions above and  }
{ replace  them with the notice and other provisions required by the LGPL      }
{ License.  If you do not delete the provisions above, a recipient may use     }
{ your version of this file under either the MPL or the LGPL License.          }
{                                                                              }
{ For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
{                                                                              }
{******************************************************************************}

{$I DirectX.inc}
{$MINENUMSIZE 1}
{$ALIGN ON}

unit DirectMusic;

interface

(*$HPPEMIT '#include "ks.h"' *)
(*$HPPEMIT '#include "dls1.h"' *)
(*$HPPEMIT '#include "dls2.h"' *)
(*$HPPEMIT '#include "dmdls.h"' *)
(*$HPPEMIT '#include "dmerror.h"' *)
(*$HPPEMIT '#include "dmplugin.h"' *)
(*$HPPEMIT '#include "dmusicc.h"' *)
(*$HPPEMIT '#include "dmusici.h"' *)
(*$HPPEMIT '#include "dmusicf.h"' *)
(*$HPPEMIT '#include "dmusbuff.h"' *)

{$NOINCLUDE ActiveX}

uses
  Windows, MMSystem, ActiveX, DXTypes, DirectSound;

(*==========================================================================;
//
//  dls1.h
//
//
//  Description:
//
//  Interface 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  = DWORD(Byte('D') or (Byte('L') shl 8) or (Byte('S') shl 16) or (Byte(' ') shl 24));
  {$EXTERNALSYM FOURCC_DLS}
  FOURCC_DLID = DWORD(Byte('d') or (Byte('l') shl 8) or (Byte('i') shl 16) or (Byte('d') shl 24));
  {$EXTERNALSYM FOURCC_DLID}
  FOURCC_COLH = DWORD(Byte('c') or (Byte('o') shl 8) or (Byte('l') shl 16) or (Byte('h') shl 24));
  {$EXTERNALSYM FOURCC_COLH}
  FOURCC_WVPL = DWORD(Byte('w') or (Byte('v') shl 8) or (Byte('p') shl 16) or (Byte('l') shl 24));
  {$EXTERNALSYM FOURCC_WVPL}
  FOURCC_PTBL = DWORD(Byte('p') or (Byte('t') shl 8) or (Byte('b') shl 16) or (Byte('l') shl 24));
  {$EXTERNALSYM FOURCC_PTBL}
  FOURCC_PATH = DWORD(Byte('p') or (Byte('a') shl 8) or (Byte('t') shl 16) or (Byte('h') shl 24));
  {$EXTERNALSYM FOURCC_PATH}
  FOURCC_wave = DWORD(Byte('w') or (Byte('a') shl 8) or (Byte('v') shl 16) or (Byte('e') shl 24));
  {$EXTERNALSYM FOURCC_wave}
  FOURCC_LINS = DWORD(Byte('l') or (Byte('i') shl 8) or (Byte('n') shl 16) or (Byte('s') shl 24));
  {$EXTERNALSYM FOURCC_LINS}
  FOURCC_INS  = DWORD(Byte('i') or (Byte('n') shl 8) or (Byte('s') shl 16) or (Byte(' ') shl 24));
  {$EXTERNALSYM FOURCC_INS}
  FOURCC_INSH = DWORD(Byte('i') or (Byte('n') shl 8) or (Byte('s') shl 16) or (Byte('h') shl 24));
  {$EXTERNALSYM FOURCC_INSH}
  FOURCC_LRGN = DWORD(Byte('l') or (Byte('r') shl 8) or (Byte('g') shl 16) or (Byte('n') shl 24));
  {$EXTERNALSYM FOURCC_LRGN}
  FOURCC_RGN  = DWORD(Byte('r') or (Byte('g') shl 8) or (Byte('n') shl 16) or (Byte(' ') shl 24));
  {$EXTERNALSYM FOURCC_RGN}
  FOURCC_RGNH = DWORD(Byte('r') or (Byte('g') shl 8) or (Byte('n') shl 16) or (Byte('h') shl 24));
  {$EXTERNALSYM FOURCC_RGNH}
  FOURCC_LART = DWORD(Byte('l') or (Byte('a') shl 8) or (Byte('r') shl 16) or (Byte('t') shl 24));
  {$EXTERNALSYM FOURCC_LART}
  FOURCC_ART1 = DWORD(Byte('a') or (Byte('r') shl 8) or (Byte('t') shl 16) or (Byte('1') shl 24));
  {$EXTERNALSYM FOURCC_ART1}
  FOURCC_WLNK = DWORD(Byte('w') or (Byte('l') shl 8) or (Byte('n') shl 16) or (Byte('k') shl 24));
  {$EXTERNALSYM FOURCC_WLNK}
  FOURCC_WSMP = DWORD(Byte('w') or (Byte('s') shl 8) or (Byte('m') shl 16) or (Byte('p') shl 24));
  {$EXTERNALSYM FOURCC_WSMP}
  FOURCC_VERS = DWORD(Byte('v') or (Byte('e') shl 8) or (Byte('r') shl 16) or (Byte('s') shl 24));
  {$EXTERNALSYM FOURCC_VERS}

(*)////////////////////////////////////////////////////////////////////////
// Articulation connection graph definitions
////////////////////////////////////////////////////////////////////////(*)

  // Generic Sources
  CONN_SRC_NONE              = $0000;
  {$EXTERNALSYM CONN_SRC_NONE}
  CONN_SRC_LFO               = $0001;
  {$EXTERNALSYM CONN_SRC_LFO}
  CONN_SRC_KEYONVELOCITY     = $0002;
  {$EXTERNALSYM CONN_SRC_KEYONVELOCITY}
  CONN_SRC_KEYNUMBER         = $0003;
  {$EXTERNALSYM CONN_SRC_KEYNUMBER}
  CONN_SRC_EG1               = $0004;
  {$EXTERNALSYM CONN_SRC_EG1}
  CONN_SRC_EG2               = $0005;
  {$EXTERNALSYM CONN_SRC_EG2}
  CONN_SRC_PITCHWHEEL        = $0006;
  {$EXTERNALSYM CONN_SRC_PITCHWHEEL}

  // Midi Controllers 0-127
  CONN_SRC_CC1               = $0081;
  {$EXTERNALSYM CONN_SRC_CC1}
  CONN_SRC_CC7               = $0087;
  {$EXTERNALSYM CONN_SRC_CC7}
  CONN_SRC_CC10              = $008a;
  {$EXTERNALSYM CONN_SRC_CC10}
  CONN_SRC_CC11              = $008b;
  {$EXTERNALSYM CONN_SRC_CC11}

  // Generic Destinations
  CONN_DST_NONE              = $0000;
  {$EXTERNALSYM CONN_DST_NONE}
  CONN_DST_ATTENUATION       = $0001;
  {$EXTERNALSYM CONN_DST_ATTENUATION}
  CONN_DST_PITCH             = $0003;
  {$EXTERNALSYM CONN_DST_PITCH}
  CONN_DST_PAN               = $0004;
  {$EXTERNALSYM CONN_DST_PAN}

  // LFO Destinations
  CONN_DST_LFO_FREQUENCY     = $0104;
  {$EXTERNALSYM CONN_DST_LFO_FREQUENCY}
  CONN_DST_LFO_STARTDELAY    = $0105;
  {$EXTERNALSYM CONN_DST_LFO_STARTDELAY}

  // EG1 Destinations
  CONN_DST_EG1_ATTACKTIME    = $0206;
  {$EXTERNALSYM CONN_DST_EG1_ATTACKTIME}
  CONN_DST_EG1_DECAYTIME     = $0207;
  {$EXTERNALSYM CONN_DST_EG1_DECAYTIME}
  CONN_DST_EG1_RELEASETIME   = $0209;
  {$EXTERNALSYM CONN_DST_EG1_RELEASETIME}
  CONN_DST_EG1_SUSTAINLEVEL  = $020a;
  {$EXTERNALSYM CONN_DST_EG1_SUSTAINLEVEL}

  // EG2 Destinations
  CONN_DST_EG2_ATTACKTIME    = $030a;
  {$EXTERNALSYM CONN_DST_EG2_ATTACKTIME}
  CONN_DST_EG2_DECAYTIME     = $030b;
  {$EXTERNALSYM CONN_DST_EG2_DECAYTIME}
  CONN_DST_EG2_RELEASETIME   = $030d;
  {$EXTERNALSYM CONN_DST_EG2_RELEASETIME}
  CONN_DST_EG2_SUSTAINLEVEL  = $030e;
  {$EXTERNALSYM CONN_DST_EG2_SUSTAINLEVEL}

  CONN_TRN_NONE              = $0000;
  {$EXTERNALSYM CONN_TRN_NONE}
  CONN_TRN_CONCAVE           = $0001;
  {$EXTERNALSYM CONN_TRN_CONCAVE}

type
  PDLSID = ^TDLSID;
  _DLSID = record
    ulData1: Cardinal;
    usData2: Word;
    usData3: Word;
    abData4: array[0..7] of Byte;
  end;
  {$EXTERNALSYM _DLSID}
  DLSID = _DLSID;
  {$EXTERNALSYM DLSID}
  TDLSID= _DLSID;

  PDLSVersion = ^TDLSVersion;
  _DLSVERSION = record
    dwVersionMS: DWORD;
    dwVersionLS: DWORD;
  end;
  {$EXTERNALSYM _DLSVERSION}
  DLSVERSION = _DLSVERSION;
  {$EXTERNALSYM DLSVERSION}
  TDLSVersion = _DLSVERSION;

  PConnection = ^TConnection;
  _CONNECTION = record
    usSource: Word;
    usControl: Word;
    usDestination: Word;
    usTransform: Word;
    lScale: Longint;
  end;
  {$EXTERNALSYM _CONNECTION}
  CONNECTION = _CONNECTION;
  {$EXTERNALSYM CONNECTION}
  TConnection = _CONNECTION;

  // Level 1 Articulation Data

  PConnectionList = ^TConnectionList;
  _CONNECTIONLIST = record
    cbSize: Cardinal;            // size of the connection list structure
    cConnections: Cardinal;      // count of connections in the list
  end;
  {$EXTERNALSYM _CONNECTIONLIST}
  CONNECTIONLIST = _CONNECTIONLIST;
  {$EXTERNALSYM CONNECTIONLIST}
  TConnectionList = _CONNECTIONLIST;


(*)////////////////////////////////////////////////////////////////////////
// Generic type defines for regions and instruments
////////////////////////////////////////////////////////////////////////(*)

  PRGNRange = ^TRGNRange;
  _RGNRANGE = record
    usLow: Word;
    usHigh: Word;
  end;
  {$EXTERNALSYM _RGNRANGE}
  RGNRANGE = _RGNRANGE;
  {$EXTERNALSYM RGNRANGE}
  TRGNRange = _RGNRANGE;

const
  F_INSTRUMENT_DRUMS      = $80000000;
  {$EXTERNALSYM F_INSTRUMENT_DRUMS}

type
  PMIDILocale = ^TMIDILocale;
  _MIDILOCALE = record
    ulBank: Cardinal;
    ulInstrument: Cardinal;
  end;
  {$EXTERNALSYM _MIDILOCALE}
  MIDILOCALE = _MIDILOCALE;
  {$EXTERNALSYM MIDILOCALE}
  TMIDILocale = _MIDILOCALE;

(*)////////////////////////////////////////////////////////////////////////
// Header structures found in an DLS file for collection, instruments, and
// regions.
////////////////////////////////////////////////////////////////////////(*)

const
  F_RGN_OPTION_SELFNONEXCLUSIVE  = $0001;
  {$EXTERNALSYM F_RGN_OPTION_SELFNONEXCLUSIVE}

type
  PRGNHeader = ^TRGNHeader;
  _RGNHEADER = 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;
  {$EXTERNALSYM _RGNHEADER}
  RGNHEADER = _RGNHEADER;
  {$EXTERNALSYM RGNHEADER}
  TRGNHeader = _RGNHEADER;

  PInstHeader = ^TInstHeader;
  _INSTHEADER = record
    cRegions: Cardinal;          // Count of regions in this instrument
    Locale: TMIDILocale;         // Intended MIDI locale of this instrument
  end;
  {$EXTERNALSYM _INSTHEADER}
  INSTHEADER = _INSTHEADER;
  {$EXTERNALSYM INSTHEADER}
  TInstHeader = _INSTHEADER;

  PDLSHeader = ^TDLSHeader;
  _DLSHEADER = record
    cInstruments: Cardinal;      // Count of instruments in the collection
  end;
  {$EXTERNALSYM _DLSHEADER}
  DLSHEADER = _DLSHEADER;
  {$EXTERNALSYM DLSHEADER}
  TDLSHeader = _DLSHEADER;

(*)///////////////////////////////////////////////////////////////////////////
// definitions for the Wave link structure
///////////////////////////////////////////////////////////////////////////(*)

// ****  For level 1 only WAVELINK_CHANNEL_MONO is valid  ****

⌨️ 快捷键说明

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