All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.robolectric.shadows.ShadowAudioEffect Maven / Gradle / Ivy

package org.robolectric.shadows;

import android.media.audiofx.AudioEffect;

import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
import org.robolectric.annotation.Resetter;

import java.util.LinkedList;
import java.util.List;

/**
 * Shadow for {@link android.media.audiofx.AudioEffect}.
 */
@Implements(AudioEffect.class)
public class ShadowAudioEffect {

  private static List DESCRIPTORS = new LinkedList<>();

  public static void addEffect(AudioEffect.Descriptor descriptor) {
    DESCRIPTORS.add(descriptor);
  }

  @Implementation
  public static AudioEffect.Descriptor[] queryEffects() {
    return DESCRIPTORS.toArray(new AudioEffect.Descriptor[DESCRIPTORS.size()]);
  }

  @Resetter
  public static void reset() {
    DESCRIPTORS.clear();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy