Share via


IWMDMObjectInfo::SetPlayOffset

banner art

The SetPlayOffset method sets the play offset of the object, in the units appropriate to the format. This specifies the starting point for the next invocation of Play.

Syntax

HRESULT SetPlayOffset(DWORDdwOffset);

Parameters

dwOffset

[in]  DWORD specifying the play offset, in units appropriate to the format.

Return Values

The method returns an HRESULT. All the interface methods in Windows Media Device Manager can return any of the following classes of error codes:

  • Standard COM error codes
  • Windows error codes converted to HRESULT values
  • Windows Media Device Manager error codes

For an extenstive list of possible error codes, see Error Codes.

Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK The method succeeded.
WMDM_E_NOTSUPPORTED This device does not support setting play lengths.
E_INVALIDTYPE The object that this interface is associated with is not a valid playable file or a folder or file system containing playable files.
E_FAIL An unspecified error occurred.

Remarks

If the value passed is greater than the total length of the object minus the current play length, it is clipped to the length of the object minus the play length.

For playable files, the value is specified in milliseconds. The play offset position value does not change when the user starts playing a file on the media device or when an application invokes the IWMDMDeviceControl::Play method.

For folders or file systems containing playable files, the value indicates the first track that is played when an application invokes the IWMDMDeviceControl::Play method.

Requirements

Header: Defined in mswmdm.h.

Library: mssachlp.lib

See Also