Package org.robolectric.shadows
Class ShadowVisualizer
java.lang.Object
org.robolectric.shadows.ShadowVisualizer
@Implements(value=android.media.audiofx.Visualizer.class,
minSdk=9)
public class ShadowVisualizer
extends Object
Shadow for the
Visualizer
class.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Provides underlying data for theShadowVisualizer
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
protected boolean
protected int
native_getFft
(byte[] fft) protected int
native_getPeakRms
(Visualizer.MeasurementPeakRms measurement) protected int
protected int
native_getWaveForm
(byte[] waveform) protected void
protected int
native_setCaptureSize
(int size) protected int
native_setEnabled
(boolean enabled) protected int
setDataCaptureListener
(Visualizer.OnDataCaptureListener listener, int rate, boolean waveform, boolean fft) void
setErrorCode
(int errorCode) Sets the error code to override setter methods in this class.void
void
setState
(int newState) Updates the state of theVisualizer
itself.void
Trigger calls to the existingVisualizer.OnDataCaptureListener
.
-
Constructor Details
-
ShadowVisualizer
public ShadowVisualizer()
-
-
Method Details
-
setSource
-
setDataCaptureListener
@Implementation(minSdk=9) protected int setDataCaptureListener(Visualizer.OnDataCaptureListener listener, int rate, boolean waveform, boolean fft) -
native_getSamplingRate
-
native_getWaveForm
-
native_getFft
-
native_getEnabled
-
native_setCaptureSize
-
native_getCaptureSize
-
native_setEnabled
-
native_getPeakRms
@Implementation(minSdk=19) protected int native_getPeakRms(Visualizer.MeasurementPeakRms measurement) -
native_release
-
triggerDataCapture
public void triggerDataCapture()Trigger calls to the existingVisualizer.OnDataCaptureListener
.This is a no-op if the listener has not been set.
-
setState
public void setState(int newState) Updates the state of theVisualizer
itself.This can be used e.g. to put the Visualizer in an unexpected state and cause an exception the next time the Visualizer is used.
-
setErrorCode
public void setErrorCode(int errorCode) Sets the error code to override setter methods in this class.When the error code is set to anything other than
Visualizer.SUCCESS
setters in the Visualizer will early-out and return that error code.
-