ShadowDynamicsProcessing
@Implements(android.media.audiofx.AudioEffect.class) public class ShadowAudioEffect extends Object
AudioEffect
by shadowing its native methods.Constructor | Description |
---|---|
ShadowAudioEffect() |
Modifier and Type | Method | Description |
---|---|---|
static void |
addEffect(AudioEffect.Descriptor descriptor) |
Adds an effect represented by an
AudioEffect.Descriptor , only to be queried from queryEffects() . |
static com.google.common.collect.ImmutableList<AudioEffect> |
getAudioEffects() |
Returns all effects created with an
AudioEffect constructor. |
int |
getAudioSession() |
Returns the audio session set in the
AudioEffect ctor. |
protected Optional<ByteBuffer> |
getDefaultParameter(ByteBuffer parameter) |
Allows sub-classes to provide default parameters.
|
int |
getPriority() |
Returns the priority set in the
AudioEffect ctor. |
protected boolean |
native_getEnabled() |
Returns whether the
AudioEffect is enabled (as per native_setEnabled(boolean) ). |
protected int |
native_getParameter(int psize,
byte[] param,
int vsize,
byte[] value) |
Gets the value of the parameter with key
param , by putting its value in value . |
protected void |
native_release() |
Removes this audio effect from the set of active audio effects.
|
protected int |
native_setEnabled(boolean enabled) |
Marks the
AudioEffect as enabled, and always returns SUCCESS . |
protected int |
native_setParameter(int psize,
byte[] param,
int vsize,
byte[] value) |
Sets the parameter with the given key
param to the given value value . |
protected int |
native_setup(Object audioEffectThis,
String type,
String uuid,
int priority,
int audioSession,
int[] id,
Object[] desc) |
|
protected int |
native_setup(Object audioEffectThis,
String type,
String uuid,
int priority,
int audioSession,
int[] id,
Object[] desc,
String opPackageName) |
|
protected static AudioEffect.Descriptor[] |
queryEffects() |
Returns the set of audio effects added through
addEffect(android.media.audiofx.AudioEffect.Descriptor) . |
static void |
reset() |
|
void |
setErrorCode(int errorCode) |
Sets the error code to override setter methods in this class.
|
void |
setInitialized(boolean initialized) |
Updates the state of the
AudioEffect itself. |
@Implementation(minSdk=16, maxSdk=22) protected int native_setup(Object audioEffectThis, String type, String uuid, int priority, int audioSession, int[] id, Object[] desc)
@Implementation(minSdk=23, maxSdk=29) protected int native_setup(Object audioEffectThis, String type, String uuid, int priority, int audioSession, int[] id, Object[] desc, String opPackageName)
@Implementation protected int native_setEnabled(boolean enabled)
AudioEffect
as enabled, and always returns SUCCESS
.@Implementation protected boolean native_getEnabled()
AudioEffect
is enabled (as per native_setEnabled(boolean)
).@Implementation protected int native_setParameter(int psize, byte[] param, int vsize, byte[] value)
param
to the given value value
.SUCCESS
@Implementation protected int native_getParameter(int psize, byte[] param, int vsize, byte[] value)
param
, by putting its value in value
.
Note: Sub-classes of ShadowAudioEffect
can declare default values for any
parameters. Note: If the given parameter has not been set, and there is no default value for
that parameter, then we "return" (set value
to) a single integer 0.
protected Optional<ByteBuffer> getDefaultParameter(ByteBuffer parameter)
Override this method to provide default parameters.
public int getPriority()
AudioEffect
ctor.public int getAudioSession()
AudioEffect
ctor.public void setInitialized(boolean initialized)
AudioEffect
itself.
This can be used e.g. to put the AudioEffect in an unexpected state and cause an exception the next time the Visualizer is used.
public void setErrorCode(int errorCode)
When the error code is set to anything other than SUCCESS
setters in the AudioEffect
will early-out and return that error code.
public static void addEffect(AudioEffect.Descriptor descriptor)
AudioEffect.Descriptor
, only to be queried from queryEffects()
.@Implementation protected static AudioEffect.Descriptor[] queryEffects()
addEffect(android.media.audiofx.AudioEffect.Descriptor)
.
Note: in the original AudioEffect
implementation this method returns all the
existing unique AudioEffects created through an AudioEffect
ctor. In this
implementation only the effects added through addEffect(android.media.audiofx.AudioEffect.Descriptor)
are returned here.
public static com.google.common.collect.ImmutableList<AudioEffect> getAudioEffects()
AudioEffect
constructor.@Implementation protected void native_release()
@Resetter public static void reset()