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 OHAudio
18  * @{
19  *
20  * @brief Provide the definition of the C interface for the audio module.
21  *
22  * @syscap SystemCapability.Multimedia.Audio.Core
23  *
24  * @since 12
25  * @version 1.0
26  */
27 
28 /**
29  * @file native_audio_manager.h
30  *
31  * @brief Declare audio manager related interfaces.
32  *
33  * @library libohaudio.so
34  * @syscap SystemCapability.Multimedia.Audio.Core
35  * @kit AudioKit
36  * @since 12
37  * @version 1.0
38  */
39 #ifndef NATIVE_AUDIO_MANAGER_H
40 #define NATIVE_AUDIO_MANAGER_H
41 
42 #include "native_audio_common.h"
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /**
48  * @brief Declare the audio manager.
49  * The handle of audio manager is used for audio management related functions.
50  *
51  * @since 12
52  */
53 typedef struct OH_AudioManager OH_AudioManager;
54 
55 /**
56  * @brief Get audio manager handle.
57  *
58  * @param audioManager the {@link OH_AudioManager} handle received from this function.
59  * @return Function result code:
60  *         {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.
61  *         {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:
62  *                                                        1.The param of audioManager is nullptr;
63  * @since 12
64  */
65 OH_AudioCommon_Result OH_GetAudioManager(OH_AudioManager **audioManager);
66 
67 /**
68  * @brief Get audio scene.
69  * @param audioManager the {@link OH_AudioManager} handle received from {@link OH_GetAudioManager}.
70  * @param scene the {@link OH_AudioScene} pointer to receive the result.
71  * @return Function result code:
72  *         {@link AUDIOCOMMON_RESULT_SUCCESS} If the execution is successful.
73  *         {@link AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM}:
74  *                                                        1.The param of audioManager is nullptr;
75  *                                                        2.The param of scene is nullptr.
76  * @since 12
77  */
78 OH_AudioCommon_Result OH_GetAudioScene(OH_AudioManager* manager, OH_AudioScene *scene);
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 /** @} */
84 #endif // NATIVE_AUDIO_ROUTING_MANAGER_H