Class AntPlusAudioControllableDevicePcc
java.lang.Object
com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc
com.dsi.ant.plugins.antplus.pcc.controls.pccbase.AntPlusBaseControllableDevicePcc
com.dsi.ant.plugins.antplus.pcc.controls.AntPlusAudioControllableDevicePcc
Enables communication between a client and the audio link of the AntPlusControllableDevice plugin service.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Receiver for the AudioCommand event, which is: Commands sent by a remote control to initiate an action on an audio device.static class
Defines the keys and values used to communicate between the PCC and plugin.Nested classes/interfaces inherited from class com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc
AntPluginPcc.IDeviceStateChangeReceiver, AntPluginPcc.IPluginAccessResultReceiver<T extends AntPluginPcc>, AntPluginPcc.RequestAccessResultHandler<T extends AntPluginPcc>, AntPluginPcc.RequestAccessResultHandler_AsyncSearchByDevNumber<T extends AntPluginPcc>, AntPluginPcc.RequestAccessResultHandler_UI<T extends AntPluginPcc>, AntPluginPcc.StandardReleaseHandle<T extends AntPluginPcc>
-
Field Summary
Fields inherited from class com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc
mReleaseHandle, mStateChangeReceiver, PATH_ANTPLUS_PLUGINS_PKG, reportedServiceVersion, supportsRssiEvent
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected void
handlePluginEvent
(android.os.Message eventMsg) requestAccess
(android.content.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 deviceMethods inherited from class com.dsi.ant.plugins.antplus.pcc.controls.pccbase.AntPlusBaseControllableDevicePcc
getRequiredServiceVersionForBind, getServiceBindIntent
Methods inherited from class com.dsi.ant.plugins.antplus.pccbase.AntPluginPcc
bindAndRequest, closePluginConnection, createCmdMsg, getAntDeviceNumber, getCurrentDeviceState, getDeviceName, getInstalledPluginsVersionNumber, getInstalledPluginsVersionString, getMissingDependencyName, getMissingDependencyPackageName, handleNonCmdPluginMessage, isUserPreferredDeviceForPlugin, isUserRecognizedDevice, releaseAccess, requestAccess_Helper_AsyncScanController, requestAccess_Helper_AsyncSearchByDevNumber, requestAccess_Helper_Main, requestAccess_Helper_SearchActivity, requestAccess_Helper_SubMain, requestAsyncScan_Helper_SubMain, sendPluginCommand, sendPluginCommand, startPluginManagerActivity, subscribeToEvent, unsubscribeFromEvent
-
Method Details
-
requestAccess
public static PccReleaseHandle<AntPlusAudioControllableDevicePcc> requestAccess(android.content.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. Only one client is allowed access to this mode at a time.- Parameters:
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: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 ofAudioDeviceCapabilities
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.- Returns:
- A release handle for the device. This can be used to guarantee the device is properly shutdown and cleaned up, even before the device is actually received through the result receiver.
-
getPluginPrintableName
- Specified by:
getPluginPrintableName
in classAntPluginPcc
-
handlePluginEvent
protected void handlePluginEvent(android.os.Message eventMsg) - Overrides:
handlePluginEvent
in classAntPlusBaseControllableDevicePcc
-
updateAudioStatus
public void updateAudioStatus(int volume, int totalTrackTime, int currentTrackTime, AudioDeviceState audioState, AudioRepeatState repeatState, AudioShuffleState shuffleState) Update the status of the audio device- Parameters:
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
- CurrentAudioDeviceState
of the music playerrepeatState
- CurrentAudioRepeatState
of the music playershuffleState
- CurrentAudioShuffleState
of the music player
-