|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.globalmentor.beans.BoundPropertyObject
com.guiseframework.event.GuiseBoundPropertyObject
com.guiseframework.platform.AbstractDepictedObject
com.guiseframework.audio.Audio
public class Audio
Audio that can be played.
The installed depictor must be of the specialized type Audio.Depictor.
| Nested Class Summary | |
|---|---|
static interface |
Audio.Depictor<A extends Audio>
The custom depictor type for audio. |
| Field Summary | |
|---|---|
static java.lang.String |
AUDIO_URI_PROPERTY
The bound property of the audio URI. |
static java.lang.String |
STATE_PROPERTY
The bound property of the state. |
static java.lang.String |
TIME_LENGTH_PROPERTY
The bound property of the play duration using microseconds. |
static java.lang.String |
TIME_POSITION_PROPERTY
The bound property of the play position in time using microseconds. |
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Constructor Summary | |
|---|---|
Audio()
Default constructor. |
|
Audio(java.net.URI audioURI)
Audio URI constructor. |
|
| Method Summary | |
|---|---|
void |
addProgressListener(ProgressListener<java.lang.Long> progressListener)
Adds a progress listener. |
protected void |
finalize()
Prepares the object for garbage collection. |
protected void |
fireProgressed(long timePosition,
long timeDuration)
Fires a progress event to all registered progress listeners. |
protected void |
fireProgressed(ProgressEvent<java.lang.Long> progressEvent)
Fires a given progress event to all registered progress listeners. |
java.net.URI |
getAudioURI()
|
Audio.Depictor<? extends Audio> |
getDepictor()
|
com.globalmentor.model.TaskState |
getState()
|
long |
getTimeLength()
|
long |
getTimePosition()
|
void |
pause()
Requests that the audio pause. |
void |
play()
Requests that the audio start playing. |
void |
removeProgressListener(ProgressListener<java.lang.Long> progressListener)
Removes an progress listener. |
void |
setAudioURI(java.net.URI newAudioURI)
Sets the URI of the audio. |
void |
setState(com.globalmentor.model.TaskState newState)
Updates the state of the audio. |
void |
setTimePosition(long newTimePosition)
Requests a new time-based play position. |
void |
stop()
Requests that the audio stop. |
protected void |
updateTimeLength(long newTimeLength)
Updates the duration of the audio. |
protected void |
updateTimePosition(long newTimePosition)
Updates the time-based play position. |
void |
updateTimeProgress(long timePosition,
long timeLength)
Updates the progress of the audio, firing the appropriate progress event. |
| Methods inherited from class com.guiseframework.platform.AbstractDepictedObject |
|---|
depict, equals, exportTransfer, getDepictID, getEventListenerManager, hashCode, processEvent, toString |
| Methods inherited from class com.guiseframework.event.GuiseBoundPropertyObject |
|---|
getSession |
| Methods inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.guiseframework.platform.DepictedObject |
|---|
getSession |
| Field Detail |
|---|
public static final java.lang.String AUDIO_URI_PROPERTY
public static final java.lang.String STATE_PROPERTY
public static final java.lang.String TIME_LENGTH_PROPERTY
public static final java.lang.String TIME_POSITION_PROPERTY
| Constructor Detail |
|---|
public Audio()
public Audio(java.net.URI audioURI)
audioURI - The new URI of the audio, which may be a resource URI, or null if there is no audio URI.| Method Detail |
|---|
public Audio.Depictor<? extends Audio> getDepictor()
getDepictor in interface DepictedObjectgetDepictor in class AbstractDepictedObjectpublic java.net.URI getAudioURI()
null if there is no audio URI.public void setAudioURI(java.net.URI newAudioURI)
URI.
newAudioURI - The new URI of the audio, which may be a resource URI, or null if there is no audio URI.AUDIO_URI_PROPERTYpublic com.globalmentor.model.TaskState getState()
null if the audio has not been started.public void setState(com.globalmentor.model.TaskState newState)
newState - The new state of the audio, or null if the audio has not been started.STATE_PROPERTYpublic long getTimePosition()
protected void updateTimePosition(long newTimePosition)
newTimePosition - The new play position in microseconds.
java.lang.IllegalArgumentException - if the given position is negative.TIME_POSITION_PROPERTYpublic void setTimePosition(long newTimePosition)
newTimePosition - The new play position in microseconds.
java.lang.IllegalArgumentException - if the given position is negative.TIME_POSITION_PROPERTYpublic long getTimeLength()
protected void updateTimeLength(long newTimeLength)
newTimeLength - The new duration in microseconds.TIME_LENGTH_PROPERTYpublic void play()
public void pause()
public void stop()
public void updateTimeProgress(long timePosition,
long timeLength)
timePosition - The current play position in microseconds, or -1 if not known.timeLength - The duration or estimated duration of the audio in microseconds, or -1 if not known.public void addProgressListener(ProgressListener<java.lang.Long> progressListener)
addProgressListener in interface ProgressListenable<java.lang.Long>progressListener - The progress listener to add.public void removeProgressListener(ProgressListener<java.lang.Long> progressListener)
removeProgressListener in interface ProgressListenable<java.lang.Long>progressListener - The progress listener to remove.
protected void fireProgressed(long timePosition,
long timeDuration)
#fireProgessed(ProgressEvent).
timePosition - The current position in microseconds, or -1 if not known.timeDuration - The length or estimated length of the audio in microseconds, or -1 if not known.ProgressListener,
ProgressEventprotected void fireProgressed(ProgressEvent<java.lang.Long> progressEvent)
progressEvent - The progress event to fire.
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||