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

#include <EqualizerController.h>

Public Member Functions

 ~EqualizerController ()=default
 
avsCommon::utils::error::SuccessResult< int > getBandLevel (acsdkEqualizerInterfaces::EqualizerBand band)
 
avsCommon::utils::error::SuccessResult< acsdkEqualizerInterfaces::EqualizerBandLevelMapgetBandLevels (std::set< acsdkEqualizerInterfaces::EqualizerBand > bands)
 
void setBandLevel (acsdkEqualizerInterfaces::EqualizerBand band, int level)
 
void setBandLevels (const acsdkEqualizerInterfaces::EqualizerBandLevelMap &bandLevelMap)
 
void adjustBandLevels (const acsdkEqualizerInterfaces::EqualizerBandLevelMap &bandAdjustmentMap)
 
void resetBands (const std::set< acsdkEqualizerInterfaces::EqualizerBand > &bands)
 
acsdkEqualizerInterfaces::EqualizerMode getCurrentMode ()
 
void setCurrentMode (acsdkEqualizerInterfaces::EqualizerMode mode)
 
acsdkEqualizerInterfaces::EqualizerState getCurrentState ()
 
std::shared_ptr< acsdkEqualizerInterfaces::EqualizerConfigurationInterfacegetConfiguration ()
 
void registerEqualizer (std::shared_ptr< acsdkEqualizerInterfaces::EqualizerInterface > equalizer)
 
void unregisterEqualizer (std::shared_ptr< acsdkEqualizerInterfaces::EqualizerInterface > equalizer)
 
void addListener (std::shared_ptr< acsdkEqualizerInterfaces::EqualizerControllerListenerInterface > listener)
 
void removeListener (std::shared_ptr< acsdkEqualizerInterfaces::EqualizerControllerListenerInterface > listener)
 

Static Public Member Functions

static std::shared_ptr< EqualizerControllercreate (std::shared_ptr< acsdkEqualizerInterfaces::EqualizerModeControllerInterface > modeController, std::shared_ptr< acsdkEqualizerInterfaces::EqualizerConfigurationInterface > configuration, std::shared_ptr< acsdkEqualizerInterfaces::EqualizerStorageInterface > storage)
 

Detailed Description

Class to control equalizer operations in the SDK. All the equalizer state manipulations and corresponding notifications are performed within this class.

Constructor & Destructor Documentation

◆ ~EqualizerController()

alexaClientSDK::acsdkEqualizer::EqualizerController::~EqualizerController ( )
default

Destructor.

Member Function Documentation

◆ addListener()

void alexaClientSDK::acsdkEqualizer::EqualizerController::addListener ( std::shared_ptr< acsdkEqualizerInterfaces::EqualizerControllerListenerInterface listener)

Adds a listener for equalizer state changes.

Parameters
listenerAn implementation of equalizer state listener to add.

◆ adjustBandLevels()

void alexaClientSDK::acsdkEqualizer::EqualizerController::adjustBandLevels ( const acsdkEqualizerInterfaces::EqualizerBandLevelMap bandAdjustmentMap)

Adjust levels of multiple equalizer bands. Levels are in dB. This method is not reenterable, calling it from the thread of listener or equalizer callback will cause deadlock. If unsupported bands are provided, method will try to use supported ones only. Adjustments leading to the levels beyond the supported range will be truncated.

Parameters
bandAdjustmentMapA map of equalizer bands to be adjusted and relative change to be applied. Negative values represent level decreasing. Levels adjustment values are in dB.

◆ create()

static std::shared_ptr<EqualizerController> alexaClientSDK::acsdkEqualizer::EqualizerController::create ( std::shared_ptr< acsdkEqualizerInterfaces::EqualizerModeControllerInterface modeController,
std::shared_ptr< acsdkEqualizerInterfaces::EqualizerConfigurationInterface configuration,
std::shared_ptr< acsdkEqualizerInterfaces::EqualizerStorageInterface storage 
)
static

Factory method to create a new instance of EqualizerController.

Parameters
modeControllerInterface to handle mode changes. This parameter may be null if no modes are supported in configuration.
configurationInterface to provide equalizer capabilities and configuration.
storageInterface to provide persistent storage for equalizer state.
Returns
A new instance of EqualizerController if all parameters are valid, nullptr otherwise.

◆ getBandLevel()

avsCommon::utils::error::SuccessResult<int> alexaClientSDK::acsdkEqualizer::EqualizerController::getBandLevel ( acsdkEqualizerInterfaces::EqualizerBand  band)

Returns current level of an equalizer band. Levels are in dB.

Parameters
bandEqualizer band to get level of.
Returns
SuccessResult containing current level of the equalizer band in dB on success and undefined value on failure.

◆ getBandLevels()

avsCommon::utils::error::SuccessResult<acsdkEqualizerInterfaces::EqualizerBandLevelMap> alexaClientSDK::acsdkEqualizer::EqualizerController::getBandLevels ( std::set< acsdkEqualizerInterfaces::EqualizerBand bands)

Get levels for multiple bands. Levels are in dB.

Parameters
bandsA set of bands to get levels for.
Returns
SuccessResult containing a map requested bands and their current levels on success and undefined value on failure. Levels are in dB.

◆ getConfiguration()

std::shared_ptr<acsdkEqualizerInterfaces::EqualizerConfigurationInterface> alexaClientSDK::acsdkEqualizer::EqualizerController::getConfiguration ( )

Returns the configuration equalizer initialized with.

Returns
The configuration equalizer initialized with.

◆ getCurrentMode()

acsdkEqualizerInterfaces::EqualizerMode alexaClientSDK::acsdkEqualizer::EqualizerController::getCurrentMode ( )

Returns equalizer mode currently applied to the device.

Returns
Equalizer mode currently applied to the device.

◆ getCurrentState()

acsdkEqualizerInterfaces::EqualizerState alexaClientSDK::acsdkEqualizer::EqualizerController::getCurrentState ( )

Returns current equalizer state.

Returns
Current equalizer state.

◆ registerEqualizer()

void alexaClientSDK::acsdkEqualizer::EqualizerController::registerEqualizer ( std::shared_ptr< acsdkEqualizerInterfaces::EqualizerInterface equalizer)

Registers an implementation of equalizer that modifies audio stream.

Parameters
equalizerAn implementation of equalizer that modifies audio stream.

◆ removeListener()

void alexaClientSDK::acsdkEqualizer::EqualizerController::removeListener ( std::shared_ptr< acsdkEqualizerInterfaces::EqualizerControllerListenerInterface listener)

Removes an equalizer state changes listener from the list of listeners.

Parameters
listenerAn implementation of equalizer state listener to remove.

◆ resetBands()

void alexaClientSDK::acsdkEqualizer::EqualizerController::resetBands ( const std::set< acsdkEqualizerInterfaces::EqualizerBand > &  bands)

Resets multiple equalizer bands to their default levels. This method is not reenterable, calling it from the thread of listener or equalizer callback will cause deadlock.

Parameters
bandsA set of bands whose level should be reset to default value.

◆ setBandLevel()

void alexaClientSDK::acsdkEqualizer::EqualizerController::setBandLevel ( acsdkEqualizerInterfaces::EqualizerBand  band,
int  level 
)

Set new level for an equalizer band. Level is in dB. This method is not reenterable, calling it from the thread of listener or equalizer callback will cause deadlock.

Parameters
bandEqualizer band to set level for.
levelLevel to set equalizer band to. Level is in dB.

◆ setBandLevels()

void alexaClientSDK::acsdkEqualizer::EqualizerController::setBandLevels ( const acsdkEqualizerInterfaces::EqualizerBandLevelMap bandLevelMap)

Set levels for multiple equalizer bands. Levels are in dB. This method is not reenterable, calling it from the thread of listener or equalizer callback will cause deadlock. If unsupported bands/levels are provided, method will try to use supported ones only and will truncate levels if needed.

Parameters
bandLevelMapA map of equalizer bands to be changed and their new levels. Levels are in dB.

◆ setCurrentMode()

void alexaClientSDK::acsdkEqualizer::EqualizerController::setCurrentMode ( acsdkEqualizerInterfaces::EqualizerMode  mode)

Sets a new equalizer mode. This method is not reenterable, calling it from the thread of listener or equalizer callback will cause deadlock.

Parameters
modeA new equalizer mode to be applied.

◆ unregisterEqualizer()

void alexaClientSDK::acsdkEqualizer::EqualizerController::unregisterEqualizer ( std::shared_ptr< acsdkEqualizerInterfaces::EqualizerInterface equalizer)

Unregisters an equalizer implementation.

Parameters
equalizerEqualizer implementation to remove.

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

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