package nxm.audio.net;

import java.rmi.Remote;
import java.rmi.RemoteException;

/** public interface to Remote Player Delegate.
    @author Lisa Tursky
    @since  NeXtMidas 2.1.0
*/
public interface PlayerIntf extends Remote {

  /** Adds a datagramreader to the hwplayer playing the audio stream at host:port.
   *  @param host       the audio stream host
   *  @param port       the audio stream port
   *  @param audiotype  the audio type
   *  @param bufferSize the buffer size
   *  @return the channel number of the stream
   *  @throws RemoteException the Remote exception
   */
  public int addReader(String host,int port,String audiotype,int bufferSize) throws RemoteException;

  /** Removes the given channel from the hwplayer.
   *  @param channel the hwplayer channel to be removed
   *  @throws RemoteException the Remote exception
   */
  public void removeReader(int channel) throws RemoteException;

  /** Get the current volume value for the indicated channel in the player.
   *  @param lineNum the source data line number
   *  @return the current volume value
   *  @throws RemoteException the Remote exception
   */
  public float getVolume(int lineNum) throws RemoteException;

  /** Get the current pan value for the indicated channel in the player.
   *  @param lineNum the source data line number
   *  @return the current pan value
   *  @throws RemoteException the Remote exception
   */
  public float getPan(int lineNum) throws RemoteException;

  /** Get the current Off state for the indicated channel in the player.
   *  @param lineNum the source data line number
   *  @return true OFF, false if ON
   *  @throws RemoteException the Remote exception
   */
  public boolean getOff(int lineNum) throws RemoteException;

  /** Sets the new volume value for the indicated channel in the player.
   *  @param volume  the new volume value
   *  @param lineNum the source data line number
   *  @throws RemoteException the Remote exception
   */
  public void setVolumeRemote(int volume, int lineNum) throws RemoteException;

  /** Sets the volume to value for the indicated channel in the player.
   *  Use a defined conversion scheme if the boolean convert is true.
   *  @param volume  the new volume value
   *  @param lineNum the source data line number
   *  @param convert true if using a defined conversion scheme, otherwise false
   *  @throws RemoteException the Remote exception
   */
  public void setVolumeRemote(int volume, int lineNum, boolean convert) throws RemoteException;

  /** Sets the pan for the indicated channel in the player.
   *  @param pan the new pan value
   *  @param lineNum the source data line number
   *  @throws RemoteException the Remote exception
   */
  public void setPanRemote(float pan, int lineNum) throws RemoteException;

  /** Sets the pan for the indicated channel in the player.
   *  Uses a defined conversion scheme if the boolean convert is true.
   *  @param pan the new pan value
   *  @param lineNum the source data line number
   *  @param convert true if using a defined conversion scheme, otherwise false
   *  @throws RemoteException the Remote exception
   */
  public void setPanRemote(float pan, int lineNum, boolean convert) throws RemoteException;

  /** Sets the Off state for the indicated channel in the player.
   *  @param off the new Off state
   *  @param lineNum the source data line number
   *  @throws RemoteException the Remote exception
   */
  public void setOffRemote(boolean off, int lineNum) throws RemoteException;

  /** Closes the audio player
   *  @throws RemoteException the Remote exception
   */
  public void close() throws RemoteException;

  /** Shuts down the audio player
   *  @throws RemoteException the Remote exception
   */
  public void shutdown() throws RemoteException;

  /** Test to see if Alive
   *  @throws RemoteException the Remote exception
   */
  public void isAlive() throws RemoteException;

  /** Sets the host and port for the audio stream played on the given channel of the hwplayer.
   *  @param host      the audio stream host
   *  @param port      the audio stream port
   *  @param channel   the channel of the hwplayer
   *  @param audiotype the audio type
   *  @param on        the state of whether or not to connect to the audio stream
   *  @throws RemoteException the Remote exception
   */
  public void setHostPort(String host,int port,int channel,String audiotype,boolean on) throws RemoteException;

  /** Gets the name that is used to bind the player in the rmi registry.
   *  @return the name
   *  @throws RemoteException Remote exception
   */
  public String getName() throws RemoteException;

  /** Prints out the channel number, host, and port information for all
   *  streams currently being played on the hwplayer. For debug purposes.
   *  @return the channel number, host, and port information
   *  @throws RemoteException the Remote exception
   */
  public String getPlayerChannelInfo() throws RemoteException;
}