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

#include <SpeakerManagerConfigHelper.h>

Public Member Functions

 SpeakerManagerConfigHelper (const std::shared_ptr< SpeakerManagerStorageInterface > &storage)
 
void loadState (SpeakerManagerStorageState &state)
 
bool saveState (const SpeakerManagerStorageState &state)
 
int getMinUnmuteVolume () const
 
bool getRestoreMuteState () const
 

Detailed Description

Helper class to manage configuration operations for SpeakerManager CA.

This class implements all configuration operations and merges logic of accessing different configuration sources. SpeakerManager get configuration values from three sources: hardcoded values, platform configuration, and persistent storage.

Constructor & Destructor Documentation

◆ SpeakerManagerConfigHelper()

SpeakerManagerConfigHelper::SpeakerManagerConfigHelper ( const std::shared_ptr< SpeakerManagerStorageInterface > &  storage)

Creates object.

Parameters
[in]storageStorage interface.

Member Function Documentation

◆ getMinUnmuteVolume()

int SpeakerManagerConfigHelper::getMinUnmuteVolume ( ) const

Loads minimum unmute volume level from platform configuration. The method tries to load the unmute value from platform configuration files, and if it fails, it returns a hardcoded value.

Returns
Minimum volume level to unmute speakers.

◆ getRestoreMuteState()

bool SpeakerManagerConfigHelper::getRestoreMuteState ( ) const

Loads mute state handling from configuration. By default the speaker manager sets the mute status to the value prior to reboot, but this behaviour can be overridden by configuration.

Returns
Returns configured value, where true indicates that mute status is configured according to the last saved state, and "false" indicates a default shall be kept.

◆ loadState()

void SpeakerManagerConfigHelper::loadState ( SpeakerManagerStorageState state)

Load configuration.

This method always succeeds (assuming state is not nullptr), as it first tries to load configuration from config storage, then from platform configuration files, and falls back to hardcoded values.

Parameters
[out]statePointer to configuration container to fill with config values.

◆ saveState()

bool SpeakerManagerConfigHelper::saveState ( const SpeakerManagerStorageState state)

Saves configuration to to config storage.

Parameters
[in]stateConfiguration data to persist.
Returns
Boolean that indicates operation success.

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

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