/src/ois/src/extras/LIRC/OISLIRCFactoryCreator.h

https://bitbucket.org/cabalistic/ogredeps/ · C++ Header · 98 lines · 40 code · 19 blank · 39 comment · 0 complexity · 6a66d4a732ed0790346f891285655fdd MD5 · raw file

  1. #include "OISConfig.h"
  2. #ifdef OIS_LIRC_SUPPORT
  3. /*
  4. The zlib/libpng License
  5. Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
  6. This software is provided 'as-is', without any express or implied warranty. In no event will
  7. the authors be held liable for any damages arising from the use of this software.
  8. Permission is granted to anyone to use this software for any purpose, including commercial
  9. applications, and to alter it and redistribute it freely, subject to the following
  10. restrictions:
  11. 1. The origin of this software must not be misrepresented; you must not claim that
  12. you wrote the original software. If you use this software in a product,
  13. an acknowledgment in the product documentation would be appreciated but is
  14. not required.
  15. 2. Altered source versions must be plainly marked as such, and must not be
  16. misrepresented as being the original software.
  17. 3. This notice may not be removed or altered from any source distribution.
  18. */
  19. #ifndef OIS_LIRCFactoryCreator_H
  20. #define OIS_LIRCFactoryCreator_H
  21. #include "OISPrereqs.h"
  22. #include "OISFactoryCreator.h"
  23. #include "OISLIRC.h"
  24. namespace OIS
  25. {
  26. //Forward declare local classes
  27. class LIRCControl;
  28. /** LIRC Factory Creator Class */
  29. class _OISExport LIRCFactoryCreator : public FactoryCreator
  30. {
  31. public:
  32. LIRCFactoryCreator();
  33. ~LIRCFactoryCreator();
  34. //FactoryCreator Overrides
  35. /** @copydoc FactoryCreator::deviceList */
  36. DeviceList freeDeviceList();
  37. /** @copydoc FactoryCreator::totalDevices */
  38. int totalDevices(Type iType);
  39. /** @copydoc FactoryCreator::freeDevices */
  40. int freeDevices(Type iType);
  41. /** @copydoc FactoryCreator::vendorExist */
  42. bool vendorExist(Type iType, const std::string & vendor);
  43. /** @copydoc FactoryCreator::createObject */
  44. Object* createObject(InputManager* creator, Type iType, bool bufferMode, const std::string & vendor = "");
  45. /** @copydoc FactoryCreator::destroyObject */
  46. void destroyObject(Object* obj);
  47. protected:
  48. //! Gets a list of all remotes available
  49. void discoverRemotes();
  50. //! Connects to LIRC server
  51. void enableConnection(bool enable, bool blocking = true);
  52. //! Creates/destroys threaded read
  53. void enableConnectionThread(bool enable);
  54. void threadUpdate();
  55. std::string mIP;
  56. std::string mPort;
  57. bool mConnected;
  58. volatile bool mThreadRunning;
  59. std::map<std::string, LIRCControl*> mUpdateRemotes;
  60. //! List of vendor named remotes that are not used yet
  61. std::vector<std::string> mUnusedRemotes;
  62. //! Information about enumerated remotes
  63. std::map<std::string, RemoteInfo> mJoyStickInformation;
  64. //! Number of total found remotes
  65. int mCount;
  66. //! Get the slow boost header includes from this header by using a proxy wrapper
  67. class BoostWrapper;
  68. //! Wrapped objects
  69. BoostWrapper *mWrapped;
  70. };
  71. }
  72. #endif //OIS_LIRCFactoryCreator_H
  73. #endif