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 | |
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() |
Unit |
writeToParcel(dest: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<MediaController.PlaybackInfo!> |
Constants
PLAYBACK_TYPE_LOCAL
static val PLAYBACK_TYPE_LOCAL: Int
The session uses local playback.
Value: 1
PLAYBACK_TYPE_REMOTE
static val PLAYBACK_TYPE_REMOTE: Int
The session uses remote playback.
Value: 2
Public 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 |
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 android.media.VolumeProvider#getVolumeControl()
.
getVolumeControlId
fun getVolumeControlId(): String?
Get the routing controller ID for this session, as indicated by android.media.VolumeProvider#getVolumeControlId()
. Returns null if unset, or if getPlaybackType()
is PLAYBACK_TYPE_LOCAL
.
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 |