|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.openal.ClipBuffer
public class ClipBuffer
Represents a sound that has been loaded into the OpenAL system.
| Nested Class Summary | |
|---|---|
static interface |
ClipBuffer.Observer
Used to notify parties interested in when a clip is loaded. |
| Field Summary | |
|---|---|
protected int |
_bound
|
protected Buffer |
_buffer
|
protected SoundManager |
_manager
|
protected ObserverList<ClipBuffer.Observer> |
_observers
|
protected String |
_path
|
protected ClipProvider |
_provider
|
protected int |
_size
|
protected int |
_state
|
protected static int |
LOADED
|
protected static int |
LOADING
|
protected static int |
UNLOADED
|
protected static int |
UNLOADING
|
| Constructor Summary | |
|---|---|
ClipBuffer(SoundManager manager,
ClipProvider provider,
String path)
Creates a new clip buffer with the specified path that will obtain its clip data from the specified source. |
|
| Method Summary | |
|---|---|
protected boolean |
bind(Clip clip)
This method is called back on the main thread and instructs this buffer to bind the clip data to this buffer's OpenAL buffer. |
void |
dispose()
Frees up the internal audio buffers associated with this clip. |
protected void |
failed()
Called when we fail in some part of the process in resolving our clip data. |
Buffer |
getBuffer()
Returns a reference to this clip's buffer or null if it is not loaded. |
ClipProvider |
getClipProvider()
Returns the provider used to load this clip. |
String |
getKey()
Returns the unique key for this clip buffer. |
String |
getPath()
Returns the path that identifies this sound clip. |
int |
getSize()
Returns the size (in bytes) of this clip as reported by OpenAL. |
boolean |
isPlayable()
Returns true if this buffer is loaded and ready to go. |
protected Clip |
load()
This method is called by the background sound loading thread and actually loads the sound data from wherever it cometh. |
static String |
makeKey(ClipProvider provider,
String path)
Create a key that uniquely identifies this combination of clip provider and path. |
void |
resolve(ClipBuffer.Observer observer)
Instructs this buffer to resolve its underlying clip and be ready to be played ASAP. |
protected void |
sourceBound()
Notifies the buffer that a source has been bound to it. |
protected void |
sourceUnbound()
Notifies the buffer that a source has been unbound from it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected SoundManager _manager
protected ClipProvider _provider
protected String _path
protected int _state
protected Buffer _buffer
protected int _size
protected ObserverList<ClipBuffer.Observer> _observers
protected int _bound
protected static final int UNLOADED
protected static final int LOADING
protected static final int LOADED
protected static final int UNLOADING
| Constructor Detail |
|---|
public ClipBuffer(SoundManager manager,
ClipProvider provider,
String path)
| Method Detail |
|---|
public static String makeKey(ClipProvider provider,
String path)
public String getKey()
public ClipProvider getClipProvider()
public String getPath()
public boolean isPlayable()
public Buffer getBuffer()
null if it is not loaded.
public int getSize()
public void resolve(ClipBuffer.Observer observer)
public void dispose()
protected Clip load()
throws IOException
IOExceptionprotected boolean bind(Clip clip)
protected void failed()
protected void sourceBound()
protected void sourceUnbound()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||