Configuration
class Configuration : Parcelable
| kotlin.Any | |
| ↳ | android.media.VolumeShaper.Configuration |
The VolumeShaper.Configuration class contains curve and duration information. It is constructed by the VolumeShaper.Configuration.Builder.
A VolumeShaper.Configuration is used by VolumeAutomation.createVolumeShaper(Configuration) to create a VolumeShaper and by VolumeShaper.replace(Configuration, Operation, boolean) to replace an existing configuration.
The AudioTrack and MediaPlayer classes implement the VolumeAutomation interface.
Summary
| Nested classes | |
|---|---|
|
Builder class for a |
|
| Constants | |
|---|---|
| static Int |
Cubic interpolated volume curve. |
| static Int |
Cubic interpolated volume curve that preserves local monotonicity. |
| static Int |
Linear interpolated volume curve. |
| static Int |
Stepwise volume curve. |
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| Int | |
| Boolean | |
| Long |
Returns the duration of the volume shape in milliseconds. |
| Int |
Returns the interpolator type. |
| static Int |
Returns the maximum number of curve points allowed for VolumeShaper. |
| FloatArray! |
getTimes()Returns the times (x) coordinate array of the volume curve points. |
| FloatArray! |
Returns the volumes (y) coordinate array of the volume curve points. |
| Int |
hashCode() |
| String |
toString() |
| Unit |
writeToParcel(dest: Parcel, flags: Int) |
| Properties | |
|---|---|
| static Parcelable.Creator<VolumeShaper.Configuration!> | |
| static VolumeShaper.Configuration! |
A one second cubic ramp from silence to full volume. |
| static VolumeShaper.Configuration! |
A one second linear ramp from silence to full volume. |
| static VolumeShaper.Configuration! |
A one second sine-squared s-curve ramp from silence to full volume. |
| static VolumeShaper.Configuration! |
A one second sine curve from silence to full volume for energy preserving cross fades. |
Constants
INTERPOLATOR_TYPE_CUBIC
static val INTERPOLATOR_TYPE_CUBIC: Int
Cubic interpolated volume curve. This is default if unspecified.
Value: 2INTERPOLATOR_TYPE_CUBIC_MONOTONIC
static val INTERPOLATOR_TYPE_CUBIC_MONOTONIC: Int
Cubic interpolated volume curve that preserves local monotonicity. So long as the control points are locally monotonic, the curve interpolation between those points are monotonic. This is useful for cubic spline interpolated volume ramps and ducks.
Value: 3INTERPOLATOR_TYPE_LINEAR
static val INTERPOLATOR_TYPE_LINEAR: Int
Linear interpolated volume curve.
Value: 1INTERPOLATOR_TYPE_STEP
static val INTERPOLATOR_TYPE_STEP: Int
Stepwise volume curve.
Value: 0Public methods
describeContents
fun describeContents(): Int
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
fun equals(other: Any?): Boolean
| Parameters | |
|---|---|
obj |
the reference object with which to compare. |
| Return | |
|---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getDuration
fun getDuration(): Long
Returns the duration of the volume shape in milliseconds.
getInterpolatorType
fun getInterpolatorType(): Int
Returns the interpolator type.
getMaximumCurvePoints
static fun getMaximumCurvePoints(): Int
Returns the maximum number of curve points allowed for VolumeShaper.Builder#setCurve(float[], float[]).
getTimes
fun getTimes(): FloatArray!
Returns the times (x) coordinate array of the volume curve points.
getVolumes
fun getVolumes(): FloatArray!
Returns the volumes (y) coordinate array of the volume curve points.
toString
fun toString(): String
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
| Parameters | |
|---|---|
dest |
Parcel: The Parcel in which the object should be written. This value cannot be null. |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
Properties
CUBIC_RAMP
static val CUBIC_RAMP: VolumeShaper.Configuration!
A one second cubic ramp from silence to full volume. Use VolumeShaper.Builder#reflectTimes() or VolumeShaper.Builder#invertVolumes() to generate the matching cubic duck.
LINEAR_RAMP
static val LINEAR_RAMP: VolumeShaper.Configuration!
A one second linear ramp from silence to full volume. Use VolumeShaper.Builder#reflectTimes() or VolumeShaper.Builder#invertVolumes() to generate the matching linear duck.
SCURVE_RAMP
static val SCURVE_RAMP: VolumeShaper.Configuration!
A one second sine-squared s-curve ramp from silence to full volume. Use VolumeShaper.Builder#reflectTimes() or VolumeShaper.Builder#invertVolumes() to generate the matching sine-squared s-curve duck.
SINE_RAMP
static val SINE_RAMP: VolumeShaper.Configuration!
A one second sine curve from silence to full volume for energy preserving cross fades. Use VolumeShaper.Builder#reflectTimes() to generate the matching cosine duck.