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 "media_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 BLUETOOTH_SPEAKER = "Bt_Speaker"; 34 static const std::string PRIMARY_SPEAKER = "Speaker"; 35 static const std::string PRIMARY_MIC = "Built_in_mic"; 36 static const std::string PIPE_SINK = "fifo_output"; 37 static const std::string PIPE_SOURCE = "fifo_input"; 38 static const std::string INTERNAL_PORT = "internal"; 39 static const std::string ROLE_SOURCE = "source"; 40 static const std::string ROLE_SINK = "sink"; 41 static const std::string PORT_NONE = "none"; 42 43 enum NodeName { 44 DEVICE_CLASS, 45 MODULES, 46 MODULE, 47 PORTS, 48 PORT, 49 AUDIO_INTERRUPT_ENABLE, 50 UNKNOWN 51 }; 52 53 enum ClassType { 54 TYPE_PRIMARY, 55 TYPE_A2DP, 56 TYPE_USB, 57 TYPE_INVALID 58 }; 59 60 class AudioModuleInfo { 61 public: 62 AudioModuleInfo() = default; 63 virtual ~AudioModuleInfo() = default; 64 65 std::string className; 66 std::string name; 67 std::string adapterName; 68 std::string id; 69 std::string lib; 70 std::string role; 71 std::string rate; 72 std::string format; 73 std::string channels; 74 std::string bufferSize; 75 std::string fileName; 76 std::list<AudioModuleInfo> ports; 77 }; 78 } // namespace AudioStandard 79 } // namespace OHOS 80 81 #endif // ST_AUDIO_CONFIG_H 82