IWMDMObjectInfo::GetPlayLength
The GetPlayLength method retrieves the play length of the object in units pertinent to the object. This is the remaining length that the object can play, not its total length.
Syntax
HRESULT GetPlayLength(
DWORD* pdwLength
);
Parameters
pdwLength
[out] Pointer to a DWORD containing the remaining play length of the object.
Return Values
The method returns an HRESULT. All the interface methods in Windows Media Device Manager and service provider 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 a complete 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 object cannot report the remaining play length. |
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
The value of the play length retrieved is either the total length of the object minus the current play position (if the IWMDMObjectInfo::SetPlayLength method has not been called), or the value set by IWMDMObjectInfo::SetPlayLength clipped to be no greater than the total play length of the object minus the current play position.
For playable files, the value returned is specified in milliseconds. The play length information can change either 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 returned is in tracks or numbers of playable files in that folder or in the root of that file system.
Requirements
Header: Defined in wmdm.idl.
Library: mssachlp.lib
See Also