uk.org.toot.audio.server
Class CompoundAudioClient
java.lang.Object
uk.org.toot.audio.server.CompoundAudioClient
- All Implemented Interfaces:
- AudioClient
public class CompoundAudioClient
- extends java.lang.Object
- implements AudioClient
A simple-mided AudioClient using the Composite design pattern.
May have concurrency issues !!! !!!
But work() shouldn't block on synchronisation so code lock-free.
Don't extend this for other functionality such as enablement, clients
form a tree but aren't currently aware of their parents so any added
functionality is currently not available to child clients.
API needs to be defined in AudioCient for best effect.
Perhaps we should be final to enforce this?
Method Summary |
void |
add(AudioClient client)
|
void |
remove(AudioClient client)
|
void |
setEnabled(boolean enable)
When not enabled, work() may not be called and should be ignored if it
is called. |
void |
work(int nFrames)
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 |
CompoundAudioClient
public CompoundAudioClient()
work
public void work(int nFrames)
- Description copied from interface:
AudioClient
- Called by an AudioServer to process the specified number of frames.
- Specified by:
work
in interface AudioClient
- Parameters:
nFrames
- the number of frames to be processed
setEnabled
public void setEnabled(boolean enable)
- 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
add
public void add(AudioClient client)
remove
public void remove(AudioClient client)
Copyright © 2004, 2005, 2006, 2007 Steve Taylor. All Rights Reserved.