java.lang.Object
org.refcodes.audio.CurveFunctionSoundSampleBuilderImpl
- All Implemented Interfaces:
CurveFunctionSoundSampleBuilder
,SamplingRateAccessor
,SamplingRateAccessor.SamplingRateBuilder<CurveFunctionSoundSampleBuilder>
,SamplingRateAccessor.SamplingRateMutator
,SamplingRateAccessor.SamplingRateProperty
public class CurveFunctionSoundSampleBuilderImpl
extends Object
implements CurveFunctionSoundSampleBuilder
The
CurveFunctionSoundSampleBuilderImpl
implements the
CurveFunctionSoundSampleBuilder
interface.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.refcodes.audio.SamplingRateAccessor
SamplingRateAccessor.SamplingRateBuilder<B extends SamplingRateAccessor.SamplingRateBuilder<B>>, SamplingRateAccessor.SamplingRateMutator, SamplingRateAccessor.SamplingRateProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the amplitude being used when generatingMonoSample
instances.double
Returns the frequency in Hz being used when generatingMonoSample
instances.int
getIndex()
Returns the index being used when generatingMonoSample
instances.int
Retrieves the sampling rate from the sampling rate property.Returns the trigonometric function being used when generatingMonoSample
instances.int
Returns the x-offset being used when generatingMonoSample
instances.double
Returns the yOffset being used when generatingMonoSample
instances.next()
Returns the nextMonoSample
for the current index (as ofCurveFunctionSoundSampleBuilder.getIndex()
) as well as for the other builder's settings and increases the index by one.void
setAmplitude
(double aAmplitude) Sets the amplitude to be used when generatingMonoSample
instances.void
setFrequency
(double aFrequencyInHz) Sets the frequency in Hz to be used when generatingMonoSample
instances.void
setIndex
(int aIndex) Sets the index to be used when generatingMonoSample
instances.void
setSamplingRate
(int aSamplingRate) Sets the sampling rate for the sampling rate property.void
setTrigonometricFunction
(Function<Double, Double> aFunction) Sets the trigonometric function to be used when generatingMonoSample
.void
setXOffset
(int aXOffset) Sets the x-offset to be used when generatingMonoSample
instances.void
setYOffset
(double aYOffset) Sets the y-offset to be used when generatingMonoSample
instances.Creates aMonoSample
as of the builder's settings.toMonoSample
(int index) Creates aMonoSample
for the given index and the the builder's settings.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.refcodes.audio.CurveFunctionSoundSampleBuilder
setTrigonometricFunction, withAmplitude, withFrequency, withIndex, withSamplingRate, withTrigonometricFunction, withTrigonometricFunction, withXOffset, withYOffset
Methods inherited from interface org.refcodes.audio.SamplingRateAccessor.SamplingRateProperty
letSamplingRate
-
Constructor Details
-
CurveFunctionSoundSampleBuilderImpl
public CurveFunctionSoundSampleBuilderImpl()
-
-
Method Details
-
setTrigonometricFunction
Sets the trigonometric function to be used when generatingMonoSample
.- Specified by:
setTrigonometricFunction
in interfaceCurveFunctionSoundSampleBuilder
- Parameters:
aFunction
- TheFunction
to be set.
-
getTrigonometricFunction
Returns the trigonometric function being used when generatingMonoSample
instances.- Specified by:
getTrigonometricFunction
in interfaceCurveFunctionSoundSampleBuilder
- Returns:
- The
Function
being set.
-
setIndex
public void setIndex(int aIndex) Sets the index to be used when generatingMonoSample
instances.- Specified by:
setIndex
in interfaceCurveFunctionSoundSampleBuilder
- Parameters:
aIndex
- The index to be set.
-
getIndex
public int getIndex()Returns the index being used when generatingMonoSample
instances.- Specified by:
getIndex
in interfaceCurveFunctionSoundSampleBuilder
- Returns:
- The index being set.
-
setFrequency
public void setFrequency(double aFrequencyInHz) Sets the frequency in Hz to be used when generatingMonoSample
instances.- Specified by:
setFrequency
in interfaceCurveFunctionSoundSampleBuilder
- Parameters:
aFrequencyInHz
- The frequency to be set.
-
getFrequency
public double getFrequency()Returns the frequency in Hz being used when generatingMonoSample
instances.- Specified by:
getFrequency
in interfaceCurveFunctionSoundSampleBuilder
- Returns:
- The frequency in Hz being set.
-
setAmplitude
public void setAmplitude(double aAmplitude) Sets the amplitude to be used when generatingMonoSample
instances.- Specified by:
setAmplitude
in interfaceCurveFunctionSoundSampleBuilder
- Parameters:
aAmplitude
- The amplitude to be set.
-
getAmplitude
public double getAmplitude()Returns the amplitude being used when generatingMonoSample
instances.- Specified by:
getAmplitude
in interfaceCurveFunctionSoundSampleBuilder
- Returns:
- The amplitude being set.
-
setXOffset
public void setXOffset(int aXOffset) Sets the x-offset to be used when generatingMonoSample
instances.- Specified by:
setXOffset
in interfaceCurveFunctionSoundSampleBuilder
- Parameters:
aXOffset
- The x-offset to be set.
-
getXOffset
public int getXOffset()Returns the x-offset being used when generatingMonoSample
instances.- Specified by:
getXOffset
in interfaceCurveFunctionSoundSampleBuilder
- Returns:
- The x-offset being set.
-
setYOffset
public void setYOffset(double aYOffset) Sets the y-offset to be used when generatingMonoSample
instances.- Specified by:
setYOffset
in interfaceCurveFunctionSoundSampleBuilder
- Parameters:
aYOffset
- The y-offset to be set.
-
getYOffset
public double getYOffset()Returns the yOffset being used when generatingMonoSample
instances.- Specified by:
getYOffset
in interfaceCurveFunctionSoundSampleBuilder
- Returns:
- The yOffset being set.
-
setSamplingRate
public void setSamplingRate(int aSamplingRate) Sets the sampling rate for the sampling rate property.- Specified by:
setSamplingRate
in interfaceSamplingRateAccessor.SamplingRateMutator
- Parameters:
aSamplingRate
- The sampling rate to be stored by the sampling rate property.
-
getSamplingRate
public int getSamplingRate()Retrieves the sampling rate from the sampling rate property.- Specified by:
getSamplingRate
in interfaceSamplingRateAccessor
- Returns:
- The sampling rate stored by the sampling rate property.
-
next
Returns the nextMonoSample
for the current index (as ofCurveFunctionSoundSampleBuilder.getIndex()
) as well as for the other builder's settings and increases the index by one.- Specified by:
next
in interfaceCurveFunctionSoundSampleBuilder
- Returns:
- The next
MonoSample
being set up.
-
toMonoSample
Creates aMonoSample
as of the builder's settings.- Specified by:
toMonoSample
in interfaceCurveFunctionSoundSampleBuilder
- Returns:
- The sound sample as of the builder's settings.
-
toMonoSample
Creates aMonoSample
for the given index and the the builder's settings.- Specified by:
toMonoSample
in interfaceCurveFunctionSoundSampleBuilder
- Parameters:
index
- The index for which to create the sound sample.- Returns:
- The sound sample as of the index and the builder's settings.
-