OIS  1.5
Object-oriented Input System
OISLIRC.h
Go to the documentation of this file.
1 #include "OISConfig.h"
2 #ifdef OIS_LIRC_SUPPORT
3 /*
4 The zlib/libpng License
5 
6 Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
7 
8 This software is provided 'as-is', without any express or implied warranty. In no event will
9 the authors be held liable for any damages arising from the use of this software.
10 
11 Permission is granted to anyone to use this software for any purpose, including commercial
12 applications, and to alter it and redistribute it freely, subject to the following
13 restrictions:
14 
15  1. The origin of this software must not be misrepresented; you must not claim that
16  you wrote the original software. If you use this software in a product,
17  an acknowledgment in the product documentation would be appreciated but is
18  not required.
19 
20  2. Altered source versions must be plainly marked as such, and must not be
21  misrepresented as being the original software.
22 
23  3. This notice may not be removed or altered from any source distribution.
24 */
25 #ifndef OIS_LIRC_H
26 #define OIS_LIRC_H
27 #include "OISJoyStick.h"
28 #include "OISLIRCRingBuffer.h"
29 
30 namespace OIS
31 {
32  class LIRCFactoryCreator;
33 
34  struct RemoteInfo
35  {
36  RemoteInfo() :
37  buttons(0) {}
38 
39  RemoteInfo(const RemoteInfo& other)
40  {
41  buttons = other.buttons;
42  buttonMap = other.buttonMap;
43  }
44 
45  int buttons;
46  std::map<std::string, int> buttonMap;
47  };
48 
49 //Number of ring buffer events. should be nice sized (the structure is not very big)
50 //Will be rounded up to power of two automatically
51 #define OIS_LIRC_EVENT_BUFFER 16
52 
54  class _OISExport LIRCControl : public JoyStick
55  {
56  friend class LIRCFactoryCreator;
57 
58  public:
59  LIRCControl(InputManager* creator, int id, bool buffered, LIRCFactoryCreator* local_creator, RemoteInfo& info);
60  ~LIRCControl();
61 
62  //Overrides of Object
64  void setBuffered(bool buffered);
65 
67  void capture();
68 
70  Interface* queryInterface(Interface::IType type);
71 
73  void _initialize();
74 
75  protected:
77  void queueButtonPressed(const std::string& id);
78 
80  LIRCFactoryCreator* mLIRCCreator;
81 
83  LIRCRingBuffer mRingBuffer;
84 
86  RemoteInfo mInfo;
87  };
88 }
89 #endif //OIS_LIRC_H
90 #endif
#define _OISExport
Definition: OISPrereqs.h:40
IType
Type of Interface.
Definition: OISInterface.h:40
Definition: OISEffect.h:28