/* For Copyright and License see LICENSE.txt and COPYING.txt in the root directory */
package com.nerdscentral.audio.volume;
import com.nerdscentral.audio.core.SFSignal;
import com.nerdscentral.audio.core.SFSingleTranslator;
import com.nerdscentral.sython.Caster;
import com.nerdscentral.sython.SFMaths;
import com.nerdscentral.sython.SFPL_Operator;
import com.nerdscentral.sython.SFPL_RuntimeException;
public class SF_Rectify implements SFPL_Operator
{
public static class Translator extends SFSingleTranslator
{
protected Translator(SFSignal input)
{
super(input);
}
@Override
public double getSample(int index)
{
return SFMaths.abs(getInputSample(index));
}
}
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public Object Interpret(final Object input) throws SFPL_RuntimeException
{
return new Translator(Caster.makeSFSignal(input));
}
@Override
public String Word()
{
return Messages.getString("SF_Rectify.1"); //$NON-NLS-1$
}
}