public class PlayerVolumeResource extends Object implements Subscribable
| Constructor and Description |
|---|
PlayerVolumeResource(SonosApiClient apiClient)
Constructor for PlayerVolumeResource.
|
| Modifier and Type | Method and Description |
|---|---|
SonosPlayerVolume |
getVolume(String clientToken,
String playerId)
Get the volume properties for the specified player
|
SonosSuccess |
setMute(String clientToken,
String playerId,
Boolean isMuted)
Set the mute status of a player (not a toggle)
|
SonosSuccess |
setRelativeVolume(String clientToken,
String playerId,
Integer volumeDelta,
Boolean isMuted)
Adjust the volume of a player by the specified amount
|
SonosSuccess |
setVolume(String clientToken,
String playerId,
Integer volume,
Boolean isMuted)
Set a specific volume for a player
|
SonosSuccess |
subscribe(String clientToken,
String playerId)
Subscribe to events for this resource.
|
SonosSuccess |
unsubscribe(String clientToken,
String playerId)
Unsubscribe from events related to this resource.
|
public PlayerVolumeResource(SonosApiClient apiClient)
Constructor for PlayerVolumeResource.
apiClient - a SonosApiClient object.public SonosPlayerVolume getVolume(String clientToken, String playerId) throws SonosApiClientException, SonosApiError
clientToken - for the userplayerId - to fetch the volume properties forSonosPlayerVolume for the specified SonosPlayerSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the API.public SonosSuccess setMute(String clientToken, String playerId, Boolean isMuted) throws SonosApiClientException, SonosApiError
clientToken - for the userplayerId - of the player to mute/unmuteisMuted - whether the player should be muted/unmutedSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosSuccess setRelativeVolume(String clientToken, String playerId, Integer volumeDelta, Boolean isMuted) throws SonosApiClientException, SonosApiError
clientToken - for the userplayerId - to set the volume forvolumeDelta - to adjust the volume byisMuted - if the player should be mutedSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosSuccess setVolume(String clientToken, String playerId, Integer volume, Boolean isMuted) throws SonosApiClientException, SonosApiError
clientToken - for the userplayerId - to modify the volume ofvolume - to set the player toisMuted - if the player should be mutedSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosSuccess subscribe(String clientToken, String playerId) throws SonosApiClientException, SonosApiError
Subscribe to events for this resource.
Subscribe to volume events for a playersubscribe in interface SubscribableclientToken - for the userplayerId - of the resource to subscribe toSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APIpublic SonosSuccess unsubscribe(String clientToken, String playerId) throws SonosApiClientException, SonosApiError
Unsubscribe from events related to this resource.
Unsubscribe from volume events for a playerunsubscribe in interface SubscribableclientToken - for the userplayerId - of the resource to unsubscribe fromSonosApiClientException - if an error occurs during the callSonosApiError - if there is an error from the APICopyright © 2018. All rights reserved.