uk.org.toot.audio.server
Class SwitchedAudioClient

java.lang.Object
  extended by uk.org.toot.audio.server.SwitchedAudioClient
All Implemented Interfaces:
AudioClient

public class SwitchedAudioClient
extends java.lang.Object
implements AudioClient

An adapter to allow switching of clients. It operatates as a stack so revert() will go back to the previous client installed. Client can be null (useful to disable the audio). To stop the server calling any clients work (e.g. to rescue CPU ovderload use setEnabled(false)

Author:
pjl, st tweaked a little for toot

Constructor Summary
SwitchedAudioClient()
           
 
Method Summary
 void attachServer(boolean yes)
           
 void installClient(AudioClient m)
           
 void revertClient()
           
 void setEnabled(boolean enabled)
          When not enabled, work() may not be called and should be ignored if it is called.
 void work(int size)
          Called by an AudioServer to process the specified number of frames.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwitchedAudioClient

public SwitchedAudioClient()
Method Detail

work

public void work(int size)
Description copied from interface: AudioClient
Called by an AudioServer to process the specified number of frames.

Specified by:
work in interface AudioClient
Parameters:
size - the number of frames to be processed

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: AudioClient
When not enabled, work() may not be called and should be ignored if it is called.

Specified by:
setEnabled in interface AudioClient

installClient

public void installClient(AudioClient m)

revertClient

public void revertClient()

attachServer

public void attachServer(boolean yes)


Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.