org.qtunes.speaker.spi.justeport
Class SpeakerImpl

java.lang.Object
  extended by org.qtunes.speaker.spi.justeport.SpeakerImpl
All Implemented Interfaces:
Service, Speaker

public class SpeakerImpl
extends Object
implements Speaker


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
 void flush()
          Immediately stop the speaker and discard any cached data written to it
 int getBufferSize()
           
 ServiceContext getContext()
           
 int getDelay()
           
 String getDisplayName()
           
 Throwable getError()
           
 Player getPlayer()
           
 int getUniqueId()
           
 int getVolumeAdjustment()
           
 void open(float sampleRate, int sampleSizeInBits, int channels, boolean signed, boolean bigEndian)
          Open the Speaker and start it
 Map<String,Object> reportState()
           
 void setError(Throwable e)
           
 void setGain(float gain)
          A value of NaN means "no audio"
 void setPlayer(Player player)
           
 void setVolumeAdjustment(int volumeadjust)
           
 void startService(ServiceContext context)
           
 void stopService(ServiceContext context)
           
 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

SpeakerImpl

public SpeakerImpl()
Method Detail

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in interface Speaker

setError

public void setError(Throwable e)
Specified by:
setError in interface Speaker

getError

public Throwable getError()
Specified by:
getError in interface Speaker

getPlayer

public Player getPlayer()
Specified by:
getPlayer in interface Speaker

setPlayer

public void setPlayer(Player player)
Specified by:
setPlayer in interface Speaker

getUniqueId

public int getUniqueId()
Specified by:
getUniqueId in interface Speaker

getDelay

public int getDelay()
Specified by:
getDelay in interface Speaker

getBufferSize

public int getBufferSize()
Specified by:
getBufferSize in interface Speaker

write

public void write(byte[] buf,
                  int off,
                  int len)
Description copied from interface: Speaker
Write data to the speaker

Specified by:
write in interface Speaker

flush

public void flush()
Description copied from interface: Speaker
Immediately stop the speaker and discard any cached data written to it

Specified by:
flush in interface Speaker

drain

public void drain()
Description copied from interface: Speaker
Block until the data already written to the speaker completes

Specified by:
drain in interface Speaker

close

public void close()
Description copied from interface: Speaker
Close the speaker, immediately stopping it and discarding any data

Specified by:
close in interface Speaker

open

public void open(float sampleRate,
                 int sampleSizeInBits,
                 int channels,
                 boolean signed,
                 boolean bigEndian)
          throws SpeakerUnavailableException
Description copied from interface: Speaker
Open the Speaker and start it

Specified by:
open in interface Speaker
Throws:
SpeakerUnavailableException

setGain

public void setGain(float gain)
Description copied from interface: Speaker
A value of NaN means "no audio"

Specified by:
setGain in interface Speaker

setVolumeAdjustment

public void setVolumeAdjustment(int volumeadjust)
Specified by:
setVolumeAdjustment in interface Speaker

getVolumeAdjustment

public int getVolumeAdjustment()
Specified by:
getVolumeAdjustment in interface Speaker

getContext

public ServiceContext getContext()
Specified by:
getContext in interface Service

startService

public void startService(ServiceContext context)
Specified by:
startService in interface Service

stopService

public void stopService(ServiceContext context)
Specified by:
stopService in interface Service

reportState

public Map<String,Object> reportState()
Specified by:
reportState in interface Service