AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <EqualizerController.h>
Static Public Member Functions | |
static std::shared_ptr< EqualizerController > | create (std::shared_ptr< acsdkEqualizerInterfaces::EqualizerModeControllerInterface > modeController, std::shared_ptr< acsdkEqualizerInterfaces::EqualizerConfigurationInterface > configuration, std::shared_ptr< acsdkEqualizerInterfaces::EqualizerStorageInterface > storage) |
Class to control equalizer operations in the SDK. All the equalizer state manipulations and corresponding notifications are performed within this class.
|
default |
Destructor.
void alexaClientSDK::acsdkEqualizer::EqualizerController::addListener | ( | std::shared_ptr< acsdkEqualizerInterfaces::EqualizerControllerListenerInterface > | listener | ) |
Adds a listener for equalizer state changes.
listener | An implementation of equalizer state listener to add. |
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.
bandAdjustmentMap | A map of equalizer bands to be adjusted and relative change to be applied. Negative values represent level decreasing. Levels adjustment values are in dB. |
|
static |
Factory method to create a new instance of EqualizerController
.
modeController | Interface to handle mode changes. This parameter may be null if no modes are supported in configuration . |
configuration | Interface to provide equalizer capabilities and configuration. |
storage | Interface to provide persistent storage for equalizer state. |
EqualizerController
if all parameters are valid, nullptr
otherwise. avsCommon::utils::error::SuccessResult<int> alexaClientSDK::acsdkEqualizer::EqualizerController::getBandLevel | ( | acsdkEqualizerInterfaces::EqualizerBand | band | ) |
Returns current level of an equalizer band. Levels are in dB.
band | Equalizer band to get level of. |
SuccessResult
containing current level of the equalizer band in dB on success and undefined value on failure. avsCommon::utils::error::SuccessResult<acsdkEqualizerInterfaces::EqualizerBandLevelMap> alexaClientSDK::acsdkEqualizer::EqualizerController::getBandLevels | ( | std::set< acsdkEqualizerInterfaces::EqualizerBand > | bands | ) |
Get levels for multiple bands. Levels are in dB.
bands | A set of bands to get levels for. |
SuccessResult
containing a map requested bands and their current levels on success and undefined value on failure. Levels are in dB. std::shared_ptr<acsdkEqualizerInterfaces::EqualizerConfigurationInterface> alexaClientSDK::acsdkEqualizer::EqualizerController::getConfiguration | ( | ) |
Returns the configuration equalizer initialized with.
acsdkEqualizerInterfaces::EqualizerMode alexaClientSDK::acsdkEqualizer::EqualizerController::getCurrentMode | ( | ) |
Returns equalizer mode currently applied to the device.
acsdkEqualizerInterfaces::EqualizerState alexaClientSDK::acsdkEqualizer::EqualizerController::getCurrentState | ( | ) |
Returns current equalizer state.
void alexaClientSDK::acsdkEqualizer::EqualizerController::registerEqualizer | ( | std::shared_ptr< acsdkEqualizerInterfaces::EqualizerInterface > | equalizer | ) |
Registers an implementation of equalizer that modifies audio stream.
equalizer | An implementation of equalizer that modifies audio stream. |
void alexaClientSDK::acsdkEqualizer::EqualizerController::removeListener | ( | std::shared_ptr< acsdkEqualizerInterfaces::EqualizerControllerListenerInterface > | listener | ) |
Removes an equalizer state changes listener from the list of listeners.
listener | An implementation of equalizer state listener to remove. |
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.
bands | A set of bands whose level should be reset to default value. |
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.
band | Equalizer band to set level for. |
level | Level to set equalizer band to. Level is in dB. |
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.
bandLevelMap | A map of equalizer bands to be changed and their new levels. Levels are in dB. |
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.
mode | A new equalizer mode to be applied. |
void alexaClientSDK::acsdkEqualizer::EqualizerController::unregisterEqualizer | ( | std::shared_ptr< acsdkEqualizerInterfaces::EqualizerInterface > | equalizer | ) |
Unregisters an equalizer implementation.
equalizer | Equalizer implementation to remove. |
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0