package vermilion;

/**
 * A mixer machine which simply places audio from its 'A' buffer into
 * the output buffer. When this machine is acting as the mixer for an
 * audio path the output buffer is the buffer being read by the soundcard.
 */
public class MachineMixer extends MachineBase
{
    /**
     * The type for this machine is 'EFFECT'.
     */
    @Override
    public String getType()
    {
        return "EFFECT";
    }

    /**
     * The name for this machine is 'Mixer'.
     */
    @Override
    public String getName()
    {
        return "Mixer";
    }

    /**
     * The mixing algorithm for this plugin simply copies the 'A' buffer to the
     * output buffer.
     */
    @Override
    public void fillBuffer(int numSamples)
    {
        int baseAddr = 0;
        for (int x = 0; x < numSamples; x++)
        {
            output[baseAddr] = aInput[baseAddr++];

            output[baseAddr] = aInput[baseAddr++];
        }
    }

    /**
     * This machine has no parameters and does nothing on parameter changes.
     */
    @Override
    public void parameterChange(ParameterBase param, Object value)
    {
    }

    /**
     * This machine has noe parameters and does nothing during setup.
     */
    @Override
    public void setupMachine()
    {
    }

    /**
     * This machine has no parameters and returns an empty string for printing.
     */
    @Override
    public String printParameter(ParameterBase p)
    {
        return "";
    }
}