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/Equalizer.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/Equalizer.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/Equalizer.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 Equalizer {
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     bandLevels = 1,
51     preset = 2,
52     centerFreqMh = 3,
53     bandFrequencies = 4,
54     presets = 5,
55   };
56 
57   class Id {
58   public:
59     typedef std::false_type fixed_size;
60     static const char* descriptor;
61 
62     enum class Tag : int32_t {
63       vendorExtensionTag = 0,
64       commonTag = 1,
65     };
66 
67     // Expose tag symbols for legacy code
68     static const inline Tag vendorExtensionTag = Tag::vendorExtensionTag;
69     static const inline Tag commonTag = Tag::commonTag;
70 
71     template<typename _Tp>
72     static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Id>;
73 
Id()74     Id() : _value(std::in_place_index<static_cast<size_t>(vendorExtensionTag)>, ::aidl::android::hardware::audio::effect::VendorExtension()) { }
75 
76     template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
77     // NOLINTNEXTLINE(google-explicit-constructor)
Id(_Tp && _arg)78     constexpr Id(_Tp&& _arg)
79         : _value(std::forward<_Tp>(_arg)) {}
80 
81     template <size_t _Np, typename... _Tp>
Id(std::in_place_index_t<_Np>,_Tp &&..._args)82     constexpr explicit Id(std::in_place_index_t<_Np>, _Tp&&... _args)
83         : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
84 
85     template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)86     static Id make(_Tp&&... _args) {
87       return Id(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
88     }
89 
90     template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)91     static Id make(std::initializer_list<_Tp> _il, _Up&&... _args) {
92       return Id(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
93     }
94 
getTag()95     Tag getTag() const {
96       return static_cast<Tag>(_value.index());
97     }
98 
99     template <Tag _tag>
get()100     const auto& get() const {
101       if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
102       return std::get<static_cast<size_t>(_tag)>(_value);
103     }
104 
105     template <Tag _tag>
get()106     auto& get() {
107       if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
108       return std::get<static_cast<size_t>(_tag)>(_value);
109     }
110 
111     template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)112     void set(_Tp&&... _args) {
113       _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
114     }
115 
116     binder_status_t readFromParcel(const AParcel* _parcel);
117     binder_status_t writeToParcel(AParcel* _parcel) const;
118 
119     inline bool operator==(const Id& _rhs) const {
120       return _value == _rhs._value;
121     }
122     inline bool operator<(const Id& _rhs) const {
123       return _value < _rhs._value;
124     }
125     inline bool operator!=(const Id& _rhs) const {
126       return !(*this == _rhs);
127     }
128     inline bool operator>(const Id& _rhs) const {
129       return _rhs < *this;
130     }
131     inline bool operator>=(const Id& _rhs) const {
132       return !(*this < _rhs);
133     }
134     inline bool operator<=(const Id& _rhs) const {
135       return !(_rhs < *this);
136     }
137 
138     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()139     inline std::string toString() const {
140       std::ostringstream os;
141       os << "Id{";
142       switch (getTag()) {
143       case vendorExtensionTag: os << "vendorExtensionTag: " << ::android::internal::ToString(get<vendorExtensionTag>()); break;
144       case commonTag: os << "commonTag: " << ::android::internal::ToString(get<commonTag>()); break;
145       }
146       os << "}";
147       return os.str();
148     }
149   private:
150     std::variant<::aidl::android::hardware::audio::effect::VendorExtension, ::aidl::android::hardware::audio::effect::Equalizer::Tag> _value;
151   };
152   class BandLevel {
153   public:
154     typedef std::false_type fixed_size;
155     static const char* descriptor;
156 
157     int32_t index = 0;
158     int32_t levelMb = 0;
159 
160     binder_status_t readFromParcel(const AParcel* parcel);
161     binder_status_t writeToParcel(AParcel* parcel) const;
162 
163     inline bool operator==(const BandLevel& _rhs) const {
164       return std::tie(index, levelMb) == std::tie(_rhs.index, _rhs.levelMb);
165     }
166     inline bool operator<(const BandLevel& _rhs) const {
167       return std::tie(index, levelMb) < std::tie(_rhs.index, _rhs.levelMb);
168     }
169     inline bool operator!=(const BandLevel& _rhs) const {
170       return !(*this == _rhs);
171     }
172     inline bool operator>(const BandLevel& _rhs) const {
173       return _rhs < *this;
174     }
175     inline bool operator>=(const BandLevel& _rhs) const {
176       return !(*this < _rhs);
177     }
178     inline bool operator<=(const BandLevel& _rhs) const {
179       return !(_rhs < *this);
180     }
181 
182     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()183     inline std::string toString() const {
184       std::ostringstream _aidl_os;
185       _aidl_os << "BandLevel{";
186       _aidl_os << "index: " << ::android::internal::ToString(index);
187       _aidl_os << ", levelMb: " << ::android::internal::ToString(levelMb);
188       _aidl_os << "}";
189       return _aidl_os.str();
190     }
191   };
192   class BandFrequency {
193   public:
194     typedef std::false_type fixed_size;
195     static const char* descriptor;
196 
197     int32_t index = 0;
198     int32_t minMh = 0;
199     int32_t maxMh = 0;
200 
201     binder_status_t readFromParcel(const AParcel* parcel);
202     binder_status_t writeToParcel(AParcel* parcel) const;
203 
204     inline bool operator==(const BandFrequency& _rhs) const {
205       return std::tie(index, minMh, maxMh) == std::tie(_rhs.index, _rhs.minMh, _rhs.maxMh);
206     }
207     inline bool operator<(const BandFrequency& _rhs) const {
208       return std::tie(index, minMh, maxMh) < std::tie(_rhs.index, _rhs.minMh, _rhs.maxMh);
209     }
210     inline bool operator!=(const BandFrequency& _rhs) const {
211       return !(*this == _rhs);
212     }
213     inline bool operator>(const BandFrequency& _rhs) const {
214       return _rhs < *this;
215     }
216     inline bool operator>=(const BandFrequency& _rhs) const {
217       return !(*this < _rhs);
218     }
219     inline bool operator<=(const BandFrequency& _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 _aidl_os;
226       _aidl_os << "BandFrequency{";
227       _aidl_os << "index: " << ::android::internal::ToString(index);
228       _aidl_os << ", minMh: " << ::android::internal::ToString(minMh);
229       _aidl_os << ", maxMh: " << ::android::internal::ToString(maxMh);
230       _aidl_os << "}";
231       return _aidl_os.str();
232     }
233   };
234   class Preset {
235   public:
236     typedef std::false_type fixed_size;
237     static const char* descriptor;
238 
239     int32_t index = 0;
240     std::string name;
241 
242     binder_status_t readFromParcel(const AParcel* parcel);
243     binder_status_t writeToParcel(AParcel* parcel) const;
244 
245     inline bool operator==(const Preset& _rhs) const {
246       return std::tie(index, name) == std::tie(_rhs.index, _rhs.name);
247     }
248     inline bool operator<(const Preset& _rhs) const {
249       return std::tie(index, name) < std::tie(_rhs.index, _rhs.name);
250     }
251     inline bool operator!=(const Preset& _rhs) const {
252       return !(*this == _rhs);
253     }
254     inline bool operator>(const Preset& _rhs) const {
255       return _rhs < *this;
256     }
257     inline bool operator>=(const Preset& _rhs) const {
258       return !(*this < _rhs);
259     }
260     inline bool operator<=(const Preset& _rhs) const {
261       return !(_rhs < *this);
262     }
263 
264     static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()265     inline std::string toString() const {
266       std::ostringstream _aidl_os;
267       _aidl_os << "Preset{";
268       _aidl_os << "index: " << ::android::internal::ToString(index);
269       _aidl_os << ", name: " << ::android::internal::ToString(name);
270       _aidl_os << "}";
271       return _aidl_os.str();
272     }
273   };
274   // Expose tag symbols for legacy code
275   static const inline Tag vendor = Tag::vendor;
276   static const inline Tag bandLevels = Tag::bandLevels;
277   static const inline Tag preset = Tag::preset;
278   static const inline Tag centerFreqMh = Tag::centerFreqMh;
279   static const inline Tag bandFrequencies = Tag::bandFrequencies;
280   static const inline Tag presets = Tag::presets;
281 
282   template<typename _Tp>
283   static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, Equalizer>;
284 
Equalizer()285   Equalizer() : _value(std::in_place_index<static_cast<size_t>(vendor)>, ::aidl::android::hardware::audio::effect::VendorExtension()) { }
286 
287   template <typename _Tp, typename = std::enable_if_t<_not_self<_Tp>>>
288   // NOLINTNEXTLINE(google-explicit-constructor)
Equalizer(_Tp && _arg)289   constexpr Equalizer(_Tp&& _arg)
290       : _value(std::forward<_Tp>(_arg)) {}
291 
292   template <size_t _Np, typename... _Tp>
Equalizer(std::in_place_index_t<_Np>,_Tp &&..._args)293   constexpr explicit Equalizer(std::in_place_index_t<_Np>, _Tp&&... _args)
294       : _value(std::in_place_index<_Np>, std::forward<_Tp>(_args)...) {}
295 
296   template <Tag _tag, typename... _Tp>
make(_Tp &&..._args)297   static Equalizer make(_Tp&&... _args) {
298     return Equalizer(std::in_place_index<static_cast<size_t>(_tag)>, std::forward<_Tp>(_args)...);
299   }
300 
301   template <Tag _tag, typename _Tp, typename... _Up>
make(std::initializer_list<_Tp> _il,_Up &&..._args)302   static Equalizer make(std::initializer_list<_Tp> _il, _Up&&... _args) {
303     return Equalizer(std::in_place_index<static_cast<size_t>(_tag)>, std::move(_il), std::forward<_Up>(_args)...);
304   }
305 
getTag()306   Tag getTag() const {
307     return static_cast<Tag>(_value.index());
308   }
309 
310   template <Tag _tag>
get()311   const auto& get() const {
312     if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
313     return std::get<static_cast<size_t>(_tag)>(_value);
314   }
315 
316   template <Tag _tag>
get()317   auto& get() {
318     if (getTag() != _tag) { __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, "bad access: a wrong tag"); }
319     return std::get<static_cast<size_t>(_tag)>(_value);
320   }
321 
322   template <Tag _tag, typename... _Tp>
set(_Tp &&..._args)323   void set(_Tp&&... _args) {
324     _value.emplace<static_cast<size_t>(_tag)>(std::forward<_Tp>(_args)...);
325   }
326 
327   binder_status_t readFromParcel(const AParcel* _parcel);
328   binder_status_t writeToParcel(AParcel* _parcel) const;
329 
330   inline bool operator==(const Equalizer& _rhs) const {
331     return _value == _rhs._value;
332   }
333   inline bool operator<(const Equalizer& _rhs) const {
334     return _value < _rhs._value;
335   }
336   inline bool operator!=(const Equalizer& _rhs) const {
337     return !(*this == _rhs);
338   }
339   inline bool operator>(const Equalizer& _rhs) const {
340     return _rhs < *this;
341   }
342   inline bool operator>=(const Equalizer& _rhs) const {
343     return !(*this < _rhs);
344   }
345   inline bool operator<=(const Equalizer& _rhs) const {
346     return !(_rhs < *this);
347   }
348 
349   static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()350   inline std::string toString() const {
351     std::ostringstream os;
352     os << "Equalizer{";
353     switch (getTag()) {
354     case vendor: os << "vendor: " << ::android::internal::ToString(get<vendor>()); break;
355     case bandLevels: os << "bandLevels: " << ::android::internal::ToString(get<bandLevels>()); break;
356     case preset: os << "preset: " << ::android::internal::ToString(get<preset>()); break;
357     case centerFreqMh: os << "centerFreqMh: " << ::android::internal::ToString(get<centerFreqMh>()); break;
358     case bandFrequencies: os << "bandFrequencies: " << ::android::internal::ToString(get<bandFrequencies>()); break;
359     case presets: os << "presets: " << ::android::internal::ToString(get<presets>()); break;
360     }
361     os << "}";
362     return os.str();
363   }
364 private:
365   std::variant<::aidl::android::hardware::audio::effect::VendorExtension, std::vector<::aidl::android::hardware::audio::effect::Equalizer::BandLevel>, int32_t, std::vector<int32_t>, std::vector<::aidl::android::hardware::audio::effect::Equalizer::BandFrequency>, std::vector<::aidl::android::hardware::audio::effect::Equalizer::Preset>> _value;
366 };
367 }  // namespace effect
368 }  // namespace audio
369 }  // namespace hardware
370 }  // namespace android
371 }  // namespace aidl
372 namespace aidl {
373 namespace android {
374 namespace hardware {
375 namespace audio {
376 namespace effect {
toString(Equalizer::Id::Tag val)377 [[nodiscard]] static inline std::string toString(Equalizer::Id::Tag val) {
378   switch(val) {
379   case Equalizer::Id::Tag::vendorExtensionTag:
380     return "vendorExtensionTag";
381   case Equalizer::Id::Tag::commonTag:
382     return "commonTag";
383   default:
384     return std::to_string(static_cast<int32_t>(val));
385   }
386 }
387 }  // namespace effect
388 }  // namespace audio
389 }  // namespace hardware
390 }  // namespace android
391 }  // namespace aidl
392 namespace ndk {
393 namespace internal {
394 #pragma clang diagnostic push
395 #pragma clang diagnostic ignored "-Wc++17-extensions"
396 template <>
397 constexpr inline std::array<aidl::android::hardware::audio::effect::Equalizer::Id::Tag, 2> enum_values<aidl::android::hardware::audio::effect::Equalizer::Id::Tag> = {
398   aidl::android::hardware::audio::effect::Equalizer::Id::Tag::vendorExtensionTag,
399   aidl::android::hardware::audio::effect::Equalizer::Id::Tag::commonTag,
400 };
401 #pragma clang diagnostic pop
402 }  // namespace internal
403 }  // namespace ndk
404 namespace aidl {
405 namespace android {
406 namespace hardware {
407 namespace audio {
408 namespace effect {
toString(Equalizer::Tag val)409 [[nodiscard]] static inline std::string toString(Equalizer::Tag val) {
410   switch(val) {
411   case Equalizer::Tag::vendor:
412     return "vendor";
413   case Equalizer::Tag::bandLevels:
414     return "bandLevels";
415   case Equalizer::Tag::preset:
416     return "preset";
417   case Equalizer::Tag::centerFreqMh:
418     return "centerFreqMh";
419   case Equalizer::Tag::bandFrequencies:
420     return "bandFrequencies";
421   case Equalizer::Tag::presets:
422     return "presets";
423   default:
424     return std::to_string(static_cast<int32_t>(val));
425   }
426 }
427 }  // namespace effect
428 }  // namespace audio
429 }  // namespace hardware
430 }  // namespace android
431 }  // namespace aidl
432 namespace ndk {
433 namespace internal {
434 #pragma clang diagnostic push
435 #pragma clang diagnostic ignored "-Wc++17-extensions"
436 template <>
437 constexpr inline std::array<aidl::android::hardware::audio::effect::Equalizer::Tag, 6> enum_values<aidl::android::hardware::audio::effect::Equalizer::Tag> = {
438   aidl::android::hardware::audio::effect::Equalizer::Tag::vendor,
439   aidl::android::hardware::audio::effect::Equalizer::Tag::bandLevels,
440   aidl::android::hardware::audio::effect::Equalizer::Tag::preset,
441   aidl::android::hardware::audio::effect::Equalizer::Tag::centerFreqMh,
442   aidl::android::hardware::audio::effect::Equalizer::Tag::bandFrequencies,
443   aidl::android::hardware::audio::effect::Equalizer::Tag::presets,
444 };
445 #pragma clang diagnostic pop
446 }  // namespace internal
447 }  // namespace ndk
448