AlexaClientSDK  1.25.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Static Public Member Functions | List of all members
alexaClientSDK::capabilityAgents::speakerManager::ChannelVolumeManager Class Reference

#include <ChannelVolumeManager.h>

Inheritance diagram for alexaClientSDK::capabilityAgents::speakerManager::ChannelVolumeManager:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::capabilityAgents::speakerManager::ChannelVolumeManager:
Collaboration graph
[legend]

Public Member Functions

avsCommon::sdkInterfaces::ChannelVolumeInterface::Type getSpeakerType () const override
 
size_t getId () const override
 
bool startDucking () override
 
bool stopDucking () override
 
bool setUnduckedVolume (int8_t volume) override
 
bool setMute (bool mute) override
 
bool getSpeakerSettings (avsCommon::sdkInterfaces::SpeakerInterface::SpeakerSettings *settings) const override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::sdkInterfaces::ChannelVolumeInterface
virtual bool adjustUnduckedVolume (int8_t delta)
 
virtual ~ChannelVolumeInterface ()=default
 

Static Public Member Functions

static std::shared_ptr< ChannelVolumeManagercreate (std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface > speaker, avsCommon::sdkInterfaces::ChannelVolumeInterface::Type type=avsCommon::sdkInterfaces::ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME, std::function< int8_t(int8_t)> volumeCurve=nullptr)
 

Additional Inherited Members

- Public Types inherited from alexaClientSDK::avsCommon::sdkInterfaces::ChannelVolumeInterface
enum  Type { Type::AVS_SPEAKER_VOLUME, Type::AVS_ALERTS_VOLUME }
 

Detailed Description

ChannelVolumeManager provides a concrete implementation of the ChannelVolumeInterface It controls an underlying SpeakerInterface object and provides functionality to be able to set SpeakerSettings and control Channel Volume Attenuation for this underlying SpeakerInterface.

Member Function Documentation

◆ create()

std::shared_ptr< ChannelVolumeManager > alexaClientSDK::capabilityAgents::speakerManager::ChannelVolumeManager::create ( std::shared_ptr< avsCommon::sdkInterfaces::SpeakerInterface speaker,
avsCommon::sdkInterfaces::ChannelVolumeInterface::Type  type = avsCommon::sdkInterfaces::ChannelVolumeInterface::Type::AVS_SPEAKER_VOLUME,
std::function< int8_t(int8_t)>  volumeCurve = nullptr 
)
static

Creates a ChannelVolumeManager that manages a single SpeakerInterface.

Parameters
speakerThe SpeakerInterface associated with this instance.
typeThe ChannelVolumeInterface type associated with this instance.
volumeCurveThe volume curve mapping to be used for channel attenuation.
Returns
ChannelVolumeManager

Retrieve initial volume setting from underlying speakers

◆ getId()

size_t alexaClientSDK::capabilityAgents::speakerManager::ChannelVolumeManager::getId ( ) const
overridevirtual

Get the unique identifier of the ChannelVolumeInterface.

Returns
The unique identifier.

Reimplemented from alexaClientSDK::avsCommon::sdkInterfaces::ChannelVolumeInterface.

◆ getSpeakerSettings()

bool alexaClientSDK::capabilityAgents::speakerManager::ChannelVolumeManager::getSpeakerSettings ( avsCommon::sdkInterfaces::SpeakerInterface::SpeakerSettings settings) const
overridevirtual

Returns a SpeakerSettings object to indicate the current settings of the underlying speaker. Note that if the underlying Channel is attenuated, the settings returned must still return the unducked volume of the underlying speaker, as set by the most recent call to the setUnduckedVolume API.

Parameters
[out]settingsA SpeakerSettings object if successful.
Returns
true if the operation succeeded, false otherwise.

Implements alexaClientSDK::avsCommon::sdkInterfaces::ChannelVolumeInterface.

◆ getSpeakerType()

ChannelVolumeInterface::Type alexaClientSDK::capabilityAgents::speakerManager::ChannelVolumeManager::getSpeakerType ( ) const
overridevirtual

ChannelVolumeInterface Functions.

Implements alexaClientSDK::avsCommon::sdkInterfaces::ChannelVolumeInterface.

◆ setMute()

bool alexaClientSDK::capabilityAgents::speakerManager::ChannelVolumeManager::setMute ( bool  mute)
overridevirtual

Set the mute state of the underlying speaker.

Parameters
mutethe mute state to be set.
Returns
true if the operation succeeded, false otherwise.

Implements alexaClientSDK::avsCommon::sdkInterfaces::ChannelVolumeInterface.

◆ setUnduckedVolume()

bool alexaClientSDK::capabilityAgents::speakerManager::ChannelVolumeManager::setUnduckedVolume ( int8_t  volume)
overridevirtual

Set the volume of the underlying speaker. This reflects the baseline volume settings for underlying Channel when it is not attenuated. If the underlying SpeakerInterface is ducked when this API is invoked, the corresponding unduckedVolume setting change is reflected upon the next stopDucking call.

Parameters
volumethe volume level to be set.
Returns
true if the operation succeeded, false otherwise.

Implements alexaClientSDK::avsCommon::sdkInterfaces::ChannelVolumeInterface.

◆ startDucking()

bool alexaClientSDK::capabilityAgents::speakerManager::ChannelVolumeManager::startDucking ( )
overridevirtual

Start channel volume attenuation for the underlying speaker. The interface consults the volume curve function set in ChannelVolumeManager to determine the desired attenuated channel volume.

Returns
true if the operation succeeded, false otherwise. The API returns true, if the channel is already attenuated.

Implements alexaClientSDK::avsCommon::sdkInterfaces::ChannelVolumeInterface.

◆ stopDucking()

bool alexaClientSDK::capabilityAgents::speakerManager::ChannelVolumeManager::stopDucking ( )
overridevirtual

Restores the channel volume for the underlying speaker.

Returns
true if the operation succeeded, false otherwise. The API returns true, if the channel was not attenuated.

Implements alexaClientSDK::avsCommon::sdkInterfaces::ChannelVolumeInterface.


The documentation for this class was generated from the following files:

AlexaClientSDK 1.25.0 - Copyright 2016-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0