// Path: src/com/nixus/raop/core/Service.java
// public interface Service {
// 
//     /**
//      * Start the Service
//      * @param context the ServiceContext for this Service
//      */
//     public void startService(ServiceContext context);
// 
//     /**
//      * Stop the Service
//      * @param context the ServiceContext for this Service (same as was passed into start)
//      */
//     public void stopService(ServiceContext context);
// 
//     /**
//      * Return the ServiceContext that was passed into {@link #startService}
//      */
//     public ServiceContext getContext();
// 
//     /**
//      * Return a Map describing the state of this Service, for serialization back to any
//      * client that needs to know (eg webplayer) - so values should be serializable objects,
//      * eg Lists, Maps or simple objects. If no useful state, return null.
//      */
//     public Map<String,Object> reportState();
// 
// }
// 
// Path: src/com/nixus/raop/speaker/Speaker.java
// public interface Speaker extends Service {
// 
//     /**
//      * Return the number of ms delay for this speaker, between a packet
//      * being written and it being heard
//      */
//     public int getDelay();
// 
//     /**
//      * Return the size of the speaker buffer in bytes.
//      */
//     public int getBufferSize();
// 
//     /**
//      * Return a nice name for the Speaker for display to the user
//      */
//     public String getDisplayName();
// 
//     /**
//      * Return a unique ID for the speaker
//      */
//     int getUniqueId();
// 
//     /**
//      * Returns true if this speaker can have its gain adjusted
//      */
//     public boolean hasGain();
// 
//     /**
//      * Set the gain of this speaker. A value of NaN means "no audio".
//      * If this method fails, set the Error.
//      */
//     public void setGain(float gain);
// 
//     /**
//      * Set the player for the speaker. This method should
//      * call {@link Player#removeSpeaker} on the old player
//      * and {@link Player#addSpeaker} on the new one, and
//      * anyone moving speakers between players should call
//      * this method rather than those methods directly.
//      */
//     public void setPlayer(Player player);
// 
//     /**
//      * Get the Player currently assigned to this speaker
//      */
//     public Player getPlayer();
// 
//     /**
//      * If this speaker has failed for some reason, return the Exception.
//      * Otherwise return null.
//      */
//     public Exception getError();
// 
//     /**
//      * Get the volume adjustment that applies to this speaker (+ve or -ve, 0
//      * for no adjustment
//      */
//     public int getVolumeAdjustment();
// 
//     /**
//      * Set the volume adjustment that applies to this speaker, which should be
//      * be added to the gain for this speaker.
//      */
//     public void setVolumeAdjustment(int volumeadjust);
// 
//     /**
//      * Open the Speaker and start it. Reset any error that may have been set.
//      */
//     public void open(float sampleRate, int sampleSizeInBits, int channels, boolean signed, boolean bigEndian);
// 
//     /**
//      * Write data to the speaker. If it fails, set the error
//      */
//     public void write(byte[] buf, int off, int len);
// 
//     /**
//      * Immediately stop the speaker and discard any cached data written to it
//      * If it fails, set the error.
//      */
//     public void flush();
// 
//     /**
//      * Block until the data already written to the speaker completes
//      * If it fails, set the error.
//      */
//     public void drain();
// 
//     /**
//      * Close the speaker, immediately stopping it and discarding any data.
//      * Does not throw exception or fail.
//      */
//     public void close();
// 
//     /**
//      * True after open has been called, false after close has been called
//      */
//     public boolean isOpen();
// 
// }


import java.util.Collection;
import com.nixus.raop.core.Service;
import com.nixus.raop.speaker.Speaker;
package com.nixus.raop.player;



/**
 * A Player plays tracks to one or more speakers which may be local speaker
 * (probably a {@link SourceDataLine}), an Airtunes speaker or some other type (eg RTSP, uPnP etc.)
 * Each player maintains it's own playlist and tracks may be cued, reordered, skipped
 * and so on as you'd expect.
 */
public interface Player extends Service {




    /**
     * Set the current volume
     * @param volume the volume, between 0 and 100
     */

    public void setVolume(int volume);

    /**
     * Return the current volume
     * @return the volume, between 0 and 100
     */

    public int getVolume();

    //-------------------------------------------------------------------------------

    /**
     * Get the collection of speakers that could be used by this Player and that
     * aren't currently in use elsewhere.
     */
// Path: src/com/nixus/raop/core/Service.java
// public interface Service {
// 
//     /**
//      * Start the Service
//      * @param context the ServiceContext for this Service
//      */
//     public void startService(ServiceContext context);
// 
//     /**
//      * Stop the Service
//      * @param context the ServiceContext for this Service (same as was passed into start)
//      */
//     public void stopService(ServiceContext context);
// 
//     /**
//      * Return the ServiceContext that was passed into {@link #startService}
//      */
//     public ServiceContext getContext();
// 
//     /**
//      * Return a Map describing the state of this Service, for serialization back to any
//      * client that needs to know (eg webplayer) - so values should be serializable objects,
//      * eg Lists, Maps or simple objects. If no useful state, return null.
//      */
//     public Map<String,Object> reportState();
// 
// }
// 
// Path: src/com/nixus/raop/speaker/Speaker.java
// public interface Speaker extends Service {
// 
//     /**
//      * Return the number of ms delay for this speaker, between a packet
//      * being written and it being heard
//      */
//     public int getDelay();
// 
//     /**
//      * Return the size of the speaker buffer in bytes.
//      */
//     public int getBufferSize();
// 
//     /**
//      * Return a nice name for the Speaker for display to the user
//      */
//     public String getDisplayName();
// 
//     /**
//      * Return a unique ID for the speaker
//      */
//     int getUniqueId();
// 
//     /**
//      * Returns true if this speaker can have its gain adjusted
//      */
//     public boolean hasGain();
// 
//     /**
//      * Set the gain of this speaker. A value of NaN means "no audio".
//      * If this method fails, set the Error.
//      */
//     public void setGain(float gain);
// 
//     /**
//      * Set the player for the speaker. This method should
//      * call {@link Player#removeSpeaker} on the old player
//      * and {@link Player#addSpeaker} on the new one, and
//      * anyone moving speakers between players should call
//      * this method rather than those methods directly.
//      */
//     public void setPlayer(Player player);
// 
//     /**
//      * Get the Player currently assigned to this speaker
//      */
//     public Player getPlayer();
// 
//     /**
//      * If this speaker has failed for some reason, return the Exception.
//      * Otherwise return null.
//      */
//     public Exception getError();
// 
//     /**
//      * Get the volume adjustment that applies to this speaker (+ve or -ve, 0
//      * for no adjustment
//      */
//     public int getVolumeAdjustment();
// 
//     /**
//      * Set the volume adjustment that applies to this speaker, which should be
//      * be added to the gain for this speaker.
//      */
//     public void setVolumeAdjustment(int volumeadjust);
// 
//     /**
//      * Open the Speaker and start it. Reset any error that may have been set.
//      */
//     public void open(float sampleRate, int sampleSizeInBits, int channels, boolean signed, boolean bigEndian);
// 
//     /**
//      * Write data to the speaker. If it fails, set the error
//      */
//     public void write(byte[] buf, int off, int len);
// 
//     /**
//      * Immediately stop the speaker and discard any cached data written to it
//      * If it fails, set the error.
//      */
//     public void flush();
// 
//     /**
//      * Block until the data already written to the speaker completes
//      * If it fails, set the error.
//      */
//     public void drain();
// 
//     /**
//      * Close the speaker, immediately stopping it and discarding any data.
//      * Does not throw exception or fail.
//      */
//     public void close();
// 
//     /**
//      * True after open has been called, false after close has been called
//      */
//     public boolean isOpen();
// 
// }


// Path: src/com/nixus/raop/player/Player.java
import java.util.Collection;
import com.nixus.raop.core.Service;
import com.nixus.raop.speaker.Speaker;

package com.nixus.raop.player;



/**
 * A Player plays tracks to one or more speakers which may be local speaker
 * (probably a {@link SourceDataLine}), an Airtunes speaker or some other type (eg RTSP, uPnP etc.)
 * Each player maintains it's own playlist and tracks may be cued, reordered, skipped
 * and so on as you'd expect.
 */
public interface Player extends Service {




    /**
     * Set the current volume
     * @param volume the volume, between 0 and 100
     */

    public void setVolume(int volume);

    /**
     * Return the current volume
     * @return the volume, between 0 and 100
     */

    public int getVolume();

    //-------------------------------------------------------------------------------

    /**
     * Get the collection of speakers that could be used by this Player and that
     * aren't currently in use elsewhere.
     */
    public Collection<Speaker> getAvailableSpeakers();