Question about UI Json data!
-
Floating tile keyboard doesn't appear to be working. I've added a floating tile and I'm using this code
const var fltKeyboard = Content.getComponent("fltKeyboard"); fltKeyboard.setContentData({"Type":"Keyboard", "LayoutData":{}, "LowKey":24});
but it's just showing up as a blank panel
Something else that's strange, I have 3 controls on my GUI - all added through the point and click method, but only one is showing up in the UI JSON. The two that arne't showing up are child components of the one that is there if that makes a difference?
Update: I got the keyboard to show up by making it not a child component (still doesn't show in the JSON though) is this intentional behaviour?
-
Ah, now I understand what's the problem. Just forget about the UI JSON Data that can be shown in the code editor, I'll remove this soon in order to avoid this confusion in the future. This is a misfortunate attempt to expose the raw data to the user but doesn't work at all with nested components, breaks up the connection between the data model and the interface and does all kinds of other stupid things. Actually I forgot it's there (I implemented it at the beginning of the redesign and forgot about it later on).
In a normal scenario you should not need to access this data directly, and if you do it, the JSON popup editor is the way to go (it's still not ideal because you loose every undo history, but as last resort OK).
-
Aha that explains 99% of my confusion :)
A few more things I noticed:
When opening a .hip each module is folded up now, could we have a context menu for each module to unfold/fold it?
Holding Alt while dragging the currently selected control on the canvas doesn't appear to duplicate it.
Ctrl+Z doesn't undo a canvas action - Linux strikes again I think because CTRL+SHIFT+Z works
Copying properties from a control and pasting them onto another worked great, but then I created another control and hit paste again (didn't copy again), result was that HISE instantly closed.Is the best way to add controls in a loop still to use
Content.addControl();
? -
Oops, you're right, something broke the restoring of the fold states. I'll investigate.
Have you tried the "Windows" key for duplicating? (I assume you're still using a Windows keyboard on Linux)? Sometimes the modifier keys get a bit confused.
However I need to go into Linux now anyway because I migrated to JUCE 5, then I'll check that everything works there as expected.
-
I just tried the Windows key but no luck there
-
I am currently compiling the Linux version of HISE, then I'll check what's the key there :)
-
Ah now I see, these keys somehow interrupt the dragging operation because they do some OS specific functions. That's too bad, not sure how to fix this and the only working modifiers (Shift / Ctrl are already used).
-
Solved it. Just press Ctrl+D and it will duplicate the selection to the current position. No need to hack around the modifier keys...
Funny story: this is nothing new, but I forgot about it because the shortcut was broke like the rest...
-
Hey David, can you check the latest version on Linux (it's on the
juce_5_migration
branch? HISE crashes when loading the simplest project, but I suspect it is something stupid going on in my VirtualBox. -
I'll build it now
-
It seems to crash at a memory copy operation which might be caused by some missing SSE flags that the virtual box can't set because it has to add a CPU emulation layer (long shot, I know).
-
Well I tried opening an existing project and instant crash.
So I created a new project, saved a blank preset, closed and reopened, loaded the preset and no crash.
I then added a sampler with a single sample, closed and reloaded, no crash.
I then added a script to the master container, the only line I put in the script is
Content.makeFrontInterface(500, 200);
. I closed and reloaded and instant crash. -
Hmm, I can't even load a preset with a single sine wave oscillator without a crash.
I'll ask the JUCE guys what could be wrong there.
-
I just tried a project with a single sine oscillator and it crashes for me too.
-
Slider.setPropertiesFromJSON();
is giving me a function not found error -
It is and had always been
Content.setPropertiesFromJSON("Slider", object)
:) -
Aha, the API needs updating, it shows
ScriptSlider.setPropertiesFromJSON( var jsonData)
Using
Content.setPropertiesFromJSON()
doesn't produce an error but it doesn't seem to have any effect on the controls and they no longer show the property overridden by script message, which was displayed when usingSlider.set()
-
Hmm,
- Add a knob called
Knob1
. - Add this line:
Content.setPropertiesFromJSON("Knob1", {"width": 200});
- The Knob should get wider and the property is deactivated (even on Linux).
- Add a knob called
-
You're right! I was using the variable of the component instead of using the component ID. Solved :)
-
I am using the ID instead of the variable almost every time I need to pass in an control as parameter to a function (and I would heavily recommend this paradigm for your own functions). The reason is to avoid reference counting cycles:
// If you would pass the variable instead of the ID: CloseButton.set("parentComponent", parentAsVariable); // and later for some weird reason: parentAsVariable.data.closeButton = CloseButton; // BOOM, Cycling reference & leaking
BTW, the Linux crash is fixed now :)