2 * Copyright (C) 2014-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.
11 #include "platform/Platform.h"
17 #include <alsa/asoundlib.h>
19 class CALSAHControlMonitor
: public IPlatformService
22 CALSAHControlMonitor();
23 ~CALSAHControlMonitor();
25 bool Add(const std::string
& ctlHandleName
,
26 snd_ctl_elem_iface_t interface
,
28 const std::string
& name
);
36 static int HCTLCallback(snd_hctl_elem_t
*elem
, unsigned int mask
);
37 static void FDEventCallback(int id
, int fd
, short revents
, void *data
);
39 snd_hctl_t
* GetHandle(const std::string
& ctlHandleName
);
40 void PutHandle(const std::string
& ctlHandleName
);
47 explicit CTLHandle(snd_hctl_t
*handle_
) : handle(handle_
) {}
48 CTLHandle() : handle(NULL
) {}
51 std::map
<std::string
, CTLHandle
> m_ctlHandles
;
53 std::vector
<int> m_fdMonitorIds
;