Closed theod closed 8 years ago
notice also that the following code return the same error :
v;
TTDictionary state;
object.get("state", v);
state = v;
but if I do :
state = v[0];
it's fine ...
It looks like TTValue doesn't have any direct support for dictionaries. This should be easy to do.
I now realize that this is less straightforward. I think it was a mistake to store dictionaries in TTValue by name. We have a much better model for representing references now. I'm not sure where we are doing some of this dictionary-by-name access so I'll do this work on a branch and then give it to @theod for review.
"I'm not sure where we are doing some of this dictionary-by-name access" : I'll maybe use the name dictionary for State management … but it is not sure for the moment.
Actually, I'm seeing this is a rabbit trail with a lot of work involved... I'm checking in this work on a branch, then maybe we can patch this particular issue on dev.
or maybe we can patch this on feature/state branch first as it is where we can use this new behavior for real ?
@theod We should probably talk about what we want to do with TTDictionary and proceed as you suggest. I need to focus on the audio graph today, however...
Here is the commit of the above. https://github.com/jamoma/JamomaCore/commit/abd11ace32775389d242e985ce89516b6c09b866
One thing you might notice is that we previously were leaking dictionaries if they were stored in a TTValue.
I also accidentally checked-in TTAudioGraphSource.cpp
no problemo @tap ! it is just to make the code as clearer as possible but this is not problematic to move forward on the state feature.
My current thinking is that we should handle this by using std::shared_ptr in TTValue. While this would add to the size of TTElement, it would solve many many problems.
Can we close this one @theod ?
ok !
The following code doesn't compile :
TTDictionary state; object.get("state", state);
would it be possible to allow this @tap ?