1 /* 2 * Copyright (c) 2024 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 MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_CALLBACK_H 17 #define MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_CALLBACK_H 18 #include "audio_group_manager.h" 19 #include "audio_system_manager.h" 20 #include "multimedia_audio_ffi.h" 21 22 namespace OHOS { 23 namespace AudioStandard { 24 class CjAudioRingerModeCallback : public AudioRingerModeCallback { 25 public: 26 CjAudioRingerModeCallback() = default; 27 virtual ~CjAudioRingerModeCallback() = default; 28 void RegisterFunc(std::function<void(int32_t)> cjCallback); 29 void OnRingerModeUpdated(const AudioRingerMode& ringerMode) override; 30 31 private: 32 std::function<void(int32_t)> func_ {}; 33 std::mutex cbMutex_; 34 }; 35 36 class CjAudioManagerMicStateChangeCallback : public AudioManagerMicStateChangeCallback { 37 public: 38 CjAudioManagerMicStateChangeCallback() = default; 39 virtual ~CjAudioManagerMicStateChangeCallback() = default; 40 void RegisterFunc(std::function<void(CMicStateChangeEvent)> cjCallback); 41 void OnMicStateUpdated(const MicStateChangeEvent& micStateChangeEvent) override; 42 43 private: 44 std::function<void(CMicStateChangeEvent)> func_ {}; 45 std::mutex cbMutex_; 46 }; 47 } // namespace AudioStandard 48 } // namespace OHOS 49 #endif // MULTIMEDIA_AUDIO_VOLUME_GROUP_MANAGER_CALLBACK_H 50