1 /* 2 * Copyright (c) 2021-2025 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 #ifndef ST_AUDIO_TONE_MANAGER_H 16 #define ST_AUDIO_TONE_MANAGER_H 17 18 #include <bitset> 19 #include <list> 20 #include <string> 21 #include <unordered_map> 22 #include <unordered_set> 23 #include <mutex> 24 #include "singleton.h" 25 #include "audio_group_handle.h" 26 #include "audio_manager_base.h" 27 #include "audio_module_info.h" 28 #include "audio_volume_config.h" 29 #include "audio_ec_info.h" 30 #include "datashare_helper.h" 31 #include "audio_errors.h" 32 33 namespace OHOS { 34 namespace AudioStandard { 35 36 class AudioToneManager { 37 public: GetInstance()38 static AudioToneManager& GetInstance() 39 { 40 static AudioToneManager instance; 41 return instance; 42 } 43 #ifdef FEATURE_DTMF_TONE 44 bool LoadToneDtmfConfig(); 45 std::vector<int32_t> GetSupportedTones(const std::string &countryCode); 46 std::shared_ptr<ToneInfo> GetToneConfig(int32_t ltonetype, const std::string &countryCode); 47 #endif 48 private: AudioToneManager()49 AudioToneManager() {} ~AudioToneManager()50 ~AudioToneManager() {} 51 private: 52 #ifdef FEATURE_DTMF_TONE 53 std::unordered_map<int32_t, std::shared_ptr<ToneInfo>> toneDescriptorMap_; 54 std::unordered_map<std::string, std::unordered_map<int32_t, std::shared_ptr<ToneInfo>>> customToneDescriptorMap_; 55 #endif 56 }; 57 58 } 59 } 60 61 #endif