// Path: src/main/java/ddf/minim/spi/AudioOut.java
// @SuppressWarnings("deprecation")
// public interface AudioOut extends AudioResource
// {
// 	/**
// 	 * @return the size of the buffer used by this output.
// 	 */
// 	int bufferSize();
// 
// 	/**
// 	 * Sets the AudioSignal that this output will use to generate sound.
// 	 * 
// 	 * @param signal
// 	 *            the AudioSignal used to generate sound
// 	 */
// 	@Deprecated
// 	void setAudioSignal(AudioSignal signal);
// 
// 	/**
// 	 * Sets the AudioStream that this output will use to generate sound.
// 	 * 
// 	 * @param stream
// 	 */
// 	void setAudioStream(AudioStream stream);
// 
// 	/**
// 	 * Sets the AudioEffect to apply to the signal.
// 	 * 
// 	 * @param effect
// 	 *            the AudioEffect to apply to the signal
// 	 */
// 	@Deprecated
// 	void setAudioEffect(AudioEffect effect);
// 
// 	/**
// 	 * Sets the AudioListener that will have sound broadcasted to it as the
// 	 * output generates.
// 	 * 
// 	 * @param listen
// 	 */
// 	void setAudioListener(AudioListener listen);
// }


import javax.sound.sampled.AudioFormat;
import ddf.minim.spi.AudioOut;
package ddf.minim;



/**
 * An <code>AudioSource</code> is a kind of wrapper around an
 * <code>AudioStream</code>. An <code>AudioSource</code> will add its
 * <code>AudioBuffer</code>s as listeners on the stream so that you can access
 * the stream's samples without having to implement <code>AudioListener</code>
 * yourself. It also provides the <code>Effectable</code> and
 * <code>Recordable</code> interface. Because an <code>AudioStream</code> must
 * be closed when you are finished with it, you must remember to call
 * {@link #close()} on any <code>AudioSource</code>s you obtain from Minim, such
 * as <code>AudioInput</code>s, <code>AudioOutput</code>s, and
 * <code>AudioPlayer</code>s.
 * 
 * @author Damien Di Fede
 * @invisible
 * 
 */
@SuppressWarnings("deprecation")
public class AudioSource extends Controller implements Effectable, Recordable
{
	// the instance of Minim that created us, if one did.
	Minim						parent;

	private AudioOut			stream;
	// the signal splitter used to manage listeners to the source
	// our stereobuffer will be the first in the list
	private SignalSplitter		splitter;
	// the StereoBuffer that will subscribe to synth
	private StereoBuffer		buffer;
	// the effects chain used for effecting
	private EffectsChain		effects;

	/**
	 * The AudioBuffer containing the left channel samples. If this is a mono
	 * sound, it contains the single channel of audio.
	 * 
	 * @example Basics/PlayAFile
	 * 
	 * @related AudioBuffer
	 */
	public final AudioBuffer	left;

	/**
	 * The AudioBuffer containing the right channel samples. If this is a mono
	 * sound, <code>right</code> contains the same samples as
	 * <code>left</code>.
	 * 
	 * @example Basics/PlayAFile
	 * 
	 * @related AudioBuffer
	 */
	public final AudioBuffer	right;

	/**
	 * The AudioBuffer containing the mix of the left and right channels. If this is
	 * a mono sound, <code>mix</code> contains the same
	 * samples as <code>left</code>.
	 * 
	 * @example Basics/PlayAFile
	 * 
	 * @related AudioBuffer
	 */
	public final AudioBuffer	mix;

	/**
	 * Constructs an <code>AudioSource</code> that will subscribe to the samples
	 * in <code>stream</code>. It is expected that the stream is using a
	 * <code>DataLine</code> for playback. If it is not, calls to
	 * <code>Controller</code>'s methods will result in a
	 * <code>NullPointerException</code>.
	 * 
	 * @param istream
	 *            the <code>AudioStream</code> to subscribe to and wrap
	 * 
	 * @invisible
	 */
// Path: src/main/java/ddf/minim/spi/AudioOut.java
// @SuppressWarnings("deprecation")
// public interface AudioOut extends AudioResource
// {
// 	/**
// 	 * @return the size of the buffer used by this output.
// 	 */
// 	int bufferSize();
// 
// 	/**
// 	 * Sets the AudioSignal that this output will use to generate sound.
// 	 * 
// 	 * @param signal
// 	 *            the AudioSignal used to generate sound
// 	 */
// 	@Deprecated
// 	void setAudioSignal(AudioSignal signal);
// 
// 	/**
// 	 * Sets the AudioStream that this output will use to generate sound.
// 	 * 
// 	 * @param stream
// 	 */
// 	void setAudioStream(AudioStream stream);
// 
// 	/**
// 	 * Sets the AudioEffect to apply to the signal.
// 	 * 
// 	 * @param effect
// 	 *            the AudioEffect to apply to the signal
// 	 */
// 	@Deprecated
// 	void setAudioEffect(AudioEffect effect);
// 
// 	/**
// 	 * Sets the AudioListener that will have sound broadcasted to it as the
// 	 * output generates.
// 	 * 
// 	 * @param listen
// 	 */
// 	void setAudioListener(AudioListener listen);
// }


// Path: src/main/java/ddf/minim/AudioSource.java
import javax.sound.sampled.AudioFormat;
import ddf.minim.spi.AudioOut;

package ddf.minim;



/**
 * An <code>AudioSource</code> is a kind of wrapper around an
 * <code>AudioStream</code>. An <code>AudioSource</code> will add its
 * <code>AudioBuffer</code>s as listeners on the stream so that you can access
 * the stream's samples without having to implement <code>AudioListener</code>
 * yourself. It also provides the <code>Effectable</code> and
 * <code>Recordable</code> interface. Because an <code>AudioStream</code> must
 * be closed when you are finished with it, you must remember to call
 * {@link #close()} on any <code>AudioSource</code>s you obtain from Minim, such
 * as <code>AudioInput</code>s, <code>AudioOutput</code>s, and
 * <code>AudioPlayer</code>s.
 * 
 * @author Damien Di Fede
 * @invisible
 * 
 */
@SuppressWarnings("deprecation")
public class AudioSource extends Controller implements Effectable, Recordable
{
	// the instance of Minim that created us, if one did.
	Minim						parent;

	private AudioOut			stream;
	// the signal splitter used to manage listeners to the source
	// our stereobuffer will be the first in the list
	private SignalSplitter		splitter;
	// the StereoBuffer that will subscribe to synth
	private StereoBuffer		buffer;
	// the effects chain used for effecting
	private EffectsChain		effects;

	/**
	 * The AudioBuffer containing the left channel samples. If this is a mono
	 * sound, it contains the single channel of audio.
	 * 
	 * @example Basics/PlayAFile
	 * 
	 * @related AudioBuffer
	 */
	public final AudioBuffer	left;

	/**
	 * The AudioBuffer containing the right channel samples. If this is a mono
	 * sound, <code>right</code> contains the same samples as
	 * <code>left</code>.
	 * 
	 * @example Basics/PlayAFile
	 * 
	 * @related AudioBuffer
	 */
	public final AudioBuffer	right;

	/**
	 * The AudioBuffer containing the mix of the left and right channels. If this is
	 * a mono sound, <code>mix</code> contains the same
	 * samples as <code>left</code>.
	 * 
	 * @example Basics/PlayAFile
	 * 
	 * @related AudioBuffer
	 */
	public final AudioBuffer	mix;

	/**
	 * Constructs an <code>AudioSource</code> that will subscribe to the samples
	 * in <code>stream</code>. It is expected that the stream is using a
	 * <code>DataLine</code> for playback. If it is not, calls to
	 * <code>Controller</code>'s methods will result in a
	 * <code>NullPointerException</code>.
	 * 
	 * @param istream
	 *            the <code>AudioStream</code> to subscribe to and wrap
	 * 
	 * @invisible
	 */
	public AudioSource(AudioOut istream)