[videodb] remove unused seasons table from episode_view
[xbmc.git] / xbmc / cores / AudioEngine / AESinkFactory.h
blob18b2eff09cf60cbd459218a3a8fe643fcd386913
1 /*
2 * Copyright (C) 2010-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "Utils/AEAudioFormat.h"
12 #include "Utils/AEDeviceInfo.h"
14 #include <functional>
15 #include <map>
16 #include <memory>
17 #include <stdint.h>
18 #include <string>
19 #include <vector>
21 class IAESink;
23 namespace AE
26 struct AESinkInfo
28 std::string m_sinkName;
29 AEDeviceInfoList m_deviceInfoList;
32 using CreateSink =
33 std::function<std::unique_ptr<IAESink>(std::string& device, AEAudioFormat& desiredFormat)>;
34 using Enumerate = std::function<void(AEDeviceInfoList& list, bool force)>;
35 using Cleanup = std::function<void()>;
37 struct AESinkRegEntry
39 std::string sinkName;
40 CreateSink createFunc;
41 Enumerate enumerateFunc;
42 Cleanup cleanupFunc;
45 struct AESinkDevice
47 std::string driver;
48 std::string name;
49 std::string friendlyName;
51 bool IsSameDeviceAs(const AESinkDevice& d) const
53 return driver == d.driver && (name == d.name || friendlyName == d.friendlyName);
57 class CAESinkFactory
59 public:
60 static void RegisterSink(const AESinkRegEntry& regEntry);
61 static void ClearSinks();
62 static bool HasSinks();
64 static AESinkDevice ParseDevice(const std::string& device);
65 static std::unique_ptr<IAESink> Create(const std::string& device, AEAudioFormat& desiredFormat);
66 static void EnumerateEx(std::vector<AESinkInfo>& list, bool force, const std::string& driver);
67 static void Cleanup();
69 protected:
70 static std::map<std::string, AESinkRegEntry> m_AESinkRegEntry;