]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/profile.h
Fixed updated joystick handling, first major stab at gamepad profiles.
[virtualjaguar] / src / gui / profile.h
1 #ifndef __PROFILE_H__
2 #define __PROFILE_H__
3
4 #include <stdint.h>
5
6 class QComboBox;
7 class QSettings;
8
9 #define MAX_PROFILES  64
10 #define CONTROLLER1   0x01
11 #define CONTROLLER2   0x02
12
13
14 struct Profile
15 {
16         int device;                                     // Host device number (-1 == invalid profile)
17         char mapName[32];                       // Human readable map name
18         int preferredController;        // CONTROLLER1 and/or CONTROLLER2
19         uint32_t map[21];                       // Keys/buttons/axes
20 };
21
22
23 // Function prototypes
24 void ReadProfiles(QSettings *);
25 void WriteProfiles(QSettings *);
26 int FindDeviceNumberForName(const char *);
27 int FindMappingsForDevice(int, QComboBox *);
28 bool ConnectProfileToController(int, int);
29 void AutoConnectProfiles(void);
30
31
32 // Exported variables
33 extern Profile profile[];
34 extern int controller1Profile;
35 extern int controller2Profile;
36 extern int gamepad1Slot;
37 extern int gamepad2Slot;
38 //extern int numberOfProfiles;
39
40 #endif  // __PROFILE_H__
41