编译了搜狗PXP视频加速引擎 不会用方法(100分)

  • 主题发起人 主题发起人 cyr520
  • 开始时间 开始时间
C

cyr520

Unregistered / Unconfirmed
GUEST, unregistred user!
想请教各位大哥 里面的play方法怎么用
谢谢
delphi2007 自动编译代码如下:
unit MMCSHELLLib_TLB;

// ************************************************************************ //
// WARNING
// -------
// The types declared in this file were generated from data read from a
// Type Library. If this type library is explicitly or indirectly (via
// another type library referring to this type library) re-imported, or the
// 'Refresh' command of the Type Library Editor activated while editing the
// Type Library, the contents of this file will be regenerated and all
// manual modifications will be lost.
// ************************************************************************ //

// $Rev: 8291 $
// File generated on 2008-12-28 17:47:33 from Type Library described below.

// ************************************************************************ //
// Type Lib: G:/program/delphi/VOD/Kernel/feidian/MMCShell.dll (1)
// LIBID: {E19CC608-392C-4794-973B-10290AD81D9F}
// LCID: 0
// Helpfile:
// HelpString: MMCShell 1.0 Type Library
// DepndLst:
// (1) v2.0 stdole, (C:/WINDOWS/system32/stdole2.tlb)
// Errors:
// Hint: Parameter 'var' of IMMCPlayer.CorePlayer changed to 'var_'
// ************************************************************************ //
// *************************************************************************//
// NOTE:
// Items guarded by $IFDEF_LIVE_SERVER_AT_DESIGN_TIME are used by properties
// which return objects that may need to be explicitly created via a function
// call prior to any access via the property. These items have been disabled
// in order to prevent accidental use from within the object inspector. You
// may enable them by defining LIVE_SERVER_AT_DESIGN_TIME or by selectively
// removing them from the $IFDEF blocks. However, such items must still be
// programmatically created via a method of the appropriate CoClass before
// they can be used.
{$TYPEDADDRESS OFF} // Unit must be compiled without type-checked pointers.
{$WARN SYMBOL_PLATFORM OFF}
{$WRITEABLECONST ON}
{$VARPROPSETTER ON}
interface

uses Windows, ActiveX, Classes, Graphics, OleCtrls, OleServer, StdVCL, Variants;



// *********************************************************************//
// GUIDS declared in the TypeLibrary. Following prefixes are used:
// Type Libraries : LIBID_xxxx
// CoClasses : CLASS_xxxx
// DISPInterfaces : DIID_xxxx
// Non-DISP interfaces: IID_xxxx
// *********************************************************************//
const
// TypeLibrary Major and minor versions
MMCSHELLLibMajorVersion = 1;
MMCSHELLLibMinorVersion = 0;

LIBID_MMCSHELLLib: TGUID = '{E19CC608-392C-4794-973B-10290AD81D9F}';

DIID__IMMCPlayerEvents: TGUID = '{ABB84162-B02F-4417-B016-DBFF01A5F816}';
IID_IMMCPlayer: TGUID = '{29B215E9-FD0A-4524-8FCD-2F2B96C4C65C}';
CLASS_MMCPlayer: TGUID = '{05C1004E-2596-48E5-8E26-39362985EEB9}';
type

// *********************************************************************//
// Forward declaration of types defined in TypeLibrary
// *********************************************************************//
_IMMCPlayerEvents = dispinterface;
IMMCPlayer = interface;
IMMCPlayerDisp = dispinterface;

// *********************************************************************//
// Declaration of CoClasses defined in Type Library
// (NOTE: Here we map each CoClass to its Default Interface)
// *********************************************************************//
MMCPlayer = IMMCPlayer;


// *********************************************************************//
// DispIntf: _IMMCPlayerEvents
// Flags: (4096) Dispatchable
// GUID: {ABB84162-B02F-4417-B016-DBFF01A5F816}
// *********************************************************************//
_IMMCPlayerEvents = dispinterface
['{ABB84162-B02F-4417-B016-DBFF01A5F816}']
procedure OnStart;
dispid 1;
procedure OnError(lErrCode: Integer);
dispid 2;
procedure OnStop(nType: Smallint);
dispid 3;
procedure OnMessage(const bstrMsg: WideString);
dispid 4;
procedure OnP2PReady(lPort: Integer);
dispid 5;
procedure OnNotifyMessage(lMsg: Integer);
dispid 6;
procedure ScriptCommand(const scType: WideString;
const Param: WideString);
dispid 7;
end;


// *********************************************************************//
// Interface: IMMCPlayer
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {29B215E9-FD0A-4524-8FCD-2F2B96C4C65C}
// *********************************************************************//
IMMCPlayer = interface(IDispatch)
['{29B215E9-FD0A-4524-8FCD-2F2B96C4C65C}']
function Get_currentPosition:do
uble;
safecall;
procedure Set_currentPosition(pdVal:do
uble);
safecall;
function Get_duration:do
uble;
safecall;
function Get_PlayState: Integer;
safecall;
procedure fullsreen;
safecall;
function Get_FileName: WideString;
safecall;
procedure Set_FileName(const pVal: WideString);
safecall;
procedure pause(sVal: Smallint);
safecall;
procedure play(sVal: Smallint);
safecall;
procedure stop(sVal: Smallint);
safecall;
function Get_uiMode: WideString;
safecall;
procedure Set_uiMode(const pVal: WideString);
safecall;
function getCurrentMedia: WideString;
safecall;
procedure Set_AutoStart(Param1: WordBool);
safecall;
function Get_volume: Integer;
safecall;
procedure Set_volume(pVal: Integer);
safecall;
function Get_mute: WordBool;
safecall;
procedure Set_mute(pVal: WordBool);
safecall;
procedure ProcPlaylist(__MIDL_0011: OleVariant);
safecall;
function Get_AdsURL1: WideString;
safecall;
procedure Set_AdsURL1(const pVal: WideString);
safecall;
function Get_AdsURL2: WideString;
safecall;
procedure Set_AdsURL2(const pVal: WideString);
safecall;
function Get_IDChannel: WideString;
safecall;
procedure Set_IDChannel(const pVal: WideString);
safecall;
function Get_IndexOfCurrentURL: Smallint;
safecall;
function Get_WorkMode: Smallint;
safecall;
procedure Set_WorkMode(pVal: Smallint);
safecall;
function Get_CanChangeWorkMode: WordBool;
safecall;
function Get_MediaCounts: Integer;
safecall;
function Get_BackupURL: WideString;
safecall;
procedure Set_BackupURL(const pVal: WideString);
safecall;
function Get_CorePlayer: OleVariant;
safecall;
procedure PlayItem(Index: Integer);
safecall;
function Get_ReceivedPackets: Integer;
safecall;
function getMediaError: Integer;
safecall;
function getMediaErrMsg: OleVariant;
safecall;
function Get_playMode: Smallint;
safecall;
procedure Set_playMode(pVal: Smallint);
safecall;
function Get_enableMovieSlide: WordBool;
safecall;
procedure Set_enableMovieSlide(pVal: WordBool);
safecall;
function Get_ChannelName: WideString;
safecall;
procedure Set_ChannelName(const pVal: WideString);
safecall;
property currentPosition:do
uble read Get_currentPosition write Set_currentPosition;
property duration:do
uble read Get_duration;
property PlayState: Integer read Get_PlayState;
property FileName: WideString read Get_FileName write Set_FileName;
property uiMode: WideString read Get_uiMode write Set_uiMode;
property AutoStart: WordBool write Set_AutoStart;
property volume: Integer read Get_volume write Set_volume;
property mute: WordBool read Get_mute write Set_mute;
property AdsURL1: WideString read Get_AdsURL1 write Set_AdsURL1;
property AdsURL2: WideString read Get_AdsURL2 write Set_AdsURL2;
property IDChannel: WideString read Get_IDChannel write Set_IDChannel;
property IndexOfCurrentURL: Smallint read Get_IndexOfCurrentURL;
property WorkMode: Smallint read Get_WorkMode write Set_WorkMode;
property CanChangeWorkMode: WordBool read Get_CanChangeWorkMode;
property MediaCounts: Integer read Get_MediaCounts;
property BackupURL: WideString read Get_BackupURL write Set_BackupURL;
property CorePlayer: OleVariant read Get_CorePlayer;
property ReceivedPackets: Integer read Get_ReceivedPackets;
property playMode: Smallint read Get_playMode write Set_playMode;
property enableMovieSlide: WordBool read Get_enableMovieSlide write Set_enableMovieSlide;
property ChannelName: WideString read Get_ChannelName write Set_ChannelName;
end;


// *********************************************************************//
// DispIntf: IMMCPlayerDisp
// Flags: (4416) Dual OleAutomation Dispatchable
// GUID: {29B215E9-FD0A-4524-8FCD-2F2B96C4C65C}
// *********************************************************************//
IMMCPlayerDisp = dispinterface
['{29B215E9-FD0A-4524-8FCD-2F2B96C4C65C}']
property currentPosition:do
uble dispid 1;
property duration:do
uble readonly dispid 2;
property PlayState: Integer readonly dispid 3;
procedure fullsreen;
dispid 4;
property FileName: WideString dispid 5;
procedure pause(sVal: Smallint);
dispid 6;
procedure play(sVal: Smallint);
dispid 7;
procedure stop(sVal: Smallint);
dispid 8;
property uiMode: WideString dispid 9;
function getCurrentMedia: WideString;
dispid 10;
property AutoStart: WordBool writeonly dispid 12;
property volume: Integer dispid 13;
property mute: WordBool dispid 14;
procedure ProcPlaylist(__MIDL_0011: OleVariant);
dispid 15;
property AdsURL1: WideString dispid 16;
property AdsURL2: WideString dispid 17;
property IDChannel: WideString dispid 18;
property IndexOfCurrentURL: Smallint readonly dispid 19;
property WorkMode: Smallint dispid 20;
property CanChangeWorkMode: WordBool readonly dispid 21;
property MediaCounts: Integer readonly dispid 22;
property BackupURL: WideString dispid 23;
property CorePlayer: OleVariant readonly dispid 24;
procedure PlayItem(Index: Integer);
dispid 25;
property ReceivedPackets: Integer readonly dispid 26;
function getMediaError: Integer;
dispid 27;
function getMediaErrMsg: OleVariant;
dispid 28;
property playMode: Smallint dispid 29;
property enableMovieSlide: WordBool dispid 30;
property ChannelName: WideString dispid 31;
end;



// *********************************************************************//
// OLE Control Proxy class declaration
// Control Name : TMMCPlayer
// Help String : MMCPlayer Class
// Default Interface: IMMCPlayer
// Def. Intf. DISP? : No
// Event Interface: _IMMCPlayerEvents
// TypeFlags : (2) CanCreate
// *********************************************************************//
TMMCPlayerOnError = procedure(ASender: TObject;
lErrCode: Integer) of object;
TMMCPlayerOnStop = procedure(ASender: TObject;
nType: Smallint) of object;
TMMCPlayerOnMessage = procedure(ASender: TObject;
const bstrMsg: WideString) of object;
TMMCPlayerOnP2PReady = procedure(ASender: TObject;
lPort: Integer) of object;
TMMCPlayerOnNotifyMessage = procedure(ASender: TObject;
lMsg: Integer) of object;
TMMCPlayerScriptCommand = procedure(ASender: TObject;
const scType: WideString;

const Param: WideString) of object;

TMMCPlayer = class(TOleControl)
private
FOnStart: TNotifyEvent;
FOnError: TMMCPlayerOnError;
FOnStop: TMMCPlayerOnStop;
FOnMessage: TMMCPlayerOnMessage;
FOnP2PReady: TMMCPlayerOnP2PReady;
FOnNotifyMessage: TMMCPlayerOnNotifyMessage;
FOnScriptCommand: TMMCPlayerScriptCommand;
FIntf: IMMCPlayer;
function GetControlInterface: IMMCPlayer;
protected
procedure CreateControl;
procedure InitControlData;
override;
function Get_CorePlayer: OleVariant;
public
procedure fullsreen;
procedure pause(sVal: Smallint);
procedure play(sVal: Smallint);
procedure stop(sVal: Smallint);
function getCurrentMedia: WideString;
procedure ProcPlaylist(__MIDL_0011: OleVariant);
procedure PlayItem(Index: Integer);
function getMediaError: Integer;
function getMediaErrMsg: OleVariant;
property ControlInterface: IMMCPlayer read GetControlInterface;
property DefaultInterface: IMMCPlayer read GetControlInterface;
property duration:do
uble index 2 read GetDoubleProp;
property PlayState: Integer index 3 read GetIntegerProp;
property AutoStart: WordBool index 12 write SetWordBoolProp;
property IndexOfCurrentURL: Smallint index 19 read GetSmallintProp;
property CanChangeWorkMode: WordBool index 21 read GetWordBoolProp;
property MediaCounts: Integer index 22 read GetIntegerProp;
property CorePlayer: OleVariant index 24 read GetOleVariantProp;
property ReceivedPackets: Integer index 26 read GetIntegerProp;
published
property Anchors;
property TabStop;
property Align;
property DragCursor;
property DragMode;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property Visible;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnStartDrag;
property currentPosition:do
uble index 1 read GetDoubleProp write SetDoubleProp stored False;
property FileName: WideString index 5 read GetWideStringProp write SetWideStringProp stored False;
property uiMode: WideString index 9 read GetWideStringProp write SetWideStringProp stored False;
property volume: Integer index 13 read GetIntegerProp write SetIntegerProp stored False;
property mute: WordBool index 14 read GetWordBoolProp write SetWordBoolProp stored False;
property AdsURL1: WideString index 16 read GetWideStringProp write SetWideStringProp stored False;
property AdsURL2: WideString index 17 read GetWideStringProp write SetWideStringProp stored False;
property IDChannel: WideString index 18 read GetWideStringProp write SetWideStringProp stored False;
property WorkMode: Smallint index 20 read GetSmallintProp write SetSmallintProp stored False;
property BackupURL: WideString index 23 read GetWideStringProp write SetWideStringProp stored False;
property playMode: Smallint index 29 read GetSmallintProp write SetSmallintProp stored False;
property enableMovieSlide: WordBool index 30 read GetWordBoolProp write SetWordBoolProp stored False;
property ChannelName: WideString index 31 read GetWideStringProp write SetWideStringProp stored False;
property OnStart: TNotifyEvent read FOnStart write FOnStart;
property OnError: TMMCPlayerOnError read FOnError write FOnError;
property OnStop: TMMCPlayerOnStop read FOnStop write FOnStop;
property OnMessage: TMMCPlayerOnMessage read FOnMessage write FOnMessage;
property OnP2PReady: TMMCPlayerOnP2PReady read FOnP2PReady write FOnP2PReady;
property OnNotifyMessage: TMMCPlayerOnNotifyMessage read FOnNotifyMessage write FOnNotifyMessage;
property OnScriptCommand: TMMCPlayerScriptCommand read FOnScriptCommand write FOnScriptCommand;
end;


procedure Register;

resourcestring
dtlServerPage = 'ActiveX';

dtlOcxPage = 'ActiveX';

implementation

uses ComObj;

procedure TMMCPlayer.InitControlData;
const
CEventDispIDs: array [0..6] of DWORD = (
$00000001, $00000002, $00000003, $00000004, $00000005, $00000006,
$00000007);
CControlData: TControlData2 = (
ClassID: '{05C1004E-2596-48E5-8E26-39362985EEB9}';
EventIID: '{ABB84162-B02F-4417-B016-DBFF01A5F816}';
EventCount: 7;
EventDispIDs: @CEventDispIDs;
LicenseKey: nil (*HR:$80004002*);
Flags: $00000000;
Version: 401);
begin

ControlData := @CControlData;
TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnStart) - Cardinal(Self);
end;


procedure TMMCPlayer.CreateControl;

proceduredo
Create;
begin

FIntf := IUnknown(OleObject) as IMMCPlayer;
end;


begin

if FIntf = nil then
do
Create;
end;


function TMMCPlayer.GetControlInterface: IMMCPlayer;
begin

CreateControl;
Result := FIntf;
end;


function TMMCPlayer.Get_CorePlayer: OleVariant;
var
InterfaceVariant : OleVariant;
begin

InterfaceVariant := DefaultInterface;
Result := InterfaceVariant.CorePlayer;
end;


procedure TMMCPlayer.fullsreen;
begin

DefaultInterface.fullsreen;
end;


procedure TMMCPlayer.pause(sVal: Smallint);
begin

DefaultInterface.pause(sVal);
end;


procedure TMMCPlayer.play(sVal: Smallint);
begin

DefaultInterface.play(sVal);
end;


procedure TMMCPlayer.stop(sVal: Smallint);
begin

DefaultInterface.stop(sVal);
end;


function TMMCPlayer.getCurrentMedia: WideString;
begin

Result := DefaultInterface.getCurrentMedia;
end;


procedure TMMCPlayer.ProcPlaylist(__MIDL_0011: OleVariant);
begin

DefaultInterface.ProcPlaylist(__MIDL_0011);
end;


procedure TMMCPlayer.PlayItem(Index: Integer);
begin

DefaultInterface.PlayItem(Index);
end;


function TMMCPlayer.getMediaError: Integer;
begin

Result := DefaultInterface.getMediaError;
end;


function TMMCPlayer.getMediaErrMsg: OleVariant;
begin

Result := DefaultInterface.getMediaErrMsg;
end;


procedure Register;
begin

RegisterComponents(dtlOcxPage, [TMMCPlayer]);
end;


end.
 
请大牛们帮忙解决下 谢谢了
 

Similar threads

后退
顶部