AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
InMemoryEqualizerConfiguration.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ACSDKEQUALIZERIMPLEMENTATIONS_INMEMORYEQUALIZERCONFIGURATION_H_
17 #define ACSDKEQUALIZERIMPLEMENTATIONS_INMEMORYEQUALIZERCONFIGURATION_H_
18 
19 #include <memory>
20 #include <mutex>
21 
23 
24 namespace alexaClientSDK {
25 namespace acsdkEqualizer {
26 
32 public:
36  ~InMemoryEqualizerConfiguration() override = default;
37 
51  static std::shared_ptr<InMemoryEqualizerConfiguration> create(
52  int minBandLevel,
53  int maxBandLevel,
54  int defaultDelta,
55  const std::set<acsdkEqualizerInterfaces::EqualizerBand>& bandsSupported,
56  const std::set<acsdkEqualizerInterfaces::EqualizerMode>& modesSupported,
58 
64  static std::shared_ptr<InMemoryEqualizerConfiguration> createDisabled();
65 
71  static std::shared_ptr<InMemoryEqualizerConfiguration> createDefault();
72 
75  bool isEnabled() const override;
76 
77  std::set<acsdkEqualizerInterfaces::EqualizerBand> getSupportedBands() const override;
78 
79  std::set<acsdkEqualizerInterfaces::EqualizerMode> getSupportedModes() const override;
80 
81  int getMinBandLevel() const override;
82 
83  int getMaxBandLevel() const override;
84 
85  int getDefaultBandDelta() const override;
86 
88 
90 
93 
94 protected:
107  int minBandLevel,
108  int maxBandLevel,
109  int defaultDelta,
110  const std::set<acsdkEqualizerInterfaces::EqualizerBand>& bandsSupported,
111  const std::set<acsdkEqualizerInterfaces::EqualizerMode>& modesSupported,
113 
118 
124  bool validateConfiguration();
125 
135  bool validateBandLevelMap(const acsdkEqualizerInterfaces::EqualizerBandLevelMap& bandLevelMap, bool validateValues);
136 
137 private:
139  int m_maxBandLevel;
140 
142  int m_minBandLevel;
143 
145  int m_defaultDelta;
146 
148  std::set<acsdkEqualizerInterfaces::EqualizerBand> m_bandsSupported;
149 
151  std::set<acsdkEqualizerInterfaces::EqualizerMode> m_modesSupported;
152 
155 
157  bool m_isEnabled;
158 };
159 
160 } // namespace acsdkEqualizer
161 } // namespace alexaClientSDK
162 
163 #endif // ACSDKEQUALIZERIMPLEMENTATIONS_INMEMORYEQUALIZERCONFIGURATION_H_
std::unordered_map< EqualizerBand, int, avsCommon::utils::functional::EnumClassHash > EqualizerBandLevelMap
A collection of bands with their level values. This is an alias for EqualizerBand to band level (int)...
Definition: EqualizerTypes.h:77
bool validateBandLevelMap(const acsdkEqualizerInterfaces::EqualizerBandLevelMap &bandLevelMap, bool validateValues)
std::set< acsdkEqualizerInterfaces::EqualizerMode > getSupportedModes() const override
static std::shared_ptr< InMemoryEqualizerConfiguration > createDisabled()
Definition: InMemoryEqualizerConfiguration.h:31
static std::shared_ptr< InMemoryEqualizerConfiguration > create(int minBandLevel, int maxBandLevel, int defaultDelta, const std::set< acsdkEqualizerInterfaces::EqualizerBand > &bandsSupported, const std::set< acsdkEqualizerInterfaces::EqualizerMode > &modesSupported, acsdkEqualizerInterfaces::EqualizerState defaultState)
bool isBandSupported(acsdkEqualizerInterfaces::EqualizerBand band) const override
EqualizerBand
Definition: EqualizerTypes.h:32
std::set< acsdkEqualizerInterfaces::EqualizerBand > getSupportedBands() const override
bool isModeSupported(acsdkEqualizerInterfaces::EqualizerMode mode) const override
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
static std::shared_ptr< InMemoryEqualizerConfiguration > createDefault()
EqualizerMode
Definition: EqualizerTypes.h:51
acsdkEqualizerInterfaces::EqualizerState getDefaultState() const override

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