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

📄 mmdmusic.pas

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

⌨️ 快捷键说明

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