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 -Werror -Weverything --structured --version 4 --hash notfrozen -t --stability vintf --min_sdk_version 29 --previous_api_dir=system/hardware/interfaces/media/aidl_api/android.media.audio.common.types/3 --previous_hash 0c86a38729dd5d560fe3a0eca6aa9d8cf83efb00 --ninja -d out/soong/.intermediates/system/hardware/interfaces/media/android.media.audio.common.types-V4-ndk-source/gen/staging/android/media/audio/common/AudioHalVolumeCurve.cpp.d -h out/soong/.intermediates/system/hardware/interfaces/media/android.media.audio.common.types-V4-ndk-source/gen/include/staging -o out/soong/.intermediates/system/hardware/interfaces/media/android.media.audio.common.types-V4-ndk-source/gen/staging -Nsystem/hardware/interfaces/media/aidl system/hardware/interfaces/media/aidl/android/media/audio/common/AudioHalVolumeCurve.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 <cstdint>
13 #include <memory>
14 #include <optional>
15 #include <string>
16 #include <vector>
17 #include <android/binder_enums.h>
18 #include <android/binder_interface_utils.h>
19 #include <android/binder_parcelable_utils.h>
20 #include <android/binder_to_string.h>
21 #include <aidl/android/media/audio/common/AudioHalVolumeCurve.h>
22 #ifdef BINDER_STABILITY_SUPPORT
23 #include <android/binder_stability.h>
24 #endif // BINDER_STABILITY_SUPPORT
25
26 namespace aidl {
27 namespace android {
28 namespace media {
29 namespace audio {
30 namespace common {
31 class AudioHalVolumeCurve {
32 public:
33 typedef std::false_type fixed_size;
34 static const char* descriptor;
35
36 enum class DeviceCategory : int8_t {
37 HEADSET = 0,
38 SPEAKER = 1,
39 EARPIECE = 2,
40 EXT_MEDIA = 3,
41 HEARING_AID = 4,
42 };
43
44 class CurvePoint {
45 public:
46 typedef std::false_type fixed_size;
47 static const char* descriptor;
48
49 int8_t index = 0;
50 int32_t attenuationMb = 0;
51
52 binder_status_t readFromParcel(const AParcel* parcel);
53 binder_status_t writeToParcel(AParcel* parcel) const;
54
55 inline bool operator==(const CurvePoint& _rhs) const {
56 return std::tie(index, attenuationMb) == std::tie(_rhs.index, _rhs.attenuationMb);
57 }
58 inline bool operator<(const CurvePoint& _rhs) const {
59 return std::tie(index, attenuationMb) < std::tie(_rhs.index, _rhs.attenuationMb);
60 }
61 inline bool operator!=(const CurvePoint& _rhs) const {
62 return !(*this == _rhs);
63 }
64 inline bool operator>(const CurvePoint& _rhs) const {
65 return _rhs < *this;
66 }
67 inline bool operator>=(const CurvePoint& _rhs) const {
68 return !(*this < _rhs);
69 }
70 inline bool operator<=(const CurvePoint& _rhs) const {
71 return !(_rhs < *this);
72 }
73
74 static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
75 enum : int8_t { MIN_INDEX = 0 };
76 enum : int8_t { MAX_INDEX = 100 };
toString()77 inline std::string toString() const {
78 std::ostringstream _aidl_os;
79 _aidl_os << "CurvePoint{";
80 _aidl_os << "index: " << ::android::internal::ToString(index);
81 _aidl_os << ", attenuationMb: " << ::android::internal::ToString(attenuationMb);
82 _aidl_os << "}";
83 return _aidl_os.str();
84 }
85 };
86 ::aidl::android::media::audio::common::AudioHalVolumeCurve::DeviceCategory deviceCategory = ::aidl::android::media::audio::common::AudioHalVolumeCurve::DeviceCategory::SPEAKER;
87 std::vector<::aidl::android::media::audio::common::AudioHalVolumeCurve::CurvePoint> curvePoints;
88
89 binder_status_t readFromParcel(const AParcel* parcel);
90 binder_status_t writeToParcel(AParcel* parcel) const;
91
92 inline bool operator==(const AudioHalVolumeCurve& _rhs) const {
93 return std::tie(deviceCategory, curvePoints) == std::tie(_rhs.deviceCategory, _rhs.curvePoints);
94 }
95 inline bool operator<(const AudioHalVolumeCurve& _rhs) const {
96 return std::tie(deviceCategory, curvePoints) < std::tie(_rhs.deviceCategory, _rhs.curvePoints);
97 }
98 inline bool operator!=(const AudioHalVolumeCurve& _rhs) const {
99 return !(*this == _rhs);
100 }
101 inline bool operator>(const AudioHalVolumeCurve& _rhs) const {
102 return _rhs < *this;
103 }
104 inline bool operator>=(const AudioHalVolumeCurve& _rhs) const {
105 return !(*this < _rhs);
106 }
107 inline bool operator<=(const AudioHalVolumeCurve& _rhs) const {
108 return !(_rhs < *this);
109 }
110
111 static const ::ndk::parcelable_stability_t _aidl_stability = ::ndk::STABILITY_VINTF;
toString()112 inline std::string toString() const {
113 std::ostringstream _aidl_os;
114 _aidl_os << "AudioHalVolumeCurve{";
115 _aidl_os << "deviceCategory: " << ::android::internal::ToString(deviceCategory);
116 _aidl_os << ", curvePoints: " << ::android::internal::ToString(curvePoints);
117 _aidl_os << "}";
118 return _aidl_os.str();
119 }
120 };
121 } // namespace common
122 } // namespace audio
123 } // namespace media
124 } // namespace android
125 } // namespace aidl
126 namespace aidl {
127 namespace android {
128 namespace media {
129 namespace audio {
130 namespace common {
toString(AudioHalVolumeCurve::DeviceCategory val)131 [[nodiscard]] static inline std::string toString(AudioHalVolumeCurve::DeviceCategory val) {
132 switch(val) {
133 case AudioHalVolumeCurve::DeviceCategory::HEADSET:
134 return "HEADSET";
135 case AudioHalVolumeCurve::DeviceCategory::SPEAKER:
136 return "SPEAKER";
137 case AudioHalVolumeCurve::DeviceCategory::EARPIECE:
138 return "EARPIECE";
139 case AudioHalVolumeCurve::DeviceCategory::EXT_MEDIA:
140 return "EXT_MEDIA";
141 case AudioHalVolumeCurve::DeviceCategory::HEARING_AID:
142 return "HEARING_AID";
143 default:
144 return std::to_string(static_cast<int8_t>(val));
145 }
146 }
147 } // namespace common
148 } // namespace audio
149 } // namespace media
150 } // namespace android
151 } // namespace aidl
152 namespace ndk {
153 namespace internal {
154 #pragma clang diagnostic push
155 #pragma clang diagnostic ignored "-Wc++17-extensions"
156 template <>
157 constexpr inline std::array<aidl::android::media::audio::common::AudioHalVolumeCurve::DeviceCategory, 5> enum_values<aidl::android::media::audio::common::AudioHalVolumeCurve::DeviceCategory> = {
158 aidl::android::media::audio::common::AudioHalVolumeCurve::DeviceCategory::HEADSET,
159 aidl::android::media::audio::common::AudioHalVolumeCurve::DeviceCategory::SPEAKER,
160 aidl::android::media::audio::common::AudioHalVolumeCurve::DeviceCategory::EARPIECE,
161 aidl::android::media::audio::common::AudioHalVolumeCurve::DeviceCategory::EXT_MEDIA,
162 aidl::android::media::audio::common::AudioHalVolumeCurve::DeviceCategory::HEARING_AID,
163 };
164 #pragma clang diagnostic pop
165 } // namespace internal
166 } // namespace ndk
167