int32 ssplSpoolData( SoundSpooler *sspl, char *Data, int32 NumBytes,
void *UserData )
{
SoundBufferNode *sbn;
/* Request another buffer! */
sbn = ssplRequestBuffer( sspl );
if( sbn == NULL ) return 0;
/* Set address amd length of buffer. */
ssplSetBufferAddressLength( sspl, sbn, Data, NumBytes );
/* Set User Data. */
ssplSetUserData( sspl, sbn, UserData );
/* Send that buffer off to be played. */
return ssplSendBuffer( sspl, sbn );
}
int32 ssplPlayData( SoundSpooler *sspl, char *Data, int32 NumBytes )
{
SoundBufferNode *sbn;
int32 Result, CurSignals;
Result = 0;
/* Request another buffer! */
while( (sbn = ssplRequestBuffer( sspl )) == NULL);
{
CurSignals = WaitSignal( sspl->sspl_SignalMask );
/* Tell sound spooler that the buffer has completed. */
Result = ssplProcessSignals( sspl, CurSignals, NULL );
CHECKRESULT(Result,"ssplProcessSignals");
}
/* Set length of buffer. */
ssplSetBufferAddressLength( sspl, sbn, Data, NumBytes );
/* Send that buffer off to be played. */
return ssplSendBuffer( sspl, sbn );
cleanup:
return Result;
}