|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.qtunes.speaker.spi.javasound.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. |
javax.sound.sampled.Mixer.Info |
getMixer()
|
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 |
isAvailable()
|
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 |
setMixer(javax.sound.sampled.Mixer.Info mixer)
|
void |
setMixer(java.lang.String name)
|
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.Exception getError()
Speaker
getError
in interface Speaker
public Player getPlayer()
Speaker
getPlayer
in interface Speaker
public void setPlayer(Player player)
Speaker
Player.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 Speaker
public java.lang.String getDisplayName()
Speaker
getDisplayName
in interface Speaker
public int getUniqueId()
Speaker
getUniqueId
in interface Speaker
public boolean isAvailable()
public boolean hasGain()
Speaker
hasGain
in interface Speaker
public void setMixer(javax.sound.sampled.Mixer.Info mixer)
public void setMixer(java.lang.String name)
public javax.sound.sampled.Mixer.Info getMixer()
public int getDelay()
Speaker
getDelay
in interface Speaker
public int getBufferSize()
Speaker
getBufferSize
in interface Speaker
public void write(byte[] buf, int off, int len)
Speaker
write
in interface Speaker
public void flush()
Speaker
flush
in interface Speaker
public void drain()
Speaker
drain
in interface Speaker
public boolean isOpen()
Speaker
isOpen
in interface Speaker
public void close()
Speaker
close
in interface Speaker
public void open(float sampleRate, int sampleSizeInBits, int channels, boolean signed, boolean bigEndian)
Speaker
open
in interface Speaker
public void setVolumeAdjustment(int volumeadjust)
Speaker
setVolumeAdjustment
in interface Speaker
public int getVolumeAdjustment()
Speaker
getVolumeAdjustment
in interface Speaker
public void setGain(float gain)
Speaker
setGain
in interface Speaker
public void startService(ServiceContext context)
Service
startService
in interface Service
context
- the ServiceContext for this Servicepublic void stopService(ServiceContext context)
Service
stopService
in interface Service
context
- the ServiceContext for this Service (same as was passed into start)public ServiceContext getContext()
Service
Service.startService(org.qtunes.core.ServiceContext)
getContext
in interface Service
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 |