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

#include <InMemoryEqualizerConfiguration.h>

Inheritance diagram for alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration:
Collaboration graph
[legend]

Public Member Functions

 ~InMemoryEqualizerConfiguration () override=default
 
EqualizerConfigurationInterface functions
bool isEnabled () const override
 
std::set< acsdkEqualizerInterfaces::EqualizerBandgetSupportedBands () const override
 
std::set< acsdkEqualizerInterfaces::EqualizerModegetSupportedModes () const override
 
int getMinBandLevel () const override
 
int getMaxBandLevel () const override
 
int getDefaultBandDelta () const override
 
acsdkEqualizerInterfaces::EqualizerState getDefaultState () const override
 
bool isBandSupported (acsdkEqualizerInterfaces::EqualizerBand band) const override
 
bool isModeSupported (acsdkEqualizerInterfaces::EqualizerMode mode) const override
 
- Public Member Functions inherited from alexaClientSDK::acsdkEqualizerInterfaces::EqualizerConfigurationInterface
virtual ~EqualizerConfigurationInterface ()=default
 

Static Public Member Functions

static std::shared_ptr< InMemoryEqualizerConfigurationcreate (int minBandLevel, int maxBandLevel, int defaultDelta, const std::set< acsdkEqualizerInterfaces::EqualizerBand > &bandsSupported, const std::set< acsdkEqualizerInterfaces::EqualizerMode > &modesSupported, acsdkEqualizerInterfaces::EqualizerState defaultState)
 
static std::shared_ptr< InMemoryEqualizerConfigurationcreateDisabled ()
 
static std::shared_ptr< InMemoryEqualizerConfigurationcreateDefault ()
 

Protected Member Functions

 InMemoryEqualizerConfiguration (int minBandLevel, int maxBandLevel, int defaultDelta, const std::set< acsdkEqualizerInterfaces::EqualizerBand > &bandsSupported, const std::set< acsdkEqualizerInterfaces::EqualizerMode > &modesSupported, acsdkEqualizerInterfaces::EqualizerState defaultState)
 
 InMemoryEqualizerConfiguration ()
 
bool validateConfiguration ()
 
bool validateBandLevelMap (const acsdkEqualizerInterfaces::EqualizerBandLevelMap &bandLevelMap, bool validateValues)
 

Detailed Description

In-memory implementation for the equalizer configuration. The configuration is set during the creation and is not changed afterwards. This class also holds the hardcoded defaults used by SDK.

Constructor & Destructor Documentation

◆ ~InMemoryEqualizerConfiguration()

alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::~InMemoryEqualizerConfiguration ( )
overridedefault

Destructor.

◆ InMemoryEqualizerConfiguration() [1/2]

alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::InMemoryEqualizerConfiguration ( int  minBandLevel,
int  maxBandLevel,
int  defaultDelta,
const std::set< acsdkEqualizerInterfaces::EqualizerBand > &  bandsSupported,
const std::set< acsdkEqualizerInterfaces::EqualizerMode > &  modesSupported,
acsdkEqualizerInterfaces::EqualizerState  defaultState 
)
protected

Constructor.

Parameters
minBandLevelMinimum band level supported by the equalizer.
maxBandLevelMaximum band level supported by the equalizer.
defaultDeltaDefault delta value to adjust the equalizer.
bandsSupportedA set of bands supported by the equalizer.
modesSupportedA set of modes supported by the equalizer.
defaultStateDefault state of the equalizer used when there is no state stored in a persistent storage or when a band level is being reset.

◆ InMemoryEqualizerConfiguration() [2/2]

alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::InMemoryEqualizerConfiguration ( )
protected

Constructor creating a disabled configuration.

Member Function Documentation

◆ create()

std::shared_ptr< InMemoryEqualizerConfiguration > alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::create ( int  minBandLevel,
int  maxBandLevel,
int  defaultDelta,
const std::set< acsdkEqualizerInterfaces::EqualizerBand > &  bandsSupported,
const std::set< acsdkEqualizerInterfaces::EqualizerMode > &  modesSupported,
acsdkEqualizerInterfaces::EqualizerState  defaultState 
)
static

Factory to create an instance of InMemoryEqualizerConfiguration from the parameters provided.

Parameters
minBandLevelMinimum band level supported by the equalizer.
maxBandLevelMaximum band level supported by the equalizer.
defaultDeltaDefault delta value to adjust the equalizer.
bandsSupportedA set of bands supported by the equalizer.
modesSupportedA set of modes supported by the equalizer.
defaultStateDefault state of the equalizer used when there is no state stored in a persistent storage or when a band level is being reset.
Returns
An instance of InMemoryEqualizerConfiguration on success, or nullptr in case of invalid parameters or inconsistent configuration.

◆ createDefault()

std::shared_ptr< InMemoryEqualizerConfiguration > alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::createDefault ( )
static

A factory to create an instance of InMemoryEqualizerConfiguration using the hardcoded defaults.

Returns
An instance of InMemoryEqualizerConfiguration using the hardcoded defaults.

◆ createDisabled()

std::shared_ptr< InMemoryEqualizerConfiguration > alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::createDisabled ( )
static

Factory to create disabled version of the configuration.

Returns
An instance of disabled version of the configuration.

◆ getDefaultBandDelta()

int alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::getDefaultBandDelta ( ) const
overridevirtual

Returns the default value of band value changes.

Returns
The default value of band value changes.

Implements alexaClientSDK::acsdkEqualizerInterfaces::EqualizerConfigurationInterface.

◆ getDefaultState()

EqualizerState alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::getDefaultState ( ) const
overridevirtual

Returns EqualizerState object defining default values for equalizer mode and band levels. These values should be used when resetting any band to its default level.

Returns
EqualizerState object representing the default state.

Implements alexaClientSDK::acsdkEqualizerInterfaces::EqualizerConfigurationInterface.

◆ getMaxBandLevel()

int alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::getMaxBandLevel ( ) const
overridevirtual

Returns the maximum band value supported by the device.

Returns
The maximum band value supported by the device.

Implements alexaClientSDK::acsdkEqualizerInterfaces::EqualizerConfigurationInterface.

◆ getMinBandLevel()

int alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::getMinBandLevel ( ) const
overridevirtual

Returns the minimum band value supported by the device.

Returns
The minimum band value supported by the device.

Implements alexaClientSDK::acsdkEqualizerInterfaces::EqualizerConfigurationInterface.

◆ getSupportedBands()

std::set< EqualizerBand > alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::getSupportedBands ( ) const
overridevirtual

Returns a set of EQ bands supported by the device.

Returns
A set of EQ bands supported by the device.

Implements alexaClientSDK::acsdkEqualizerInterfaces::EqualizerConfigurationInterface.

◆ getSupportedModes()

std::set< EqualizerMode > alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::getSupportedModes ( ) const
overridevirtual

Returns a set of EQ modes supported by the device.

Returns
A set of EQ modes supported by the device.

Implements alexaClientSDK::acsdkEqualizerInterfaces::EqualizerConfigurationInterface.

◆ isBandSupported()

bool alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::isBandSupported ( acsdkEqualizerInterfaces::EqualizerBand  band) const
overridevirtual

Checks if band is supported by the device.

Parameters
bandEqualizerBand to check.
Returns
True if band is supported, false otherwise.

Implements alexaClientSDK::acsdkEqualizerInterfaces::EqualizerConfigurationInterface.

◆ isEnabled()

bool alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::isEnabled ( ) const
overridevirtual

Returns true if equalizer is enabled, false otherwise.

Returns
True if equalizer is enabled, false otherwise.

Implements alexaClientSDK::acsdkEqualizerInterfaces::EqualizerConfigurationInterface.

◆ isModeSupported()

bool alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::isModeSupported ( acsdkEqualizerInterfaces::EqualizerMode  mode) const
overridevirtual

Checks if mode is supported by the device.

Parameters
modeEqualizerMode to check.
Returns
True if mode is supported, false otherwise.

Implements alexaClientSDK::acsdkEqualizerInterfaces::EqualizerConfigurationInterface.

◆ validateBandLevelMap()

bool alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::validateBandLevelMap ( const acsdkEqualizerInterfaces::EqualizerBandLevelMap bandLevelMap,
bool  validateValues 
)
protected

Validates EqualizerBandLevelMap for consistency.

Parameters
bandLevelMapA EqualizerBandLevelMap to validate.
validateValuesA flag indicating whether to check band levels for the allowed range. This could be false for the case when allowed range is inconsistent and there is no point in validating against it.
Returns
True if all bands are supported and (optionally) band levels are withing the supported range, false otherwise.

◆ validateConfiguration()

bool alexaClientSDK::acsdkEqualizer::InMemoryEqualizerConfiguration::validateConfiguration ( )
protected

Validates the initialized configuration for consistency.

Returns
True if configuration is consistent, false otherwise.

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

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