|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mitre.jdas.Controller
The Controller
class keeps track of the operating mode and state of JDAS,
processes requests for mode and state changes, and dispatches events indicating
those changes to listeners implementing the ControllerListener
interface
or extending the ControllerAdapter
adapter class.
In the context of JDAS, "states" refer to inherently dynamic operating conditions. States currently supported by JDAS include
To track event timing in situations where latency exists between "start/stop" requests dispatched to other objects and activation of requests by those objects, many states are tracked by "started" and "active" fields. "started" fields are typically (ultimately universally) manipulated through "start/stop" methods invoked by an object requesting a particular operation, whereas "active" fields are typically manipulated through "activate/deactivate" methods invoked by the object responsible for implementing the request.
By contrast, "modes" are quasi-stationary conditions related to the general operation of JDAS. Currently supported modes include
ControllerListener
,
ControllerAdapter
Constructor Summary | |
Controller(galaxy.server.ServerArgParser argParser)
The Controller class constructor processes command line arguments to set mode parameters and default audio format settings. |
Method Summary | |
void |
activateMute()
Activate VAD mute. |
boolean |
activateVoice()
Set voice state to active if possible. |
void |
addEventListener(java.util.EventListener l)
Adds the specified ControllerListener to the collection of current listeners. |
boolean |
bargeIn()
Activates a barge-in event if barge-in enabled and playback has started. |
void |
deactivateMute()
Deactivate VAD mute. |
void |
deactivateVoice()
Set voice state to inactive. |
void |
disableBargeIn()
Disables barge-in mode. |
void |
disableDebug()
Disables debugging output mode. |
void |
disableGUI()
Disables controller GUI. |
void |
disableHalfDuplex()
Disables half-duplex mode. |
void |
disableKeypad()
Disables keypad GUI. |
void |
disablePlaybox()
Disables MIT audio playbox brokering mode. |
void |
disablePTT()
Disables push-to-talk mode. |
boolean |
disableStreaming()
Disables streaming mode if not currently recording. |
void |
enableBargeIn()
Enables barge-in mode. |
void |
enableDebug()
Enables debugging output mode. |
void |
enableGUI()
Enables controller GUI. |
void |
enableHalfDuplex()
Enables half-duplex mode. |
void |
enableKeypad()
Enables keypad GUI. |
void |
enablePlaybox()
Disables MIT audio playbox brokering mode. |
void |
enablePTT()
Enables push-to-talk mode. |
boolean |
enableStreaming()
Enables streaming mode if not currently recording. |
void |
flash()
Perform on-hook immediately followed by off-hook. |
AudioBroker |
getAudioBroker()
Returns object implementing the AudioBroker interface to handle
audio brokering. |
javax.sound.sampled.AudioFormat |
getDefaultPlaybackAudioFormat()
Return the default playback audio format determined from defaults overridden by command line arguments. |
javax.sound.sampled.AudioFormat |
getDefaultRecordAudioFormat()
Return the default recording audio format determined from defaults overridden by command line arguments. |
float |
getDefaultVadLowerFactor()
Return the default factor used to adaptively lower the VAD threshold. |
float |
getDefaultVadRaiseFactor()
Return the default factor used to adaptively raise the VAD threshold. |
int |
getLockoutDelay()
Returns delay used by the lockout timer. |
boolean |
guiInvisible()
Sets GUI state to invisible if the GUI is enabled and currently visible. |
boolean |
guiVisible()
Sets GUI state to visible if the GUI is enabled and currently invisible. |
boolean |
isBargeInEnabled()
Indicates whether barge-in is enabled. |
boolean |
isCaptureActive()
|
boolean |
isCaptureLineOpen()
|
boolean |
isCaptureStartable()
|
boolean |
isDebugEnabled()
Indicates whether debugging output is enabled. |
boolean |
isGUIEnabled()
Indicates whether the JDAS controller GUI is enabled. |
boolean |
isGUIVisible()
Indicates whether the controller GUI is visible. |
boolean |
isHalfDuplexEnabled()
Indicates whether half-duplex operation is enabled. |
boolean |
isKeypadEnabled()
Indicates whether the JDAS telephony keypad GUI is enabled. |
boolean |
isKeypadVisible()
Indicates whether the keypad GUI is visible. |
boolean |
isMuteActive()
Indicates whether VAD mute is active. |
boolean |
isOnHook()
Indicates whether JDAS is in an on-hook state. |
boolean |
isPlaybackActive()
|
boolean |
isPlaybackLineOpen()
|
boolean |
isPlaybackStartable()
Indicates whether playback may be started. |
boolean |
isPlaybackStarted()
Indicates whether a start playback request is in force. |
boolean |
isPlayboxEnabled()
Indicates whether the MIT audio playbox audio brokering protocol is enabled. |
boolean |
isPTTEnabled()
Indicates whether push-to-talk operation is enabled. |
boolean |
isRecordStartable()
Indicates whether recording may be started. |
boolean |
isRecordStarted()
Indicates whether a start recording request is in force. |
boolean |
isResendable()
|
boolean |
isStreamingEnabled()
Indicates whether streaming audio brokering is enabled. |
boolean |
isVADStartable()
Indicates whether voice activity detection may be started. |
boolean |
isVADStarted()
Indicates whether VAD has been started. |
boolean |
isVoiceActivateable()
Indicates whether the voice state may be set active. |
boolean |
isVoiceActive()
Indicates whether the voice state is active. |
boolean |
keypadInvisible()
Sets keypad GUI state to invisible if the keypad is enabled and currently visible. |
boolean |
keypadVisible()
Sets keypad GUI state to visible if the keypad is enabled and currently invisible. |
void |
notifySubscribers(java.lang.Object source,
java.util.EventObject e)
Send a ControllerEvent to the subscribers. |
void |
offHook()
Take JDAS off-hook. |
void |
onHook()
Put JDAS on-hook. |
void |
removeEventListener(java.util.EventListener l)
Removes the specified ControllerListener from the collection of current listeners. |
boolean |
resend()
Activate resend state if not recording and there is audio data to send. |
void |
setAudioBroker(AudioBroker audioBroker)
Sets object implementing the AudioBroker interface to handle
audio brokering. |
void |
setBargeInEnabled(boolean bargeInEnabled)
Sets debugging output mode to specified value. |
void |
setCaptureLineOpen(boolean captureLineOpen)
|
void |
setDebugEnabled(boolean debugEnabled)
Sets debugging output mode to specified value. |
void |
setDefaultPlaybackAudioFormat(javax.sound.sampled.AudioFormat defaultPlaybackAudioFormat)
Set default playback audio format. |
void |
setDefaultRecordAudioFormat(javax.sound.sampled.AudioFormat defaultRecordAudioFormat)
Set default recording audio format. |
void |
setDefaultVadLowerFactor(float defaultVadLowerFactor)
Set the default factor used to adaptively lower the VAD threshold. |
void |
setDefaultVadRaiseFactor(float defaultVadRaiseFactor)
Set the default factor used to adaptively raise the VAD threshold. |
void |
setGUIEnabled(boolean guiEnabled)
Sets controller GUI mode to specified value. |
boolean |
setGUIVisible(boolean guiVisible)
Sets GUI state to specified value if possible. |
void |
setHalfDuplexEnabled(boolean halfDuplexEnabled)
Sets half-duplex mode to specified value. |
void |
setHook(boolean onHook)
Set hook state to specified value. |
void |
setKeypadEnabled(boolean keypadEnabled)
Sets keypad GUI mode to specified value. |
boolean |
setKeypadVisible(boolean keypadVisible)
Sets keypad GUI state to specified value if possible. |
void |
setMuteActive(boolean muteActive)
Set VAD mute to specified value. |
void |
setPlaybackLineOpen(boolean playbackLineOpen)
|
boolean |
setPlaybackStarted(boolean playbackStarted)
Set playback start to specified value if possible. |
void |
setPlayboxEnabled(boolean playboxEnabled)
Sets MIT audio playbox brokering mode to specified value. |
void |
setPTTEnabled(boolean pttEnabled)
Sets push-to-talk mode to specified value. |
boolean |
setRecordStarted(boolean recordStarted)
Set record start to specified value if possible. |
boolean |
setStreaming(boolean streamingEnabled)
Sets streaming mode if not currently recording. |
boolean |
setVADStarted(boolean vadStarted)
Set VAD start to specified value if possible. |
boolean |
setVoiceActive(boolean voiceActive)
Set voice activity state to specified value if possible. |
void |
sleep()
Sleeps invoking thread for default number of msec (125 to be exact) |
boolean |
startPlayback()
Start playback if possible. |
boolean |
startRecord()
Start recording if possible. |
boolean |
startVAD()
Start VAD monitoring if possible. |
void |
stopPlayback()
Stop playback. |
void |
stopRecord()
Stop recording. |
void |
stopVAD()
Stop VAD monitoring. |
java.lang.String |
toString()
|
boolean |
touchtone(int id)
Generate KeypadEvent event with specified id value, provided JDAS
is not on-hook at the time. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Controller(galaxy.server.ServerArgParser argParser)
InitializationEvent
handled by listener objects.argParser
- Parsed command line argument object passed from MainServer
Method Detail |
public boolean isBargeInEnabled()
public boolean isDebugEnabled()
public boolean isGUIEnabled()
public boolean isHalfDuplexEnabled()
public boolean isKeypadEnabled()
public boolean isPlayboxEnabled()
public boolean isPTTEnabled()
public boolean isStreamingEnabled()
public boolean isCaptureActive()
public boolean isCaptureLineOpen()
public boolean isCaptureStartable()
public boolean isGUIVisible()
public boolean isKeypadVisible()
public boolean isMuteActive()
public boolean isOnHook()
public boolean isPlaybackActive()
public boolean isPlaybackLineOpen()
public boolean isPlaybackStartable()
public boolean isPlaybackStarted()
public boolean isRecordStartable()
public boolean isRecordStarted()
public boolean isResendable()
public boolean isVADStartable()
public boolean isVADStarted()
public boolean isVoiceActivateable()
public boolean isVoiceActive()
public javax.sound.sampled.AudioFormat getDefaultRecordAudioFormat()
public javax.sound.sampled.AudioFormat getDefaultPlaybackAudioFormat()
public float getDefaultVadRaiseFactor()
public float getDefaultVadLowerFactor()
public int getLockoutDelay()
LockoutTimer
public AudioBroker getAudioBroker()
AudioBroker
interface to handle
audio brokering.AudioBroker
public void setDefaultPlaybackAudioFormat(javax.sound.sampled.AudioFormat defaultPlaybackAudioFormat)
public void setDefaultRecordAudioFormat(javax.sound.sampled.AudioFormat defaultRecordAudioFormat)
public void setDefaultVadRaiseFactor(float defaultVadRaiseFactor)
public void setDefaultVadLowerFactor(float defaultVadLowerFactor)
public void setAudioBroker(AudioBroker audioBroker)
AudioBroker
interface to handle
audio brokering.AudioBroker
public void disableBargeIn()
ModeEvent
event with a
BARGE_IN_DISABLED
id.public void enableBargeIn()
ModeEvent
event with a
BARGE_IN_ENABLED
id.public void setBargeInEnabled(boolean bargeInEnabled)
ModeEvent
event with an appropriate id.public void disableDebug()
ModeEvent
event with a
DEBUG_DISABLED id.
public void enableDebug()
ModeEvent
event with a
DEBUG_ENABLED id.
public void setDebugEnabled(boolean debugEnabled)
ModeEvent
event with an appropriate id.public void disableGUI()
ModeEvent
event with a
GUI_DISABLED
id.public void enableGUI()
ModeEvent
event with a
GUI_ENABLED
id.public void setGUIEnabled(boolean guiEnabled)
ModeEvent
event with an appropriate id.public void disableKeypad()
ModeEvent
event with a
KEYPAD_DISABLED
id.public void enableKeypad()
ModeEvent
event with a
KEYPAD_ENABLED
id.public void setKeypadEnabled(boolean keypadEnabled)
ModeEvent
event with an appropriate id.public void disableHalfDuplex()
ModeEvent
event with a
HALF_DUPLEX_DISABLED
id.public void enableHalfDuplex()
ModeEvent
event with a
HALF_DUPLEX_ENABLED
id.public void setHalfDuplexEnabled(boolean halfDuplexEnabled)
ModeEvent
event with an appropriate id.public void disablePlaybox()
ModeEvent
event with a
PLAYBOX_DISABLED
id.public void enablePlaybox()
ModeEvent
event with a
PLAYBOX_ENABLED
id.public void setPlayboxEnabled(boolean playboxEnabled)
ModeEvent
event with an appropriate id.public void disablePTT()
ModeEvent
event with a
PTT_DISABLED
id.public void enablePTT()
ModeEvent
event with a
PTT_ENABLED
id.public void setPTTEnabled(boolean pttEnabled)
ModeEvent
event with an appropriate id.public boolean disableStreaming()
ModeEvent
event with a STREAMING_DISABLED
id.isRecordStarted()
public boolean enableStreaming()
ModeEvent
event with a STREAMING_ENABLED
id.isRecordStarted()
public boolean setStreaming(boolean streamingEnabled)
ModeEvent
event an appropriate id.public boolean guiInvisible()
GUIEvent
event with a GUI_INVISIBLE
id.isGUIEnabled()
,
isGUIVisible()
public boolean guiVisible()
GUIEvent
event with a GUI_VISIBLE
id.isGUIEnabled()
,
isGUIVisible()
public boolean setGUIVisible(boolean guiVisible)
GUIEvent
event with an appropriate id.public boolean keypadInvisible()
GUIEvent
event with a KEYPAD_INVISIBLE
id.isKeypadEnabled()
,
isKeypadVisible()
public boolean keypadVisible()
GUIEvent
event with a KEYPAD_VISIBLE
id.isKeypadEnabled()
,
isKeypadVisible()
public boolean setKeypadVisible(boolean keypadVisible)
GUIEvent
event with an appropriate id.public void activateMute()
VADEvent
event with
MUTE_ACTIVE
id.public void deactivateMute()
VADEvent
event with
MUTE_INACTIVE
id.public void setMuteActive(boolean muteActive)
VADEvent
event with
an appropriate id.public void offHook()
KeypadEvent
event with
OFF_HOOK
id.public void onHook()
KeypadEvent
event with
ON_HOOK
id.public void setHook(boolean onHook)
KeypadEvent
event with an
appropriate id.public void flash()
public boolean touchtone(int id)
KeypadEvent
event with specified id value, provided JDAS
is not on-hook at the time.isOnHook()
public boolean startPlayback()
PlaybackEvent
event with a
PLAYBACK_STARTED
id.isPlaybackStartable()
public void stopPlayback()
PlaybackEvent
event with a
PLAYBACK_STOPPED
id.public boolean setPlaybackStarted(boolean playbackStarted)
PlaybackEvent
event with an appropriate id.public boolean bargeIn()
isBargeInEnabled()
,
isPlaybackStarted()
public void setPlaybackLineOpen(boolean playbackLineOpen)
public boolean startRecord()
CaptureEvent
event with a
RECORD_STARTED
id.isRecordStartable()
public void stopRecord()
CaptureEvent
event with a
RECORD_STOPPED
id.public boolean setRecordStarted(boolean recordStarted)
CaptureEvent
event with an appropriate id.public boolean resend()
CaptureEvent
event with a RESEND_ACTIVE
id.isRecordStarted()
public void setCaptureLineOpen(boolean captureLineOpen)
public boolean startVAD()
VoiceActivityDetector
will adapt its threshold and detect voice
activity on the basis of each captured buffer.isVadStartable()
public void stopVAD()
VADEvent
event with a
VAD_STOPPED
id.public boolean setVADStarted(boolean vadStarted)
VADEvent
event with an appropriate id.public boolean activateVoice()
VADEvent
event with a VOICE_ACTIVE
id.isVoiceActivateable()
public void deactivateVoice()
VADEvent
event with a
VOICE_INACTIVE
id.public boolean setVoiceActive(boolean voiceActive)
VADEvent
event with an appropriate id.isVoiceActivateable()
public void addEventListener(java.util.EventListener l)
addEventListener
in interface EventGenerator
public void removeEventListener(java.util.EventListener l)
removeEventListener
in interface EventGenerator
public void notifySubscribers(java.lang.Object source, java.util.EventObject e)
ControllerEvent
to the subscribers.notifySubscribers
in interface EventGenerator
public void sleep()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |