|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Speaker
A Speaker is an output device, which may be a local JavaSound speaker,
an Airtunes speaker, a network speaker or similar. A Player
has
one or more speakers and a Speaker
may be assigned to exactly
one Player, or unassigned. Writing to a Speaker should never throw
an Exception of any sort - instead the internal Exception
should be set. This is reset when the Speaker is opened.
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. |
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. |
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 |
write(byte[] buf,
int off,
int len)
Write data to the speaker. |
Methods inherited from interface org.qtunes.core.Service |
---|
getContext, reportState, startService, stopService |
Method Detail |
---|
int getDelay()
int getBufferSize()
java.lang.String getDisplayName()
int getUniqueId()
boolean hasGain()
void setGain(float gain)
void setPlayer(Player player)
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.
Player getPlayer()
java.lang.Exception getError()
int getVolumeAdjustment()
void setVolumeAdjustment(int volumeadjust)
void open(float sampleRate, int sampleSizeInBits, int channels, boolean signed, boolean bigEndian)
void write(byte[] buf, int off, int len)
void flush()
void drain()
void close()
boolean isOpen()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |