home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 May / PCFMay2001.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / dmdls.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  6.6 KB  |  180 lines

  1. /************************************************************************
  2. *                                                                       *
  3. *   dmdls.h -- DLS download definitions for DirectMusic API's           *
  4. *                                                                       *
  5. *   Copyright (c) 1998, Microsoft Corp. All rights reserved.            *
  6. *                                                                       *
  7. ************************************************************************/
  8.  
  9. #ifndef _DMDLS_
  10. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  11. #define _DMDLS_
  12.  
  13. #include "dls1.h"
  14.  
  15. typedef long PCENT;     /* Pitch cents */
  16. typedef long GCENT;     /* Gain cents */
  17. typedef long TCENT;     /* Time cents */
  18. typedef long PERCENT;   /* Per.. cent! */
  19.  
  20. typedef LONGLONG REFERENCE_TIME;
  21. typedef REFERENCE_TIME *LPREFERENCE_TIME;
  22.  
  23. #ifndef MAKE_FOURCC
  24. #define MAKEFOURCC(ch0, ch1, ch2, ch3)                              \
  25.                 ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) |   \
  26.                 ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
  27.  
  28.  
  29. typedef DWORD           FOURCC;         /* a four character code */
  30. #endif
  31.  
  32. typedef struct _DMUS_DOWNLOADINFO
  33. {
  34.     DWORD dwDLType;                     /* Instrument or Wave */
  35.     DWORD dwDLId;                       /* Unique identifier to tag this download. */
  36.     DWORD dwNumOffsetTableEntries;      /* Number of index in the offset address table. */
  37.     DWORD cbSize;                       /* Total size of this memory chunk. */
  38. } DMUS_DOWNLOADINFO;
  39.  
  40. #define DMUS_DOWNLOADINFO_INSTRUMENT    1
  41. #define DMUS_DOWNLOADINFO_WAVE          2
  42. #define DMUS_DOWNLOADINFO_INSTRUMENT2   3   /* New version for better DLS2 support. */
  43.  
  44. #define DMUS_DEFAULT_SIZE_OFFSETTABLE   1
  45.  
  46. /* Flags for DMUS_INSTRUMENT's ulFlags member */
  47.  
  48. #define DMUS_INSTRUMENT_GM_INSTRUMENT   (1 << 0)
  49.  
  50. typedef struct _DMUS_OFFSETTABLE
  51. {
  52.     ULONG ulOffsetTable[DMUS_DEFAULT_SIZE_OFFSETTABLE];
  53. } DMUS_OFFSETTABLE;
  54.  
  55. typedef struct _DMUS_INSTRUMENT
  56. {
  57.     ULONG           ulPatch;
  58.     ULONG           ulFirstRegionIdx;             
  59.     ULONG           ulGlobalArtIdx;         /* If zero the instrument does not have an articulation */
  60.     ULONG           ulFirstExtCkIdx;        /* If zero no 3rd party entenstion chunks associated with the instrument */
  61.     ULONG           ulCopyrightIdx;         /* If zero no Copyright information associated with the instrument */
  62.     ULONG           ulFlags;                        
  63. } DMUS_INSTRUMENT;
  64.  
  65. typedef struct _DMUS_REGION
  66. {
  67.     RGNRANGE        RangeKey;
  68.     RGNRANGE        RangeVelocity;
  69.     USHORT          fusOptions;
  70.     USHORT          usKeyGroup;
  71.     ULONG           ulRegionArtIdx;         /* If zero the region does not have an articulation */
  72.     ULONG           ulNextRegionIdx;        /* If zero no more regions */
  73.     ULONG           ulFirstExtCkIdx;        /* If zero no 3rd party entenstion chunks associated with the region */
  74.     WAVELINK        WaveLink;
  75.     WSMPL           WSMP;                   /*  If WSMP.cSampleLoops > 1 then a WLOOP is included */
  76.     WLOOP           WLOOP[1];
  77. } DMUS_REGION;
  78.  
  79. typedef struct _DMUS_LFOPARAMS
  80. {
  81.     PCENT       pcFrequency;
  82.     TCENT       tcDelay;
  83.     GCENT       gcVolumeScale;
  84.     PCENT       pcPitchScale;
  85.     GCENT       gcMWToVolume;
  86.     PCENT       pcMWToPitch;
  87. } DMUS_LFOPARAMS;
  88.  
  89. typedef struct _DMUS_VEGPARAMS
  90. {
  91.     TCENT       tcAttack;
  92.     TCENT       tcDecay;
  93.     PERCENT     ptSustain;
  94.     TCENT       tcRelease;
  95.     TCENT       tcVel2Attack;
  96.     TCENT       tcKey2Decay;
  97. } DMUS_VEGPARAMS;
  98.  
  99. typedef struct _DMUS_PEGPARAMS
  100. {
  101.     TCENT       tcAttack;
  102.     TCENT       tcDecay;
  103.     PERCENT     ptSustain;
  104.     TCENT       tcRelease;
  105.     TCENT       tcVel2Attack;
  106.     TCENT       tcKey2Decay;
  107.     PCENT       pcRange;
  108. } DMUS_PEGPARAMS;
  109.  
  110. typedef struct _DMUS_MSCPARAMS
  111. {
  112.     PERCENT     ptDefaultPan;
  113. } DMUS_MSCPARAMS;
  114.  
  115. typedef struct _DMUS_ARTICPARAMS
  116. {
  117.     DMUS_LFOPARAMS   LFO;
  118.     DMUS_VEGPARAMS   VolEG;
  119.     DMUS_PEGPARAMS   PitchEG;
  120.     DMUS_MSCPARAMS   Misc;
  121. } DMUS_ARTICPARAMS;
  122.  
  123. typedef struct _DMUS_ARTICULATION           /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT format. */
  124. {
  125.     ULONG           ulArt1Idx;              /* DLS Level 1 articulation chunk */
  126.     ULONG           ulFirstExtCkIdx;        /* 3rd party extenstion chunks associated with the articulation */
  127. } DMUS_ARTICULATION;
  128.  
  129. typedef struct _DMUS_ARTICULATION2          /* Articulation chunk for DMUS_DOWNLOADINFO_INSTRUMENT2 format. */
  130. {
  131.     ULONG           ulArtIdx;               /* DLS Level 1/2 articulation chunk */
  132.     ULONG           ulFirstExtCkIdx;        /* 3rd party extenstion chunks associated with the articulation */
  133.     ULONG           ulNextArtIdx;           /* Additional articulation chunks */
  134. } DMUS_ARTICULATION2;
  135.  
  136. #define DMUS_MIN_DATA_SIZE 4       
  137. /*  The actual number is determined by cbSize of struct _DMUS_EXTENSIONCHUNK */
  138.  
  139. typedef struct _DMUS_EXTENSIONCHUNK
  140. {
  141.     ULONG           cbSize;                      /*  Size of extension chunk  */
  142.     ULONG           ulNextExtCkIdx;              /*  If zero no more 3rd party entenstion chunks */
  143.     FOURCC          ExtCkID;                                      
  144.     BYTE            byExtCk[DMUS_MIN_DATA_SIZE]; /*  The actual number that follows is determined by cbSize */
  145. } DMUS_EXTENSIONCHUNK;
  146.  
  147. /*  The actual number is determined by cbSize of struct _DMUS_COPYRIGHT */
  148.  
  149. typedef struct _DMUS_COPYRIGHT
  150. {
  151.     ULONG           cbSize;                             /*  Size of copyright information */
  152.     BYTE            byCopyright[DMUS_MIN_DATA_SIZE];    /*  The actual number that follows is determined by cbSize */
  153. } DMUS_COPYRIGHT;
  154.  
  155. typedef struct _DMUS_WAVEDATA
  156. {
  157.     ULONG           cbSize;
  158.     BYTE            byData[DMUS_MIN_DATA_SIZE]; 
  159. } DMUS_WAVEDATA;
  160.  
  161. typedef struct _DMUS_WAVE
  162. {
  163.     ULONG           ulFirstExtCkIdx;    /* If zero no 3rd party entenstion chunks associated with the wave */
  164.     ULONG           ulCopyrightIdx;     /* If zero no Copyright information associated with the wave */
  165.     ULONG           ulWaveDataIdx;      /* Location of actual wave data. */
  166.     WAVEFORMATEX    WaveformatEx;       
  167. } DMUS_WAVE;
  168.  
  169. typedef struct _DMUS_NOTERANGE *LPDMUS_NOTERANGE;
  170. typedef struct _DMUS_NOTERANGE
  171. {
  172.     DWORD           dwLowNote;  /* Sets the low note for the range of MIDI note events to which the instrument responds.*/
  173.     DWORD           dwHighNote; /* Sets the high note for the range of MIDI note events to which the instrument responds.*/
  174. } DMUS_NOTERANGE;
  175.  
  176. #pragma option pop /*P_O_Pop*/
  177. #endif 
  178.  
  179.  
  180.