summaryrefslogtreecommitdiffstats
path: root/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2017-07-23 16:59:43 +0200
committermanuel <manuel@mausz.at>2017-07-23 16:59:43 +0200
commit4c3251ec645c8b71820dab7e51e612e5919d4e75 (patch)
tree9533268a93e58fc2e16de1b8ee3fafe3784e5225 /xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h
parentf44ecaa4f27e7538ddcad66d40e543bffa2d2d86 (diff)
downloadkodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.tar.gz
kodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.tar.bz2
kodi-pvr-build-4c3251ec645c8b71820dab7e51e612e5919d4e75.zip
sync with upstream
Diffstat (limited to 'xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h')
-rw-r--r--xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h103
1 files changed, 0 insertions, 103 deletions
diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h
deleted file mode 100644
index d1d8e4b..0000000
--- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h
+++ /dev/null
@@ -1,103 +0,0 @@
1/*
2 * Copyright (C) 2014-2017 Team Kodi
3 * http://kodi.tv
4 *
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
8 * any later version.
9 *
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this Program; see the file COPYING. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 */
20#pragma once
21
22#include "libXBMC_addon.h"
23#include "kodi_peripheral_types.h"
24
25#include <string>
26#include <stdio.h>
27
28#if defined(ANDROID)
29 #include <sys/stat.h>
30#endif
31
32namespace ADDON
33{
34
35class CHelper_libKODI_peripheral
36{
37public:
38 CHelper_libKODI_peripheral(void)
39 {
40 m_Handle = nullptr;
41 m_Callbacks = nullptr;
42 }
43
44 ~CHelper_libKODI_peripheral(void)
45 {
46 }
47
48 /*!
49 * @brief Resolve all callback methods
50 * @param handle Pointer to the add-on
51 * @return True when all methods were resolved, false otherwise.
52 */
53 bool RegisterMe(void* handle)
54 {
55 m_Handle = static_cast<AddonCB*>(handle);
56 if (m_Handle)
57 m_Callbacks = (AddonInstance_Peripheral*)m_Handle->PeripheralLib_RegisterMe(m_Handle->addonData);
58 if (!m_Callbacks)
59 fprintf(stderr, "libKODI_peripheral-ERROR: PeripheralLib_register_me can't get callback table from Kodi !!!\n");
60
61 return m_Callbacks != nullptr;
62 }
63
64 /*!
65 * @brief Trigger a scan for peripherals
66 *
67 * The add-on calls this if a change in hardware is detected.
68 */
69 void TriggerScan(void)
70 {
71 return m_Callbacks->toKodi.TriggerScan(m_Callbacks->toKodi.kodiInstance);
72 }
73
74 /*!
75 * @brief Notify the frontend that button maps have changed
76 *
77 * @param[optional] deviceName The name of the device to refresh, or empty/null for all devices
78 * @param[optional] controllerId The controller ID to refresh, or empty/null for all controllers
79 */
80 void RefreshButtonMaps(const std::string& strDeviceName = "", const std::string& strControllerId = "")
81 {
82 return m_Callbacks->toKodi.RefreshButtonMaps(m_Callbacks->toKodi.kodiInstance, strDeviceName.c_str(), strControllerId.c_str());
83 }
84
85 /*!
86 * @brief Return the number of features belonging to the specified controller
87 *
88 * @param controllerId The controller ID to enumerate
89 * @param type[optional] Type to filter by, or JOYSTICK_FEATURE_TYPE_UNKNOWN for all features
90 *
91 * @return The number of features matching the request parameters
92 */
93 unsigned int FeatureCount(const std::string& strControllerId, JOYSTICK_FEATURE_TYPE type = JOYSTICK_FEATURE_TYPE_UNKNOWN)
94 {
95 return m_Callbacks->toKodi.FeatureCount(m_Callbacks->toKodi.kodiInstance, strControllerId.c_str(), type);
96 }
97
98private:
99 AddonCB* m_Handle;
100 AddonInstance_Peripheral* m_Callbacks;
101};
102
103} /* namespace ADDON */