Waave
An audio video engine
 All Data Structures Functions Variables Groups Pages
Functions
Stream playback control

Detailed Description

Here the functions that control stream playback. Note that the commands behavior is influenced by the stream parameters.

Functions

int WV_playStream (WVStream *stream)
 Start stream playback.
int WV_pauseStream (WVStream *stream)
 Pause stream playback.
int WV_stopStream (WVStream *stream)
 Stop stream playback and return to start.
int WV_rewindStream (WVStream *stream)
 Move playback to the stream beginning.
int WV_rseekStream (WVStream *stream, uint32_t seekShift, int seekDirection)
 Relative seek command.
int WV_seekStream (WVStream *stream, uint32_t clock)
 The seek command.
uint32_t WV_getStreamDuration (WVStream *stream)
 Give total stream duration.
uint32_t WV_getStreamClock (WVStream *stream)
 Give the current playback position.

Function Documentation

uint32_t WV_getStreamClock ( WVStream *  stream)

Give the current playback position.

Parameters:
streamThe stream

Give the current playback position in milliseconds.

uint32_t WV_getStreamDuration ( WVStream *  stream)

Give total stream duration.

Parameters:
streamThe stream

Give the total stream duration in milliseconds.

int WV_pauseStream ( WVStream *  stream)

Pause stream playback.

Parameters:
streamThe stream that receive the pause commmand

Pause stream playback while keeping the current reading position. Note that send the pause command again will not relaunch playback. But depending on the seek method, seeking can unpause the stream. See WV_setSeekMethod.

int WV_playStream ( WVStream *  stream)

Start stream playback.

Parameters:
streamThe stream that receive the play commmand

Start stream playback if it was paused. If playback already running, the play command behavior depend of the selected play method. See WV_setPlayMethod. The function return -1 if the play command was useless and 0 otherwise.

int WV_rewindStream ( WVStream *  stream)

Move playback to the stream beginning.

Parameters:
streamThe stream that receive the rewind commmand

Reset playback position at the stream beginning. If the stream was paused the command behavior depend on the seek method. See WV_setSeekMethod.

int WV_rseekStream ( WVStream *  stream,
uint32_t  seekShift,
int  seekDirection 
)

Relative seek command.

Parameters:
streamThe stream that receive the relative seek command
seekShiftThe seek step in milliseconds
seekDirectionThe direction where we move playback position (see below)

Seek on the stream relative to the current playback position. The seekShift parameter control for how many millisecond we seek and the two possible seeking direction are given by the folowing values :

Seek direction Description
WV_SEEK_BACKWARD seek in the reverse playback direction
WV_SEEK_FORWARD seek in the playback direction

If the stream was paused the command behavior depend on the seek method. See WV_setSeekMethod.

int WV_seekStream ( WVStream *  stream,
uint32_t  clock 
)

The seek command.

Parameters:
streamThe stream that receive the seek command
clockThe stream position where playback is moved in milliseconds

Seek on the stream giving the absolute position. Use WV_getStreamDuration to know the maximum clock value and WV_getStreamClock to know the current playback position. If the given stream position is after the stream end then playback restart to the beginning.

int WV_stopStream ( WVStream *  stream)

Stop stream playback and return to start.

Parameters:
streamThe stopped stream

Stop stream playback and put the reading position at the stream beginning. The stream will be paused, even if you have set the WV_PLAYING_SEEK flag.