getSettingsWindowObject alternative
-
Just use a JSON object that defines everything you need, like this one:
namespace SettingsJson { const var isPlugin = Engine.isPlugin(); // Use this function to get the Height for the popup inline function getHeight() { return isPlugin ? 360 : 520; }; // Pass this object to the floating tile const var settings = { "Type": "Tabs", "Font": "Comic Sans MS", "FontSize": 18, "Dynamic": false, "ColourData": { "bgColour": "0", "itemColour1": "0xFF222222" }, "Content": [ { "Type": "CustomSettings", "Title": "Settings", "StyleData": { }, "ColourData": { "textColour": "0xFFCCCCCC" }, "Font": "Comic Sans MS", "FontSize": 16, "Driver": !isPlugin, "Device": !isPlugin, "Output": !isPlugin, "BufferSize": !isPlugin, "SampleRate": !isPlugin, "GlobalBPM": true, "StreamingMode": false, "GraphicRendering": false, "ScaleFactor": true, "SustainCC": false, "ClearMidiCC": true, "SampleLocation": true, "DebugMode": true, "ScaleFactorList": [ 1, 1.25, 1.5, 2 ] } ], "CurrentTab": 0 }; if(!isPlugin) { settings["Content"].push( { "Type": "MidiSources", "Title": "MIDI Input", "StyleData": { }, "Font": "Comic Sans MS", "FontSize": 15, "ColourData": { "textColour": "0xFFCCCCCC" } }); } settings["Content"].push({ "Type": "MidiChannelList", "Title": "MIDI Channel Filter", "StyleData": { }, "Font": "Comic Sans MS", "FontSize": 15, "ColourData": { "textColour": "0xFFCCCCCC" } }); settings["Content"].push({ "Type": "MidiLearnPanel", "Title": "MIDI Automation", "Font": "Comic Sans MS", "FontSize": 15, "ColourData": { "textColour": "0xFFCCCCCC", "itemColour2": "0xFF50ebf8", "itemColour1": "0xFF111111", "bgColour": "0xFF000000" } }); };
As you can see, a few settings like sample rate etc. and even the whole MIDI sources panel are not relevant (or even harmful) for plugins and can be deactivated like shown above. This is much more flexible than relying on the old getSettingsWindowObject() function which I was constantly messing up.
PS: The new MIDI learn panel is awesome :)
-
I'm trying to use this in the
setPopupData()
function of a panel but it's not working, can this only be used with a floating tile? -
If I understand correctly this script is the replacement of the SettingsButton.js which used a FloatingTile for the last version of HISE on Github.
So I think I can say that: YES Floating Tile, No the rest.
Unless modification maybe ...
-
This is explained at the front page of the FloatingTile API. Basically you need to set the
callbackLevel
in order to receive mouse events (event if you just want to open the Popup without doing any event scripting:Content.makeFrontInterface(600, 500); // The JSON data for a simple virtual Keyboard const var data = {"Type": "Keyboard"}; // Create a FloatingTile widget const var FloatingTile = Content.addFloatingTile("FloatingTile", 0, 0); // Set its dimension to match the keyboard FloatingTile.set("width", 200); FloatingTile.set("height", 72); // Pass the JSON data to the widget and it will show the keyboard. FloatingTile.setContentData(data); // Create a ScriptPanel const var Panel = Content.addPanel("Panel", 230, 6); // Set the callback level to anything above No callbacks in order to receive mouse clicks Panel.set("allowCallbacks", "Context Menu"); // Pass the JSON to the panel and it will open a popup when clicked // The second argument is the position and size of the popup: [x-pos, y-pos, width, height] Panel.setPopupData(data, [50, 50, 200, 72]);
-
Hmm, that's what I'm doing. I'll investigate further, I must have made a mistake somewhere
-
Yeah it was my mistake. I was putting the SettingsJson namespace after the
setPopupData()
but of course it needed to be declared before. Problem solved :) -
this is for the settings.js
but what about the preset system.js ? -
Should not be any different. Give it a JSON with the preset browser details and it should popup on click.
The special thing here was just the weird function that created the settings data object and was never 100% right so I removed it.
-
hello !
found the new settings and presets .js in the musicbox example.work with 1.5.0 version.
but where is the "screw" logo that can permit to go to the settings ?
is it possible to know what to modify in the "old" sttingsbutton ?
-
found !
mixed script for multipages with this:
http://forum.hise.audio/topic/411/standalone-instrument-midi-input/7and added the midi input section.
:D
-
You can use icons from an SVG image by converting them to a list of numbers as described here:
-
yes thanks Christoph.
but finally i used the multipages script (with the panel, floating tiles and button).
i changed some parts of the script from "getSettingsWindowObject alternative" to use the multipages OnControl scripts (but with only 1 button) , and "skinned" the button with .png (that looks really better for me)the new preset manager is so powerful ! better than older.
-
Comic Sans MS!!! Best font ever.
-
lol !
hey ! right !
i didn't change this !oh, about font, i use in this project the Digital mono and TR-909 font. for another user, must he have the same font or is it "embedded/pixelated" in the final compilated project (VST, standalone) ?