Object in JSON to Object in HISE
-
Hey!
I have this JSON file in my expansion:
{ "name": "Night Owl", "type": "Morphology", "version": "1.0.0", "samplemaps": { "Bionic Morph": { "instrument": "Night Owl", "samplemap": "{EXP::Morphology - Night Owl}Bionic Morph", "tags": ["Pad"] }, "Native Morph": { "instrument": "Night Owl", "samplemap": "{EXP::Morphology - Night Owl}Native Morph", "tags": ["Chord"] }, "Plucked Morph": { "instrument": "Night Owl", "samplemap": "{EXP::Morphology - Night Owl}Plucked Morph", "tags": ["Pluck"] } } }
In my HISE project, I have an object called
layerScreenObject
:reg layerScreenObject = {};
I'm currently in my installation callback and I'd like to get the objects within the
"samplemaps"
object inside the json file. So in this case, it'd be the"Bionic Morph"
,"Native Morph"
, and"Plucked Morph"
objects and I'd like to "push" them intolayerScreenObject
. I've already have the json file defined in my callback such that any data in it can be called withjsonFile
, such asjsonFile["samplemaps"]
. Any ideas on how I could do this?Thanks!
-
@Casmat Why not just
reg thingIwant = dataFile.samplemaps["Bionic Morph"];
? -
@d-healey the
layerScreenObject
object would house all of the samplemap objects from every instrument the user has installed. So there may be multiple objects existing inlayerScreenObject
and the installation callback would add more objects (Bionic Morph
,Native Morph
, andPlucked Morph
) to the mainlayerScreenObject
-
@Casmat Ok, so what's the problem with just adding the result of the thingy I put into your layerScreenObject ?
-
@d-healey what do you mean by add?
Edit: i guess i'm trying to figure out how you add something to an object, like pushing something in a list
-
@d-healey got it fixed! I fell victim to HISEing fatigue