Class ShadowVisualizer

java.lang.Object
org.robolectric.shadows.ShadowVisualizer

@Implements(android.media.audiofx.Visualizer.class) public class ShadowVisualizer extends Object
Shadow for the Visualizer class.
  • Constructor Details

    • ShadowVisualizer

      public ShadowVisualizer()
  • Method Details

    • setSource

      public void setSource(ShadowVisualizer.VisualizerSource source)
    • setDataCaptureListener

      @Implementation protected int setDataCaptureListener(Visualizer.OnDataCaptureListener listener, int rate, boolean waveform, boolean fft)
    • native_getSamplingRate

      @Implementation protected int native_getSamplingRate()
    • native_getWaveForm

      @Implementation protected int native_getWaveForm(byte[] waveform)
    • native_getFft

      @Implementation protected int native_getFft(byte[] fft)
    • native_getEnabled

      @Implementation protected boolean native_getEnabled()
    • native_setCaptureSize

      @Implementation protected int native_setCaptureSize(int size)
    • native_getCaptureSize

      @Implementation protected int native_getCaptureSize()
    • native_setEnabled

      @Implementation protected int native_setEnabled(boolean enabled)
    • native_getPeakRms

      @Implementation protected int native_getPeakRms(Visualizer.MeasurementPeakRms measurement)
    • native_release

      @Implementation protected void native_release()
    • triggerDataCapture

      public void triggerDataCapture()
      Trigger calls to the existing Visualizer.OnDataCaptureListener.

      This is a no-op if the listener has not been set.

    • setState

      public void setState(int newState)
      Updates the state of the Visualizer 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.