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.
  • Constructor Details

    • ShadowVisualizer

      public ShadowVisualizer()
  • Method Details

    • setSource

      public void setSource(ShadowVisualizer.VisualizerSource source)
    • setDataCaptureListener

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

      @Implementation(minSdk=9) protected int native_getSamplingRate()
    • native_getWaveForm

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

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

      @Implementation(minSdk=9) protected boolean native_getEnabled()
    • native_setCaptureSize

      @Implementation(minSdk=9) protected int native_setCaptureSize(int size)
    • native_getCaptureSize

      @Implementation(minSdk=9) protected int native_getCaptureSize()
    • native_setEnabled

      @Implementation(minSdk=9) protected int native_setEnabled(boolean enabled)
    • native_getPeakRms

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

      @Implementation(minSdk=9) 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.