aboutsummaryrefslogtreecommitdiff
path: root/xbmc/platform/linux/OptionalsReg.cpp
blob: 3992f2a0d05b0728291fc707e116df7fd90ef5b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
 *  Copyright (C) 2005-2018 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#include "OptionalsReg.h"


//-----------------------------------------------------------------------------
// ALSA
//-----------------------------------------------------------------------------

#ifdef HAS_ALSA
#include "cores/AudioEngine/Sinks/AESinkALSA.h"
bool OPTIONALS::ALSARegister()
{
  CAESinkALSA::Register();
  return true;
}
#else
bool OPTIONALS::ALSARegister()
{
  return false;
}
#endif

//-----------------------------------------------------------------------------
// PulseAudio
//-----------------------------------------------------------------------------

#ifdef HAS_PULSEAUDIO
#include "cores/AudioEngine/Sinks/AESinkPULSE.h"
bool OPTIONALS::PulseAudioRegister(bool allowPipeWireCompatServer)
{
  bool ret = CAESinkPULSE::Register(allowPipeWireCompatServer);
  return ret;
}
#else
bool OPTIONALS::PulseAudioRegister(bool)
{
  return false;
}
#endif

//-----------------------------------------------------------------------------
// Pipewire
//-----------------------------------------------------------------------------

#ifdef HAS_PIPEWIRE
#include "cores/AudioEngine/Sinks/pipewire/AESinkPipewire.h"
bool OPTIONALS::PipewireRegister()
{
  bool ret = AE::SINK::CAESinkPipewire::Register();
  return ret;
}
#else
bool OPTIONALS::PipewireRegister()
{
  return false;
}
#endif

//-----------------------------------------------------------------------------
// sndio
//-----------------------------------------------------------------------------

#ifdef HAS_SNDIO
#include "cores/AudioEngine/Sinks/AESinkSNDIO.h"
bool OPTIONALS::SndioRegister()
{
  CAESinkSNDIO::Register();
  return true;
}
#else
bool OPTIONALS::SndioRegister()
{
  return false;
}
#endif

//-----------------------------------------------------------------------------
// Lirc
//-----------------------------------------------------------------------------

#ifdef HAS_LIRC
#include "platform/linux/input/LIRC.h"
#include "ServiceBroker.h"
class OPTIONALS::CLircContainer
{
public:
  CLircContainer()
  {
    m_lirc.Start();
  }
protected:
  CLirc m_lirc;
};
#else
class OPTIONALS::CLircContainer
{
};
#endif

OPTIONALS::CLircContainer* OPTIONALS::LircRegister()
{
  return new CLircContainer();
}
void OPTIONALS::delete_CLircContainer::operator()(CLircContainer *p) const
{
  delete p;
}