[dict] is it possible to retrieve a (sub)dictionary using a contained value?
for example, if i have this dictionary which contains 3 sub-dictionaries, and i want to call the one that contains the "display_name " : "3-MIDI", but i don't know it's index or identifier, is it possible to call it somehow just using the display_name value ("3-MIDI" in this case)?
{ "available_output_routing_types" : [
{ "identifier" : 1, "display_name" : "Microsoft GS Wavetable Synth" } ,
{ "identifier" : 3, "display_name" : "3-MIDI" } ,
{ "identifier" : 0, "display_name" : "No Output" }
] }
To my knowledge the only way to access it is by iterating through the dictionaries and selecting the one you want using [dict.route].
When dealing with this same change to "available_output_routing_types" a couple months ago I made the attached sample/scratch patch.
Hope this is useful,
Tyler
thank you so much my friend!
i had temporarily given up on this for the time being, and am working on something else at the moment, so i didn't test it yet, but i had a look at your examples patch and it seems it will let me do exactly what i wanted.
one question: have you noticed any improvement using the new commands instead of the deprecated ones? for example, renaming a track was not being reported and i had to do some hacks to tackle that. maybe the new commands work properly?
in case it is of any interest to you, i am posting the link to the post which contains the M4L device i made and want to update. i will post an update when i have time to replace the deprecated commands.
https://cycling74.com/forums/e%C2%B7z%C2%B7chooser-a-simple-midi-track-output-routing-and-sub-routing-m4l-device%C2%B7-feel-free-to-use-please-help-to-update-or-improve!
it seems the hyperlink is not working for some reason. if you search "E.Z.Chooser" on the forums, the post will show up