MFP_EVENT_TYPE enumeration (mfplay.h)
Defines event types for the IMFPMediaPlayerCallback interface.
Syntax
typedef enum MFP_EVENT_TYPE {
MFP_EVENT_TYPE_PLAY = 0,
MFP_EVENT_TYPE_PAUSE = 1,
MFP_EVENT_TYPE_STOP = 2,
MFP_EVENT_TYPE_POSITION_SET = 3,
MFP_EVENT_TYPE_RATE_SET = 4,
MFP_EVENT_TYPE_MEDIAITEM_CREATED = 5,
MFP_EVENT_TYPE_MEDIAITEM_SET = 6,
MFP_EVENT_TYPE_FRAME_STEP = 7,
MFP_EVENT_TYPE_MEDIAITEM_CLEARED = 8,
MFP_EVENT_TYPE_MF = 9,
MFP_EVENT_TYPE_ERROR = 10,
MFP_EVENT_TYPE_PLAYBACK_ENDED = 11,
MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL = 12
} ;
Constants
MFP_EVENT_TYPE_PLAYValue: 0 Playback has started. This event is sent when the IMFPMediaPlayer::Play method completes. |
MFP_EVENT_TYPE_PAUSEValue: 1 Playback has paused. This event is sent when the IMFPMediaPlayer::Pause method completes. |
MFP_EVENT_TYPE_STOPValue: 2 Playback has stopped. This event is sent when the IMFPMediaPlayer::Stop method completes. |
MFP_EVENT_TYPE_POSITION_SETValue: 3 The MFPlay player object has seeked to a new playback position. This event is sent when the IMFPMediaPlayer::SetPosition method completes. |
MFP_EVENT_TYPE_RATE_SETValue: 4 The playback rate has changed. This event is sent when the IMFPMediaPlayer::SetRate method completes. |
MFP_EVENT_TYPE_MEDIAITEM_CREATEDValue: 5 A new media item was created. This event is sent when the IMFPMediaPlayer::CreateMediaItemFromURL or CreateMediaItemFromObject method completes. |
MFP_EVENT_TYPE_MEDIAITEM_SETValue: 6 A media item is ready for playback. This event is sent when the IMFPMediaPlayer::SetMediaItem method completes. |
MFP_EVENT_TYPE_FRAME_STEPValue: 7 A frame-step operation has completed. This event is sent when the IMFPMediaPlayer::FrameStep method completes. |
MFP_EVENT_TYPE_MEDIAITEM_CLEAREDValue: 8 The current media item was cleared. This event is sent when the IMFPMediaPlayer::ClearMediaItem method completes. |
MFP_EVENT_TYPE_MFValue: 9 A pipeline object sent an event. The player object forwards certain pipeline events to the application. For more information, see MFP_MF_EVENT. |
MFP_EVENT_TYPE_ERRORValue: 10 A playback error has occurred. |
MFP_EVENT_TYPE_PLAYBACK_ENDEDValue: 11 Playback has ended. The player object sends this event when playback reaches the end of the media file. |
MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIALValue: 12 The media source requires authentication before it can play the file. |
Remarks
For each event type, the IMFPMediaPlayerCallback::OnMediaPlayerEvent callback receives a pointer to a data structure. The first part of the data structure is always an MFP_EVENT_HEADER structure. The following table lists the data structure for each event type.
In your implementation of OnMediaPlayerEvent, you must cast the pEventHeader parameter to the correct structure type. A set of macros is defined for this purpose. These macros check the value of the event type and return NULL if there is a mismatch; otherwise they return a pointer to the correct structure type.
| Event type |
Event structure
Pointer cast macro |
| MFP_EVENT_TYPE_PLAY | |
| MFP_EVENT_TYPE_PAUSE | |
| MFP_EVENT_TYPE_STOP | |
| MFP_EVENT_TYPE_POSITION_SET | |
| MFP_EVENT_TYPE_RATE_SET | |
| MFP_EVENT_TYPE_MEDIAITEM_CREATED | |
| MFP_EVENT_TYPE_MEDIAITEM_SET | |
| MFP_EVENT_TYPE_FRAME_STEP | |
| MFP_EVENT_TYPE_MEDIAITEM_CLEARED | |
| MFP_EVENT_TYPE_MF | |
| MFP_EVENT_TYPE_ERROR | |
| MFP_EVENT_TYPE_PLAYBACK_ENDED | |
| MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL |
Requirements
| Minimum supported client | Windows 7 [desktop apps only] |
| Minimum supported server | Windows Server 2008 R2 [desktop apps only] |
| Header | mfplay.h |