agentland.device
Class AudioMuxAgent

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--metaglue.AgentAgent
                          |
                          +--agentland.util.GoodAgent
                                |
                                +--agentland.resource.ManagedAgent
                                      |
                                      +--agentland.device.DeviceAgent
                                            |
                                            +--agentland.device.BaseMuxAgent
                                                  |
                                                  +--agentland.device.AudioMuxAgent
All Implemented Interfaces:
Agent, AudioMux, BaseMux, Connectable, Device, Good, Managed, MetagluePrimitives, Mux, NamedMux, Presetable, Remote, Serializable, Spy

public class AudioMuxAgent
extends BaseMuxAgent
implements AudioMux

See Also:
Serialized Form

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
Field Summary
protected  UniversalAudioMux audioMux
           
protected  int numInputs
           
protected  int numOutputs
           
protected  Vector presets
           
 
Fields inherited from class agentland.device.DeviceAgent
defaultState, fName, names, states
 
Fields inherited from class agentland.resource.ManagedAgent
rm, society
 
Fields inherited from class agentland.util.GoodAgent
alert, notifier
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Constructor Summary
AudioMuxAgent()
           
 
Method Summary
 boolean addPresetName(String presetName)
          Adds a preset name to the frozen list
 boolean areYouThere()
           
 boolean clearPresetNames()
          Clears the names associated with all presets.
 boolean connect(int in, int out)
           
 UncertainValue getInput(int out)
          Returns the number of the input connected to the output specified as a parameter for this method.
 int getNumInputs()
          Gets the number of inputs the mux can take.
 int getNumOutputs()
          Gets the number of outputs the mux can take.
 int getNumPresets()
          Gets the number of presets currently programmed in the mux.
 String getPresetName(int number)
          Gets the name of the preset associated with a given number.
 Vector getPresets()
          Get the names of the presets.
 boolean gotoPreset(int i)
           
 boolean loadDefaults()
           
 boolean muteAll()
           
 boolean muteInChannel(int in)
           
 boolean muteOutChannel(int out)
           
 void setNumInputs(int inputs)
          Sets the number of inputs the mux can take.
 void setNumOutputs(int outputs)
          Sets the number of outputs the mux can take.
 boolean setPresetName(int number, String presetName)
          Assign presetName to the preset with the given number.
 boolean setPresets(Vector presets)
          Set the names of the presets.
 boolean unmuteAll()
           
 boolean unmuteInChannel(int in)
           
 boolean unmuteOutChannel(int out)
           
 
Methods inherited from class agentland.device.BaseMuxAgent
connect, connectionSet, findPositionInVector, getInputName, getInputs, getOutputName, getOutputs, getVectorIndex, resetNames, resolveInputName, resolveOutputName, setInputName, setOutputName
 
Methods inherited from class agentland.device.DeviceAgent
addName, createStateChangeNotification, ensureState, getDefaultNames, getDefaultStateName, getName, getNames, getState, getState, getStateNames, hasName, quietException, resetAllStates, resetName, resetState, resetState, setDefaultStateName, setName, setState, throwException, updateState, updateState, updateState, updateState, updateState, updateState, updateState, updateState
 
Methods inherited from class agentland.resource.ManagedAgent
connect, getAlert, getNeed, isAvailable, isAvailable, reliesOn, reliesOn, replace, replace, request, request, request, requestAgent, requestAgent, resources, resourcesByAgentID, setNeed, tiedTo, yank, yank, yank
 
Methods inherited from class agentland.util.GoodAgent
addSpy, addSpy, alert, alertString, beep, error, getHistory, getHistoryElement, getPersistentMap, log, notify, removeSpy, removeSpy, resetHistory, safeRely, safeRely, safeRely, setNiceLogName, tell
 
Methods inherited from class metaglue.AgentAgent
addMonitor, alive, defrost, defrostAll, defrostBoolean, defrostInt, defrostString, fixAttribute, fixAttribute, freeze, freeze, freeze, freezeAll, freezeVar, getAgentID, getAttribute, getCatalog, getCatalogID, getDesignation, getFrozenVariables, getLogLevel, getMetaglueAgent, getMetaglueAgentID, getOccupation, getProperties, getSociety, log, log, lookupClass, obtainMetaglueAgent, obtainMetaglueAgent, obtainMetaglueAgentByName, reliesOn, reliesOnSynch, removeFrozen, replaceExceptionHandler, setFreezeName, setLogLevel, setLogName, shutdown, startAgent, startAgentOn, startAgentOn, startup, status, tiedTo, tiedTo, tiedTo, tiedTo, tieToDesignation, whereAreYou
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface agentland.device.NamedMux
connect, getInputName, getInputs, getOutputName, getOutputs, resetNames, setInputName, setOutputName
 
Methods inherited from interface agentland.device.Device
addName, getName, getNames, getState, getState, getStateNames, hasName, resetAllStates, resetName, resetState, resetState, setName, setState
 
Methods inherited from interface agentland.resource.Managed
getNeed, replace, replace, resources, yank, yank
 
Methods inherited from interface agentland.util.Good
getHistory, getHistoryElement, resetHistory
 
Methods inherited from interface metaglue.Agent
addMonitor, alive, getAgentID, getMetaglueAgentID, shutdown, startup, whereAreYou
 
Methods inherited from interface agentland.util.Spy
tell
 

Field Detail

audioMux

protected UniversalAudioMux audioMux

numInputs

protected int numInputs

numOutputs

protected int numOutputs

presets

protected Vector presets
Constructor Detail

AudioMuxAgent

public AudioMuxAgent()
              throws RemoteException
Method Detail

areYouThere

public boolean areYouThere()
                    throws RemoteException
Specified by:
areYouThere in interface AudioMux

gotoPreset

public boolean gotoPreset(int i)
                   throws RemoteException
Specified by:
gotoPreset in interface AudioMux

muteAll

public boolean muteAll()
                throws RemoteException
Specified by:
muteAll in interface AudioMux

muteOutChannel

public boolean muteOutChannel(int out)
                       throws RemoteException
Specified by:
muteOutChannel in interface AudioMux

muteInChannel

public boolean muteInChannel(int in)
                      throws RemoteException
Specified by:
muteInChannel in interface AudioMux

unmuteAll

public boolean unmuteAll()
                  throws RemoteException
Specified by:
unmuteAll in interface AudioMux

unmuteOutChannel

public boolean unmuteOutChannel(int out)
                         throws RemoteException
Specified by:
unmuteOutChannel in interface AudioMux

unmuteInChannel

public boolean unmuteInChannel(int in)
                        throws RemoteException
Specified by:
unmuteInChannel in interface AudioMux

addPresetName

public boolean addPresetName(String presetName)
                      throws RemoteException
Description copied from interface: Presetable
Adds a preset name to the frozen list
Specified by:
addPresetName in interface Presetable
Following copied from interface: agentland.device.Presetable
Parameters:
presetName - a String value to add to the preset Vector
Returns:
true if successful
Throws:
RemoteException - if an error occurs

setPresetName

public boolean setPresetName(int number,
                             String presetName)
                      throws RemoteException
Description copied from interface: Presetable
Assign presetName to the preset with the given number.
Specified by:
setPresetName in interface Presetable
Following copied from interface: agentland.device.Presetable
Parameters:
number - an int between 1 and getNumPresets()
presetName - a String value
Returns:
true if successful
Throws:
RemoteException - if an error occurs

getPresetName

public String getPresetName(int number)
                     throws RemoteException
Description copied from interface: Presetable
Gets the name of the preset associated with a given number.
Specified by:
getPresetName in interface Presetable
Following copied from interface: agentland.device.Presetable
Parameters:
number - an int between 1 and getNumPresets()
Returns:
the corresponding preset's name
Throws:
RemoteException - if an error occurs

getPresets

public Vector getPresets()
                  throws RemoteException
Description copied from interface: Presetable
Get the names of the presets.
Specified by:
getPresets in interface Presetable
Following copied from interface: agentland.device.Presetable
Returns:
a Vector of preset names stored as Strings
Throws:
RemoteException - if an error occurs

setPresets

public boolean setPresets(Vector presets)
Description copied from interface: Presetable
Set the names of the presets.
Specified by:
setPresets in interface Presetable
Following copied from interface: agentland.device.Presetable
Parameters:
presets - is a Vector representing the names of all presets in numerical order.
Returns:
true if successful
Throws:
RemoteException - if an error occurs

clearPresetNames

public boolean clearPresetNames()
                         throws RemoteException
Description copied from interface: Presetable
Clears the names associated with all presets.
Specified by:
clearPresetNames in interface Presetable
Following copied from interface: agentland.device.Presetable
Returns:
true if successful
Throws:
RemoteException - if an error occurs

getNumPresets

public int getNumPresets()
                  throws RemoteException
Description copied from interface: Presetable
Gets the number of presets currently programmed in the mux.
Specified by:
getNumPresets in interface Presetable
Following copied from interface: agentland.device.Presetable
Returns:
the number of presets
Throws:
RemoteException - if an error occurs

loadDefaults

public boolean loadDefaults()
Specified by:
loadDefaults in interface Mux

connect

public boolean connect(int in,
                       int out)
Specified by:
connect in interface Mux

getInput

public UncertainValue getInput(int out)
Description copied from class: BaseMuxAgent
Returns the number of the input connected to the output specified as a parameter for this method. Returns an UncertainValue -- it tells you the answer and how sure it is of it.
Specified by:
getInput in interface Mux
Overrides:
getInput in class BaseMuxAgent

getNumInputs

public int getNumInputs()
                 throws RemoteException
Gets the number of inputs the mux can take.
Specified by:
getNumInputs in interface NamedMux
Returns:
the number of inputs
Throws:
RemoteException - if an error occurs

getNumOutputs

public int getNumOutputs()
                  throws RemoteException
Gets the number of outputs the mux can take.
Specified by:
getNumOutputs in interface NamedMux
Returns:
the number of outputs
Throws:
RemoteException - if an error occurs

setNumInputs

public void setNumInputs(int inputs)
                  throws RemoteException
Sets the number of inputs the mux can take.
Parameters:
inputs - the number of inputs
Throws:
RemoteException - if an error occurs

setNumOutputs

public void setNumOutputs(int outputs)
                   throws RemoteException
Sets the number of outputs the mux can take.
Parameters:
outputs - the number of outputs
Throws:
RemoteException - if an error occurs