关于DLL调用及Vod开发的问题!(800分)(80分)

  • 主题发起人 主题发起人 snqy
  • 开始时间 开始时间
S

snqy

Unregistered / Unconfirmed
GUEST, unregistred user!
假定Dll名称:winvod.dll<br>已知头文件信息:<br>/*******************************************************************************<br>*<br>* &nbsp; COPYRIGHT &nbsp; : &nbsp; (c) 1995-1996 Sigma Designs, Inc. All rights reserved.<br>*<br>* &nbsp; FILENAME &nbsp; &nbsp;: &nbsp; FMPMacs.h<br>*<br>* &nbsp; DESCRIPTION : &nbsp; This header file contains FMP specific macros that provide<br>* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for an easier interface to sending FMP calls to the FMP<br>* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MPEG support driver.<br>*<br>* &nbsp; PLATFORM &nbsp; &nbsp;: &nbsp; DOS, Windows<br>*<br>* &nbsp; PROGRAMMER &nbsp;: &nbsp; ECY<br>*<br>* &nbsp; COMMENTS &nbsp; &nbsp;: &nbsp; NONE<br>*<br>* &nbsp; NOTES &nbsp; &nbsp; &nbsp; : &nbsp; NONE<br>*<br>* &nbsp; CHANGES &nbsp; &nbsp; :<br>* &nbsp; 08/10/95 &nbsp; &nbsp;- &nbsp; Created.<br>* &nbsp; &nbsp;(ECY)<br>*<br>*******************************************************************************/<br><br><br>#ifndef __FMPMACS_H__<br>#define __FMPMACS_H__<br><br><br>#define FMPOpen( Flags, Filename ) /<br>&nbsp; &nbsp; LOBYTE( LOWORD( FMPCommand( FMP_OPEN, 0, Flags, Filename ) ) )<br><br>#define FMPClose( hMPEGStream ) /<br>&nbsp; &nbsp; FMPCommand( FMP_CLOSE, hMPEGStream, 0, 0 )<br><br>#define FMPSet( hMPEGStream, Index, Value ) /<br>&nbsp; &nbsp; FMPCommand( FMP_SET, hMPEGStream, Index, Value )<br><br>#define FMPGet( hMPEGStream, Index ) /<br>&nbsp; &nbsp; FMPCommand( FMP_GET, hMPEGStream, Index, 0 )<br><br>#define FMPPlay( hMPEGStream, Flags, Position ) /<br>&nbsp; &nbsp; FMPCommand( FMP_PLAY, hMPEGStream, Flags, Position )<br><br>#define FMPStep( hMPEGStream, Flags, Position ) /<br>&nbsp; &nbsp; FMPCommand( FMP_STEP, hMPEGStream, Flags, Position )<br><br>#define FMPCapture( hMPEGStream, Index, Position ) /<br>&nbsp; &nbsp; FMPCommand( FMP_CAPTURE, hMPEGStream, Index, Position )<br><br>#define FMPSeek( hMPEGStream, Flags, Position ) /<br>&nbsp; &nbsp; FMPCommand( FMP_SEEK, hMPEGStream, Flags, Position )<br><br>#define FMPSignal( hMPEGStream, Flags, Position ) /<br>&nbsp; &nbsp; FMPCommand( FMP_SIGNAL, hMPEGStream, Flags, Position )<br><br>#define FMPPause( hMPEGStream ) /<br>&nbsp; &nbsp; FMPCommand( FMP_PAUSE, hMPEGStream, 0, 0 )<br><br>#define FMPStop( hMPEGStream ) /<br>&nbsp; &nbsp; FMPCommand( FMP_STOP, hMPEGStream, 0, 0 )<br><br>#define FMPGroup( hMPEGStream, Flags, Value ) /<br>&nbsp; &nbsp; FMPCommand( FMP_GROUP, hMPEGStream, Flags, Value )<br><br>#define FMPCallback( hMPEGStream, Value ) /<br>&nbsp; &nbsp; FMPCommand( FMP_CALLBACK, hMPEGStream, FMPF_C, Value )<br><br>#define FMPUnload() /<br>&nbsp; &nbsp; FMPCommand( FMP_UNLOAD, 0, 0, 0 )<br><br>#define FMPInit() /<br>&nbsp; &nbsp; FMPCommand( FMP_INIT, 0, 0, 0 )<br><br>#define FMPFreeze( hMPEGStream, Flags, Value ) /<br>&nbsp; &nbsp; FMPCommand( FMP_FREEZE, hMPEGStream, Flags, Value )<br><br>#define FMPUpdate(subfunc,param1,param2) /<br>&nbsp; &nbsp; FMPCommand(FMP_UPDATE,subfunc,param1,param2)<br><br>#define FMPUpdatePalette( PaletteIndex, nColors ) /<br>&nbsp; &nbsp; FMPCommand( FMP_UPDATE, FMPI_UPD_PALETTE, 0, MAKEDWORD( nColors, PaletteIndex ) )<br><br>#define FMPUpdateVGAMode( Bits, Mode ) /<br>&nbsp; &nbsp; FMPCommand( FMP_UPDATE, FMPI_UPD_VGA_MODE, Bits, Mode )<br><br><br>#endif &nbsp;/* __FMPMACS_H__ */<br><br>在Delphi中如何调用相关接口?<br>参考材料:<br><br>[ Delphi中动态链接库两种调用方式的比较(1 2 3) ] <br><br>摘要:本文阐述了Windows环境下动态链接库的概念和特点,对静态调用和动态调用两种调用方式作出了比较,并给出了Delphi中应用动态链接库的实例。<br><br>  一、动态链接库的概念<br><br>  动态链接库(Dynamic Link Library,缩写为DLL)是一个可以被其它应用程序共享的程序模块,其中封装了一些可以被共享的例程和资源。动态链接库文件的扩展名一般是dll,也有可能是drv、sys和fon,它和可执行文件(exe)非常类似,区别在于DLL中虽然包含了可执行代码却不能单独执行,而应由Windows应用程序直接或间接调用。<br><br>  动态链接是相对于静态链接而言的。所谓静态链接是指把要调用的函数或者过程链接到可执行文件中,成为可执行文件的一部分。换句话说,函数和过程的代码就在程序的exe文件中,该文件包含了运行时所需的全部代码。当多个程序都调用相同函数时,内存中就会存在这个函数的多个拷贝,这样就浪费了宝贵的内存资源。而动态链接所调用的函数代码并没有被拷贝到应用程序的可执行文件中去,而是仅仅在其中加入了所调用函数的描述信息(往往是一些重定位信息)。仅当应用程序被装入内存开始运行时,在Windows的管理下,才在应用程序与相应的DLL之间建立链接关系。当要执行所调用DLL中的函数时,根据链接产生的重定位信息,Windows才转去执行DLL中相应的函数代码。<br><br>  一般情况下,如果一个应用程序使用了动态链接库,Win32系统保证内存中只有DLL的一份复制品,这是通过内存映射文件实现的。DLL首先被调入Win32系统的全局堆栈,然后映射到调用这个DLL的进程地址空间。在Win32系统中,每个进程拥有自己的32位线性地址空间,如果一个DLL被多个进程调用,每个进程都会收到该DLL的一份映像。与16位Windows不同,在Win32中DLL可以看作是每个进程自己的代码。<br><br>  二、动态链接库的优点<br><br>  1. 共享代码、资源和数据<br><br>   使用DLL的主要目的就是为了共享代码,DLL的代码可以被所有的Windows应用程序共享。<br><br>  2. 隐藏实现的细节<br><br>   DLL中的例程可以被应用程序访问,而应用程序并不知道这些例程的细节。<br><br>  3. 拓展开发工具如Delphi的功能<br><br>  由于DLL是与语言无关的,因此可以创建一个DLL,被C++、VB或任何支持动态链接库的语言调用。这样如果一种语言存在不足,就可以通过访问另一种语言创建的DLL来弥补。<br><br>  三、动态链接库的实现方法<br><br>  1. Load-time Dynamic Linking<br><br>  这种用法的前提是在编译之前已经明确知道要调用DLL中的哪几个函数,编译时在目标文件中只保留必要的链接信息,而不含DLL函数的代码;当程序执行时,利用链接信息加载DLL函数代码并在内存中将其链接入调用程序的执行空间中,其主要目的是便于代码共享。<br><br>  2. Run-time Dynamic Linking <br><br>  这种方式是指在编译之前并不知道将会调用哪些DLL函数,完全是在运行过程中根据需要决定应调用哪个函数,并用LoadLibrary和GetProcAddress动态获得DLL函数的入口地址。<br>------------------------------------<br>四、DLL的两种调用方式在Delphi中的比较<br><br>  编写DLL的目的是为了输出例程供其他程序调用,因此在DLL的工程文件中要把输出的例程用Exports关键字引出。在调用DLL的应用程序中,需要声明用到的DLL中的方法,声明格式要和DLL中的声明一样。访问DLL中的例程有静态调用和动态调用两种方式。静态调用方式就是在单元的Interface部分用External指示字列出要从DLL中引入的例程;动态调用方式就是通过调用Windows的API包括LoadLibrary函数、GetProcAddress函数以及FreeLibrary函数动态的引入DLL中的例程。<br><br>  静态调用方式所需的代码较动态调用方式所需的少,但存在着一些不足,一是如果要加载的DLL不存在或者DLL中没有要引入的例程,这时候程序就自动终止运行;二是DLL一旦加载就一直驻留在应用程序的地址空间,即使DLL已不再需要了。动态调用方式就可解决以上问题,它在需要用到DLL的时候才通过LoadLibrary函数引入,用完后通过FreeLibrary函数从内存中卸载,而且通过调GetProcAddress函数可以指定不同的例程。最重要的是,如果指定的DLL出错,至多是API调用失败,不会导致程序终止。以下将通过具体的实例说明说明这调用方式的使用方法。<br><br>  1. 静态调用方式<br><br>  示例程序创建了一个DLL,其中仅包含一个求两个整数的和的函数,在主程序中输入两个整数,通过调用该DLL,即可求出两个整数的和,如图1所示。<br>     图1 DLL的静态调用 <br><br>  该DLL的程序代码如下:<br><br>library AddNum;<br>uses<br>SysUtils,<br>Classes;<br><br>{$R *.res}<br><br>function AddNumber(Num1,Num2:integer):integer;stdcall; //定义求和函数<br> begin<br>  result:=Num1+Num2;<br> end;<br>  exports<br>  AddNumber; //引出求和函数<br> begin<br>end. <br><br>  主程序在调用该DLL时,首先在interface部分声明要调用的函数:<br><br>function AddNum(Num1,Num2:integer):integer;stdcall;external 'AddNum.dll'<br>name 'AddNumber'; <br><br>  然后在按钮控件的事件中写入如下代码:<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br> Number1,Number2:integer; <br> Sum:integer;<br>begin<br> Number1:=strtoint(Edit1.Text);<br> Number2:=strtoint(Edit2.Text);<br> Sum:=AddNum(Number1,Number2); //调用求和函数计算结果<br> Edit3.Text:=inttostr(Sum);<br>end; <br>--------------------------------<br>2.动态调用方式<br><br>  这个示例程序创建了一个显示日期的DLL,其中包含一个窗体,如图2所示。<br>     图2 DLL的动态调用 <br><br>  程序中定义了一个ShowCalendar函数,返回在这个窗体中设定的日期。函数定义如下:<br><br>function ShowCalendar(AHandle: THandle; ACaption: String): TDateTime;<br>var<br> DLLForm: TDLLForm;<br>begin<br> Application.Handle := AHandle;<br> DLLForm := TDLLForm.Create(Application); //创建并显示窗体<br> try<br>  DLLForm.Caption := ACaption;<br>  DLLForm.ShowModal; //显示方式为模式化<br>  Result := DLLForm.calDLLCalendar.CalendarDate; //返回设定日期<br> finally<br>  DLLForm.Free; //用完后卸载该窗体<br> end;<br>end; <br><br>  在DLL的工程文件中用exports ShowCalendar; 语句引出该函数。下面通过一个简单的应用程序测试一下该DLL文件。新建一个工程文件,在窗体中放置一个Label控件和一个按钮控件,在按钮控件的OnClick事件中编写如下代码:<br><br>procedure TMainForm.Button1Click(Sender: TObject);<br>var<br> OneHandle : THandle; //定义一个句柄变量<br>begin<br> OneHandle := LoadLibrary('Clendar.dll'); //动态载入DLL,并返回其句柄<br> try<br>  if OneHandle &lt;&gt; 0 then //如果载入成功则获取ShowCalendar函数的地址<br>   @ShowCalendar := GetProcAddress(OneHandle, 'ShowCalendar');<br>   if not (@ShowCalendar = nil) then<br>    //如果找到该函数则在主窗体的Label1中显示DLL窗体中设定的日期<br>    Label1.Caption := DateToStr(ShowCalendar(Application.Handle, Caption))<br>   else<br>    RaiseLastWin32Error;<br> finally<br>  FreeLibrary(OneHandle); //调用完毕收回DLL占用的资源<br> end;<br>end; <br><br>  从以上程序中可以看到DLL的动态调用方式比静态调用方式的优越之处。DLL例程在用到时才被调入,用完后就被卸载,大大减少了系统资源的占用。在调用LoadLibrary函数时可以明确指定DLL的完整路径,如果没有指定路径,运行时首先查找应用程序载入的目录,然后是Windows系统的System目录和环境变量Path设定的路径。<br><br>  五、结束语<br><br>  由于动态链接库可以实现代码和资源的共享,大大减少系统资源的占用,因此在当今的应用程序开发中起着非常重要的作用。Delphi是现今流行的应用软件开发工具,本文就如何在Delphi中使用动态链接库给出了一定程度上的阐述。<br><br>&nbsp;<br><br>Delphi中如何调用VC++创建的动态链接库<br><br>肖运勇 &nbsp;<br>01-10-29 下午 02:06:09<br><br>--------------------------------------------------------------------------------<br>&nbsp;<br><br>Delphi以其独特的面向控件的开发方式、强大的数据库功能、快速的编译技术以及简单易学的编程特性,使得它自发布之日起即格外引人注目,许多程序员也因此将它作为首选的开发工具。然而,Delphi在科学计算、低端编程等方面的功能不如VC++。VC++功能强大、齐全,但是整个系统比较复杂、庞大,尤其对于初学者来说比较难学,其用户界面的开发远不如Delphi那样方便、快捷。那么,我们能否将两者的优点结合起来呢?答案是肯定的!具体做法是:将涉及到比较低级的操作、计算等方面的程序用VC++写成函数放在动态链接库中,而涉及到界面及与用户交互的编程则用Delphi来实现,最后只需在Delphi中调用VC++编写的动态链接库即可。 <br>一、动态链接库简介 <br>动态链接库(DLL,即 “Dynamic-Link Library”)是一个能够被应用程序和其它的DLL调用的过程和函数的集合体,它里面包含的是公共代码或资源。DLL是Windows的基石,所有的Win32 API函数都包含在DLL中。 <br>使用DLL有许多优点: &nbsp;<br>1、一个DLL可以提供给不同的程序使用,如果有多个程序使用相同的DLL,也只需将DLL在内存中装载一次,这样就节省了内存开销。 <br>2、DLL可以使我们的编程更加模块化,将功能相对独立的模块编成一个动态链接库,这样改动程序时不需将整个程序重新编译,只需重新编译所改动的模块。 &nbsp;<br>3、使用了DLL组件包可以大大减小可执行文件的规模。 &nbsp;<br>4、对于一个大型的、不断更新的应用程序,可以将许多重复的功能写成DLL,用主程序调用,这样既减少了开发的工作量,又提高了访问速度。 &nbsp;<br>5、DLL独立于编程语言,大多数WINDOWS编程环境都允许主程序调用DLL中的函数。即可以用VC++、VB、PowerBuilder、Delphi、汇编语言等建立DLL,然后在不同语言编制的应用程序中调用它。这样就给多人使用不同的编程语言开发项目提供了极大的方便。 <br>&nbsp;<br>二、在Delphi中调用VC++创建的动态链接库的实例 <br>(一)实验环境 <br>本实例的编程工具及运行环境为:Windows 98,VC++6.0,Delphi 5.0 。 <br>(二)实验内容 <br>1.用VC++6.0建立一个动态链接库MaxMin.DLL,该库中包含有两个函数:返回三个整数中最大整数的函数Max1( )和返回三个整数中最小整数的函数Min1( )。 <br>2.用Delphi编写测试程序调用动态链接库MaxMin.DLL中的两个函数。 <br>(三)实验步骤 <br>1.用VC++6.0建立动态链接库MaxMin.DLL <br>第一步:启动VC++6.0,选择“File/New/MFC AppWizzard(Dll)”,工程名设为“MaxMin”,按“确定”钮后,选择“Regular DLL Using shared MFC DLL”,按“Finish”钮后,即创造了一个DLL的框架工程。 <br>第二步:选择“File/New”,在出现的对话框中选择“C/C++ Header File”,在文件名处输入“MyDLL”,按“确定”钮,即创建了一个空的头文件“MyDLL.h”。在该文件中输入以下两行内容: <br>extern "C" _declspec(dllexport) int Min1(int x,int y,int z); <br>extern "C" _declspec(dllexport) int Max1(int x,int y,int z); <br>选择“File/Save”保存该文件的内容。 <br>第三步:选择“File/New”,在出现的对话框中选择“C/C++ Source File”, 在文件名处输入“MyDLL”,按“确定”钮,即创建了一个空的源文件“MyDLL.cpp”。在该文件中输入以下内容: <br>#include "stdafx.h" <br>#include "MyDll.h" <br>extern "C" __declspec(dllexport) int Min1(int x,int y,int z) <br>{ <br>if ((x&lt;=y) &amp; (x&lt;=z)) return x; <br>else if ((y&lt;=x) &amp; (y&lt;=z)) return y; <br>else return z; /*找出x,y,z中的最小整数*/ <br>} <br>&nbsp;<br>extern "C" __declspec(dllexport) int Max1(int x,int y,int z) <br>{ <br>if ((x&gt;=y) &amp; (x&gt;=z)) return x; <br>else if ((y&gt;=x) &amp; (y&gt;=z)) return y; <br>else return z; /*找出x,y,z中的最大整数*/ <br>} <br>选择“File/Save”保存该文件的内容。 <br>第四步:按下运行图标“!”,即生成了MyDLL.DLL(在当前工程目录的DEBUG子目录下)。 <br>&nbsp;<br>2.用Delphi编写调用MaxMin.DLL的测试程序 <br>调用动态链接库有两种方法,即隐式调用和显式调用。 <br>(1)隐式调用 <br>第一步:启动Delphi,选择“New Application”,生成一个空的应用程序,在Form的“Name”属性处输入“TestVcDLLForm”,Caption属性处输入“VC++的DLL隐式调用测试”,在Form中放入控件如表1所示(其中所有的Edit控件的“Text”属性均设为空): <br><br>&nbsp;<br>(表1:所用到的控件及其属性) <br>&nbsp;<br><br>&nbsp;<br>(图1:应用程序屏幕效果)<br>&nbsp;<br>最后设计的Form的屏幕效果如图1所示。选择“File/Save all”,在“Save unit1 as”对话框中将源文件名设为“main.pas”,按“保存”钮;在“Save Project1 as”对话框中将工程名设为“TestVcDLL”,按“保存”钮。 <br>第二步:选择“File/New…”,在出现的“New Item”对话框中选择“unit”,按“OK”钮,生成一个空的源文件,在该文件中输入以下内容: <br>unit MaxMin; <br>&nbsp;<br>interface <br>function Min1(x,y,z:Integer):Integer; stdcall; <br>function Max1(x,y,z:Integer):Integer; stdcall; <br>&nbsp;<br>implementation <br>function Min1;external 'MaxMin.DLL' name 'Min1'; <br>function Max1;external Max'Min.DLL' name 'Max1'; <br>end. <br>选择“File/Save As…”,将上述文件存为“MaxMin.pas”。 <br>第三步:在Main.pas文件中,在“implementation”语句后加入: <br>uses <br>MaxMin; <br>第四步:在Form上双击“运行”按钮对该按钮的“Click”事件编程,代码如下: <br>procedure TTestVcDLLForm.btnRunClick(Sender: TObject); <br>begin <br>edtMax.Text:=IntToStr(Max1(StrToInt(edtInt1.Text), <br>StrToInt(edtInt2.Text),StrToInt(edtInt3.Text))); //调用动态链接库中的函数Max1 <br>edtMin.Text:=IntToStr(Min1(StrToInt(edtInt1.Text), <br>StrToInt(edtInt2.Text),StrToInt(edtInt3.Text))); //调用动态链接库中的函数Min1 <br>end; <br>保存该文件。 <br>第五步:将上述1.中VC++6所建立的动态链接库“MaxMin.DLL”拷入Delphi的当前工作目录中。 <br>第六步:运行。结果如图2所示。 <br>&nbsp;<br>&nbsp;<br>图2:隐式调用DLL运行结果<br>&nbsp;<br>&nbsp;<br>&nbsp;<br>图3:显式调用DLL运行结果 <br>&nbsp;<br>(2)显示调用 <br>第一步:同隐式调用。只是将Form的“Caption”属性改为“VC++的DLL显式调用测试”。 <br>第二步:选择“File/New…”,在出现的“New Item”对话框中选择“unit”,按“OK”钮,生成一个空的源文件,在该文件中输入以下内容: <br>unit Unit1; <br>&nbsp;<br>interface <br>&nbsp;<br>type <br>TMin1=function(x,y,z:Integer):Integer; stdcall; <br>TMax1=function(x,y,z:Integer):Integer; stdcall; <br>THandle=Integer; <br>&nbsp;<br>implementation <br>&nbsp;<br>end. <br>选择“File/Save As…”,将上述文件存为“MaxMin.pas”。 <br>第三步:在Main.pas文件中,在“implementation”语句后加入: <br>uses <br>MaxMin; <br>第四步:在Form上双击“运行”按钮对该按钮的“Click”事件编程,代码如下: <br>procedure TTestVcDLLForm.btnRunClick(Sender: TObject); <br>var <br>Handle:THandle; <br>Min1:TMin1; <br>Max1:TMax1; <br>begin <br>Handle:=LoadLibrary('MaxMin.dll'); //将“MaxMin.dll”的文件映象映射进调用进程的地址空间 <br>if Handle&lt;&gt;0 then <br>begin <br>@Min1:=GetProcAddress(Handle,'Min1'); //取得DLL中函数Min1( )的地址 <br>@Max1:=GetProcAddress(Handle,'Max1'); //取得DLL中函数Max1( )的地址 <br>if (@Min1&lt;&gt;nil) and (@Min1&lt;&gt;nil) then <br>begin <br>edtMin.Text:=IntToStr(Min1(StrToInt(edtInt1.Text), <br>StrToInt(edtInt2.Text),StrToInt(edtInt3.Text))); //调用动态链接库中的函数Min1 <br>edtMax.Text:=IntToStr(Max1(StrToInt(edtInt1.Text), <br>StrToInt(edtInt2.Text),StrToInt(edtInt3.Text))); //调用动态链接库中的函数Max1 <br>end else ShowMessage('调用函数“GetProcAddress”时出错!'); <br>FreeLibrary(Handle); //从进程的地址空间中解除“MaxMin.dll”文件的映射 <br>end; <br>end; <br>保存该文件。 <br>第五步:将上述1.中VC++6所建立的动态链接库“MaxMin.DLL”拷入Delphi的当前工作目录中。 <br>第六步:运行。结果如图3所示。 <br>&nbsp;<br>以上实例均编译通过,运行正确。 <br>&nbsp;<br>三、结束语 &nbsp;<br>动态链接库为不同编程环境下的应用程序之间的连接提供了方便,节省了内存,提高了速度,同时也丰富了PowerScript语言的编程能力。动态链接库是Windows下程序组织的一种重要方式,使用动态链接库可以极大地保护用户在不同开发工具、不同时期所做的工作;利用动态链接库,用户可以逐步去构筑自己的程序模块库,为今后的工作积累素材。 <br>&nbsp;<br>
 
为何要写成DLL呢,开发神龙卡,直接写到PAS中就可以了。
 
为何要写成DLL呢,开发神龙卡,直接写到PAS中就可以了。<br><br>能详细点说明吗?
 
你可以直接将神龙卡API翻译成DELPHI,写到PAS中呀<br>大富翁上已经有翻译过的API了,偶贴给你:<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2388405(神龙卡回调函数)<br>http://www.delphifans.com/down_view.asp?id=476(神龙卡API)<br>
 
谢谢!可以直接把http://www.delphifans.com/down_view.asp?id=476(神龙卡API)<br>Email:softdiy@21cn.com
 
OK,MAIL已发,请查收。[:)]
 
偶发的心竟然被退回来了!<br>This message is generated by COREMAIL email system.<br>I'm sorry to have to inform you that the message returned<br><br>The message to softdiy@21cn.com is bounced because : SMTP error, DOT: 553 Mail data refused by AISP, rule [1661492].<br><br>你发送到softdiy@21cn.com的邮件由于以下原因被退回 : SMTP error, DOT: 553 Mail data refused by AISP, rule [1661492].<br><br>算了,直接贴出来吧:<br><br><br>-----------------------------------------------------------------------------<br>unit FMPdefs;<br><br>interface<br><br>&nbsp; uses Windows, mmSystem;<br><br>{------------------------- &nbsp;FMP Commands &nbsp;---------------------}<br>const FMP_OPEN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$01;<br>const FMP_CLOSE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$02;<br>const FMP_PLAY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$03;<br>const FMP_PAUSE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$04;<br>const FMP_STOP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$05;<br>const FMP_SEEK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$06;<br>const FMP_STEP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$07;<br>const FMP_GROUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$08;<br>const FMP_SET &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$09;<br>const FMP_GET &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0A;<br>const FMP_CALLBACK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0B;<br>const FMP_SIGNAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0C;<br>const FMP_UNLOAD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0D;<br>const FMP_INIT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0E;<br>const FMP_CAPTURE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0F;<br>const FMP_UPDATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$10;<br>const FMP_FREEZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$12;<br><br>{------------------------- &nbsp;FMP Errors &nbsp;---------------------}<br>const FMPE_DOS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0100;<br>const FMPE_INVALID_FLAGS &nbsp; &nbsp; = &nbsp;$0200;<br>const FMPE_HANDLE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0300;<br>const FMPE_NOT_IMPLEMENT &nbsp; &nbsp; = &nbsp;$0400;<br>const FMPE_INVALID_CMD &nbsp; &nbsp; &nbsp; = &nbsp;$0500;<br>const FMPE_OUT_OF_MEM &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0600;<br>const FMPE_INDEX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0700;<br>const FMPE_TYPE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0800;<br>const FMPE_WRITE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0900;<br>const FMPE_TOO_MANY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0A00;<br>const FMPE_ITEM_INDEX &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0B00;<br>const FMPE_ITEM_HANDLE &nbsp; &nbsp; &nbsp; = &nbsp;$0C00;<br>const FMPE_ERROR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0D00;<br>const FMPE_STREAM_DATA &nbsp; &nbsp; &nbsp; = &nbsp;$0E00;<br>const FMPE_NOT_CDXA_DRV &nbsp; &nbsp; &nbsp;= &nbsp;$0F00;<br>const FMPE_HARDWARE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$1000;<br>const FMPE_NA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$1100;<br>const FMPE_VALUE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$1200;<br>const FMPE_TIME_FMT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$1300;<br>const FMPE_NOT_READY &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$1400;<br>const FMPE_POS &nbsp; &nbsp; = &nbsp;$1500;<br>const FMPE_REFUSE &nbsp; &nbsp; = $1600;<br>const FMPE_INVALID_INDEX &nbsp; &nbsp; = &nbsp;$1700;<br><br>{------------------------- &nbsp;FMP Messages &nbsp;---------------------}<br>const FMPM_BUF_POS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$01;<br>const FMPM_BUF_EMPTY &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$02;<br>const FMPM_BUF_SEEK &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$03;<br>const FMPM_BUF_CREATE &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$04;<br>const FMPM_BUF_CLOSE &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$05;<br>const FMPM_BUF_TOTALSIZE &nbsp; &nbsp; = &nbsp;$06;<br>const FMPM_COMPLETED &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$07;<br>const FMPM_CANCELED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$08;<br>const FMPM_ERROR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$09;<br>const FMPM_MEM_ALLOC &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0A;<br>const FMPM_MEM_FREE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0B;<br>const FMPM_SIGNAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0C;<br>const FMPM_FIFO_START &nbsp; &nbsp; = &nbsp;$0D;<br>const FMPM_FIFO_LOW &nbsp; &nbsp; = &nbsp;$0E;<br>const FMPM_FIFO_HIGH &nbsp; &nbsp; = &nbsp;$0F;<br>const FMPM_FIFO_DROP &nbsp; &nbsp; = &nbsp;$10;<br>const FMPM_PUSH_READ &nbsp; &nbsp; = &nbsp;$11;<br>const FMPM_PUSH_SEEK &nbsp; &nbsp; = &nbsp;$12;<br>const FMPM_PUSH_CREATE &nbsp; &nbsp; = &nbsp;$13;<br><br>{------------------------- &nbsp;FMP Flags &nbsp;---------------------}<br>const FMPF_BUF_LOW &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$00000000;<br>const FMPF_BUF_EMS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$00010000;<br>const FMPF_BUF_XMS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$00020000;<br><br>const FMPF_PASCAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$1000;<br>const FMPF_C &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$2000;<br><br>const FMPF_TEST &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$8000;<br><br>const FMPF_INSERT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0001;<br>const FMPF_REMOVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0002;<br>const FMPF_GET &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0003;<br>const FMPF_SELECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0004;<br>const FMPF_UNSELECT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0005;<br>const FMPF_HANDLE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0000;<br>const FMPF_INDEX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0020;<br><br>const FMPF_FILE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0001;<br>const FMPF_BUFFERS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0002;<br>const FMPF_GROUP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0003;<br>const FMPF_BROADCAST &nbsp; &nbsp; = &nbsp;$0004;<br>const FMPF_EXTEND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0010;<br>const FMPF_NOACCESS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0100;<br><br>const FMPF_UNKNOWN &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0000;<br>const FMPF_AUDIO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0001;<br>const FMPF_VIDEO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0002;<br><br>const FMPF_POS_START &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0100;<br>const FMPF_POS_SET &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0200;<br>const FMPF_POS_END &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0300;<br>const FMPF_POS_CUR &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0400;<br><br>const FMPF_DONT_UPDATE &nbsp; &nbsp; &nbsp; = &nbsp;$1000;<br>const FMPF_UPDATE_ALL &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$2000;<br><br>const FMPF_SIG_AT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0001;<br>const FMPF_SIG_EVERY &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0002;<br>const FMPF_SIG_REMOVE &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0003;<br>const FMPF_SIG_REMOVE_AT &nbsp; &nbsp; = &nbsp;$0004;<br>const FMPF_SIG_REMOVE_ALL &nbsp; &nbsp;= &nbsp;$0005;<br><br>const FMPE_HRD &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$2000;<br>const FMPE_HRD_NO_DMA &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$2100;<br>const FMPE_HRD_NO_INT &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$2200;<br>const FMPE_HRD_NO_PORT &nbsp; &nbsp; &nbsp; = &nbsp;$2300;<br>const FMPE_HRD_NOT_FOUND &nbsp; &nbsp; = &nbsp;$2400;<br>const FMPE_HRD_DONT_USE &nbsp; &nbsp; &nbsp;= &nbsp;$2500;<br><br>const FMPF_END_STOP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0000;<br>const FMPF_END_PAUSE &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0001;<br>const FMPF_END_KEEP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0002;<br>const FMPF_END_REPEAT &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0004;<br>const FMPF_END_CLOSE &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0005;<br><br>const FMPF_PAUSED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0001;<br>const FMPF_STOPPED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0002;<br>const FMPF_PLAYING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0004;<br>const FMPF_SEEKING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0008;<br>const FMPF_STEPPING &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0010;<br>const FMPF_CLOSED &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0020;<br>const FMPF_READY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = (FMPF_PAUSED or FMPF_STOPPED);<br><br>const FMPF_BYTES &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0001;<br>const FMPF_SAMPLES &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0002;<br>const FMPF_MSEC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0003;<br>const FMPF_HMSF &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0004;<br>const FMPF_HMSC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0005;<br>const FMPF_FRAMES &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;FMPF_SAMPLES;<br>const FMPF_TIME &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;FMPF_HMSC;<br>const FMPF_SMPTE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;FMPF_HMSF;<br><br>const FMPF_BUF_32_BITS &nbsp; &nbsp; &nbsp; = &nbsp;$0001;<br>const FMPF_BUF_LOOP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0002;<br><br>const FMPF_VID_UNKNOWN &nbsp; &nbsp; &nbsp; = &nbsp;$0000;<br>const FMPF_VID_MPEG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0001;<br>const FMPF_VID_AVI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0002;<br>const FMPF_VID_MPEG2 &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0004;<br><br>const FMPF_ALL_VGA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0001;<br>const FMPF_ALL_VID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0002;<br>const FMPF_KEY_VGA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0004;<br>const FMPF_KEY_VID &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0008;<br>const FMPF_KEY_MIX &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$000C;<br>const FMPF_KEY_CALIBRATE &nbsp; &nbsp; = &nbsp;$000D;<br><br>const FMPF_AUD_UNKNOWN &nbsp; &nbsp; &nbsp; = &nbsp;$0000;<br>const FMPF_AUD_MPEG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0001;<br>const FMPF_AUD_MPEG_L1 &nbsp; &nbsp; &nbsp; = &nbsp;$0002;<br>const FMPF_AUD_MPEG_L2 &nbsp; &nbsp; &nbsp; = &nbsp;$0004;<br>const FMPF_AUD_MPEG_L3 &nbsp; &nbsp; &nbsp; = &nbsp;$0008;<br>const FMPF_AUD_MPEG2 &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0010;<br>const FMPF_AUD_MPEG2_L1 &nbsp; &nbsp; &nbsp;= &nbsp;$0020;<br>const FMPF_AUD_MPEG2_L2 &nbsp; &nbsp; &nbsp;= &nbsp;$0040;<br>const FMPF_AUD_MPEG2_L3 &nbsp; &nbsp; &nbsp;= &nbsp;$0080;<br>const FMPF_AUD_DOLBY_AC3 &nbsp; &nbsp; = &nbsp;$0100;<br><br>const FMPF_AUD_WAVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0010;<br>const FMPF_AUD_VOC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0020;<br>const FMPF_AUD_PCM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0040;<br>const FMPF_AUD_ADPCM &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0080;<br><br>const FMPF_AUD_STEREO &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0001;<br>const FMPF_AUD_JSTEREO &nbsp; &nbsp; &nbsp; = &nbsp;$0002;<br>const FMPF_AUD_DUAL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0003;<br>const FMPF_AUD_SINGLE &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0004;<br>const FMPF_AUD_11 &nbsp; &nbsp; = &nbsp;$0000;<br>const FMPF_AUD_10 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0001;<br>const FMPF_AUD_20 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0002;<br>const FMPF_AUD_30 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0003;<br>const FMPF_AUD_21 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0004;<br>const FMPF_AUD_31 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0005;<br>const FMPF_AUD_22 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0006;<br>const FMPF_AUD_32 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0007;<br><br>const FMPF_AUD_NO_EMPH &nbsp; &nbsp; &nbsp; = &nbsp;$0001;<br>const FMPF_AUD_EMPH_50 &nbsp; &nbsp; &nbsp; = &nbsp;$0002;<br>const FMPF_AUD_EMPH_J17 &nbsp; &nbsp; &nbsp;= &nbsp;$0003;<br><br>const FMPF_AUD_COPYRIGHT &nbsp; &nbsp; = &nbsp;$0001;<br>const FMPF_AUD_ORIGINAL &nbsp; &nbsp; &nbsp;= &nbsp;$0002;<br><br>const FMPF_GRP_UNKNOWN &nbsp; &nbsp; &nbsp; = &nbsp;$0000;<br>const FMPF_GRP_MPEG &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0001;<br>const FMPF_GRP_AVI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0002;<br>const FMPF_GRP_CUSTOM &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0004;<br>const FMPF_GRP_MPEG2_PROGRAM = &nbsp;$0008;<br>const FMPF_GRP_MPEG2_TRANSPORT &nbsp;= &nbsp;$0010;<br><br>const FMPF_PIC_BMP &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0001;<br>const FMPF_PIC_DIB24 &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0002;<br>const FMPF_PIC_TOFILE &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0004;<br><br>const FMPF_REFUSE &nbsp; &nbsp; = $0001;<br>const FMPF_IGNORE &nbsp; &nbsp; = $0002;<br><br>{------------------------- &nbsp;FMP Index &nbsp;---------------------}<br>const FMPI_DRV_PRODUCT &nbsp; &nbsp; &nbsp; = &nbsp;$0101;<br>const FMPI_DRV_VERSION &nbsp; &nbsp; &nbsp; = &nbsp;$0102;<br>const FMPI_DRV_MAX_CHAN &nbsp; &nbsp; &nbsp;= &nbsp;$0103;<br>const FMPI_DRV_VID_SUP &nbsp; &nbsp; &nbsp; = &nbsp;$0104;<br>const FMPI_DRV_AUD_SUP &nbsp; &nbsp; &nbsp; = &nbsp;$0105;<br>const FMPI_DRV_GRP_SUP &nbsp; &nbsp; &nbsp; = &nbsp;$0106;<br>const FMPI_DRV_HDR_STAT &nbsp; &nbsp; &nbsp;= &nbsp;$0107;<br>const FMPI_DRV_MEMORY &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0108;<br>const FMPI_DRV_ID &nbsp; &nbsp; = &nbsp;$0109;<br>const FMPI_DRV_CAPABILITY &nbsp; &nbsp;= $010A;<br><br>const FMPI_STM_TYPE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0202;<br>const FMPI_STM_SOURCE &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0203;<br>const FMPI_STM_MODE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0204;<br>const FMPI_STM_TIME_FMT &nbsp; &nbsp; &nbsp;= &nbsp;$0205;<br>const FMPI_STM_POSITION &nbsp; &nbsp; &nbsp;= &nbsp;$0206;<br>const FMPI_STM_SPEED &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0207;<br>const FMPI_STM_USER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0208;<br>const FMPI_STM_SIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0209;<br>const FMPI_STM_SLIDE &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$020A;<br>const FMPI_STM_PASSWD &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0210;<br>const FMPI_STM_FILETYPE &nbsp; &nbsp; &nbsp;= &nbsp;$0211;<br>const FMPI_STM_MEMFLAGS &nbsp; &nbsp; &nbsp;= &nbsp;$0212;<br>const FMPI_STM_FILESIZE &nbsp; &nbsp; &nbsp;= &nbsp;$0213;<br>const FMPI_STM_FILEORG &nbsp; &nbsp; &nbsp; = &nbsp;$0214;<br>const FMPI_STM_BIT_RATE &nbsp; &nbsp; = $0215;<br>const FMPI_STM_NOCACHE &nbsp; &nbsp; = $0216;<br><br>const FMPI_BUF_LEFT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0301;<br>const FMPI_BUF_POS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0302;<br>const FMPI_BUF_ADDRESS &nbsp; &nbsp; &nbsp; = &nbsp;$0303;<br>const FMPI_BUF_SIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0304;<br>const FMPI_BUF_MODE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0305;<br>const FMPI_BUF_TOTALSIZE &nbsp; &nbsp; = &nbsp;$0306;<br><br>const FMPI_VID_TYPE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0401;<br>const FMPI_VID_RATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0402;<br>const FMPI_VID_SIZE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0403;<br>const FMPI_VID_ASPECT &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0404;<br>const FMPI_VID_BIT_RATE &nbsp; &nbsp; &nbsp;= &nbsp;$0405;<br>const FMPI_VID_SRC_POS &nbsp; &nbsp; &nbsp; = &nbsp;$0406;<br>const FMPI_VID_SRC_SIZE &nbsp; &nbsp; &nbsp;= &nbsp;$0407;<br>const FMPI_VID_DEST_POS &nbsp; &nbsp; &nbsp;= &nbsp;$0408;<br>const FMPI_VID_DEST_SIZE &nbsp; &nbsp; = &nbsp;$0409;<br>const FMPI_VID_KEY_MIN &nbsp; &nbsp; &nbsp; = &nbsp;$040A;<br>const FMPI_VID_KEY_MAX &nbsp; &nbsp; &nbsp; = &nbsp;$040B;<br>const FMPI_VID_KEY_MASK &nbsp; &nbsp; &nbsp;= &nbsp;$040C;<br>const FMPI_VID_KEY_COL &nbsp; &nbsp; &nbsp; = &nbsp;$040D;<br>const FMPI_VID_KEY_MODE &nbsp; &nbsp; &nbsp;= &nbsp;$040E;<br>const FMPI_VID_KEY_TYPE &nbsp; &nbsp; &nbsp;= &nbsp;$040F;<br>const FMPI_VID_CONTRAST &nbsp; &nbsp; = $0410;<br>const FMPI_VID_BRIGHTNESS &nbsp; &nbsp;= $0411;<br>const FMPI_VID_SATURATION &nbsp; &nbsp;= $0412;<br>const FMPI_VID_SLIDE &nbsp; &nbsp; = $0420;<br>const FMPI_VID_HWND &nbsp; &nbsp; = $0413;<br>const FMPI_VID_KEY_COL_INDEX = &nbsp;$0414;<br>const FMPI_VID_TV &nbsp; &nbsp; = &nbsp;$041b;<br><br>const FMPI_VID_DEFAULTS &nbsp; &nbsp; = &nbsp;$1000;<br>const FMPI_VID_REGISTRY &nbsp; &nbsp; = $2000;<br><br>const FMPI_AUD_TYPE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0501;<br>const FMPI_AUD_RATE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0502;<br>const FMPI_AUD_VOLUME &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0503;<br>const FMPI_AUD_BIT_RATE &nbsp; &nbsp; &nbsp;= &nbsp;$0504;<br>const FMPI_AUD_TREBLE &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0505;<br>const FMPI_AUD_BASS &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0506;<br>const FMPI_AUD_CHANNELS &nbsp; &nbsp; &nbsp;= &nbsp;$0507;<br>const FMPI_AUD_EMPH &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0508;<br>const FMPI_AUD_RIGHTS &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;$0509;<br>const FMPI_AUD_SHIFT &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0510;<br>const FMPI_AUD_BAL_L &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0511;<br>const FMPI_AUD_BAL_R &nbsp; &nbsp; &nbsp; &nbsp; = &nbsp;$0512;<br><br>const FMPI_AUD_DEFAULTS &nbsp; &nbsp; = &nbsp;$1000;<br>const FMPI_AUD_REGISTRY &nbsp; &nbsp; = &nbsp;$2000;<br><br>const FMPI_GRP_TYPE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0601;<br>const FMPI_GRP_NB &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = $0602;<br><br>const FMPI_FIFO_FCNTRL &nbsp; &nbsp; &nbsp; &nbsp;= $0701;<br>const FMPI_FIFO_SIZE &nbsp; &nbsp; &nbsp; &nbsp;= $0702;<br>const FMPI_FIFO_MAX &nbsp; &nbsp; &nbsp; &nbsp;= $0703;<br>const FMPI_FIFO_VID_SIZE &nbsp; &nbsp; &nbsp; &nbsp;= $0704;<br>const FMPI_FIFO_AUD_SIZE &nbsp; &nbsp; &nbsp; &nbsp;= $0705;<br>const FMPI_FIFO_START &nbsp; &nbsp; &nbsp; &nbsp;= $0706;<br>const FMPI_FIFO_LOW &nbsp; &nbsp; &nbsp; &nbsp;= $0707;<br>const FMPI_FIFO_HIGH &nbsp; &nbsp; &nbsp; &nbsp;= $0708;<br>const FMPI_FIFO_DROP &nbsp; &nbsp; &nbsp; &nbsp;= $0709;<br>const FMPI_FIFO_UNIT &nbsp; &nbsp; &nbsp; &nbsp;= $070A;<br><br>const FMPI_PUSH_ASYNC &nbsp; &nbsp; &nbsp; &nbsp;= $0801;<br>const FMPI_PUSH_SYNC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= $0802;<br><br>const FMPI_OVLY_XOFFSET &nbsp; &nbsp; &nbsp; &nbsp;= $0901;<br>const FMPI_OVLY_YOFFSET &nbsp; &nbsp; &nbsp; &nbsp;= $0902;<br>const FMPI_OVLY_VGACORRECTION &nbsp; = $0903;<br>const FMPI_OVLY_STABILITY &nbsp; &nbsp; &nbsp; = $0904;<br>const FMPI_OVLY_HFREQUENCY &nbsp; &nbsp; &nbsp;= $0905;<br>const FMPI_OVLY_USEDEFAULTFREQ = $0906;<br>const FMPI_OVLY_COLOR_SETTING = $0907;<br>const FMPI_OVLY_LOWERLEVEL = $0908;<br>const FMPI_OVLY_UPPERLEVEL = $0909;<br>const FMPI_OVLY_DELTA_CALIBRATE = $090A;<br>const FMPI_OVLY_COLOR_CALIBRATION &nbsp;= $090B;<br><br>const FMPI_OVLY_DEFAULTS &nbsp; &nbsp; = $1000;<br>const FMPI_OVLY_REGISTRY &nbsp; &nbsp; = $2000;<br><br>const FMPI_UPD_PALETTE &nbsp; &nbsp; &nbsp; = $0001;<br>const FMPI_UPD_VGA_MODE &nbsp; &nbsp; &nbsp;= $0007;<br>const FMPI_UPD_FRAME_POS &nbsp; &nbsp; = $0008;<br>const FMPI_UPD_FRAME_SIZE &nbsp; &nbsp;= $0009;<br><br><br>const FMP_MIN_AUD_VOLUME = 0;<br>const FMP_MAX_AUD_VOLUME = 100;<br>const FMP_DEF_AUD_VOLUME = 50;<br><br>const FMP_MIN_BSC = 0;<br>const FMP_MAX_BSC = 1000;<br>const FMP_DEF_BSC = 500;<br><br>const FMP_CAPABILITY_BORDER_ADJUST &nbsp; &nbsp;= $0001;<br>const FMP_CAPABILITY_KEYCOLOR_ADJUST &nbsp;= $0002;<br>const FMP_CAPABILITY_BSC_ADJUST &nbsp; &nbsp; &nbsp;= $0004;<br><br><br>const FMP_MIN_COLOR_LEVEL &nbsp; &nbsp; &nbsp;= $00000000;<br>const FMP_MEDIUM_COLOR_LEVEL &nbsp; &nbsp; &nbsp;= $00808080;<br>const FMP_MAX_COLOR_LEVEL &nbsp; &nbsp; &nbsp;= $00FFFFFF;<br>const FMP_MEDIUM_COLOR &nbsp; &nbsp; &nbsp;= $80;<br><br>const FMP_LOWER_RED &nbsp; &nbsp; &nbsp;= $01;<br>const FMP_LOWER_GREEN &nbsp; &nbsp; &nbsp;= $02;<br>const FMP_LOWER_BLUE &nbsp; &nbsp; &nbsp;= $04;<br>const FMP_UPPER_RED &nbsp; &nbsp; &nbsp;= $10;<br>const FMP_UPPER_GREEN &nbsp; &nbsp; &nbsp;= $20;<br>const FMP_UPPER_BLUE &nbsp; &nbsp; &nbsp;= $40;<br><br>const SET_VGA &nbsp; &nbsp; &nbsp;= 1;<br>const SET_TV &nbsp; &nbsp; &nbsp;= 0;<br><br>const MAXFILENAME &nbsp; &nbsp; = &nbsp;256; &nbsp; &nbsp;// maximum length of file pathname<br>const MAXCUSTFILTER &nbsp; = &nbsp;40; &nbsp; &nbsp; // maximum size of custom filter buffer<br>const MAX_BUF_SIZE &nbsp; &nbsp;= &nbsp;40960; &nbsp; // maximum buffer size (&lt; 65534)(multiple of 1024)<br>const MAX_BUF_NUMBER &nbsp;= &nbsp;20; // maximum number of buffers to use<br><br>{------------------------- &nbsp;FMP Structures &nbsp;---------------------}<br>Type<br>&nbsp; COLORREF = DWORD;<br>Type<br>&nbsp; PFMP_OPEN_STRUCT = ^TFMP_OPEN_STRUCT;<br>&nbsp; TFMP_OPEN_STRUCT = record<br> lpFileName: LPTSTR;<br> dwCallBack: DWORD; &nbsp; &nbsp; &nbsp; &nbsp; <br> Reserved &nbsp;: array[0..7] of Byte;<br>&nbsp; end;<br><br>&nbsp; PFMP_PUSH_STRUCT = ^TFMP_PUSH_STRUCT;<br>&nbsp; TFMP_PUSH_STRUCT = record<br>&nbsp; &nbsp; dwSize &nbsp;: DWORD;<br>&nbsp; &nbsp; lpBuffer: Pointer;<br>&nbsp; end;<br><br>&nbsp; PBuffer = ^Byte;<br>&nbsp; PBuf= ^TBuf;<br>&nbsp; TBuffer = array[0..MAX_BUF_NUMBER - 1] of PBuffer;<br>&nbsp; TBuf = record<br>&nbsp; &nbsp; hFile : THandle;<br>&nbsp; &nbsp; dwSize: DWORD;<br>&nbsp; &nbsp; wIndex: WORD;<br>&nbsp; &nbsp; Buffer: TBuffer;<br>&nbsp; &nbsp; BufferIndex: array[0..MAX_BUF_NUMBER- 1] of DWord; &nbsp; <br>&nbsp; end; &nbsp; &nbsp; <br><br>&nbsp; PFMP_COLOR_SETTING_STRUCT = ^FMP_COLOR_SETTING_STRUCT;<br>&nbsp; FMP_COLOR_SETTING_STRUCT = record<br>&nbsp; &nbsp; RGBColorKey: COLORREF;<br>&nbsp; &nbsp; RGBUpper &nbsp; : COLORREF;<br>&nbsp; &nbsp; RGBLower &nbsp; : COLORREF;<br>&nbsp; &nbsp; Mask &nbsp; &nbsp; &nbsp; : Short;<br>&nbsp; end;<br><br>var<br>&nbsp; hReelDrv: HDRVR; &nbsp; &nbsp; &nbsp; &nbsp; // RealMagic Driver Handle<br><br>function FMPOpenDriver: integer;<br>procedure FMPCloseDriver;<br>function FMPCommand(Command: Byte; hMPEGStream: Byte; Flags: WORD; Value: DWORD):DWORD;<br>function FMPGetLastError(a: Word): DWORD;<br><br>function FMPOpen(Flags: WORD; Filename: DWORD): DWORD; <br>function FMPClose(hStream: Byte):DWORD;<br>function FMPSet(hStream: Byte; Index: WORD; Value: DWORD): DWORD;<br>function FMPGet(hStream: Byte; Index: WORD):DWORD;<br>function FMPPlay(hStream: Byte; Flags: WORD; Position: DWORD): DWORD;<br>function FMPStep(hStream: Byte; Flags: WORD; Position: DWORD): DWORD;<br>function FMPCapture(hStream: Byte; Index: WORD; Position: DWORD): DWORD;<br>function FMPSeek(hStream: Byte; Flags: WORD; Position: DWORD): DWORD;<br>function FMPSignal(hStream: Byte; Flags: WORD; Position: DWORD): DWORD;<br>function FMPPause(hStream: Byte):DWORD;<br>function FMPStop(hStream: Byte):DWORD;<br>function FMPGroup(hStream: Byte; Flags: WORD; Value: DWORD): DWORD;<br>function FMPCallback(hStream: Byte; Value: DWORD): DWORD;<br>function FMPFreeze(hStream: Byte; Flags: WORD; Value: DWORD): DWORD;<br><br><br>implementation<br><br>{--------------------------------------------------------------<br>* &nbsp; FUNCTION &nbsp; &nbsp;: &nbsp; FMPOpenDriver()<br>* &nbsp; DESCRIPTION : &nbsp; Opens IMPEG32.DLL<br>* &nbsp; RETURN &nbsp; &nbsp; &nbsp;: &nbsp; non-zero if successful, 0 if failed.<br>---------------------------------------------------------------}<br>function FMPOpenDriver: integer;<br>const<br>&nbsp; szDriverName &nbsp;= 'reeldrv';<br>&nbsp; szSectionName = 'Drivers32';<br>begin<br>&nbsp; hReelDrv:= OpenDriver(szDriverName, szSectionName, 0);<br>&nbsp; Result &nbsp;:= hReelDrv;<br>end;<br><br>{--------------------------------------------------------------<br>* &nbsp; procedure &nbsp; : &nbsp; FMPCloseDriver()<br>* &nbsp; DESCRIPTION : &nbsp; Closes IMPEG32.DLL<br>* &nbsp; RETURN &nbsp; &nbsp; &nbsp;: &nbsp; NONE<br>---------------------------------------------------------------}<br>procedure FMPCloseDriver;<br>begin<br>&nbsp; CloseDriver(hReelDrv,0,0);<br>&nbsp; hReelDrv:= 0;<br>end;<br><br>{--------------------------------------------------------------<br>* &nbsp; FUNCTION &nbsp; &nbsp;: &nbsp; FMPCommand()<br>* &nbsp; DESCRIPTION : &nbsp; This function interfaces with the FMP MPEG support driver<br>* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and sends out the requested command.<br>* &nbsp; RETURN &nbsp; &nbsp; &nbsp;: &nbsp; value from SendDriverMessage<br>------------------------------------------------------------------}<br>function FMPCommand(Command: Byte; hMPEGStream: Byte; Flags: WORD; Value: DWORD):DWORD;<br>begin<br>&nbsp; Result:= SendDriverMessage(hReelDrv,DRV_USER+1,<br>&nbsp; MakeLParam(MakeWord(Command,hMPEGStream),Flags),Value);<br>end;<br><br>{-----------------------------------------------------------------<br>* &nbsp; FUNCTION &nbsp; &nbsp;: &nbsp; FMPGetLastError()<br>* &nbsp; DESCRIPTION : &nbsp; Returns last command error code.<br>* &nbsp; RETURN &nbsp; &nbsp; &nbsp;: &nbsp; last REALmagic command error code<br>------------------------------------------------------------------}<br>function FMPGetLastError(a: Word): DWORD;<br>begin<br>&nbsp; Result:= SendDriverMessage(hReelDrv, DRV_USER + 2, a, 0);<br>end;<br><br>function FMPOpen(Flags: WORD; Filename: DWORD): DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_OPEN, 0, Flags, Filename);<br>end;<br><br>function FMPClose(hStream: Byte):DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_CLOSE, hStream, 0, 0)<br>end;<br><br>function FMPSet(hStream: Byte; Index: WORD; Value: DWORD): DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_SET, hStream, Index, Value);<br>end;<br><br>function FMPGet(hStream: Byte; Index: WORD):DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_GET, hStream, Index, 0);<br>end;<br><br>function FMPPlay(hStream: Byte; Flags: WORD; Position: DWORD): DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_PLAY, hStream, Flags, Position);<br>end;<br><br>function FMPStep(hStream: Byte; Flags: WORD; Position: DWORD): DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_STEP, hStream, Flags, Position);<br>end;<br><br>function FMPCapture(hStream: Byte; Index: WORD; Position: DWORD): DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_CAPTURE, hStream, Index, Position);<br>end;<br><br>function FMPSeek(hStream: Byte; Flags: WORD; Position: DWORD): DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_SEEK, hStream, Flags, Position);<br>end;<br><br>function FMPSignal(hStream: Byte; Flags: WORD; Position: DWORD): DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_SIGNAL, hStream, Flags, Position);<br>end;<br><br>function FMPPause(hStream: Byte):DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_PAUSE, hStream, 0, 0);<br>end;<br><br>function FMPStop(hStream: Byte):DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_STOP, hStream, 0, 0);<br>end;<br><br>function FMPGroup(hStream: Byte; Flags: WORD; Value: DWORD): DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_GROUP, hStream, Flags, Value);<br>end;<br><br>function FMPCallback(hStream: Byte; Value: DWORD): DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_CALLBACK, hStream, FMPF_PASCAL, Value);<br>end;<br><br>function FMPFreeze(hStream: Byte; Flags: WORD; Value: DWORD): DWORD;<br>begin<br>&nbsp; Result:= FMPCommand(FMP_FREEZE, hStream, Flags, Value);<br>end;<br><br>end.<br>//-----------------------------------------------------------------------------
 
虽然我还没有验证您的答案,但您的诚挚也应该接受我的敬意!
 
后退
顶部