HISE Logo Forum
    • Categories
    • Register
    • Login

    getSettingsWindowObject alternative

    Scheduled Pinned Locked Moved Scripting
    15 Posts 3 Posters 2.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • d.healeyD
      d.healey
      last edited by

      Apparently this command is deprecated, what should one use instead?

      Libre Wave - Freedom respecting instruments and effects
      My Patreon - HISE tutorials
      YouTube Channel - Public HISE tutorials

      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        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 :)

        1 Reply Last reply Reply Quote 1
        • d.healeyD
          d.healey
          last edited by d.healey

          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?

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          1 Reply Last reply Reply Quote 0
          • staiffS
            staiff
            last edited by

            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 ...

            Excuse me i'm French.

            1 Reply Last reply Reply Quote 0
            • Christoph HartC
              Christoph Hart
              last edited by

              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]);
              
              1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey
                last edited by

                Hmm, that's what I'm doing. I'll investigate further, I must have made a mistake somewhere

                Libre Wave - Freedom respecting instruments and effects
                My Patreon - HISE tutorials
                YouTube Channel - Public HISE tutorials

                1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey
                  last edited by

                  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 :)

                  Libre Wave - Freedom respecting instruments and effects
                  My Patreon - HISE tutorials
                  YouTube Channel - Public HISE tutorials

                  1 Reply Last reply Reply Quote 0
                  • staiffS
                    staiff
                    last edited by

                    this is for the settings.js
                    but what about the preset system.js ?

                    Excuse me i'm French.

                    1 Reply Last reply Reply Quote 0
                    • Christoph HartC
                      Christoph Hart
                      last edited by

                      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.

                      1 Reply Last reply Reply Quote 0
                      • staiffS
                        staiff
                        last edited by staiff

                        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 ?

                        Excuse me i'm French.

                        1 Reply Last reply Reply Quote 0
                        • staiffS
                          staiff
                          last edited by

                          found !
                          mixed script for multipages with this:
                          http://forum.hise.audio/topic/411/standalone-instrument-midi-input/7

                          and added the midi input section.

                          :D

                          Excuse me i'm French.

                          1 Reply Last reply Reply Quote 0
                          • Christoph HartC
                            Christoph Hart
                            last edited by

                            You can use icons from an SVG image by converting them to a list of numbers as described here:

                            favicon

                            (hise.audio)

                            1 Reply Last reply Reply Quote 0
                            • staiffS
                              staiff
                              last edited by staiff

                              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.

                              Excuse me i'm French.

                              1 Reply Last reply Reply Quote 1
                              • Christoph HartC
                                Christoph Hart
                                last edited by

                                Comic Sans MS!!! Best font ever.

                                1 Reply Last reply Reply Quote 1
                                • staiffS
                                  staiff
                                  last edited by staiff

                                  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) ?

                                  Excuse me i'm French.

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post

                                  16

                                  Online

                                  1.7k

                                  Users

                                  11.9k

                                  Topics

                                  103.6k

                                  Posts