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

📄 mmdmusic.pas

📁 一套及时通讯的原码
💻 PAS
📖 第 1 页 / 共 5 页
字号:
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;

⌨️ 快捷键说明

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