• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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_COLLABORATIVE_MANAGER_H
16 #define ST_AUDIO_COLLABORATIVE_MANAGER_H
17 #include <cstdint>
18 #include <memory>
19 #include "parcel.h"
20 #include "audio_device_descriptor.h"
21 
22 namespace OHOS {
23 namespace AudioStandard {
24 
25 class AudioCollaborativeManager {
26 public:
27     static AudioCollaborativeManager *GetInstance();
28 
29     /**
30      * @brief Check whether the collaborative is supported for local device
31      *
32      * @return Returns <b>true</b> if the collaborative is successfully enabled; returns <b>false</b> otherwise.
33      * @since 20
34      */
35     bool IsCollaborativePlaybackSupported();
36 
37     /**
38      * @brief Set the spatialization enabled or disabled by the specified device.
39      *
40      * @return Returns success or not
41      * @since 20
42      */
43     int32_t SetCollaborativePlaybackEnabledForDevice(
44         const std::shared_ptr<AudioDeviceDescriptor> &selectedAudioDevice, bool enabled);
45 
46     /**
47      * @brief Check whether the collaborative is supported for some device
48      *
49      * @return Returns <b>true</b> if the spatialization is supported; returns <b>false</b> otherwise.
50      * @since 20
51      */
52     bool IsCollaborativePlaybackEnabledForDevice(const std::shared_ptr<AudioDeviceDescriptor> &selectedAudioDevice);
53 private:
54     AudioCollaborativeManager();
55     virtual ~AudioCollaborativeManager();
56 };
57 
58 } // AudioStandard
59 } // OHOS
60 #endif
61