|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.qtunes.speaker.spi.airport.SpeakerImpl
public class SpeakerImpl
| Constructor Summary | |
|---|---|
SpeakerImpl()
|
|
| Method Summary | |
|---|---|
void |
close()
Close the speaker, immediately stopping it and discarding any data. |
void |
drain()
Block until the data already written to the speaker completes If it fails, set the error. |
void |
flush()
Immediately stop the speaker and discard any cached data written to it If it fails, set the error. |
int |
getBufferSize()
Return the size of the speaker buffer in bytes. |
ServiceContext |
getContext()
Return the ServiceContext that was passed into Service.startService(org.qtunes.core.ServiceContext) |
int |
getDelay()
Return the number of ms delay for this speaker, between a packet being written and it being heard |
java.lang.String |
getDisplayName()
Return a nice name for the Speaker for display to the user |
java.lang.Exception |
getError()
If this speaker has failed for some reason, return the Exception. |
Player |
getPlayer()
Get the Player currently assigned to this speaker |
int |
getUniqueId()
Return a unique ID for the speaker |
int |
getVolumeAdjustment()
Get the volume adjustment that applies to this speaker (+ve or -ve, 0 for no adjustment |
boolean |
hasGain()
Returns true if this speaker can have its gain adjusted |
boolean |
isOpen()
True after open has been called, false after close has been called |
void |
open(float sampleRate,
int sampleSizeInBits,
int channels,
boolean signed,
boolean bigEndian)
Open the Speaker and start it. |
java.util.Map<java.lang.String,java.lang.Object> |
reportState()
Return a Map describing the state of this Service, for serialization back to any client that needs to know (eg webplayer) - so values should be serializable objects, eg Lists, Maps or simple objects. |
void |
setGain(float gain)
Set the gain of this speaker. |
void |
setPlayer(Player player)
Set the player for the speaker. |
void |
setVolumeAdjustment(int volumeadjust)
Set the volume adjustment that applies to this speaker, which should be be added to the gain for this speaker. |
void |
startService(ServiceContext context)
Start the Service |
void |
stopService(ServiceContext context)
Stop the Service |
void |
write(byte[] buf,
int off,
int len)
Write data to the speaker. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SpeakerImpl()
| Method Detail |
|---|
public java.lang.String getDisplayName()
Speaker
getDisplayName in interface Speakerpublic java.lang.Exception getError()
Speaker
getError in interface Speakerpublic Player getPlayer()
Speaker
getPlayer in interface Speakerpublic void setPlayer(Player player)
SpeakerPlayer.removeSpeaker(org.qtunes.speaker.Speaker) on the old player
and Player.addSpeaker(org.qtunes.speaker.Speaker) on the new one, and
anyone moving speakers between players should call
this method rather than those methods directly.
setPlayer in interface Speakerpublic int getUniqueId()
Speaker
getUniqueId in interface Speakerpublic int getDelay()
Speaker
getDelay in interface Speakerpublic int getBufferSize()
Speaker
getBufferSize in interface Speaker
public void write(byte[] buf,
int off,
int len)
Speaker
write in interface Speakerpublic void flush()
Speaker
flush in interface Speakerpublic void drain()
Speaker
drain in interface Speakerpublic boolean isOpen()
Speaker
isOpen in interface Speakerpublic void close()
Speaker
close in interface Speaker
public void open(float sampleRate,
int sampleSizeInBits,
int channels,
boolean signed,
boolean bigEndian)
Speaker
open in interface Speakerpublic void setGain(float gain)
Speaker
setGain in interface Speakerpublic void setVolumeAdjustment(int volumeadjust)
Speaker
setVolumeAdjustment in interface Speakerpublic int getVolumeAdjustment()
Speaker
getVolumeAdjustment in interface Speakerpublic boolean hasGain()
Speaker
hasGain in interface Speakerpublic ServiceContext getContext()
ServiceService.startService(org.qtunes.core.ServiceContext)
getContext in interface Servicepublic void startService(ServiceContext context)
Service
startService in interface Servicecontext - the ServiceContext for this Servicepublic void stopService(ServiceContext context)
Service
stopService in interface Servicecontext - the ServiceContext for this Service (same as was passed into start)public java.util.Map<java.lang.String,java.lang.Object> reportState()
Service
reportState in interface Service
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||