Android-cuttlefish cvd tool
audio_settings.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 The Android Open Source Project
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 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <cstdint>
20#include <optional>
21
22namespace cuttlefish {
23
25 Mono,
26 Stereo,
28};
29
31 enum class Direction {
32 Playback,
33 Capture,
34 };
35
37 uint32_t min = 0;
38 uint32_t max = 100;
39 uint32_t step = 1;
40 };
41
42 uint8_t id = 0;
45
46 bool has_mute_control = false;
47 std::optional<VolumeControl> master_volume_control;
48};
49
52 uint32_t sample_rate = 48000;
53};
54
55static constexpr inline uint8_t GetChannelsCount(AudioChannelsLayout layout) {
56 switch (layout) {
58 return 1;
60 return 2;
62 return 6;
63 }
64}
65
66} // namespace cuttlefish
Definition: alloc_driver.h:20
static constexpr uint8_t GetChannelsCount(AudioChannelsLayout layout)
Definition: audio_settings.h:55
AudioChannelsLayout
Definition: audio_settings.h:24
Definition: audio_settings.h:50
uint32_t sample_rate
Definition: audio_settings.h:52
AudioChannelsLayout channels_layout
Definition: audio_settings.h:51
Definition: audio_settings.h:36
uint32_t step
Definition: audio_settings.h:39
uint32_t max
Definition: audio_settings.h:38
uint32_t min
Definition: audio_settings.h:37
Definition: audio_settings.h:30
AudioChannelsLayout channels_layout
Definition: audio_settings.h:43
Direction
Definition: audio_settings.h:31
Direction direction
Definition: audio_settings.h:44
std::optional< VolumeControl > master_volume_control
Definition: audio_settings.h:47
bool has_mute_control
Definition: audio_settings.h:46