[XAudio2] share Xbox audio device enumeration with desktop and Windows 8.1 compatibility
[xbmc.git] / xbmc / platform / win10 / input / RemoteControlXbox.h
blob40a3c045305daa0be2fa4a7677266434a8e3865a
1 /*
2 * Copyright (C) 2005-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 <chrono>
12 #include <string>
14 #include <winrt/Windows.Media.h>
16 class CRemoteControlXbox
18 public:
19 CRemoteControlXbox();
20 virtual ~CRemoteControlXbox();
21 void Initialize();
22 void Disconnect();
23 bool IsRemoteDevice(const std::wstring &deviceId) const;
25 private:
26 void HandleAcceleratorKey(const winrt::Windows::UI::Core::CoreDispatcher&, const winrt::Windows::UI::Core::AcceleratorKeyEventArgs&);
27 void HandleMediaButton(const winrt::Windows::Media::SystemMediaTransportControlsButtonPressedEventArgs&);
28 int32_t TranslateVirtualKey(winrt::Windows::System::VirtualKey vk);
29 int32_t TranslateMediaKey(winrt::Windows::Media::SystemMediaTransportControlsButton mk);
31 bool m_bInitialized;
32 std::chrono::time_point<std::chrono::steady_clock> m_firstClickTime;
33 uint32_t m_repeatCount;
34 winrt::event_token m_token;
35 winrt::event_token m_mediatoken;