1 /*
2 * This file is auto-generated. DO NOT MODIFY.
3 * Using: out/host/linux-x86/bin/aidl --lang=ndk -Weverything -Wno-missing-permission-annotation --structured --version 3 --hash notfrozen -t --stability vintf --min_sdk_version current -pout/soong/.intermediates/system/hardware/interfaces/media/android.media.audio.eraser.types_interface/1/preprocessed.aidl -pout/soong/.intermediates/system/hardware/interfaces/media/android.media.audio.common.types_interface/4/preprocessed.aidl -pout/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.common_interface/4/preprocessed.aidl -pout/soong/.intermediates/hardware/interfaces/common/aidl/android.hardware.common_interface/2/preprocessed.aidl -pout/soong/.intermediates/hardware/interfaces/common/fmq/aidl/android.hardware.common.fmq_interface/1/preprocessed.aidl --previous_api_dir=hardware/interfaces/audio/aidl/aidl_api/android.hardware.audio.effect/2 --previous_hash 54d5a2e1d59066b57e35eb7bcb5ebc72a1259c1c --ninja -d out/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.effect-V3-ndk-source/gen/staging/android/hardware/audio/effect/AutomaticGainControlV1.cpp.d -h out/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.effect-V3-ndk-source/gen/include/staging -o out/soong/.intermediates/hardware/interfaces/audio/aidl/android.hardware.audio.effect-V3-ndk-source/gen/staging -Nhardware/interfaces/audio/aidl hardware/interfaces/audio/aidl/android/hardware/audio/effect/AutomaticGainControlV1.aidl
4 *
5 * DO NOT CHECK THIS FILE INTO A CODE TREE (e.g. git, etc..).
6 * ALWAYS GENERATE THIS FILE FROM UPDATED AIDL COMPILER
7 * AS A BUILD INTERMEDIATE ONLY. THIS IS NOT SOURCE CODE.
8 */
9 #pragma once
10
11 #include <array>
12 #include <cassert>
13 #include <cstdint>
14 #include <memory>
15 #include <optional>
16 #include <string>
17 #include <type_traits>
18 #include <utility>
19 #include <variant>
20 #include <vector>
21 #include <android/binder_enums.h>
22 #include <android/binder_interface_utils.h>
23 #include <android/binder_parcelable_utils.h>
24 #include <android/binder_to_string.h>
25 #include <aidl/android/hardware/audio/effect/AutomaticGainControlV1.h>
26 #include <aidl/android/hardware/audio/effect/VendorExtension.h>
27 #ifdef BINDER_STABILITY_SUPPORT
28 #include <android/binder_stability.h>
29 #endif // BINDER_STABILITY_SUPPORT
30
31 #ifndef __BIONIC__
32 #define __assert2(a,b,c,d) ((void)0)
33 #endif
34
35 namespace aidl::android::hardware::audio::effect {
36 class VendorExtension;
37 } // namespace aidl::android::hardware::audio::effect
38 namespace aidl {
39 namespace android {
40 namespace hardware {
41 namespace audio {
42 namespace effect {
43 class AutomaticGainControlV1 {
44 public:
45 typedef std::false_type fixed_size;
46 static const char* descriptor;
47
48 enum class Tag : int32_t {
49 vendor = 0,
50 targetPeakLevelDbFs = 1,
51 maxCompressionGainDb = 2,
52 enableLimiter = 3,
53 };
54
55 class Id {
56 public:
57 typedef std::false_type fixed_size;
58 static const char* descriptor;
59
60 enum class Tag : int32_t {
61 vendorExtensionTag = 0,
62 commonTag = 1,
63 };
64
65 // Expose tag symbols for legacy code
66 static const inline Tag vendorExtensionTag = Tag::vendorExtensionTag;
67 static const inline Tag commonTag = Tag::commonTag;
68
69 template<typename _Tp>
70 static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Id>;
71
Id()72 Id() : _value(std::in_place_index<static_cast<size_t>(vendorExtensionTag)>, ::aidl::android::hardware::audio::effect::VendorExtension()) { }
73
74 template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
75 // NOLINTNEXTLINE(google-explicit-constructor)
Id(_Tp && _arg)76 constexpr Id(_Tp&& _arg)
77 : _value(std::forward<_Tp>(_arg)) {}
78
79 template <size_t _Np, typename... _Tp>
Id(std::in_place_index_t<_Np>,_Tp &&..._args)80 constexpr explicit Id(std::in_place_index_t<_Np>, _Tp&&... _args)
81 : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
82
83 template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)84 static Id make(_Tp&&... _args) {
85 return Id(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
86 }
87
88 template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)89 static Id make(std::initializer_list<_Tp> _il, _Up&&... _args) {
90 return Id(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
91 }
92
getTag()93 Tag getTag() const {
94 return static_cast<Tag>(_value.index());
95 }
96
97 template <Tag _tag>
get()98 const auto& get() const {
99 if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
100 return std::get<static_cast<size_t>(_tag)>(_value);
101 }
102
103 template <Tag _tag>
get()104 auto& get() {
105 if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
106 return std::get<static_cast<size_t>(_tag)>(_value);
107 }
108
109 template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)110 void set(_Tp&&... _args) {
111 _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
112 }
113
114 binder_status_t readFromParcel(const AParcel* _parcel);
115 binder_status_t writeToParcel(AParcel* _parcel) const;
116
117 inline bool operator==(const Id& _rhs) const {
118 return _value == _rhs._value;
119 }
120 inline bool operator<(const Id& _rhs) const {
121 return _value < _rhs._value;
122 }
123 inline bool operator!=(const Id& _rhs) const {
124 return !(*this == _rhs);
125 }
126 inline bool operator>(const Id& _rhs) const {
127 return _rhs < *this;
128 }
129 inline bool operator>=(const Id& _rhs) const {
130 return !(*this < _rhs);
131 }
132 inline bool operator<=(const Id& _rhs) const {
133 return !(_rhs < *this);
134 }
135
136 static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()137 inline std::string toString() const {
138 std::ostringstream os;
139 os << "Id{";
140 switch (getTag()) {
141 case vendorExtensionTag: os << "vendorExtensionTag: " << ::android::internal::ToString(get<vendorExtensionTag>()); break;
142 case commonTag: os << "commonTag: " << ::android::internal::ToString(get<commonTag>()); break;
143 }
144 os << "}";
145 return os.str();
146 }
147 private:
148 std::variant<::aidl::android::hardware::audio::effect::VendorExtension, ::aidl::android::hardware::audio::effect::AutomaticGainControlV1::Tag> _value;
149 };
150 // Expose tag symbols for legacy code
151 static const inline Tag vendor = Tag::vendor;
152 static const inline Tag targetPeakLevelDbFs = Tag::targetPeakLevelDbFs;
153 static const inline Tag maxCompressionGainDb = Tag::maxCompressionGainDb;
154 static const inline Tag enableLimiter = Tag::enableLimiter;
155
156 template<typename _Tp>
157 static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, AutomaticGainControlV1>;
158
AutomaticGainControlV1()159 AutomaticGainControlV1() : _value(std::in_place_index<static_cast<size_t>(vendor)>, ::aidl::android::hardware::audio::effect::VendorExtension()) { }
160
161 template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
162 // NOLINTNEXTLINE(google-explicit-constructor)
AutomaticGainControlV1(_Tp && _arg)163 constexpr AutomaticGainControlV1(_Tp&& _arg)
164 : _value(std::forward<_Tp>(_arg)) {}
165
166 template <size_t _Np, typename... _Tp>
AutomaticGainControlV1(std::in_place_index_t<_Np>,_Tp &&..._args)167 constexpr explicit AutomaticGainControlV1(std::in_place_index_t<_Np>, _Tp&&... _args)
168 : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
169
170 template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)171 static AutomaticGainControlV1 make(_Tp&&... _args) {
172 return AutomaticGainControlV1(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
173 }
174
175 template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)176 static AutomaticGainControlV1 make(std::initializer_list<_Tp> _il, _Up&&... _args) {
177 return AutomaticGainControlV1(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
178 }
179
getTag()180 Tag getTag() const {
181 return static_cast<Tag>(_value.index());
182 }
183
184 template <Tag _tag>
get()185 const auto& get() const {
186 if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
187 return std::get<static_cast<size_t>(_tag)>(_value);
188 }
189
190 template <Tag _tag>
get()191 auto& get() {
192 if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
193 return std::get<static_cast<size_t>(_tag)>(_value);
194 }
195
196 template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)197 void set(_Tp&&... _args) {
198 _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
199 }
200
201 binder_status_t readFromParcel(const AParcel* _parcel);
202 binder_status_t writeToParcel(AParcel* _parcel) const;
203
204 inline bool operator==(const AutomaticGainControlV1& _rhs) const {
205 return _value == _rhs._value;
206 }
207 inline bool operator<(const AutomaticGainControlV1& _rhs) const {
208 return _value < _rhs._value;
209 }
210 inline bool operator!=(const AutomaticGainControlV1& _rhs) const {
211 return !(*this == _rhs);
212 }
213 inline bool operator>(const AutomaticGainControlV1& _rhs) const {
214 return _rhs < *this;
215 }
216 inline bool operator>=(const AutomaticGainControlV1& _rhs) const {
217 return !(*this < _rhs);
218 }
219 inline bool operator<=(const AutomaticGainControlV1& _rhs) const {
220 return !(_rhs < *this);
221 }
222
223 static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()224 inline std::string toString() const {
225 std::ostringstream os;
226 os << "AutomaticGainControlV1{";
227 switch (getTag()) {
228 case vendor: os << "vendor: " << ::android::internal::ToString(get<vendor>()); break;
229 case targetPeakLevelDbFs: os << "targetPeakLevelDbFs: " << ::android::internal::ToString(get<targetPeakLevelDbFs>()); break;
230 case maxCompressionGainDb: os << "maxCompressionGainDb: " << ::android::internal::ToString(get<maxCompressionGainDb>()); break;
231 case enableLimiter: os << "enableLimiter: " << ::android::internal::ToString(get<enableLimiter>()); break;
232 }
233 os << "}";
234 return os.str();
235 }
236 private:
237 std::variant<::aidl::android::hardware::audio::effect::VendorExtension, int32_t, int32_t, bool> _value;
238 };
239 } // namespace effect
240 } // namespace audio
241 } // namespace hardware
242 } // namespace android
243 } // namespace aidl
244 namespace aidl {
245 namespace android {
246 namespace hardware {
247 namespace audio {
248 namespace effect {
toString(AutomaticGainControlV1::Id::Tag val)249 [[nodiscard]] static inline std::string toString(AutomaticGainControlV1::Id::Tag val) {
250 switch(val) {
251 case AutomaticGainControlV1::Id::Tag::vendorExtensionTag:
252 return "vendorExtensionTag";
253 case AutomaticGainControlV1::Id::Tag::commonTag:
254 return "commonTag";
255 default:
256 return std::to_string(static_cast<int32_t>(val));
257 }
258 }
259 } // namespace effect
260 } // namespace audio
261 } // namespace hardware
262 } // namespace android
263 } // namespace aidl
264 namespace ndk {
265 namespace internal {
266 #pragma clang diagnostic push
267 #pragma clang diagnostic ignored "-Wc++17-extensions"
268 template <>
269 constexpr inline std::array<aidl::android::hardware::audio::effect::AutomaticGainControlV1::Id::Tag, 2> enum_values<aidl::android::hardware::audio::effect::AutomaticGainControlV1::Id::Tag> = {
270 aidl::android::hardware::audio::effect::AutomaticGainControlV1::Id::Tag::vendorExtensionTag,
271 aidl::android::hardware::audio::effect::AutomaticGainControlV1::Id::Tag::commonTag,
272 };
273 #pragma clang diagnostic pop
274 } // namespace internal
275 } // namespace ndk
276 namespace aidl {
277 namespace android {
278 namespace hardware {
279 namespace audio {
280 namespace effect {
toString(AutomaticGainControlV1::Tag val)281 [[nodiscard]] static inline std::string toString(AutomaticGainControlV1::Tag val) {
282 switch(val) {
283 case AutomaticGainControlV1::Tag::vendor:
284 return "vendor";
285 case AutomaticGainControlV1::Tag::targetPeakLevelDbFs:
286 return "targetPeakLevelDbFs";
287 case AutomaticGainControlV1::Tag::maxCompressionGainDb:
288 return "maxCompressionGainDb";
289 case AutomaticGainControlV1::Tag::enableLimiter:
290 return "enableLimiter";
291 default:
292 return std::to_string(static_cast<int32_t>(val));
293 }
294 }
295 } // namespace effect
296 } // namespace audio
297 } // namespace hardware
298 } // namespace android
299 } // namespace aidl
300 namespace ndk {
301 namespace internal {
302 #pragma clang diagnostic push
303 #pragma clang diagnostic ignored "-Wc++17-extensions"
304 template <>
305 constexpr inline std::array<aidl::android::hardware::audio::effect::AutomaticGainControlV1::Tag, 4> enum_values<aidl::android::hardware::audio::effect::AutomaticGainControlV1::Tag> = {
306 aidl::android::hardware::audio::effect::AutomaticGainControlV1::Tag::vendor,
307 aidl::android::hardware::audio::effect::AutomaticGainControlV1::Tag::targetPeakLevelDbFs,
308 aidl::android::hardware::audio::effect::AutomaticGainControlV1::Tag::maxCompressionGainDb,
309 aidl::android::hardware::audio::effect::AutomaticGainControlV1::Tag::enableLimiter,
310 };
311 #pragma clang diagnostic pop
312 } // namespace internal
313 } // namespace ndk
314