AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
EqualizerTypes.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 ACSDKEQUALIZERINTERFACES_EQUALIZERTYPES_H_
17 #define ACSDKEQUALIZERINTERFACES_EQUALIZERTYPES_H_
18 
19 #include <array>
20 #include <string>
21 #include <unordered_map>
22 
25 
26 namespace alexaClientSDK {
27 namespace acsdkEqualizerInterfaces {
28 
32 enum class EqualizerBand {
34  BASS,
36  MIDRANGE,
38  TREBLE
39 };
40 
44 const std::array<EqualizerBand, 3> EqualizerBandValues = {
46 
51 enum class EqualizerMode {
53  NONE,
55  MOVIE,
57  MUSIC,
59  NIGHT,
61  SPORT,
63  TV
64 };
65 
69 const std::array<EqualizerMode, 6> EqualizerModeValues = {{EqualizerMode::NONE,
75 
77 using EqualizerBandLevelMap = std::unordered_map<EqualizerBand, int, avsCommon::utils::functional::EnumClassHash>;
78 
87 };
88 
89 inline bool operator==(const EqualizerState& state1, const EqualizerState& state2) {
90  return state1.mode == state2.mode && state1.bandLevels == state2.bandLevels;
91 }
92 
100  switch (band) {
101  case EqualizerBand::BASS:
102  return "BASS";
104  return "MIDRANGE";
106  return "TREBLE";
107  }
108 
109  return "UNKNOWN";
110 }
111 
119 inline std::ostream& operator<<(std::ostream& stream, EqualizerBand band) {
120  return stream << equalizerBandToString(band);
121 }
122 
130  switch (mode) {
131  case EqualizerMode::NONE:
132  return "NONE";
134  return "MOVIE";
136  return "MUSIC";
138  return "NIGHT";
140  return "SPORT";
141  case EqualizerMode::TV:
142  return "TV";
143  }
144 
145  return "UNKNOWN";
146 }
147 
155 inline std::ostream& operator<<(std::ostream& stream, EqualizerMode mode) {
156  return stream << equalizerModeToString(mode);
157 }
158 
166  if (stringValue == "BASS") {
168  }
169  if (stringValue == "MIDRANGE") {
171  }
172  if (stringValue == "TREBLE") {
174  }
175 
177 }
178 
188  if (stringValue == "NONE") {
190  }
191  if (stringValue == "MOVIE") {
193  }
194  if (stringValue == "MUSIC") {
196  }
197  if (stringValue == "NIGHT") {
199  }
200  if (stringValue == "SPORT") {
202  }
203  if (stringValue == "TV") {
205  }
206 
208 }
209 
210 } // namespace acsdkEqualizerInterfaces
211 } // namespace alexaClientSDK
212 
213 #endif // ACSDKEQUALIZERINTERFACES_EQUALIZERTYPES_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
EqualizerBandLevelMap bandLevels
Device supported bands with their levels.
Definition: EqualizerTypes.h:86
std::string equalizerModeToString(EqualizerMode mode)
Definition: EqualizerTypes.h:129
::std::string string
Definition: gtest-port.h:1097
std::string equalizerBandToString(EqualizerBand band)
Definition: EqualizerTypes.h:99
bool operator==(const EqualizerState &state1, const EqualizerState &state2)
Definition: EqualizerTypes.h:89
Equalizer mode representing default (no mode) behavior.
static SuccessResult< TValue > failure()
Definition: SuccessResult.h:87
const std::array< EqualizerBand, 3 > EqualizerBandValues
Definition: EqualizerTypes.h:44
static SuccessResult< TValue > success(TValue value)
Definition: SuccessResult.h:92
EqualizerMode mode
Equalizer mode selected. Use EqualizerMode::NONE value to represent no specific mode.
Definition: EqualizerTypes.h:84
EqualizerBand
Definition: EqualizerTypes.h:32
std::ostream & operator<<(std::ostream &stream, EqualizerBand band)
Definition: EqualizerTypes.h:119
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
avsCommon::utils::error::SuccessResult< EqualizerBand > stringToEqualizerBand(const std::string &stringValue)
Definition: EqualizerTypes.h:165
EqualizerMode
Definition: EqualizerTypes.h:51
const std::array< EqualizerMode, 6 > EqualizerModeValues
Definition: EqualizerTypes.h:69
avsCommon::utils::error::SuccessResult< EqualizerMode > stringToEqualizerMode(const std::string &stringValue)
Definition: EqualizerTypes.h:187

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