cmil::SDL::SDLControllers::Device Class Reference

This class encapsulates individual joystick information. More...

#include <SDLTranslator.h>

List of all members.

Public Member Functions

 Device (const GameController &joy, SDL_Joystick *opened)
 This initializes the conversion structures from a base game controller definition.
virtual ~Device ()
AxisgetAxis (unsigned int id) const
HatgetHat (unsigned int id) const
PressgetButton (unsigned int id) const
MotiongetBall (unsigned int id) const
std::string getName () const

Private Attributes

tInputIndex< Axism_axes
tInputIndex< Hatm_hats
tInputIndex< Pressm_buttons
tInputIndex< Motionm_balls
SDL_Joystick * m_opened_sdl_joy


Detailed Description

This class encapsulates individual joystick information.

Definition at line 226 of file SDLTranslator.h.


Constructor & Destructor Documentation

cmil::SDL::SDLControllers::Device::Device ( const GameController joy,
SDL_Joystick *  opened 
)

This initializes the conversion structures from a base game controller definition.

Definition at line 453 of file SDLTranslator.cpp.

00453                                                                                   :
00454      m_axes(joy.m_axes), 
00455      m_hats(joy.m_hats), 
00456      m_buttons(joy.m_buttons), 
00457      m_balls(joy.m_balls), 
00458      m_opened_sdl_joy(opened) 
00459     {};

virtual cmil::SDL::SDLControllers::Device::~Device (  )  [inline, virtual]

Definition at line 230 of file SDLTranslator.h.

References m_opened_sdl_joy.

00230                               {
00231               if(SDL_WasInit(SDL_INIT_JOYSTICK)) 
00232                 if(m_opened_sdl_joy)
00233                   SDL_JoystickClose(m_opened_sdl_joy);
00234             }


Member Function Documentation

Axis* cmil::SDL::SDLControllers::Device::getAxis ( unsigned int  id  )  const [inline]

Definition at line 236 of file SDLTranslator.h.

References m_axes.

00236                                                  {
00237               return m_axes.getData(id); 
00238             }

Motion* cmil::SDL::SDLControllers::Device::getBall ( unsigned int  id  )  const [inline]

Definition at line 248 of file SDLTranslator.h.

References m_balls.

00248                                                    {
00249               return m_balls.getData(id); 
00250             }

Press* cmil::SDL::SDLControllers::Device::getButton ( unsigned int  id  )  const [inline]

Definition at line 244 of file SDLTranslator.h.

References m_buttons.

00244                                                     {
00245               return m_buttons.getData(id); 
00246             }

Hat* cmil::SDL::SDLControllers::Device::getHat ( unsigned int  id  )  const [inline]

Definition at line 240 of file SDLTranslator.h.

References m_hats.

00240                                                {
00241               return m_hats.getData(id); 
00242             }

std::string cmil::SDL::SDLControllers::Device::getName (  )  const [inline]

Definition at line 252 of file SDLTranslator.h.

00252 { return "SDLControllers::Device"; }


Member Data Documentation

tInputIndex<Axis> cmil::SDL::SDLControllers::Device::m_axes [private]

Definition at line 255 of file SDLTranslator.h.

Referenced by getAxis().

tInputIndex<Motion> cmil::SDL::SDLControllers::Device::m_balls [private]

Definition at line 258 of file SDLTranslator.h.

Referenced by getBall().

tInputIndex<Press> cmil::SDL::SDLControllers::Device::m_buttons [private]

Definition at line 257 of file SDLTranslator.h.

Referenced by getButton().

tInputIndex<Hat> cmil::SDL::SDLControllers::Device::m_hats [private]

Definition at line 256 of file SDLTranslator.h.

Referenced by getHat().

SDL_Joystick* cmil::SDL::SDLControllers::Device::m_opened_sdl_joy [private]

Definition at line 260 of file SDLTranslator.h.

Referenced by ~Device().


The documentation for this class was generated from the following files:
(c) 2006-2007 John P. Feltz
Generated on Wed Jul 25 16:08:03 2007 for Common Media Input Layer by doxygen 1.4.7

SourceForge.net Logo