bool Play() {
if ( !this ) { printf( "ALUREStream:Play:Called on a null object.\n" ); return false; }
if ( !source ) { printf( "ALUREStream:Play:No source defined for the stream '%s'. Did it load properly?\n", name ); return false; }
if ( source.state == stopped ) {
printf ( "Play() was called on a stream.\n" );
alGetError();
alSourceQueueBuffers(source.id,usesBuffers,buf);
if ( ALError("ALUREStream:Play:alSourceQueueBuffers") ) { printf( "ALUREStream:Play failed to queue buffers.\n" ); return false; }
alSourcePlay(source.id);
source.state=playing;
if ( ALError("ALUREStream:Play:alSourcePlay") ) { printf( "ALUREStream:Play failed to start source.\n" ); return false; }
// this.timer.delay = (1.0f/refreshRate);
// this.timer.Start();
Create();
} else if ( source.state == paused || source.state==stopped ) { source.Resume(); return true; }
else if ( source.state == empty ) { printf( "ALUREStream:Play called on an empty source (no buffer selected).\n" ); return false; }
else if ( source.state == playing ) { printf( "ALUREStream:Play() called on a playing stream.\n" ); return true; }
return true;
}