agentland.device
Class CDPlayerAgent

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--metaglue.AgentAgent
                          |
                          +--agentland.device.CDPlayerAgent
All Implemented Interfaces:
Agent, CDPlayer, MetagluePrimitives, Player, Remote, Serializable

public class CDPlayerAgent
extends AgentAgent
implements CDPlayer

CDPlayer Agent Intelligent Room/HAL Project MIT Artificial Intelligence Laboratory Cambridge, MA

Adapted from sbj's hci.dev.CDPlayer code into agent form 1/26/98 - jjlilley Here's part of the original description: The CDPlayer class controls the CDPlayer currently connected to Bird "A", by sending the appropriate addresses to the SerialIR class. It also keeps status information: power on/standby, and cd status (Play/Pause/Stop). Of course, it doesn't recieve this information from the CDPlayer, so when this class is instantiated some status information is assumed. See below. nn *

See Also:
Serialized Form

Inner classes inherited from class metaglue.AgentAgent
AgentAgent.Attribute
 
Field Summary
static int CD_PAUSED
           
static int CD_PLAYING
           
static int CD_STOPPED
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface metaglue.Agent
ALIVE, DIED, NO_METAGLUE, NOT_RUNNING, STARTING
 
Constructor Summary
CDPlayerAgent()
           
 
Method Summary
 int getIntCDStatus()
           
 boolean getPowerStatus()
           
 String getStringCDStatus()
           
 void nextDisc()
           
 void nextTrack()
           
 void pause()
           
 void play()
           
 void play(Song s)
           
 void playSong(int disc, int track)
          This method plays a song on disc disc and track track.
 void previousDisc()
           
 void previousTrack()
           
 void resume()
           
 void setDisc(int ch)
          This sets the disc to the specified integer, by pressing the buttons in order, followed by "SET DISC".
 void setPowerStatus(boolean on)
          Use this to set the power status if it's wrong
 void setTrack(int ch)
          This sets the track to the specified integer, by pressing the buttons in order, followed by "SET TRACK".
 void stop()
           
 void turnOff()
           
 void turnOn()
           
 
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, log, lookupClass, obtainMetaglueAgent, obtainMetaglueAgent, obtainMetaglueAgentByName, reliesOn, reliesOn, 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 metaglue.Agent
addMonitor, alive, getAgentID, getMetaglueAgentID, shutdown, startup, whereAreYou
 

Field Detail

CD_STOPPED

public static final int CD_STOPPED

CD_PLAYING

public static final int CD_PLAYING

CD_PAUSED

public static final int CD_PAUSED
Constructor Detail

CDPlayerAgent

public CDPlayerAgent()
              throws RemoteException
Method Detail

setPowerStatus

public void setPowerStatus(boolean on)
                    throws RemoteException
Use this to set the power status if it's wrong
Specified by:
setPowerStatus in interface CDPlayer

getPowerStatus

public boolean getPowerStatus()
                       throws RemoteException
Specified by:
getPowerStatus in interface CDPlayer

turnOn

public void turnOn()
            throws RemoteException
Specified by:
turnOn in interface CDPlayer

turnOff

public void turnOff()
             throws RemoteException
Specified by:
turnOff in interface CDPlayer

setDisc

public void setDisc(int ch)
             throws RemoteException
This sets the disc to the specified integer, by pressing the buttons in order, followed by "SET DISC". A half-second delay seperates the presses, and a half-second delay follows the presses.
Specified by:
setDisc in interface CDPlayer

setTrack

public void setTrack(int ch)
              throws RemoteException
This sets the track to the specified integer, by pressing the buttons in order, followed by "SET TRACK". A half-second delay seperates the presses, and a half-second delay follows the presses.
Specified by:
setTrack in interface CDPlayer

play

public void play()
          throws RemoteException
Specified by:
play in interface CDPlayer

stop

public void stop()
          throws RemoteException
Specified by:
stop in interface CDPlayer

pause

public void pause()
           throws RemoteException
Specified by:
pause in interface CDPlayer

nextTrack

public void nextTrack()
               throws RemoteException
Specified by:
nextTrack in interface CDPlayer

previousTrack

public void previousTrack()
                   throws RemoteException
Specified by:
previousTrack in interface CDPlayer

nextDisc

public void nextDisc()
              throws RemoteException
Specified by:
nextDisc in interface CDPlayer

previousDisc

public void previousDisc()
                  throws RemoteException
Specified by:
previousDisc in interface CDPlayer

getStringCDStatus

public String getStringCDStatus()
                         throws RemoteException
Specified by:
getStringCDStatus in interface CDPlayer

getIntCDStatus

public int getIntCDStatus()
                   throws RemoteException
Specified by:
getIntCDStatus in interface CDPlayer

playSong

public void playSong(int disc,
                     int track)
              throws RemoteException
This method plays a song on disc disc and track track. The player stops after playing the song
Specified by:
playSong in interface CDPlayer

play

public void play(Song s)
          throws RemoteException
Specified by:
play in interface Player

resume

public void resume()
            throws RemoteException
Specified by:
resume in interface Player