00001
00002
00009 #ifndef DEVICES_H
00010 #define DEVICES_H
00011
00012 #include "devicePlugIn.h"
00013
00014 #include <string>
00015 #include <vector>
00016
00017 #define DEVICE_EVENTS 11
00018
00019 enum DeviceEvent {
00020 NONE,
00021 EXIT_CLIENT,
00022 ROTATE_UP,
00023 ROTATE_DOWN,
00024 ROTATE_LEFT,
00025 ROTATE_RIGHT,
00026 MOVE_FORWARD,
00027 MOVE_BACKWARD,
00028 INC_SPEED,
00029 DEC_SPEED,
00030 CHAT_MODE
00031 };
00032
00033 class Devices {
00034 public:
00035
00037 Devices ();
00039 ~Devices ();
00040
00042
00046 string addDevicePlugIn (string filename);
00047
00048 bool update ();
00049
00051
00054 int countDevices ();
00055
00057
00061 int nameToInt (string name);
00062
00064
00068 string getDeviceName (int i);
00069
00071
00075 int getDeviceAxes (int i);
00077
00081 int getDeviceButtons (int i);
00082
00084
00088 int getDeviceSlots (int i);
00089
00091
00096 float getSlot (int device, int slot);
00097
00099
00105 bool connect (int device, int deviceslot, DeviceEvent ev);
00106
00108
00112 float eventStatus (DeviceEvent ev);
00113
00114
00115 private:
00116
00117 typedef vector<DevicePlugIn*> CVectorDevicePlugIn;
00118 typedef vector<float> CEvents;
00119 typedef vector< vector<int> > CCEvents;
00120 int registeredDevices;
00121 CVectorDevicePlugIn devs;
00122 CEvents events;
00123 CCEvents cEvents;
00124 };
00125
00126 #endif