FreeStick  0.3
Cross Platform Open Sorce Joystick Lib
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
freestick::FSUSBDeviceManager Class Reference

#include <FSUSBDeviceManager.h>

Inheritance diagram for freestick::FSUSBDeviceManager:
Inheritance graph
[legend]

Public Member Functions

void addMapping (vendorIDType vendorUSBID, productIDType productUSBID, idNumber controlUSBID, FSDeviceInput deviceInput)
 
void addMapping (idNumber deviceID, idNumber controlID, FSDeviceInput deviceInput)
 
FSUSBElementInfoMap lookUpDeviceInputFromID (idNumber deviceID, idNumber controlID, minMaxNumber min, minMaxNumber max, physicalValueNumber value)
 
FSUSBElementInfoMap lookUpDeviceInputFromUSBID (vendorIDType vendorUSBID, productIDType productUSBID, idNumber controlID, minMaxNumber min, minMaxNumber max, physicalValueNumber value)
 
FSUSBElementInfoMap infoMapForInputType (vendorIDType vendorUSBID, productIDType productUSBID, FSDeviceInput inputToLookFor)
 
bool doesDeviceHaveDeviceInput (idNumber deviceID, FSDeviceInput inputToLookFor)
 
bool doesElementHaveDeviceInputForValue (vendorIDType vendorUSBID, productIDType productUSBID, elementID elementID, FSDeviceInput inputToLookFor)
 
bool doesDeviceHaveDeviceInput (vendorIDType vendorUSBID, productIDType productUSBID, FSDeviceInput inputToLookFor)
 
bool doesDeviceHaveDeviceInputForValue (vendorIDType vendorUSBID, productIDType productUSBID, FSDeviceInput inputToLookFor, physicalValueNumber value)
 
bool doesDeviceHaveDeviceInputForValue (idNumber deviceID, FSDeviceInput inputToLookFor, physicalValueNumber value)
 
 FSUSBDeviceManager ()
 
virtual void init ()
 
virtual ~FSUSBDeviceManager ()
 
- Public Member Functions inherited from freestick::FSBaseManager
 FSBaseManager ()
 
virtual ~FSBaseManager ()
 
virtual void ListenForAllJoysticksForEventTypes (unsigned int eventFlags, IFSJoystickListener &listener)
 This is the base manager. More...
 
virtual void UnListenForAllJoysticksForEventTypes (unsigned int eventFlags, IFSJoystickListener &listener)
 
float convertRawToNormalizedRanger (double value, minMaxNumber maxValue, minMaxNumber minValue)
 
virtual void init (IFSDeviceIDCreator *idCreator)
 
virtual const FSBaseDevicegetDevice (idNumber deviceID)
 

Static Public Member Functions

static deviceID createVPId (uint32_t vendor, uint32_t product)
 

Protected Attributes

std::unordered_map< deviceID, std::unordered_map< idNumber, FSDeviceInput > > _usageMapToInputEvent
 
std::unordered_map< deviceID, std::unordered_map< idNumber, std::vector< FSUSBElementInfoMap > > > _usageMapToInputRangeEvent
 
- Protected Attributes inherited from freestick::FSBaseManager
std::unordered_map< unsigned int, FSBaseDevice * > deviceMap
 

Additional Inherited Members

- Protected Member Functions inherited from freestick::FSBaseManager
void ListenForAllJoysticksForEventType (FreeStickEventType eventType, IFSJoystickListener &listener)
 
void UnListenForAllJoysticksForEventType (FreeStickEventType eventType, IFSJoystickListener &listener)
 
void ListenForJoystickEvent (FreeStickEventType eventType, IFSJoystickListener &listener)
 
void RemoveListenerForEventType (FreeStickEventType eventType, IFSJoystickListener &listener)
 
virtual void addDevice (FSBaseDevice *device)
 
virtual void removeDevice (FSBaseDevice *device)
 
virtual void inputOnDeviceChanged (FreeStickEventType eventType, FSEventAction eventAction, FSDeviceInput inputType, idNumber deviceID, idNumber deviceControlID, int newValue, int oldValue, minMaxNumber min, minMaxNumber max)
 
virtual void inputOnDeviceChangedWithNormilzedValues (FreeStickEventType eventType, FSEventAction eventAction, FSDeviceInput inputType, idNumber deviceID, idNumber deviceControlID, float newValue, float oldValue)
 
virtual elementID getNextID ()
 
void updateEvent (FSBaseEvent &event)
 

Constructor & Destructor Documentation

◆ FSUSBDeviceManager()

FSUSBDeviceManager::FSUSBDeviceManager ( )
Todo:
populate map _usageMapToInputEvent

◆ ~FSUSBDeviceManager()

FSUSBDeviceManager::~FSUSBDeviceManager ( )
virtual

Member Function Documentation

◆ addMapping() [1/2]

void freestick::FSUSBDeviceManager::addMapping ( vendorIDType  vendorUSBID,
productIDType  productUSBID,
idNumber  controlUSBID,
FSDeviceInput  deviceInput 
)

◆ addMapping() [2/2]

void freestick::FSUSBDeviceManager::addMapping ( idNumber  deviceID,
idNumber  controlID,
FSDeviceInput  deviceInput 
)

◆ createVPId()

static deviceID freestick::FSUSBDeviceManager::createVPId ( uint32_t  vendor,
uint32_t  product 
)
inlinestatic

◆ doesDeviceHaveDeviceInput() [1/2]

bool freestick::FSUSBDeviceManager::doesDeviceHaveDeviceInput ( idNumber  deviceID,
FSDeviceInput  inputToLookFor 
)

◆ doesDeviceHaveDeviceInput() [2/2]

bool freestick::FSUSBDeviceManager::doesDeviceHaveDeviceInput ( vendorIDType  vendorUSBID,
productIDType  productUSBID,
FSDeviceInput  inputToLookFor 
)

◆ doesDeviceHaveDeviceInputForValue() [1/2]

bool freestick::FSUSBDeviceManager::doesDeviceHaveDeviceInputForValue ( vendorIDType  vendorUSBID,
productIDType  productUSBID,
FSDeviceInput  inputToLookFor,
physicalValueNumber  value 
)

◆ doesDeviceHaveDeviceInputForValue() [2/2]

bool freestick::FSUSBDeviceManager::doesDeviceHaveDeviceInputForValue ( idNumber  deviceID,
FSDeviceInput  inputToLookFor,
physicalValueNumber  value 
)

◆ doesElementHaveDeviceInputForValue()

bool FSUSBDeviceManager::doesElementHaveDeviceInputForValue ( vendorIDType  vendorUSBID,
productIDType  productUSBID,
elementID  elementID,
FSDeviceInput  inputToLookFor 
)

◆ infoMapForInputType()

FSUSBElementInfoMap FSUSBDeviceManager::infoMapForInputType ( vendorIDType  vendorUSBID,
productIDType  productUSBID,
FSDeviceInput  inputToLookFor 
)

◆ init()

void FSUSBDeviceManager::init ( )
virtual

◆ lookUpDeviceInputFromID()

FSUSBElementInfoMap FSUSBDeviceManager::lookUpDeviceInputFromID ( idNumber  deviceID,
idNumber  controlID,
minMaxNumber  min,
minMaxNumber  max,
physicalValueNumber  value 
)

◆ lookUpDeviceInputFromUSBID()

FSUSBElementInfoMap FSUSBDeviceManager::lookUpDeviceInputFromUSBID ( vendorIDType  vendorUSBID,
productIDType  productUSBID,
idNumber  controlID,
minMaxNumber  min,
minMaxNumber  max,
physicalValueNumber  value 
)

Member Data Documentation

◆ _usageMapToInputEvent

std::unordered_map<deviceID,std::unordered_map<idNumber,FSDeviceInput> > freestick::FSUSBDeviceManager::_usageMapToInputEvent
protected
Todo:
combind vendor and product ID in to on 64bit key to cut down the size of this type

◆ _usageMapToInputRangeEvent

std::unordered_map<deviceID,std::unordered_map<idNumber,std::vector<FSUSBElementInfoMap> > > freestick::FSUSBDeviceManager::_usageMapToInputRangeEvent
protected

The documentation for this class was generated from the following files: