kodi
AEChannelInfo.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 "AEChannelData.h"
12 
13 #include <stdint.h>
14 #include <string>
15 #include <vector>
16 
17 class CHelper_libKODI_audioengine;
18 
20  friend class CHelper_libKODI_audioengine;
21 
22 public:
24  explicit CAEChannelInfo(const enum AEChannel* rhs);
25  CAEChannelInfo(const enum AEStdChLayout rhs);
26  ~CAEChannelInfo() = default;
27  CAEChannelInfo(const CAEChannelInfo&) = default;
28  CAEChannelInfo& operator=(const CAEChannelInfo& rhs);
29  CAEChannelInfo& operator=(const enum AEChannel* rhs);
30  CAEChannelInfo& operator=(const enum AEStdChLayout rhs);
31  bool operator==(const CAEChannelInfo& rhs) const;
32  bool operator!=(const CAEChannelInfo& rhs) const;
33  CAEChannelInfo& operator+=(const enum AEChannel& rhs);
34  CAEChannelInfo& operator-=(const enum AEChannel& rhs);
35  enum AEChannel operator[](unsigned int i) const;
36  operator std::string() const;
37 
38  /* remove any channels that dont exist in the provided info */
39  void ResolveChannels(const CAEChannelInfo& rhs);
40  void Reset();
41  inline unsigned int Count() const { return m_channelCount; }
42  static const char* GetChName(const enum AEChannel ch);
43  bool HasChannel(const enum AEChannel ch) const;
44  bool IsChannelValid(const unsigned int pos);
45  bool IsLayoutValid();
46  bool ContainsChannels(const CAEChannelInfo& rhs) const;
47  void ReplaceChannel(const enum AEChannel from, const enum AEChannel to);
48  int BestMatch(const std::vector<CAEChannelInfo>& dsts, int* score = NULL) const;
49  void AddMissingChannels(const CAEChannelInfo& rhs);
50 
51 private:
52  unsigned int m_channelCount;
53  enum AEChannel m_channels[AE_CH_MAX];
54 };
55 
Definition: LibInputPointer.h:13
Definition: AEChannelInfo.h:19