xbmc
AESinkFactory.h
1 /*
2  * Copyright (C) 2010-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "Utils/AEAudioFormat.h"
12 #include "Utils/AEDeviceInfo.h"
13 
14 #include <map>
15 #include <stdint.h>
16 #include <string>
17 #include <vector>
18 
19 class IAESink;
20 
21 namespace AE
22 {
23 
24 struct AESinkInfo
25 {
26  std::string m_sinkName;
27  AEDeviceInfoList m_deviceInfoList;
28 };
29 
30 typedef IAESink* (*CreateSink)(std::string &device, AEAudioFormat &desiredFormat);
31 typedef void (*Enumerate)(AEDeviceInfoList &list, bool force);
32 typedef void (*Cleanup)();
33 
35 {
36  std::string sinkName;
37  CreateSink createFunc = nullptr;
38  Enumerate enumerateFunc = nullptr;
39  Cleanup cleanupFunc = nullptr;
40 };
41 
43 {
44 public:
45  static void RegisterSink(const AESinkRegEntry& regEntry);
46  static void ClearSinks();
47  static bool HasSinks();
48 
49  static void ParseDevice(std::string &device, std::string &driver);
50  static IAESink *Create(std::string &device, AEAudioFormat &desiredFormat);
51  static void EnumerateEx(std::vector<AESinkInfo>& list, bool force, const std::string& driver);
52  static void Cleanup();
53 
54 protected:
55  static std::map<std::string, AESinkRegEntry> m_AESinkRegEntry;
56 };
57 
58 }
Definition: AESinkFactory.h:24
Definition: AESinkFactory.h:21
Definition: AESink.h:18
Definition: AESinkFactory.h:42
The audio format structure that fully defines a stream&#39;s audio information.
Definition: AEAudioFormat.h:19
Definition: AESinkFactory.h:34