Waave
An audio video engine
|
Before loading a stream in the Waave engine you can set parameters that control the stream behavior. Be carefull ! For a video stream, setting the streaming method is mandatory !
Macros | |
#define | WV_EOF_EVENT SDL_NUMEVENTS - 2 |
Functions | |
int | WV_disableAudio (WVStream *stream) |
Disable audio playing in a stream. | |
int | WV_disableVideo (WVStream *stream) |
Disable video playing in a stream. | |
int | WV_setPlayMethod (WVStream *stream, int playFlag) |
Set the stream behavior when a play command is sent. | |
int | WV_setSeekMethod (WVStream *stream, int seekFlag) |
Set the stream behavior when a seek command is sent. | |
int | WV_setEOFMethod (WVStream *stream, int loopingFlag) |
Set the stream behavior when end of file is reached. | |
int | WV_setStreamingMethod (WVStream *stream, WVStreamingObject *streamObj) |
Associate a streaming object with an opened stream. | |
WVStreamingObject * | WV_getStreamingMethod (WVStream *stream) |
Return the streaming object associated with the stream. | |
int | WV_setSyncMethod (WVStream *stream, WVSyncObject *syncObj) |
Apply a user defined synchronisation method to a stream. | |
WVSyncObject * | WV_getSyncMethod (WVStream *stream) |
Return the synchronisation method associated with the stream. | |
int | WV_setEOFSignalParam (WVStream *stream, void *param) |
Set the parameter that will be sent with the stream when end of file is reached. | |
int | WV_setEOFSignalCall (WVStream *stream, WVEOFSignalCall eofCall) |
Enable callback to signal end of file | |
int | WV_setVolumeDBPitche (WVStream *stream, double DBPitche) |
Set the volume exponentiation factor. | |
double | WV_getVolumeDBPitche (WVStream *stream) |
Get the volume exponentiation factor. |
int WV_disableAudio | ( | WVStream * | stream | ) |
Disable audio playing in a stream.
stream | The stream where the audio will be disabled. |
You can use the WV_disableAudio function when you want only play the video data of an audio/video file. Check the stream type before doing this, it will change after the call.
int WV_disableVideo | ( | WVStream * | stream | ) |
Disable video playing in a stream.
stream | The stream where the video will be disabled. |
You can use the WV_disableAudio function when you want only play the audio data of an audio/video file. Check the stream type before doing this, it will change after the call.
WVStreamingObject* WV_getStreamingMethod | ( | WVStream * | stream | ) |
Return the streaming object associated with the stream.
stream | A video stream |
Give the streaming object associated with a stream by the WV_setStreamingMethod command.
WVSyncObject* WV_getSyncMethod | ( | WVStream * | stream | ) |
Return the synchronisation method associated with the stream.
stream | A synchronized stream |
Give the synchronisation method associated with a stream with the WV_setSyncMethod command.
double WV_getVolumeDBPitche | ( | WVStream * | stream | ) |
Get the volume exponentiation factor.
stream | The stream with get exponentiation factor. |
Return the stream's volume DB pitche.
int WV_setEOFMethod | ( | WVStream * | stream, |
int | loopingFlag | ||
) |
Set the stream behavior when end of file is reached.
stream | The stream you want to set the EOF method |
loopingFlag | The wanted EOF behavior |
This function set the stream behavior when the end of file is reached. Possible behavior are :
EOF method | Description |
---|---|
WV_BLOCKING_STREAM | When the stream reach end of file it stops (default) |
WV_LOOPING_STREAM | When the stream reach end of file it restart playing at the beginning |
int WV_setEOFSignalCall | ( | WVStream * | stream, |
WVEOFSignalCall | eofCall | ||
) |
Enable callback to signal end of file
stream | The stream where eof signal callback will be enabled |
eofCall | The callback function that will be called when EOF is reached |
Set a callback function that will be called when the end of file of a stream is reached. Be carefull that, once done, the WV_EVENT_EOF_SIGNAL is no longer sended. The eofCall as to be of type :
int (*WVEOFSignalCall)(struct WVStream* stream, void* param)
You can set the param that will be sent to the callback function with WV_setEOFSignalParam.
Be carefull ! The callback function will be called by the waave engine thread ! To call your function with the main thread, use the WV_EVENT_EOF_SIGNAL.
int WV_setEOFSignalParam | ( | WVStream * | stream, |
void * | param | ||
) |
Set the parameter that will be sent with the stream when end of file is reached.
stream | The stream you set the parameter |
param | The sended pointer to the user defined data |
With the WV_setSyncMethod you can set you own stream descriptor that will be returned to you when EOF is reached. If the stream signal EOF by sending an WV_EVENT_EOF_SIGNAL event then the parameter will be found in event.user.data2. Else, if the stream signal EOF with a user defined function, then param will be passed to this function.
int WV_setPlayMethod | ( | WVStream * | stream, |
int | playFlag | ||
) |
Set the stream behavior when a play command is sent.
stream | The stream you want to set the play method |
playFlag | The wanted play behavior |
This function set the playing behavior when the play command is sent to the stream. It can be useful when you have an audio file used as sound effect and you want it to be played each time an event occur.
Possible behavior are :
Play method | Description |
---|---|
WV_NEUTRAL_PLAY | If the stream already playing, the play command do nothing (default) |
WV_LOOPING_PLAY | Each time the play command is sent, the stream restart to the beginning |
int WV_setSeekMethod | ( | WVStream * | stream, |
int | seekFlag | ||
) |
Set the stream behavior when a seek command is sent.
stream | The stream you want to set the seek method |
seekFlag | The wanted seek behavior |
This function set the seeking behavior when the seek command is sent to the stream. Possible behavior are :
Seek method | Description |
---|---|
WV_BLOCKING_SEEK | If the stream is paused it stay paused after the seek (default) |
WV_PLAYING_SEEK | If the stream is paused it restart playing when a seek command is sent |
int WV_setStreamingMethod | ( | WVStream * | stream, |
WVStreamingObject * | streamObj | ||
) |
Associate a streaming object with an opened stream.
stream | A video stream |
streamObj | The streaming object to associate with the stream |
For a stream that contain video data, it's absolutly mandatory to give a streaming object that describe the methods to displaying video frames ! Waave library comes with standard streaming objects (see relative documentation). Be carefull to only use one streaming object instance for one video stream ! Check the object documentation to know how to create your own streaming objects.
int WV_setSyncMethod | ( | WVStream * | stream, |
WVSyncObject * | syncObj | ||
) |
Apply a user defined synchronisation method to a stream.
stream | The synchronized stream |
syncObj | The user defined sync method |
To know how to create you own streaming object check the object documentation.
int WV_setVolumeDBPitche | ( | WVStream * | stream, |
double | DBPitche | ||
) |
Set the volume exponentiation factor.
stream | A stream with audio data |
DBPitche | The exponentiation factor used to compute DB volume |
To apply volume, audio data is multiplied by a volume factor which depend of the DBvolume and the internal DBPitche factor with the above fomula :