Merge pull request #4592 from koying/fixlinhotplug
[vuplus_xbmc] / xbmc / input / linux / LinuxInputDevices.h
index fa6f3e0..384a83a 100644 (file)
@@ -1,6 +1,6 @@
 /*
- *      Copyright (C) 2005-2009 Team XBMC
- *      http://www.xbmc.org
+ *      Copyright (C) 2005-2013 Team XBMC
+ *      http://xbmc.org
  *
  *  This Program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -13,9 +13,8 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with XBMC; see the file COPYING.  If not, write to
- *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- *  http://www.gnu.org/copyleft/gpl.html
+ *  along with XBMC; see the file COPYING.  If not, see
+ *  <http://www.gnu.org/licenses/>.
  *
  */
 #ifndef LINUXINPUTDEVICES_H_
@@ -42,6 +41,8 @@ public:
   CLinuxInputDevice(const std::string fileName, int index);
   ~CLinuxInputDevice();
   XBMC_Event ReadEvent();
+  const std::string& GetFileName();
+  bool IsUnplugged();
  
 private:
   void SetupKeyboardAutoRepeat(int fd);
@@ -77,19 +78,24 @@ private:
   int m_deviceMaxKeyCode;
   int m_deviceMaxAxis;
   bool m_bSkipNonKeyEvents;
+  bool m_bUnplugged;
 };
 
 class CLinuxInputDevices
 {
 public:
   void InitAvailable();
+  void CheckHotplugged();
   XBMC_Event ReadEvent();
   bool IsRemoteLowBattery();
   bool IsRemoteNotPaired();
+  size_t Size() { return m_devices.size(); }
 private:
   CCriticalSection m_devicesListLock;
   bool CheckDevice(const char *device);
   std::vector<CLinuxInputDevice*> m_devices;
+  bool m_bReInitialize;
+  time_t m_lastHotplugCheck;
 };
 
 #endif /* LINUXINPUTDEVICES_H_ */