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

📄 mmacm.pas

📁 一套及时通讯的原码
💻 PAS
📖 第 1 页 / 共 4 页
字号:
{========================================================================}
{=                (c) 1995-98 SwiftSoft Ronald Dittrich                 =}
{========================================================================}
{=                          All Rights Reserved                         =}
{========================================================================}
{=  D 01099 Dresden             = Fax.: +49 (0)351-8037944              =}
{=  Loewenstr.7a                = info@swiftsoft.de                     =}
{========================================================================}
{=  Actual versions on http://www.swiftsoft.de/mmtools.html             =}
{========================================================================}
{=  This code is for reference purposes only and may not be copied or   =}
{=  distributed in any format electronic or otherwise except one copy   =}
{=  for backup purposes.                                                =}
{=                                                                      =}
{=  No Delphi Component Kit or Component individually or in a collection=}
{=  subclassed or otherwise from the code in this unit, or associated   =}
{=  .pas, .dfm, .dcu, .asm or .obj files may be sold or distributed     =}
{=  without express permission from SwiftSoft.                          =}
{=                                                                      =}
{=  For more licence informations please refer to the associated        =}
{=  HelpFile.                                                           =}
{========================================================================}
{=  $Date: 06.09.98 - 12:42:51 $                                        =}
{========================================================================}
unit MMACM;

{$I COMPILER.INC}

interface

uses
{$IFDEF WIN32}
    Windows,
{$ELSE}
    WinProcs,   
    WinTypes,
{$ENDIF}
    SysUtils,
    MMSystem,
    MMRegs;

const
     acmDLLLoaded: Boolean = False;
     acmDLLHandle: THandle = 0;

const
     DRV_MAPPER_PREFERRED_INPUT_GET  = (DRV_USER + 0);
     DRV_MAPPER_PREFERRED_OUTPUT_GET = (DRV_USER + 2);

     DRVM_MAPPER_STATUS              = ($2000);

     WIDM_MAPPER_STATUS              = (DRVM_MAPPER_STATUS + 0);
     WAVEIN_MAPPER_STATUS_DEVICE     = 0;
     WAVEIN_MAPPER_STATUS_MAPPED     = 1;
     WAVEIN_MAPPER_STATUS_FORMAT     = 2;

     WODM_MAPPER_STATUS              = (DRVM_MAPPER_STATUS + 0);
     WAVEOUT_MAPPER_STATUS_DEVICE    = 0;
     WAVEOUT_MAPPER_STATUS_MAPPED    = 1;
     WAVEOUT_MAPPER_STATUS_FORMAT    = 2;

{========================================================================}
{ ACM General API's and Defines                                          }
{========================================================================}

{------------------------------------------------------------------------}
{ there are four types of 'handles' used by the ACM. the first three     }
{ are unique types that define specific objects:                         }
{                                                                        }
{ HACMDRIVERID:                                                          }
{ used to _identify_ an ACM driver. this identifier can be used to _open_}
{ the driver for querying details, etc about the driver.                 }
{                                                                        }
{ HACMDRIVER:                                                            }
{ used to manage a driver (codec, filter, etc). this handle is much like }
{ a handle to other media drivers--you use it to send messages to the    }
{ converter, query for capabilities, etc.                                }
{                                                                        }
{ HACMSTREAM:                                                            }
{ used to manage a 'stream' (conversion channel) with the ACM. you use a }
{ stream handle to convert data from one format/type to another--much    }
{ like dealing with a file handle.                                       }
{                                                                        }
{ the fourth handle type is a generic type used on ACM functions that    }
{ can accept two or more of the above handle types (for example the      }
{ acmMetrics and acmDriverID functions).                                 }
{                                                                        }
{ HACMOBJ:                                                               }
{ used to identify ACM objects. this handle is used on functions that can}
{ accept two or more ACM handle types.                                   }
{------------------------------------------------------------------------}
type
    PHACMDRIVERID = ^THACMDRIVERID;
    THACMDRIVERID = THandle;

    PHACMDRIVER   = ^THACMDRIVER;
    THACMDRIVER   = THandle;

    PHACMSTREAM   = ^THACMSTREAM;
    THACMSTREAM   = THandle;

    PHACMOBJ      = ^THACMOBJ;
    THACMOBJ      = THandle;

{-----------------------------------------------------------------------}
{ ACM Error Codes                                                       }
{                                                                       }
{ Note that these error codes are specific errors that apply to the ACM }
{ directly--general errors are defined as MMSYSTEM.                     }
{-----------------------------------------------------------------------}
const
     ACMERR_BASE        = (512);
     ACMERR_NOTPOSSIBLE = (ACMERR_BASE + 0);
     ACMERR_BUSY        = (ACMERR_BASE + 1);
     ACMERR_UNPREPARED  = (ACMERR_BASE + 2);
     ACMERR_CANCELED    = (ACMERR_BASE + 3);

{-----------------------------------------------------------------------}
{ ACM Window Messages                                                   }
{                                                                       }
{ These window messages are sent by the ACM or ACM drivers to notify    }
{ applications of events.                                               }
{                                                                       }
{ Note that these window message numbers will also be defined in        }
{ MMSYSTEM.                                                             }
{-----------------------------------------------------------------------}
const   { BUGBUG: ev. 16 bit others ? }
     MM_ACM_OPEN  = $03D4;               { conversion callback messages }
     MM_ACM_CLOSE = $03D5;
     MM_ACM_DONE  = $03D6;

{-----------------------------------------------------------------------}
{  function acmGetVersion: Longint;                                     }
{                                                                       }
{ the ACM version is a 32 bit number that is broken into three parts as }
{  follows:                                                             }
{                                                                       }
{     bits 24 - 31:   8 bit _major_ version number                      }
{     bits 16 - 23:   8 bit _minor_ version number                      }
{     bits  0 - 15:   16 bit build number                               }
{                                                                       }
{  this is then displayed as follows:                                   }
{                                                                       }
{     bMajor = (BYTE)(dwVersion >> 24)                                  }
{     bMinor = (BYTE)(dwVersion >> 16) &                                }
{     wBuild = LOWORD(dwVersion)                                        }
{                                                                       }
{-----------------------------------------------------------------------}
var
   acmGetVersion: function: DWORD; {$IFDEF WIN32}stdcall;{$ENDIF}

{-----------------------------------------------------------------------}
{ acmMetrics                                                            }
{-----------------------------------------------------------------------}
var
   acmMetrics: function(hao: THACMOBJ; uMetric: UINT; pMetric: Pointer): MMRESULT;
                        {$IFDEF WIN32}stdcall;{$ENDIF}

const
     ACM_METRIC_COUNT_DRIVERS          = 1;
     ACM_METRIC_COUNT_CODECS           = 2;
     ACM_METRIC_COUNT_CONVERTERS       = 3;
     ACM_METRIC_COUNT_FILTERS          = 4;
     ACM_METRIC_COUNT_DISABLED         = 5;
     ACM_METRIC_COUNT_HARDWARE         = 6;
     ACM_METRIC_COUNT_LOCAL_DRIVERS    = 20;
     ACM_METRIC_COUNT_LOCAL_CODECS     = 21;
     ACM_METRIC_COUNT_LOCAL_CONVERTERS = 22;
     ACM_METRIC_COUNT_LOCAL_FILTERS    = 23;
     ACM_METRIC_COUNT_LOCAL_DISABLED   = 24;
     ACM_METRIC_HARDWARE_WAVE_INPUT    = 30;
     ACM_METRIC_HARDWARE_WAVE_OUTPUT   = 31;
     ACM_METRIC_MAX_SIZE_FORMAT        = 50;
     ACM_METRIC_MAX_SIZE_FILTER        = 51;
     ACM_METRIC_DRIVER_SUPPORT         = 100;
     ACM_METRIC_DRIVER_PRIORITY        = 101;

{=======================================================================}
{ ACM Drivers                                                           }
{=======================================================================}

{=======================================================================}
{ acmDriverEnum                                                         }
{=======================================================================}
type
    TACMDRIVERENUMCB = function(hadid: THACMDRIVERID;
                                dwInstance, fdwSupport: DWORD): Boolean;
                                {$IFDEF WIN32} stdcall; {$ENDIF}

var
   acmDriverEnum: function(fnCallback: TACMDRIVERENUMCB;
                           dwInstance, fdwEnum: DWORD): MMRESULT;
                           {$IFDEF WIN32} stdcall; {$ENDIF}

const
     ACM_DRIVERENUMF_NOLOCAL  = $40000000;
     ACM_DRIVERENUMF_DISABLED = $80000000;

{-----------------------------------------------------------------------}
{ acmDriverID                                                           }
{-----------------------------------------------------------------------}
var
   acmDriverID: function(hao: THACMOBJ; phadid: PHACMDRIVERID;
                         fdwDriverID: DWORD): MMRESULT;
                         {$IFDEF WIN32} stdcall; {$ENDIF}


{-----------------------------------------------------------------------}
{ acmDriverAdd                                                          }
{-----------------------------------------------------------------------}
var
   acmDriverAdd: function(phadid: PHACMDRIVERID; hinstModule: THandle;
                          lParam: LPARAM; dwPriority: DWORD; fdwAdd: DWORD): MMRESULT;
                          {$IFDEF WIN32} stdcall; {$ENDIF}

const
     ACM_DRIVERADDF_FUNCTION   = $00000003;  { lParam is a procedure    }
     ACM_DRIVERADDF_NOTIFYHWND = $00000004;  { lParam is notify hwnd    }
     ACM_DRIVERADDF_TYPEMASK   = $00000007;  { driver type mask         }
     ACM_DRIVERADDF_LOCAL      = $00000000;  { is local to current task }
     ACM_DRIVERADDF_GLOBAL     = $00000008;  { is global                }

{-----------------------------------------------------------------------}
{ prototype for ACM driver procedures that are installed as _functions_ }
{ or _notifations_ instead of as a standalone installable driver.       }
{-----------------------------------------------------------------------}
(*type
    PACMDRIVERPROC = ^TACMDRIVERPROC;
    TACMDRIVERPROC = function(DWORD; THACMDRIVERID; UINT; LPARAM;
                              LPARAM): LRESULT;
                              {$IFDEF WIN32} stdcall; {$ENDIF}
*)

{-----------------------------------------------------------------------}
{ acmDriverRemove                                                       }
{-----------------------------------------------------------------------}
var
   acmDriverRemove: function(hadid: THACMDRIVERID; fdwRemove: DWORD): MMRESULT;

⌨️ 快捷键说明

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