See Also
You are here: Player Plug-ins > Definitions > Input Plug-ins > QCDModInitIn > QCDModInitIn::toModule > Play
QMP Developer Reference Guide
ContentsIndexHome
PreviousUpNext
Play

The player calls this function to begin or resume playback of the given media.

Parameters
Parameters 
Description 
medianame 
[in] string of filename or stream URL (encoding determined by version setting) 
playfrom 
[in] start playback at this position (-1 for current position) 
playto 
[in] stop playback at this position 
flags 
[in] no flags currently defined 
Return Values
Return Values 
Description 
play command unsuccessful (player will skip to next track) 
play command successful 
-1 
unsupported media. GetMediaSupported succeeded but on further examination the media is not supported. (The player will attempt to find an alternate plug-in for support, otherwise it will skip to next track.) 
-2 
play command failed (stop playback altogether) 
Remarks

Play is used for two functions: to initiate playback, and to seek. Seeking can be considered starting playback at a new location, so the two functions do overlap. 

The playfrom parameter will indicate the starting point for playback. In normal circumstances, playfrom will be 0, and playto will be the end of the current media (according to the TrackExtents). Both values will be in the units set in the TrackExtents last reported by the plug-in (see GetTrackExtents). 

Even when playback is being initiated, playfrom could be non-zero. In this case it is important to seek to the correct position before sending back decoded audio. 

In instances where playfrom = –1, playto will be a new ending position. This should be handled by updating the current playto position, but not interrupt or reposition current playback. 

Handling playfrom correctly is important to many player features (such as playlist seeking). However, handling playto to be something other than the end of media will only be required in very limited scenarios, usually dependant on what the plug-in itself is trying to implement.

See Also
Copyright (c) Quinnware 2007. All rights reserved.