• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024-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
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.IDAudioHdfCallback;
33import ohos.hdi.distributed_audio.audioext.v2_0.Types;
34
35/**
36 * @brief Basic operations of Distributed Audio devices
37 *
38 * Register and unregister distributed audio devices, and provide event notification
39 * mechanisms for distributed audio SA to the HDF layer.
40 *
41 * @since 5.0
42 * @version 2.0
43 */
44interface IDAudioManager {
45    /**
46     * @brief Registering distributed audio device drivers
47     *
48     * @param adpName Distributed audio device NetworkID.
49     * @param devId Distributed audio device Port ID.
50     * @param capability Distributed audio device capability set (including sampling rate, channels, etc).
51     * @param callbackObj Distributed Audio SA Callback.
52     *
53     * @return a value of 0 if success and a negative value if failed.
54     *
55     * @since 5.0
56     * @version 2.0
57     */
58    RegisterAudioDevice([in] String adpName, [in] int devId, [in] String capability, [in] IDAudioCallback callbackObj);
59
60    /**
61     * @brief Unregistering distributed audio device drivers
62     *
63     * @param adpName Distributed audio device NetworkID.
64     * @param devId Distributed audio device Port ID.
65     *
66     * @return a value of 0 if success and a negative value if failed.
67     *
68     * @since 5.0
69     * @version 2.0
70     */
71    UnRegisterAudioDevice([in] String adpName, [in] int devId);
72
73    /**
74     * @brief Distribute audio device SA notification events.
75     *
76     * @param adpName Distributed audio device NetworkID.
77     * @param devId Distributed audio device Port ID.
78     * @param streamId Stream ID for distributed audio devices.
79     * @param event Notification event types (such as focus events, volume events).
80     *
81     * @return a value of 0 if success and a negative value if failed.
82     *
83     * @since 5.0
84     * @version 2.0
85     */
86    NotifyEvent([in] String adpName, [in] int devId, [in] int streamId, [in] struct DAudioEvent event);
87
88    /**
89     * @brief Registering distributed audio HDF drivers listener.
90     *
91     * @param serviceName Service name.
92     * @param callbackObj Distributed Audio HDF listener Callback.
93     *
94     * @return a value of 0 if success and a negative value if failed.
95     *
96     * @since 6.0
97     * @version 1.0
98     */
99    RegisterAudioHdfListener([in] String serviceName, [in] IDAudioHdfCallback callbackObj);
100
101    /**
102     * @brief Unregistering distributed audio HDF drivers listener.
103     *
104     * @param serviceName Service name.
105     *
106     * @return a value of 0 if success and a negative value if failed.
107     *
108     * @since 6.0
109     * @version 1.0
110     */
111    UnRegisterAudioHdfListener([in] String serviceName);
112}