Logo Search packages:      
Sourcecode: lastfm version File versions  Download package

void RtAudio::setStreamCallback ( RtAudioCallback  callback,
void *  userData 
) [inline]

A public method which sets a user-defined callback function for a given stream.

This method assigns a callback function to a previously opened stream for non-blocking stream functionality. A separate process is initiated, though the user function is called only when the stream is "running" (between calls to the startStream() and stopStream() methods, respectively). The callback process remains active for the duration of the stream and is automatically shutdown when the stream is closed (via the closeStream() method or by object destruction). The callback process can also be shutdown and the user function de-referenced through an explicit call to the cancelStreamCallback() method. Note that the stream can use only blocking or callback functionality at a particular time, though it is possible to alternate modes on the same stream through the use of the setStreamCallback() and cancelStreamCallback() methods (the blocking tickStream() method can be used before a callback is set and/or after a callback is cancelled). An RtError will be thrown if called when no stream is open or a thread errors occurs.

Definition at line 469 of file RtAudio.h.

{ rtapi_->setStreamCallback( callback, userData ); };

Generated by  Doxygen 1.6.0   Back to index