1 /* 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef ST_AUDIO_CONFIG_H 17 #define ST_AUDIO_CONFIG_H 18 19 #include <list> 20 #include <string> 21 22 #include "audio_info.h" 23 #include "audio_log.h" 24 25 #include <libxml/tree.h> 26 #include <libxml/parser.h> 27 28 namespace OHOS { 29 namespace AudioStandard { 30 static const std::string PRIMARY_CLASS = "primary"; 31 static const std::string A2DP_CLASS = "a2dp"; 32 static const std::string USB_CLASS = "usb"; 33 static const std::string FILE_CLASS = "file_io"; 34 static const std::string BLUETOOTH_SPEAKER = "Bt_Speaker"; 35 static const std::string PRIMARY_SPEAKER = "Speaker"; 36 static const std::string PRIMARY_MIC = "Built_in_mic"; 37 static const std::string FILE_SINK = "file_sink"; 38 static const std::string FILE_SOURCE = "file_source"; 39 static const std::string PIPE_SINK = "fifo_output"; 40 static const std::string PIPE_SOURCE = "fifo_input"; 41 static const std::string INTERNAL_PORT = "internal"; 42 static const std::string ROLE_SOURCE = "source"; 43 static const std::string ROLE_SINK = "sink"; 44 static const std::string PORT_NONE = "none"; 45 46 enum NodeName { 47 DEVICE_CLASS, 48 MODULES, 49 MODULE, 50 PORTS, 51 PORT, 52 AUDIO_INTERRUPT_ENABLE, 53 UPDATE_ROUTE_SUPPORT, 54 AUDIO_LATENCY, 55 SINK_LATENCY, 56 VOLUME_GROUP_CONFIG, 57 INTERRUPT_GROUP_CONFIG, 58 UNKNOWN 59 }; 60 61 enum ClassType { 62 TYPE_PRIMARY, 63 TYPE_A2DP, 64 TYPE_USB, 65 TYPE_FILE_IO, 66 TYPE_REMOTE_AUDIO, 67 TYPE_INVALID 68 }; 69 70 class AudioModuleInfo { 71 public: 72 AudioModuleInfo() = default; 73 virtual ~AudioModuleInfo() = default; 74 75 std::string className; 76 std::string name; 77 std::string adapterName; 78 std::string id; 79 std::string lib; 80 std::string role; 81 std::string rate; 82 std::string format; 83 std::string channels; 84 std::string bufferSize; 85 std::string fixedLatency; 86 std::string sinkLatency; 87 std::string renderInIdleState; 88 std::string OpenMicSpeaker; 89 std::string fileName; 90 std::string networkId; 91 std::string deviceType; 92 std::list<AudioModuleInfo> ports; 93 }; 94 } // namespace AudioStandard 95 } // namespace OHOS 96 97 #endif // ST_AUDIO_CONFIG_H 98