FreeStick  0.3
Cross Platform Open Sorce Joystick Lib
FSUSBJoystickDeviceManager.h
Go to the documentation of this file.
1 /**************************************************************************
2 Created by Alan Uthoff on 10/15/2013
3 Copyright (C) 2013
4 
5 This Code is free software; you can redistribute it and/or
6 modify it under the terms of the zlib/libpng License as published
7 by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9 This software is provided 'as-is', without any express or implied warranty.
10 
11 In no event will the authors be held liable for any damages arising from the use of this software.
12 
13 Permission is granted to anyone to use this software for any purpose,
14 including commercial applications, and to alter it and redistribute
15 it freely, subject to the following restrictions:
16 
17 1. The origin of this software must not be misrepresented;
18 you must not claim that you wrote the original software.
19 If you use this software in a product, an acknowledgment
20 in the product documentation would be appreciated but is not required.
21 
22 2. Altered source versions must be plainly marked as such,
23 and must not be misrepresented as being the original software.
24 
25 3. This notice may not be removed or altered from any source distribution.
26 **************************************************************************/
27 
28 #pragma once
29 #include "FSUSBDeviceManager.h"
30 #include "FSUSBJoystick.h"
31 
32 namespace freestick
33 {
35  {
36  public:
39  virtual void init( );
40  const FSUSBJoystick * getUSBJoystickDevice(idNumber deviceID){return static_cast<const FSUSBJoystick *>(FSUSBDeviceManager::getDevice(deviceID));}
41  virtual void updateEvents(idNumber joystickDeviceID,FSUSBJoyStickInputElement * elementDevice, physicalValueNumber elementValue);
42  static uint32_t createIdForElement(uint32_t usage, uint32_t usagePage);
43  static void getUsageFromIdForElement(idNumber id, uint16_t &usage,uint16_t &usagePage);
44  static uint16_t getUsageForElement(idNumber id);
45  static uint16_t getUsagePageForElement(idNumber id);
46 
47 
48  };
49 }
Definition: FSUSBJoyStickInputElement.h:38
Definition: FSUSBDeviceManager.h:96
virtual const FSBaseDevice * getDevice(idNumber deviceID)
Definition: FSBaseManager.cpp:72
uint32_t idNumber
Definition: FSTypes.h:33
FSUSBJoystickDeviceManager()
Definition: FSUSBJoystickDeviceManager.cpp:31
static void getUsageFromIdForElement(idNumber id, uint16_t &usage, uint16_t &usagePage)
Definition: FSUSBJoystickDeviceManager.cpp:54
virtual void updateEvents(idNumber joystickDeviceID, FSUSBJoyStickInputElement *elementDevice, physicalValueNumber elementValue)
Definition: FSUSBJoystickDeviceManager.cpp:66
virtual ~FSUSBJoystickDeviceManager()
Definition: FSUSBJoystickDeviceManager.cpp:40
Definition: FSBaseDevice.h:32
Definition: FSUSBJoystick.h:36
virtual void init()
Definition: FSUSBJoystickDeviceManager.cpp:35
uint64_t deviceID
Definition: FSTypes.h:37
static uint16_t getUsageForElement(idNumber id)
Definition: FSUSBJoystickDeviceManager.cpp:45
Definition: FSUSBJoystickDeviceManager.h:34
int32_t physicalValueNumber
Definition: FSTypes.h:35
const FSUSBJoystick * getUSBJoystickDevice(idNumber deviceID)
Definition: FSUSBJoystickDeviceManager.h:40
static uint16_t getUsagePageForElement(idNumber id)
Definition: FSUSBJoystickDeviceManager.cpp:50
static uint32_t createIdForElement(uint32_t usage, uint32_t usagePage)
Definition: FSUSBJoystickDeviceManager.cpp:60