OIS::Win32ForceFeedback Class Reference

#include <Win32ForceFeedback.h>

Inheritance diagram for OIS::Win32ForceFeedback:
[legend]
Collaboration diagram for OIS::Win32ForceFeedback:
[legend]

List of all members.

Public Member Functions

 Win32ForceFeedback (IDirectInputDevice8 *joy)
 ~Win32ForceFeedback ()
void upload (const Effect *effect)
void modify (const Effect *effect)
void remove (const Effect *effect)
void setMasterGain (float level)
void setAutoCenterMode (bool auto_on)
short getFFAxesNumber ()
void _addEffectSupport (LPCDIEFFECTINFO pdei)

Protected Types

typedef std::map< int,
LPDIRECTINPUTEFFECT > 
EffectList

Protected Member Functions

void _updateConstantEffect (const Effect *effect)
void _updateRampEffect (const Effect *effect)
void _updatePeriodicEffect (const Effect *effect)
void _updateConditionalEffect (const Effect *effect)
void _updateCustomEffect (const Effect *effect)
void _setCommonProperties (DIEFFECT *diEffect, DWORD *rgdwAxes, LONG *rglDirection, DWORD struct_size, LPVOID struct_type, const Effect *effect)
void _upload (GUID, DIEFFECT *, const Effect *)

Protected Attributes

EffectList mEffectList
int mHandles
IDirectInputDevice8 * mJoyStick

Private Member Functions

 Win32ForceFeedback ()


Detailed Description

Definition at line 32 of file Win32ForceFeedback.h.


Member Typedef Documentation

typedef std::map<int,LPDIRECTINPUTEFFECT> OIS::Win32ForceFeedback::EffectList [protected]

Definition at line 80 of file Win32ForceFeedback.h.


Constructor & Destructor Documentation

OIS::Win32ForceFeedback::Win32ForceFeedback (  )  [inline, private]

Definition at line 34 of file Win32ForceFeedback.h.

Win32ForceFeedback::Win32ForceFeedback ( IDirectInputDevice8 *  joy  ) 

Definition at line 34 of file Win32ForceFeedback.cpp.

Win32ForceFeedback::~Win32ForceFeedback (  ) 

Definition at line 40 of file Win32ForceFeedback.cpp.

References mEffectList.


Member Function Documentation

void Win32ForceFeedback::upload ( const Effect effect  )  [virtual]

Remarks:
Creates and Plays the effect immediately. If the device is full of effects, it will fail to be uploaded. You will know this by an invalid Effect Handle

Implements OIS::ForceFeedback.

Definition at line 54 of file Win32ForceFeedback.cpp.

References _updateConditionalEffect(), _updateConstantEffect(), _updatePeriodicEffect(), _updateRampEffect(), OIS::Effect::ConditionalForce, OIS::Effect::ConstantForce, E_NotImplemented, OIS::Effect::force, OIS_EXCEPT, OIS::Effect::PeriodicForce, and OIS::Effect::RampForce.

Referenced by modify().

void Win32ForceFeedback::modify ( const Effect effect  )  [virtual]

Remarks:
Modifies an effect that is currently playing

Implements OIS::ForceFeedback.

Definition at line 68 of file Win32ForceFeedback.cpp.

References upload().

void Win32ForceFeedback::remove ( const Effect effect  )  [virtual]

Remarks:
Remove the effect from the device

Implements OIS::ForceFeedback.

Definition at line 75 of file Win32ForceFeedback.cpp.

References OIS::Effect::_handle, and mEffectList.

void Win32ForceFeedback::setMasterGain ( float  level  )  [virtual]

Remarks:
This is like setting the master volume of an audio device. Individual effects have gain levels; however, this affects all effects at once.
Parameters:
level A value between 0.0 and 1.0 represent the percentage of gain. 1.0 being the highest possible force level (means no scaling).

Implements OIS::ForceFeedback.

Definition at line 96 of file Win32ForceFeedback.cpp.

References mJoyStick.

void Win32ForceFeedback::setAutoCenterMode ( bool  auto_on  )  [virtual]

Remarks:
If using Force Feedback effects, this should be turned off before uploading any effects. Auto centering is the motor moving the joystick back to center. DirectInput only has an on/off setting, whereas linux has levels.. Though, we go with DI's on/off mode only
Parameters:
auto_on true to turn auto centering on, false to turn off.

Implements OIS::ForceFeedback.

Definition at line 117 of file Win32ForceFeedback.cpp.

References mJoyStick.

short OIS::Win32ForceFeedback::getFFAxesNumber (  )  [inline, virtual]

Remarks:
Get the number of supported Axes for FF usage
xxx todo - Actually return correct number

Implements OIS::ForceFeedback.

Definition at line 57 of file Win32ForceFeedback.h.

void Win32ForceFeedback::_addEffectSupport ( LPCDIEFFECTINFO  pdei  ) 

Remarks:
Internal use.. Used during enumeration to build a list of a devices support effects.

Definition at line 295 of file Win32ForceFeedback.cpp.

References OIS::ForceFeedback::_addEffectTypes(), OIS::Effect::Constant, OIS::Effect::Custom, OIS::Effect::Damper, OIS::Effect::Friction, OIS::Effect::Inertia, OIS::Effect::Ramp, OIS::Effect::SawToothDown, OIS::Effect::SawToothUp, OIS::Effect::Sine, OIS::Effect::Spring, OIS::Effect::Square, and OIS::Effect::Triangle.

Referenced by OIS::Win32JoyStick::DIEnumEffectsCallback().

void Win32ForceFeedback::_updateConstantEffect ( const Effect effect  )  [protected]

Definition at line 132 of file Win32ForceFeedback.cpp.

References _setCommonProperties(), _upload(), and OIS::Effect::getForceEffect().

Referenced by upload().

void Win32ForceFeedback::_updateRampEffect ( const Effect effect  )  [protected]

Definition at line 148 of file Win32ForceFeedback.cpp.

References _setCommonProperties(), _upload(), and OIS::Effect::getForceEffect().

Referenced by upload().

void Win32ForceFeedback::_updatePeriodicEffect ( const Effect effect  )  [protected]

Definition at line 164 of file Win32ForceFeedback.cpp.

References _setCommonProperties(), _upload(), OIS::Effect::getForceEffect(), OIS::Effect::SawToothDown, OIS::Effect::SawToothUp, OIS::Effect::Sine, OIS::Effect::Square, OIS::Effect::Triangle, and OIS::Effect::type.

Referenced by upload().

void Win32ForceFeedback::_updateConditionalEffect ( const Effect effect  )  [protected]

Definition at line 191 of file Win32ForceFeedback.cpp.

References _setCommonProperties(), _upload(), OIS::Effect::Damper, OIS::Effect::Friction, OIS::Effect::getForceEffect(), OIS::Effect::Inertia, OIS::Effect::Spring, and OIS::Effect::type.

Referenced by upload().

void Win32ForceFeedback::_updateCustomEffect ( const Effect effect  )  [protected]

Definition at line 218 of file Win32ForceFeedback.cpp.

void Win32ForceFeedback::_setCommonProperties ( DIEFFECT *  diEffect,
DWORD *  rgdwAxes,
LONG *  rglDirection,
DWORD  struct_size,
LPVOID  struct_type,
const Effect effect 
) [protected]

Definition at line 233 of file Win32ForceFeedback.cpp.

References OIS::Effect::getNumAxes(), OIS::Effect::replay_delay, and OIS::Effect::replay_length.

Referenced by _updateConditionalEffect(), _updateConstantEffect(), _updatePeriodicEffect(), and _updateRampEffect().

void Win32ForceFeedback::_upload ( GUID  guid,
DIEFFECT *  diEffect,
const Effect effect 
) [protected]

Definition at line 257 of file Win32ForceFeedback.cpp.

References OIS::Effect::_handle, E_DeviceFull, E_InvalidParam, mEffectList, mHandles, mJoyStick, and OIS_EXCEPT.

Referenced by _updateConditionalEffect(), _updateConstantEffect(), _updatePeriodicEffect(), and _updateRampEffect().


Member Data Documentation

EffectList OIS::Win32ForceFeedback::mEffectList [protected]

Definition at line 81 of file Win32ForceFeedback.h.

Referenced by _upload(), remove(), and ~Win32ForceFeedback().

int OIS::Win32ForceFeedback::mHandles [protected]

Definition at line 84 of file Win32ForceFeedback.h.

Referenced by _upload().

IDirectInputDevice8* OIS::Win32ForceFeedback::mJoyStick [protected]

Definition at line 86 of file Win32ForceFeedback.h.

Referenced by _upload(), setAutoCenterMode(), and setMasterGain().


The documentation for this class was generated from the following files:
Generated on Sat Dec 1 20:13:55 2007 for OIS by  doxygen 1.5.4