XOutput icon indicating copy to clipboard operation
XOutput copied to clipboard

Rework mapping save format

Open ericlbarrett opened this issue 10 years ago • 15 comments

Right now the mappings are just crudely converted to text and saved in an ini file. A typical XOutput binding usually looks something like this:

[bf964500-f65b-11e3-8001-444553540000]
AAEAAgAAAAMgACEAIgAjAAAGAAcABAAFAAoACwAMAAkACBABEAAQBRAC

The first part in the square brackets is the GUID of the controller. The second line is the mapping converted to text. In the future I would like it to look something more like this:

[bf964500-f65b-11e3-8001-444553540000]
left_trigger=ax1
right_trigger=ax1
a_button=btn1
up=dpd_up

ericlbarrett avatar Nov 03 '15 07:11 ericlbarrett

I have one suggestion on this, maybe do it on a profile basis, so you can share profile files for specific controllers and then link them to ID's later on?

KrisZane avatar Nov 04 '15 12:11 KrisZane

I'm not quite sure what you mean. Do you mean like saving each controller binding in its own file?

ericlbarrett avatar Nov 04 '15 16:11 ericlbarrett

Yeah, exactly, then you also avoid duplicates and make it easily shareable.

KrisZane avatar Nov 04 '15 17:11 KrisZane

That would work. Configs would then be sorted by their device name rather than their GUID. I actually noticed currently it sorts it by instance GUID which is unique to each computer, meaning configs aren't transferable right now.

ericlbarrett avatar Nov 04 '15 19:11 ericlbarrett

Then you could tie config files with GUID's in the ini file or something like that. Also I noticed that the GUID changes if you unbind and re-bind the controller?

KrisZane avatar Nov 04 '15 19:11 KrisZane

Alright, in 0ec47c1 the new format is pretty much fully implemented. I just need to clean some of the code up and add work on the error handling.

The new format saves files named after their device in a folder named "configs". The files just contain the left_trigger=axis1 type stuff, do we really need any more than that?

ericlbarrett avatar Nov 04 '15 21:11 ericlbarrett

Sounds good, just checked out the correct revision, but it's getting late so I will try and get compiling set up tomorrow and test.

KrisZane avatar Nov 04 '15 22:11 KrisZane

Also might want to do some trailing spaces clipping: 1446713711 screenshot

And for the use of the configs, maybe we make it so that you can select a config, so for example if several controllers are built on the same chipset, you can just have one config and use it with all controllers? Also I think ipega calls all their controllers the same as in the screenshot, might be other companies doing the same, so this might also be a potential issue of not letting people choose a profile

  • @KrisZane

Yeah, I can have it trim. I'd like the config file names to be easily identifiable but at the same time I want each controller to have a unique config. As for controllers on similar chipsets, I'm gonna have to investigate the types of data I can get from the controller.

ericlbarrett avatar Nov 05 '15 09:11 ericlbarrett

Neat, I was actually reworking the saveManager a bit to add the trim and add a device overview ini file, I can send you what I got so far? :P

KrisZane avatar Nov 05 '15 09:11 KrisZane

Yeah, sure.

ericlbarrett avatar Nov 05 '15 18:11 ericlbarrett

I can't really seem to find a way to actually add it though, maybe using a fork or something? It won't allow me to paste documents. :/

Also I didn't get far, so might be easier to just do it. :P

KrisZane avatar Nov 05 '15 19:11 KrisZane

You can just fork it and send a pull request

ericlbarrett avatar Nov 05 '15 19:11 ericlbarrett

Can't get my private key to work right now for whatever ungodly reason, so I will give it a go tomorrow if I have time. :)

KrisZane avatar Nov 05 '15 21:11 KrisZane

So now I added a pull request, I don't have my controller with me at work though, so I can't test it out unfortunately, but the code compiles and seems to be sound.

KrisZane avatar Nov 06 '15 09:11 KrisZane

I've tested the new .ini format: loading/saving seems OK :) actually I've started to debug the app because x360ce seems to show fake button names in their UI, I discovered than xOutput does the job for my Saitek p26000 gamepad. thank you

mapperCoderZ avatar Jul 02 '16 14:07 mapperCoderZ