public void resolve ( Observer observer ) { // if we were waiting to unload, cancel that if ( _state == UNLOADING ) { _state = LOADED ; _manager . restoreClip ( this ) ; } // if we're already loaded, this is easy if ( _state == LOADED ) { if ( observer != null ) { observer . clipLoaded ( this ) ; } return ; } // queue up the observer if ( observer != null ) { _observers . add ( observer ) ; } // if we're already loading, we can stop here if ( _state == LOADING ) { return ; } // create our OpenAL buffer and then queue ourselves up to have // our clip data loaded AL10 . alGetError ( ) ; // throw away any unchecked error prior to an op we want to check _buffer = new Buffer ( _manager ) ; int errno = AL10 . alGetError ( ) ; if ( errno != AL10 . AL_NO_ERROR ) { log . warning ( "Failed to create buffer [key=" + getKey ( ) + ", errno=" + errno + "]." ) ; _buffer = null ; // queue up a failure notification so that we properly return // from this method and our sound has a chance to register // itself as an observer before we jump up and declare failure _manager . queueClipFailure ( this ) ; } else { _state = LOADING ; _manager . queueClipLoad ( this ) ; } }
Instructs this buffer to resolve its underlying clip and be ready to be played ASAP .