public class AntPlusAudioControllableDevicePcc extends AntPlusBaseControllableDevicePcc
Modifier and Type | Class and Description |
---|---|
static interface |
AntPlusAudioControllableDevicePcc.IAudioCommandReceiver
Receiver for the AudioCommand event, which is:
Commands sent by a remote control to initiate an action on an audio device.
|
static class |
AntPlusAudioControllableDevicePcc.IpcDefines
Defines the keys and values used to communicate between the PCC and plugin.
|
AntPluginPcc.IDeviceStateChangeReceiver, AntPluginPcc.IPluginAccessResultReceiver<T extends AntPluginPcc>
PATH_ANTPLUS_PLUGINS_PKG
Modifier and Type | Method and Description |
---|---|
static PccReleaseHandle<AntPlusAudioControllableDevicePcc> |
requestAccess(Context bindToContext,
AntPluginPcc.IPluginAccessResultReceiver<AntPlusAudioControllableDevicePcc> resultReceiver,
AntPluginPcc.IDeviceStateChangeReceiver stateReceiver,
AntPlusAudioControllableDevicePcc.IAudioCommandReceiver audioCommandReceiver,
AudioDeviceCapabilities capabilities,
int channelDeviceNumber)
Send a request to access the plugin to receive audio commands and gain control of audio status updates.
|
void |
updateAudioStatus(int volume,
int totalTrackTime,
int currentTrackTime,
AudioDeviceState audioState,
AudioRepeatState repeatState,
AudioShuffleState shuffleState)
Update the status of the audio device
|
getAntDeviceNumber, getCurrentDeviceState, getDeviceName, getInstalledPluginsVersionNumber, getInstalledPluginsVersionString, getMissingDependencyName, getMissingDependencyPackageName, isUserPreferredDeviceForPlugin, isUserRecognizedDevice, releaseAccess, startPluginManagerActivity
public static PccReleaseHandle<AntPlusAudioControllableDevicePcc> requestAccess(Context bindToContext, AntPluginPcc.IPluginAccessResultReceiver<AntPlusAudioControllableDevicePcc> resultReceiver, AntPluginPcc.IDeviceStateChangeReceiver stateReceiver, AntPlusAudioControllableDevicePcc.IAudioCommandReceiver audioCommandReceiver, AudioDeviceCapabilities capabilities, int channelDeviceNumber)
bindToContext
- The context to which the plugin will be bound. Used for plugin lifecycle management.resultReceiver
- The receiver to receive the results of the request. Possible returns include:
RequestAccessResult#SUCCESS
RequestAccessResult#DEVICE_ALREADY_IN_USE
RequestAccessResult#USER_CANCELLED
RequestAccessResult#CHANNEL_NOT_AVAILABLE
RequestAccessResult#BAD_PARAMS
RequestAccessResult#ADAPTER_NOT_DETECTED
RequestAccessResult#DEPENDENCY_NOT_INSTALLED
RequestAccessResult#OTHER_FAILURE
stateReceiver
- The receiver to receive the state updates of the accessed device, if successful.
This receiver will receive notifications of all state changes to the device that occur subsequent
to the initial state returned in the result receiver.audioCommandReceiver
- Receiver to receive audio eventscapabilities
- An instance of AudioDeviceCapabilities
used to indicate the capabilities of the audio
device (e.g., support for custom shuffle or repeat mode). Capabilities cannot be changed after initialization.channelDeviceNumber
- Two-byte device number in the ANT channel ID to use when opening the controls channel.
This number is used for pairing with remotes and should be as unique as possible.
Set to zero to let the plugin generate the device ID (RECOMMENDED) based on the ANDROID_ID.
This number cannot be changed after initialization.public void updateAudioStatus(int volume, int totalTrackTime, int currentTrackTime, AudioDeviceState audioState, AudioRepeatState repeatState, AudioShuffleState shuffleState)
volume
- Current volume setting, given as a percentage.totalTrackTime
- Total time of the current track, in secondscurrentTrackTime
- Current number of seconds into the current trackaudioState
- Current AudioDeviceState
of the music playerrepeatState
- Current AudioRepeatState
of the music playershuffleState
- Current AudioShuffleState
of the music playerCopyright © 2015 Dynastream Innovations Inc. All Rights Reserved.