HISE Logo Forum
    • Categories
    • Register
    • Login

    Help me understand how to script .setZoomLevel

    Scheduled Pinned Locked Moved Solved General Questions
    13 Posts 2 Posters 351 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.
    • M
      Mighty23
      last edited by

      I would like the plugin to be initialized with a zoom of 0.5, then I would like the user to be able to choose the size of the UI.

      Content.makeFrontInterface(700, 1000);
      Settings.setZoomLevel(0.5);
      
      //Zoom UI
      reg size_ui = 0.5;
      inline function onComboBox1Control(component, value)
      {
          if (value == 1) { 
              size_ui = 0.5;
          }
          else if (value == 2) { 
              size_ui = 0.625;
          }
          else if (value == 3) { 
              size_ui = 0.825;
          }    
          // Set the zoom level based on the selected value
          Settings.setZoomLevel(size_ui);
          Content.getComponent("pnlMain").repaint();
      }
      Content.getComponent("ComboBox1").setControlCallback(onComboBox1Control);
      

      UI does not start at 50% (0.5)
      I have to select the element inside the combo box several times to get the right UI. For example, to select the second option and trigger the zoom I have to choose the second element, then choose another and then return to the second.

      What am I doing wrong? What is the correct way to resize the UI according to the proposed logic?

      Free Party, Free Tekno & Free Software too

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

        @Mighty23 said in Help me understand how to script .setZoomLevel:

        Content.getComponent("pnlMain").repaint();

        Instead of creating references dynamically, do something like:

        const pnlMain = Content.getComponent("pnlMain"); within your on init callback, then just refer to pnlMain when you want to use it, for example pnlMain.repaint();

        Is your combobox set to saveInPreset?

        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

          This works here

          HiseSnippet 823.3ocsUssaSCDDccZLfMfTqDe.V8oDoRZbuQkJHJ4FJhdIB2VgnppZy5IIq55cirWWZJh+KdjOI9CfcscRboQ8RjHOjjYmK6Yl4Ly1ITPfnHQHxv5nQCAjwKL8FwkCpO.S4n1MPF1lWKDAGAQRTsQCwQQfOxvXgOp0aXUDk742uuFlg4DX5QHzIBJA1iFPkSOsytehxXsv9vQzfbVuwtsIBdcASDqvxBlUQCwjKv8gCvZyJXhLdRSepTD5IwRHRYSMg+HuAhuwSs+DZDsKCzBtHOUfROFUe.k42YbdFgPFE6LMqWHMqek49Te5jyml8KlnvYpG4qAFEtKH49HfjQNHULERKY5QBoCkS0nwyyMaykPXOrpTmGJo1hJ7SCy5BkEbYk.7EPqPkvDOJsU0pq3n9p7N11qt5WU8UmiaaS4LJGb5EyIRpf6n6CAcE0DW4piUnfUhHBFJ3pnthykXVLT1961VzdNkRjbdqiaYaKqPPFGxUw1hIHXlSD8ZHx4cNmVsxlq3TsxVqk7y1qs4Y6Xa4ARIk2OpRDH0PYO3RfUJwmSSC6qcbOSA0eXONk5Cx5iQRokmfxkKqiQFVqiYrtJtSoamFpXkKIOPHgC4kRRE0c37up50al5xhECBmoZMsN7tbrDONnKDluPpMT02uIY5IOLxDIszjyPAuMmJObHjI2Rv70jD8+uM0CkUa0jvLDpLUlPAWLiBNtNhn9ZF3jxJJIExOxiNtcCrDONXp3ptqgPnjpSIiFvkpUBo7aKyFPzERwvDayZppz9Ad0WM4Z+U+cGMECzcCvJclFKnEjPf5depoq8Z1qq19bqoL07svOlgk2bnWucKSgp4ciIM8zDOhJGke62iXSP06bSvCEhKY1gJIClMFKLCLpZI+OvX19yWZ1rWOfHmBvhls9x7tr7dt9OKh0KN1GKCo5V8AwAdpmMHf514bfEoa+EzT6T4pZYcEvC39IB+Q8ISoqV1HSo6Xkn.LITbNIcfPug9YImnvDO4AIKy80xNyXFHP8fw4DxMC0sbbs40w0mWG2Xdcby40wslWGey75312ui52y+PrTDjN1fP62oYxNKCilbrhAlvVQ+EiUhgTA
          

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

          M 1 Reply Last reply Reply Quote 0
          • M
            Mighty23 @d.healey
            last edited by Mighty23

            @d-healey I compiled the snippet and it doesn't work in the DAW (both Win & Mac).

            At startup the UI is at 100% not in the value indicated by the combo box.
            I tried both with and without:

            Content.makeFrontInterface(700, 1000);
            // Settings.setZoomLevel(0.5);  (with & without this)
            
            //Zoom UI
            inline function onComboBox1Control(component, value)
            {
            	if (value < 1)
            		return;
            
            	local sizes = [0.5, 0.625, 0.825];
            	Settings.setZoomLevel(sizes[value - 1]);
            }
            Content.getComponent("ComboBox1").setControlCallback(onComboBox1Control);
            

            Free Party, Free Tekno & Free Software too

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

              @Mighty23 Does it work when compiled as a standalone app?

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

              M 1 Reply Last reply Reply Quote 0
              • M
                Mighty23 @d.healey
                last edited by

                @d-healey I can tell you with certainty that the standalone version (Windows) works; the vst/au version does not.

                Free Party, Free Tekno & Free Software too

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

                  @Mighty23 ok, I'll test the plugin version in a little while

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

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

                    VST3 working here too. Did you import the snippet into your current project or a new clean project?

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

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      Mighty23 @d.healey
                      last edited by

                      @d-healey I apologize if it took me half a day to answer you but I would have liked to give you answers for sure and therefore I did all the tests that came to mind.

                      • If I import your snippet into a new project, it behaves exactly as we expect. 👍

                      • if I import your snippet into the existing project, the UI zoom does not happen as hoped. The plugin launches with 100% UI. 👎

                      • if I copy and/or recreate the code proposed in my project, the plugin does not start with a UI zoomed to 0.5 👎

                      • extra: if I open another project this one in HISE "inherits" the zoom of the previous project; only in HISE not in the compiled plugin. (minor issue)

                      The problem manifests itself in the compiled version of the plugins. How can I continue investigating?

                      Free Party, Free Tekno & Free Software too

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

                        @Mighty23 what happens if you delete the app data folder for your project before launching the plugin?

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

                        M 1 Reply Last reply Reply Quote 1
                        • M
                          Mighty23 @d.healey
                          last edited by

                          @d-healey I believe this solved the problem in Windows. Now I have to look for something similar in OSX, right?

                          on windows:

                          1. with the "run" command I searched for the location of AppData
                          2. inside the AppData folder we find the Roaming folder
                          3. Delete the plugin folder: AppData/Roaming/[Company Name]/[Plugin Name]/

                          I will wait to complete the final tests on both OSes to be able to confirm this issue as fixed. ⏳

                          Free Party, Free Tekno & Free Software too

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

                            @Mighty23 Yeah I'm guessing some setting within the app data folder was set by some previous iteration of your project and the new value is just being ignored. So by deleting that folder we start fresh.

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

                            M 1 Reply Last reply Reply Quote 1
                            • M
                              Mighty23 @d.healey
                              last edited by

                              @d-healey I confirm that it solves completely, thanks for the always efficient help.

                              On mac os AppData is this:
                              /users/[YOUR_USER]/Library/Application Support

                              Free Party, Free Tekno & Free Software too

                              1 Reply Last reply Reply Quote 0
                              • M Mighty23 marked this topic as a question on
                              • M Mighty23 has marked this topic as solved on
                              • First post
                                Last post

                              49

                              Online

                              1.7k

                              Users

                              11.7k

                              Topics

                              101.8k

                              Posts