home *** CD-ROM | disk | FTP | other *** search
- // CWMPEventDispatch.h : Declaration of the event dispatcher
- //
- // Copyright (C) 2000-2001 Microsoft Corporation
- // All rights reserved.
- //
-
- #include "stdafx.h"
- #include "wmpids.h"
- #include "wmp.h"
-
- class CWMPEventDispatch:
- public CComObjectRootEx<CComSingleThreadModel>,
- public _WMPOCXEvents
- {
- public:
-
- BEGIN_COM_MAP(CWMPEventDispatch)
- COM_INTERFACE_ENTRY(_WMPOCXEvents)
- COM_INTERFACE_ENTRY(IDispatch)
- END_COM_MAP()
-
- // IDispatch methods
-
- STDMETHOD(GetIDsOfNames)( REFIID riid,
- OLECHAR FAR *FAR *rgszNames,
- unsigned int cNames,
- LCID lcid,
- DISPID FAR *rgDispId )
- { return( E_NOTIMPL ); }
-
- STDMETHOD(GetTypeInfo)( unsigned int iTInfo,
- LCID lcid,
- ITypeInfo FAR *FAR *ppTInfo )
- { return( E_NOTIMPL ); }
-
- STDMETHOD(GetTypeInfoCount)( unsigned int FAR *pctinfo )
- {
- return( E_NOTIMPL );
- }
-
- STDMETHOD(Invoke)( DISPID dispIdMember,
- REFIID riid,
- LCID lcid,
- WORD wFlags,
- DISPPARAMS FAR* pDispParams,
- VARIANT FAR* pVarResult,
- EXCEPINFO FAR* pExcepInfo,
- unsigned int FAR* puArgErr );
-
- // WMP Event methods
-
- // Sent when the control changes OpenState
- void OpenStateChange(long NewState);
-
- // Sent when the status string changes
- void StatusChange();
-
- // Sent when the control changes PlayState
- void PlayStateChange(long NewState);
-
- // Sent when a synchronized command or URL is received
- void ScriptCommand(BSTR scType,BSTR Param);
-
- // Sent when the control is disconnected from the server
- void Disconnect(long Result );
-
- // Sent when the control begins or ends buffering
- void Buffering(VARIANT_BOOL Start);
-
- // Sent when the control has an error condition
- void Error();
-
- // Sent when the media object has an error condition
- void MediaError(IDispatch * pMediaObject);
-
- // Indicates that the current position of the movie has changed
- void PositionChange(double oldPosition,double newPosition);
-
- // Sent when a marker is reached
- void MarkerHit(long MarkerNum );
-
- // Indicates that the unit used to express duration and position has changed
- void DurationUnitChange(long NewDurationUnit);
-
- // Indicates that the CD ROM media has changed
- void CdromMediaChange(long CdromNum);
-
- // Sent when a playlist changes
- void PlaylistChange(IDispatch * Playlist,WMPPlaylistChangeEventType change);
-
- // Sent when the current playlist changes
- void CurrentPlaylistChange(WMPPlaylistChangeEventType change );
-
- // Sent when a current playlist item becomes available
- void CurrentPlaylistItemAvailable(BSTR bstrItemName);
-
- // Sent when a media object changes
- void MediaChange(IDispatch * Item);
-
- // Sent when a current media item becomes available
- void CurrentMediaItemAvailable(BSTR bstrItemName);
-
- // Sent when the item selection on the current playlist changes
- void CurrentItemChange(IDispatch *pdispMedia);
- };
-
- typedef CComObject<CWMPEventDispatch> CComWMPEventDispatch;