]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/profile.h
473d8320231889df69119109b543f4be07047fa5
[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 GetFreeProfile(void);
27 void DeleteProfile(int);
28 int FindDeviceNumberForName(const char *);
29 int FindMappingsForDevice(int, QComboBox *);
30 int FindUsableProfiles(QComboBox *);
31 bool ConnectProfileToController(int, int);
32 void AutoConnectProfiles(void);
33
34
35 // Exported variables
36 extern Profile profile[];
37 extern int controller1Profile;
38 extern int controller2Profile;
39 extern int gamepad1Slot;
40 extern int gamepad2Slot;
41 //extern int numberOfProfiles;
42
43 #endif  // __PROFILE_H__
44