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 #ifndef AUDIO_ENGINE_MANAGER_H
16 #define AUDIO_ENGINE_MANAGER_H
17 #include <unordered_map>
18 #include "audio_playback_engine.h"
19 
20 namespace OHOS {
21 namespace AudioStandard {
22 enum class PlaybackType : int32_t {
23     DIRECT,
24     VOIP
25 };
26 class AudioEngineManager {
27 public:
28     static AudioEngineManager GetInstance();
29     ~AudioEngineManager() = default;
30     void AddRenderer(std::shared_ptr<IRendererStream> stream, DeviceInfo device);
31     void RemoveRenderer(std::shared_ptr<IRendererStream> stream);
32 
33 private:
34     AudioEngineManager() = default;
35 
36 private:
37     std::unordered_map<PlaybackType, std::shared_ptr<AudioPlaybackEngine>> renderEngines_;
38 };
39 } // namespace AudioStandard
40 } // namespace OHOS
41 #endif
42