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

📄 mmacm.pas

📁 一套及时通讯的原码
💻 PAS
📖 第 1 页 / 共 4 页
字号:
                             {$IFDEF WIN32} stdcall; {$ENDIF}

{-----------------------------------------------------------------------}
{ acmDriverOpen                                                         }
{-----------------------------------------------------------------------}
var
   acmDriverOpen: function(phad: PHACMDRIVER; hadid: THACMDRIVERID; fdwOpen: DWORD): MMRESULT;
                           {$IFDEF WIN32} stdcall; {$ENDIF}

{-----------------------------------------------------------------------}
{ acmDriverClose                                                        }
{-----------------------------------------------------------------------}
var
   acmDriverClose: function(had: THACMDRIVER; fdwClose: DWORD): MMRESULT;
                            {$IFDEF WIN32} stdcall; {$ENDIF}

{-----------------------------------------------------------------------}
{ acmDriverMessage                                                      }
{-----------------------------------------------------------------------}
var
   acmDriverMessage: function(had: THACMDRIVER; uMsg: UINT;
                              lParam1, lParam2: LPARAM): LRESULT;
                              {$IFDEF WIN32} stdcall; {$ENDIF}

const
     ACMDM_USER          = (DRV_USER + $0000);
     ACMDM_RESERVED_LOW  = (DRV_USER + $2000);
     ACMDM_RESERVED_HIGH = (DRV_USER + $2FFF);
     ACMDM_BASE          = ACMDM_RESERVED_LOW;
     ACMDM_DRIVER_ABOUT  = (ACMDM_BASE + 11);

{-----------------------------------------------------------------------}
{ acmDriverPriority                                                     }
{-----------------------------------------------------------------------}
var
   acmDriverPriority: function(hadid: THACMDRIVERID;
                               dwPriority, fdwPriority: DWORD): MMRESULT;
                               {$IFDEF WIN32} stdcall; {$ENDIF}

const
     ACM_DRIVERPRIORITYF_ENABLE    = $00000001;
     ACM_DRIVERPRIORITYF_DISABLE   = $00000002;
     ACM_DRIVERPRIORITYF_ABLEMASK  = $00000003;
     ACM_DRIVERPRIORITYF_BEGIN     = $00010000;
     ACM_DRIVERPRIORITYF_END       = $00020000;
     ACM_DRIVERPRIORITYF_DEFERMASK = $00030000;

{-----------------------------------------------------------------------}
{ acmDriverDetails                                                      }
{-----------------------------------------------------------------------}
{                                                                       }
{  ACMDRIVERDETAILS                                                     }
{                                                                       }
{  the ACMDRIVERDETAILS structure is used to get various capabilities   }
{  from an ACM driver (codec, converter, filter).                       }
{-----------------------------------------------------------------------}
const
     ACMDRIVERDETAILS_SHORTNAME_CHARS = 32;
     ACMDRIVERDETAILS_LONGNAME_CHARS  = 128;
     ACMDRIVERDETAILS_COPYRIGHT_CHARS = 80;
     ACMDRIVERDETAILS_LICENSING_CHARS = 128;
     ACMDRIVERDETAILS_FEATURES_CHARS  = 512;

type
    PACMDRIVERDETAILS = ^TACMDRIVERDETAILS;
    TACMDRIVERDETAILS = record
        cbStruct   : DWORD;        { number of valid bytes in structure }
        fccType    : FOURCC;       { compressor type 'audc'             }
        fccComp    : FOURCC;       { sub-type (not used; reserved)      }

        wMid       : WORD;         { manufacturer id                    }
        wPid       : WORD;         { product id                         }

        vdwACM     : DWORD;        { version of the ACM *compiled* for  }
        vdwDriver  : DWORD;        { version of the driver              }

        fdwSupport : DWORD;        { misc. support flags                }
        cFormatTags: DWORD;        { total unique format tags supported }
        cFilterTags: DWORD;        { total unique filter tags supported }

        hicon      : HICON;        { handle to custom icon              }

        szShortName: array[0..ACMDRIVERDETAILS_SHORTNAME_CHARS-1]of Char;
        szLongName : array[0..ACMDRIVERDETAILS_LONGNAME_CHARS-1] of Char;
        szCopyright: array[0..ACMDRIVERDETAILS_COPYRIGHT_CHARS-1]of Char;
        szLicensing: array[0..ACMDRIVERDETAILS_LICENSING_CHARS-1]of Char;
        szFeatures : array[0..ACMDRIVERDETAILS_FEATURES_CHARS-1] of Char;
    end;

{-----------------------------------------------------------------------}
{                                                                       }
{  ACMDRIVERDETAILS.fccType                                             }
{                                                                       }
{  ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC: the FOURCC used in the fccType  }
{  field of the ACMDRIVERDETAILS structure to specify that this is an   }
{  ACM codec designed for audio.                                        }
{                                                                       }
{                                                                       }
{  ACMDRIVERDETAILS.fccComp                                             }
{                                                                       }
{  ACMDRIVERDETAILS_FCCCOMP_UNDEFINED: the FOURCC used in the fccComp   }
{  field of the ACMDRIVERDETAILS structure. this is currently an unused }
{  field.                                                               }
{-----------------------------------------------------------------------}
const
     ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC = $63647561; {'audc'}
     ACMDRIVERDETAILS_FCCCOMP_UNDEFINED  = $0;

{  the following flags are used to specify the type of conversion(s) that     }
{  the converter/codec/filter supports. these are placed in the fdwSupport    }
{  field of the ACMDRIVERDETAILS structure. note that a converter can         }
{  support one or more of these flags in any combination.                     }
{                                                                             }
{  ACMDRIVERDETAILS_SUPPORTF_CODEC: this flag is set if the driver supports   }
{  conversions from one format tag to another format tag. for example, if a   }
{  converter compresses WAVE_FORMAT_PCM to WAVE_FORMAT_ADPCM, then this bit   }
{  should be set.                                                             }
{                                                                             }
{  ACMDRIVERDETAILS_SUPPORTF_CONVERTER: this flags is set if the driver       }
{  supports conversions on the same format tag. as an example, the PCM        }
{  converter that is built into the ACM sets this bit (and only this bit)     }
{  because it converts only PCM formats (bits, sample rate).                  }
{                                                                             }
{  ACMDRIVERDETAILS_SUPPORTF_FILTER: this flag is set if the driver supports  }
{  transformations on a single format. for example, a converter that changed  }
{  the 'volume' of PCM data would set this bit. 'echo' and 'reverb' are       }
{  also filter types.                                                         }
{                                                                             }
{  ACMDRIVERDETAILS_SUPPORTF_HARDWARE: this flag is set if the driver supports}
{  hardware input and/or output through a waveform device.                    }
{                                                                             }
{  ACMDRIVERDETAILS_SUPPORTF_ASYNC: this flag is set if the driver supports   }
{  async conversions.                                                         }
{                                                                             }
{  ACMDRIVERDETAILS_SUPPORTF_LOCAL: this flag is set _by the ACM_ if a        }
{  driver has been installed local to the current task. this flag is also     }
{  set in the fdwSupport argument to the enumeration callback function        }
{  for drivers.                                                               }
{                                                                             }
{  ACMDRIVERDETAILS_SUPPORTF_DISABLED: this flag is set _by the ACM_ if a     }
{  driver has been disabled. this flag is also passed set in the fdwSupport   }
{  argument to the enumeration callback function for drivers.                 }
{                                                                             }
{-----------------------------------------------------------------------------}
const
     ACMDRIVERDETAILS_SUPPORTF_CODEC     = $00000001;
     ACMDRIVERDETAILS_SUPPORTF_CONVERTER = $00000002;
     ACMDRIVERDETAILS_SUPPORTF_FILTER    = $00000004;
     ACMDRIVERDETAILS_SUPPORTF_HARDWARE  = $00000008;
     ACMDRIVERDETAILS_SUPPORTF_ASYNC     = $00000010;
     ACMDRIVERDETAILS_SUPPORTF_LOCAL     = $40000000;
     ACMDRIVERDETAILS_SUPPORTF_DISABLED  = $80000000;

var
   acmDriverDetails: function(hadid: THACMDRIVERID; padd: PACMDRIVERDETAILS;
                              fdwDetails: DWORD): MMRESULT;
                              {$IFDEF WIN32} stdcall; {$ENDIF}

{=======================================================================}
{ ACM Format Tags                                                       }
{=======================================================================}

{-----------------------------------------------------------------------}
{ acmFormatTagDetails                                                   }
{-----------------------------------------------------------------------}
const
     ACMFORMATTAGDETAILS_FORMATTAG_CHARS = 48;

type
    PACMFORMATTAGDETAILS = ^TACMFORMATTAGDETAILS;
    TACMFORMATTAGDETAILS = record
       cbStruct        : DWORD;
       dwFormatTagIndex: DWORD;
       dwFormatTag     : DWORD;
       cbFormatSize    : DWORD;
       fdwSupport      : DWORD;
       cStandardFormats: DWORD;
       szFormatTag: array[0..ACMFORMATTAGDETAILS_FORMATTAG_CHARS-1] of Char;
    end;

var
   acmFormatTagDetails: function(had: THACMDRIVER; paftd: PACMFORMATTAGDETAILS;
                                 fdwDetails: DWORD): MMRESULT;
                                 {$IFDEF WIN32}stdcall; {$ENDIF}

const
     ACM_FORMATTAGDETAILSF_INDEX       = $00000000;
     ACM_FORMATTAGDETAILSF_FORMATTAG   = $00000001;
     ACM_FORMATTAGDETAILSF_LARGESTSIZE = $00000002;
     ACM_FORMATTAGDETAILSF_QUERYMASK   = $0000000F;

{-----------------------------------------------------------------------}
{ acmFormatTagEnum                                                      }
{-----------------------------------------------------------------------}
type
    TACMFORMATTAGENUMCB = function(hadid: THACMDRIVERID;
                                   paftd: PACMFORMATTAGDETAILS;
                                   dwInstance, fdwSupport: DWORD): Boolean; 
                                   {$IFDEF WIN32}stdcall;{$ENDIF}

var
   acmFormatTagEnum: function(had: THACMDRIVER; paftd: PACMFORMATTAGDETAILS;
                              fnCallBack: TACMFORMATTAGENUMCB;
                              dwInstance, fdwEnum: DWORD): MMRESULT;
                              {$IFDEF WIN32}stdcall;{$ENDIF}

{=======================================================================}
{ ACM Formats                                                           }
{=======================================================================}

{-----------------------------------------------------------------------}
{ acmFormatDetails                                                      }
{-----------------------------------------------------------------------}
const
     ACMFORMATDETAILS_FORMAT_CHARS = 128;

type
    PACMFORMATDETAILS = ^TACMFORMATDETAILS;
    TACMFORMATDETAILS = record
        cbStruct     : DWORD;
        dwFormatIndex: DWORD;
        dwFormatTag  : DWORD;
        fdwSupport   : DWORD;
        pwfx         : PWAVEFORMATEX;
        cbwfx        : DWORD;
        szFormat: array[0..ACMFORMATDETAILS_FORMAT_CHARS-1] of Char;
    end;

var
   acmFormatDetails: function(had: THACMDRIVER; pafd: PACMFORMATDETAILS;
                              fdwDetails: DWORD): MMRESULT;
                              {$IFDEF WIN32} stdcall; {$ENDIF}

const
     ACM_FORMATDETAILSF_INDEX     = $00000000;
     ACM_FORMATDETAILSF_FORMAT    = $00000001;
     ACM_FORMATDETAILSF_QUERYMASK = $0000000F;

⌨️ 快捷键说明

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