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/** 17 * @addtogroup Distributed Audio 18 * @{ 19 * 20 * @brief Provides APIs for registration, unregistration, and event notification. 21 * 22 * The interface for the distributed audio, providing hardware driver registration, 23 * unregistration, and event notification capabilities for distributed audio SA. 24 * 25 * @since 5.0 26 * @version 2.0 27 */ 28 29package ohos.hdi.distributed_audio.audioext.v2_0; 30 31import ohos.hdi.distributed_audio.audioext.v2_0.IDAudioCallback; 32import ohos.hdi.distributed_audio.audioext.v2_0.Types; 33 34/** 35 * @brief Basic operations of Distributed Audio devices 36 * 37 * Register and unregister distributed audio devices, and provide event notification 38 * mechanisms for distributed audio SA to the HDF layer. 39 * 40 * @since 5.0 41 * @version 2.0 42 */ 43interface IDAudioManager { 44 /** 45 * @brief Registering distributed audio device drivers 46 * 47 * @param adpName Distributed audio device NetworkID. 48 * @param devId Distributed audio device Port ID. 49 * @param capability Distributed audio device capability set (including sampling rate, channels, etc). 50 * @param callbackObj Distributed Audio SA Callback. 51 * 52 * @return a value of 0 if success and a negative value if failed. 53 * 54 * @since 5.0 55 * @version 2.0 56 */ 57 RegisterAudioDevice([in] String adpName, [in] int devId, [in] String capability, [in] IDAudioCallback callbackObj); 58 59 /** 60 * @brief Unregistering distributed audio device drivers 61 * 62 * @param adpName Distributed audio device NetworkID. 63 * @param devId Distributed audio device Port ID. 64 * 65 * @return a value of 0 if success and a negative value if failed. 66 * 67 * @since 5.0 68 * @version 2.0 69 */ 70 UnRegisterAudioDevice([in] String adpName, [in] int devId); 71 72 /** 73 * @brief Distribute audio device SA notification events. 74 * 75 * @param adpName Distributed audio device NetworkID. 76 * @param devId Distributed audio device Port ID. 77 * @param streamId Stream ID for distributed audio devices. 78 * @param event Notification event types (such as focus events, volume events). 79 * 80 * @return a value of 0 if success and a negative value if failed. 81 * 82 * @since 5.0 83 * @version 2.0 84 */ 85 NotifyEvent([in] String adpName, [in] int devId, [in] int streamId, [in] struct DAudioEvent event); 86}