[ create a new paste ] login | about

Link: http://codepad.org/rmhj0ZeQ    [ raw code | fork ]

Plain Text, pasted on Jun 14:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 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;
 }


Create a new paste based on this one


Comments: