PlaybackInfo
class PlaybackInfo : Parcelable
| kotlin.Any | |
| ↳ | android.media.session.MediaController.PlaybackInfo |
Holds information about the current playback and how audio is handled for this session.
Summary
| Constants | |
|---|---|
| static Int |
The session uses local playback. |
| static Int |
The session uses remote playback. |
| Inherited constants | |
|---|---|
| Public methods | |
|---|---|
| Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| AudioAttributes! |
Get the audio attributes for this session. |
| Int |
Get the current volume for this session. |
| Int |
Get the maximum volume that may be set for this session. |
| Int |
Get the type of playback which affects volume handling. |
| Int |
Get the volume control type associated to the session, as indicated by |
| String? |
Get the routing controller ID for this session, as indicated by |
| String |
toString()Returns a string representation of the object. |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<MediaController.PlaybackInfo!> | |
Constants
PLAYBACK_TYPE_LOCAL
static val PLAYBACK_TYPE_LOCAL: Int
The session uses local playback.
Value: 1PLAYBACK_TYPE_REMOTE
static val PLAYBACK_TYPE_REMOTE: Int
The session uses remote playback.
Value: 2Public methods
describeContents
fun describeContents(): Int
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
getAudioAttributes
fun getAudioAttributes(): AudioAttributes!
Get the audio attributes for this session. The attributes will affect volume handling for the session. When the playback type is PlaybackInfo.PLAYBACK_TYPE_REMOTE these may be ignored by the remote volume handler.
| Return | |
|---|---|
AudioAttributes! |
The attributes for this session. |
getCurrentVolume
fun getCurrentVolume(): Int
Get the current volume for this session.
| Return | |
|---|---|
Int |
The current volume where this session is playing. |
getMaxVolume
fun getMaxVolume(): Int
Get the maximum volume that may be set for this session.
| Return | |
|---|---|
Int |
The maximum allowed volume where this session is playing. |
getPlaybackType
fun getPlaybackType(): Int
Get the type of playback which affects volume handling. One of:
| Return | |
|---|---|
Int |
The type of playback this session is using. |
getVolumeControl
fun getVolumeControl(): Int
Get the volume control type associated to the session, as indicated by VolumeProvider.getVolumeControl().
getVolumeControlId
fun getVolumeControlId(): String?
Get the routing controller ID for this session, as indicated by VolumeProvider.getVolumeControlId(). Returns null if unset, or if getPlaybackType() is PLAYBACK_TYPE_LOCAL.
toString
fun toString(): String
Returns a string representation of the object.
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| 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 the following:
|