Hello devs,
I have 2 different juce::var objects that generate the exact same JSON string (including properties order) when serialized but the var::equals method is returning false.
Just to verify, I’ve also tried to parse the same json string into two different juce::var objects and the var::equals method is still returning false.
The culprit seem to be the array comparison, the rest of the properties are fine.
Can anyone confirm? I’m on JUCE 8.0.8
Here is my test JSON string, the equality failure happens in the “tracks” property, which is an array
{
“project_name”: “test”,
“project_sample_rate”: 48000.0,
“project_metronome_state”: false,
“project_count_in_state”: false,
“project_loop_state”: true,
“project_loop_start_index”: 192000,
“project_loop_end_index”: 288000,
“project_tempo_bpm”: 120.0,
“project_tempo_signature_numerator”: 4,
“project_tempo_signature_denominator”: 4,
“project_snap”: true,
“project_waveform_view_offset_seconds”: 0.0,
“project_waveform_view_size_seconds”: 22.96875,
“project_play_head_position_seconds”: 20.0,
“project_master_level_norm”: 0.0,
“project_metronome_level_norm”: 0.0,
“tracks”: [
{
“index”: 0,
“name”: “”,
“solo”: false,
“mute”: true,
“rec”: true,
“level”: 0.813084125518799,
“pan”: 0.0,
“takes”: null
},
{
“index”: 1,
“name”: “”,
“solo”: false,
“mute”: true,
“rec”: false,
“level”: 0.75,
“pan”: 0.0,
“takes”: null
},
{
“index”: 2,
“name”: “Guitar DI 1”,
“solo”: false,
“mute”: false,
“rec”: false,
“level”: 0.644859790802002,
“pan”: -0.567567586898804,
“takes”: [
{
“file”: “D:\Development\cpp\wavs\DIs\Chunk.wav”,
“imported”: true,
“start_index”: 576000,
“end_index”: 767999,
“start_index_offset”: 24000,
“end_index_offset”: -24000
}
]
},
{
“index”: 3,
“name”: “Guitar DI 2”,
“solo”: false,
“mute”: false,
“rec”: false,
“level”: 0.79439252614975,
“pan”: 0.783783793449402,
“takes”: [
{
“file”: “D:\Development\cpp\wavs\DIs\emg dry.wav”,
“imported”: true,
“start_index”: 120000,
“end_index”: 2279999,
“start_index_offset”: 0,
“end_index_offset”: 0
}
]
},
{
“index”: 4,
“name”: “”,
“solo”: false,
“mute”: false,
“rec”: false,
“level”: 0.598130822181702,
“pan”: 0.0,
“takes”: null
},
{
“index”: 5,
“name”: “”,
“solo”: false,
“mute”: false,
“rec”: false,
“level”: 0.691588759422302,
“pan”: 0.0,
“takes”: null
},
{
“index”: 6,
“name”: “”,
“solo”: false,
“mute”: false,
“rec”: false,
“level”: 0.813084125518799,
“pan”: 0.0,
“takes”: null
},
{
“index”: 7,
“name”: “”,
“solo”: false,
“mute”: false,
“rec”: false,
“level”: 0.75,
“pan”: 0.0,
“takes”: null
}
]
}
Regards,
Federico
