Interface IAudioSinkPlayerController
interface IAudioSinkPlayerController
Extends com.amazon.apmf.IStandard
The Audio Player controller takes care of all the AVRCP functionalities in
this layer.
There is only one Audio player controller associated with an
Audio Sink. If there are multiple user interfaces for a audio play control, a
centralized entity in the OS takes care of arbitrating the requests from
multiple user interfaces.
Methods
play()
void play()
Sends the ‘play’ command to the connected remote device.
The device must be connected to be able to process this command. This
is a blocking call and throws an exception if the command
is not successfully sent to the target device. However, the successful
processing of this command at the target device and an acknowledgement
is not guaranteed by this interface.
Privilege: com.amazon.bluetooth.privilege.audio_sink
Throws
BluetoothAudioNotConnected— if there is no audio connection.
stop()
void stop()
Sends the ‘stop’ command to the connected remote device.
The device must be connected to be able to process this command. This
is a blocking call and throws exception if the command
is not successfully sent to the target device. However, the successful
processing of this command at the target device and an acknowledgement
is not guaranteed by this interface.
Privilege: com.amazon.bluetooth.privilege.audio_sink
Throws
BluetoothAudioNotConnected— if there is no audio connection.
pause()
void pause()
Sends the ‘pause’ command to the connected remote device.
The device must be connected to be able to process this command. This
is a blocking call and throws an exception if the command
is not successfully sent to the target device. However, the successful
processing of this command at the target device and an acknowledgement
is not guaranteed by this interface.
Privilege: com.amazon.bluetooth.privilege.audio_sink
Throws
BluetoothAudioNotConnected— if there is no audio connection.
reverseSeek()
void reverseSeek()
Sends the ‘rewind’ command to the connected remote device. It seeks the
current playing track to a backward position, and then plays at the normal
pace. The length at which it seeks is determined by the
application setting at the target (for example, phone).
The device must be connected to process this command.
Privilege: com.amazon.bluetooth.privilege.audio_sink
Throws
BluetoothAudioNotConnected— if there is no audio connection.
forwardSeek()
void forwardSeek()
Sends the fast_forward command to the connected remote device. This
command seeks the current playing track position to a forward position and
then plays at the normal pace. The length at which
it seeks is determined by the application setting at the target (for example, phone).
The device must be connected to be able to process this command.
Throws
BluetoothAudioNotConnected— if there is no audio connection.
nextTrack()
void nextTrack()
Sends the ‘forward’ command to the connected remote device. After the
command is accepted by the target device, the next track starts playing.
The device must be connected to be able to process this command. This
is a blocking call and throws an exception if the command
is not successfully sent to the target device. However, the successful
processing of this command at the target device and an acknowledgement
is not guaranteed by this interface.
Privilege: com.amazon.bluetooth.privilege.audio_sink
Throws
BluetoothAudioNotConnected— if there is no audio connection.
previousTrack()
void previousTrack()
Sends the ‘backward’ command to the connected remote device. Once the
command is accepted by the target device, the previous track starts
playing.
The device must be connected to be able to process this command. This
is a blocking call and throws an exception if the command
is not successfully sent to the target device. However, the successful
processing of this command at the target device and an acknowledgement
is not guaranteed by this interface.
Privilege: com.amazon.bluetooth.privilege.audio_sink
Throws
BluetoothAudioNotConnected— if there is no audio connection.
getCurrentPlayingTrack()
Retrieves the metadata of the currently playing track. This information is retrieved from the data cached in the Bluetooth service. This is a synchronous call across IPC to the Bluetooth service. Privilege: com.amazon.bluetooth.privilege.audio_sinkIAudioSinkTrack*getCurrentPlayingTrack()
Returns
IAudioSinkTrack*
Returns pointer to IAudioSinkTrack.
Throws
BluetoothAudioNotConnected— if there is no audio connection.
getTrackCount()
i32 getTrackCount()
Retrieves the number of tracks in the player metadata.
Privilege: com.amazon.bluetooth.privilege.audio_sink
Returns
i32
If successful, the API returns the number of tracks in the
metadata, otherwise returns -1.
Throws
BluetoothNotFound— if it is not able to retrieve the number or tracks for any reason.
getPlayState()
PlayerPlayState getPlayState()
Returns the state of the audio player as per PlayerPlayState.
This information is retrieved from the data cached in the Bluetooth
service. This is a synchronous call across IPC to the Bluetooth service.
Privilege: com.amazon.bluetooth.privilege.audio_sink
Returns
PlayerPlayState
Returns PlayerPlayState.
Throws
BluetoothAudioNotConnected— if there is no audio connection.
getSettings()
Returns the interface to manipulate the settings of the Audio Sink Player. Privilege: com.amazon.bluetooth.privilege.audio_sinkIAudioSinkPlayerSettings*getSettings()
Returns
IAudioSinkPlayerSettings*
Returns pointer to IAudioSinkPlayerSettings.
addListener()
Registers listener to receive all the audio player event notifications. This interface needs to be called by the client to receive any AVRCP events. Privilege: com.amazon.bluetooth.privilege.audio_sinkcom.amazon.apmf.ISubscription*addListener(IAudioSinkPlayerListener*listener)
Parameters
listener
IAudioSinkPlayerListener* — Required
The listener instance pointer that must be registered
to receive the AVRCP notifications.
Returns
com.amazon.apmf.ISubscription*
Returns pointer to ISubscription.

