HISE Logo Forum
    • Categories
    • Register
    • Login

    Plugin doesn't respect UI Zoom Factor onInit

    Scheduled Pinned Locked Moved Scripting
    25 Posts 6 Posters 873 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.
    • oskarshO
      oskarsh @ccbl
      last edited by

      @ccbl when using toggle buttons make sure to always use if (value) {}

      if (value) { Settings.setZoomLevel(0.75); }

      in your case the callback fires for each button and executes the statement even if the button value is false but it should only set the value when its true.

      that should do the trick.

      breathing HISE

      C 1 Reply Last reply Reply Quote 0
      • C
        ccbl @oskarsh
        last edited by

        @oskarsh how would that look in context?

        inline function onFiftyControl(component, value)
        {
        	Settings.setZoomLevel(0.5);
        };
        Content.getComponent("Fifty").setControlCallback(onFiftyControl)
        

        Do you define the value as 1.0?

        I really don't know coding very well.

        d.healeyD LindonL 2 Replies Last reply Reply Quote 0
        • MorphoiceM
          Morphoice @d.healey
          last edited by Morphoice

          @d-healey just out of interest, is there a way to detect the screen resolution by any chance? it would be a nice way to set a default zoom level accordingly so the user doesn't have to. e.g. I'm always having a hard time on a 5k monitor with plugins being microscopic and many manufacturers aren't even bothered to make the GUI sizable at all... those are the plugins I ususally don't buy because they are unusable for me. I have a ruptured retina and very poor eyesight so I'm naturally paying attention to usability and visibility a lot

          https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

          ustkU 1 Reply Last reply Reply Quote 0
          • ustkU
            ustk @Morphoice
            last edited by ustk

            @Morphoice Settings.getUserDesktopSize() might help you

            Can't help pressing F5 in the forum...

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

              @ccbl Setting it in on init won't work because the button callbacks are triggered after on init so it will overwrite it.

              Just as a test, what happens if you disable saveInPreset on all the buttons, except the one you want?

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

              MorphoiceM 1 Reply Last reply Reply Quote 0
              • MorphoiceM
                Morphoice @d.healey
                last edited by

                @d-healey saving the gui size in a preset doesn't make much sense though, so disabling that shouldn't be a problem

                https://instagram.com/morphoice - 80s inspired Synthwave Music, Arcade & Gameboy homebrew!

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

                  @Morphoice said in Plugin doesn't respect UI Zoom Factor onInit:

                  saving the gui size in a preset doesn't make much sense though, so disabling that shouldn't be a problem

                  I'm just suggesting this as a test to figure out the source of the issue. But you don't want it to always open at 50% so we need to find a better solution after.

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

                  ustkU 1 Reply Last reply Reply Quote 1
                  • ustkU
                    ustk @d.healey
                    last edited by ustk

                    @d-healey but the zoom level is always restored to the last state right? So why bother with all that? You just need to read what is the current zoom to reflect this to the right button, at least this is how I see it...

                    Can't help pressing F5 in the forum...

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

                      @ustk said in Plugin doesn't respect UI Zoom Factor onInit:

                      but the zoom level is always restored to the last state right?

                      Only if you use the built in custom settings floating tile which saves it to the generalSettings.xml file.

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

                      ustkU 1 Reply Last reply Reply Quote 0
                      • ustkU
                        ustk @d.healey
                        last edited by ustk

                        @d-healey Hmm... should be the same thing no? I thought it was always saved in the xml no matter where the call is coming from (when the plugin/standalone is closed)

                        Can't help pressing F5 in the forum...

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

                          @ustk Yeah just tested and seems you are correct.

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

                          1 Reply Last reply Reply Quote 0
                          • LindonL
                            Lindon @ccbl
                            last edited by

                            @ccbl said in Plugin doesn't respect UI Zoom Factor onInit:

                            @oskarsh how would that look in context?

                            inline function onFiftyControl(component, value)
                            {
                            	Settings.setZoomLevel(0.5);
                            };
                            Content.getComponent("Fifty").setControlCallback(onFiftyControl)
                            

                            Do you define the value as 1.0?

                            I really don't know coding very well.

                            so like this:

                            inline function onFiftyControl(component, value)
                            {
                                if(value)
                                    Settings.setZoomLevel(0.5);
                            };
                            Content.getComponent("Fifty").setControlCallback(onFiftyControl)
                            

                            HISE Development for hire.
                            www.channelrobot.com

                            d.healeyD oskarshO C 3 Replies Last reply Reply Quote 0
                            • d.healeyD
                              d.healey @Lindon
                              last edited by

                              @Lindon Genius!

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

                              LindonL 1 Reply Last reply Reply Quote 1
                              • LindonL
                                Lindon @d.healey
                                last edited by

                                @d-healey ha ha ha ha.....

                                HISE Development for hire.
                                www.channelrobot.com

                                1 Reply Last reply Reply Quote 0
                                • oskarshO
                                  oskarsh @Lindon
                                  last edited by

                                  @Lindon wow sleek and elegant solution!

                                  breathing HISE

                                  1 Reply Last reply Reply Quote 0
                                  • C
                                    ccbl @Lindon
                                    last edited by

                                    @Lindon said in Plugin doesn't respect UI Zoom Factor onInit:

                                    @ccbl said in Plugin doesn't respect UI Zoom Factor onInit:

                                    @oskarsh how would that look in context?

                                    inline function onFiftyControl(component, value)
                                    {
                                    	Settings.setZoomLevel(0.5);
                                    };
                                    Content.getComponent("Fifty").setControlCallback(onFiftyControl)
                                    

                                    Do you define the value as 1.0?

                                    I really don't know coding very well.

                                    so like this:

                                    inline function onFiftyControl(component, value)
                                    {
                                        if(value)
                                            Settings.setZoomLevel(0.5);
                                    };
                                    Content.getComponent("Fifty").setControlCallback(onFiftyControl)
                                    

                                    After flushing my %appdata% config this worked! Thanks!

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

                                    48

                                    Online

                                    1.7k

                                    Users

                                    11.7k

                                    Topics

                                    101.9k

                                    Posts