HISE Logo Forum
    • Categories
    • Register
    • Login

    Settings.setZoomLevel()?

    Scheduled Pinned Locked Moved Solved General Questions
    14 Posts 3 Posters 227 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 @clevername27
      last edited by

      @clevername27 Are you setting it from within a control callback?

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

      clevername27C 1 Reply Last reply Reply Quote 1
      • clevername27C
        clevername27 @d.healey
        last edited by

        @d-healey I'm not sure what you're asking? (Sorry if I'm being dense.)

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

          @clevername27 Can you show me the context in which you are calling the function?

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

          clevername27C 1 Reply Last reply Reply Quote 0
          • clevername27C
            clevername27 @d.healey
            last edited by

            @d-healey Thanks, man.

            c332b26d-ae60-462d-a4cc-d3db5e67039c-image.png

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

              @clevername27 When is InitaliseSystem called?

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

              clevername27C 1 Reply Last reply Reply Quote 1
              • clevername27C
                clevername27 @d.healey
                last edited by

                @d-healey During onInit().

                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //                                                                                                              //
                //                                                                                                              //
                //                                               INIT [UI THREAD]                                               //
                //                                                                                                              // 
                //                                                                                                              //
                /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                ///////////////////////////////////////////// INITIAL CODE EXECUTION /////////////////////////////////////////////
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                // Create the canvas.
                Content.makeFrontInterface(720, 660);
                
                // Put everything in the Message thread.
                Synth.deferCallbacks(true);
                
                // Clear the Console.
                Console.clear();
                
                // Log start.
                Console.print("> ––––––––––––––––––––––––––––––––––– Begin: onInit <");
                
                global g_executionFlags = {
                	
                		onInitComplete: false,
                		presetLoading: false
                };
                
                // Declare the constant.
                const DEV_DUMP_SAMPLEMAP = false;
                
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                ////////////////////////////////// GLOBAL VARIABLES & CONSTANTS & COMPONENTS DECLARATIONS ////////////////////////
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                include("Init - Constants.js");
                include("Init - Global Variables.js");
                include("Init - Components.js");
                include("Init - Processors.js");
                
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //////////////////////////////////////////////// LOAD DATA FILES /////////////////////////////////////////////////
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                include("Data - Graphics.js");
                include("Data - Strings.js");
                
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //////////////////////////////////////////////////// HISE OBJECTS ////////////////////////////////////////////////
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                // Engage OpenGL
                Settings.setEnableOpenGL(true);
                
                // Declare preset handler.
                const var internalPresetHandler = Engine.createUserPresetHandler();
                internalPresetHandler.setUseCustomUserPresetModel(onPresetLoad, onPresetSave, false);
                
                // Create Sampler.
                const var mySampler = Synth.getSampler("Sampler");
                mySampler.clearSampleMap();
                
                // Create Silent Synthesizer.
                const var fx_MODEL_Synthesiser = Synth.getChildSynth("fx_MODEL_Synthesiser");
                
                // Create the MIDI Player's animation timer.
                const var g_ScreenAnimationTimer = Engine.createTimerObject();
                
                // Include the MIDI transport code.
                include ("Init - MIDI Transport.js");
                
                // Activate safe-checks for delaying MIDI events.
                // Synth.setFixNoteOnAfterNoteOff(true);
                // Synth.setShouldKillRetriggeredNote(true);
                
                // Hide the header menu. This is a hack.
                panel_HEADER_Performance_ART.showControl(false);
                
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                /////////////////////////////////////////// LOADING DATA THIRD-PARTY FILES ///////////////////////////////////////
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                // =========================================== Impulse Responses
                
                // Load them into the Pool.
                const global_ImpulseResponses = Engine.loadAudioFilesIntoPool();
                
                // ================================================ Images
                
                // Load image files into the Pool.
                include("Init - Images.js");
                
                // Load image files into the Pool.
                include("Init - Fonts.js");
                
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                ////////////////////////////////////////////////////// LAF DEFINITIONS ///////////////////////////////////////////
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                // ------------- Definitions 
                
                include("LAF - Button - Factory - Progress Button Factory.js");
                include("LAF - Button - Regular Illuminated Button.js");
                include("LAF - Button - Indicator Light Button.js");
                include("LAF - Button - Circular Glyph Button.js");
                include("LAF - Button - Home Page Icon Button.js");
                include("LAF - Button - Square Icon Button.js");
                include("LAF - Button - Circle X Button.js");
                include("LAF - Button - Textless Button.js");
                include("LAF - Button - Radio Button.js");
                include("LAF - Slider - Regular Knob.js");
                include("LAF - Button - Text Button.js");
                include("LAF - Button - Checkbox.js");
                include("LAF - Combo Box - Main.js");
                include("LAF - Table - Velocity.js");
                include("LAF - Preset Browser.js");
                include("LAF - Meter - Main.js");
                include("LAF - Sliderpack.js");
                
                // ------------- Import 
                
                include("Init - LAFs.js");
                
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //////////////////////////////////////////////////// UTILITY CODE ////////////////////////////////////////////////
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                include("UIT Utility - Animation.js");
                include("UIT Utility - General.js");
                include("UIT Utility - Popup.js");
                
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                ///////////////////////////////////////////////////// GENERAL CODE ///////////////////////////////////////////////
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                // ================================================== Documentation
                
                include("UIT Documentation.js");
                
                // ===================================================== Engine
                
                include("UIT Engine - Render.js");
                include("UIT Engine - MIDI.js");
                include("UIT Engine.js");
                
                // ===================================================== Margins
                
                // ------------- Header
                
                include("UIT Header - Framework Selector.js");
                include("UIT Header - LED Meter.js");
                include("UIT Header.js");
                
                // ------------- Footer
                
                include("UIT Footer - Tooltips.js");
                include("UIT Footer - History.js");
                include("UIT Footer.js");
                
                // ===================================================== Future
                
                include("UIT Future - Content.js");
                include("UIT Future.js");
                
                // ====================================================== Home
                
                include("UIT Home.js");
                
                // ===================================================== Performer
                
                include("UIT Performer - Module - Vel Map Table.js");
                include("UIT Performer - Module - Note Onset.js");
                include("UIT Performer - Variable Durations.js");
                include("UIT Performer - Note Type Lights.js");
                include("UIT Performer - Note Derriver.js");
                include("UIT Performer - Note Mixer.js");
                include("UIT Performer - Animations.js");
                include("UIT Performer.js");
                
                // ===================================================== Presets
                
                include("UIT Presets - Load.js");
                include("UIT Presets - Save.js");
                
                // ===================================================== Sessions
                
                include("UIT Session - Performances.js");
                include("UIT Session - Note Maps.js");
                include("UIT Session.js");
                
                // =================================================== Settings
                
                include("UIT Settings.js");
                include("UIT Settings - Update.js");
                include("UIT Settings - Prefs - UI.js");
                include("UIT Settings - Prefs - Ops.js");
                include("UIT Settings - Prefs - File.js");
                include("UIT Settings - Diagnostics.js");
                
                // ====================================================== Transformer
                
                // Load the core functions.
                include("UIT Trans.js");
                
                // Load TM module.
                include("UIT Trans - TM - Inst Modeller.js");
                include("UIT Trans - TM - Mic Changer.js");
                include("UIT Trans - TM - Mic Mover.js");
                include("UIT Trans - TM - Shaper.js");
                include("UIT Trans - TM - Tuner.js");
                include("UIT Trans - TM.js");
                
                // Load Spatial module.
                include("UIT Trans - Space - 3D Audio.js");
                include("UIT Trans - Space - Anechoic.js");
                include("UIT Trans - Space - New Space.js");
                include("UIT Trans - Space - Original Space.js");
                include("UIT Trans - Space - Orig Mic Ambience.js");
                include("UIT Trans - Space.js");
                
                // Load Format module.
                include("UIT Trans - Format - Inst Phase.js");
                include("UIT Trans - Format - Mic Phase.js");
                include("UIT Trans - Format - Mic Mixer.js");
                include("UIT Trans - Format - FFT Graph.js");
                include("UIT Trans - Format - Mic Info.js");
                include("UIT Trans - Format.js");
                
                // Load Output module.
                include("UIT Trans - Out - Manual Gain.js");
                include("UIT Trans - Out - Clip Light.js");
                include("UIT Trans - Out - Energiser.js");
                include("UIT Trans - Out - Match DR.js");
                include("UIT Trans - Out - Auto EQ.js");
                include("UIT Trans - Out - Limiter.js");
                include("UIT Trans - Out - Meters.js");
                include("UIT Trans - Out.js");
                
                // Modelling module.
                include("UIT Trans - Architect.js");
                include("UIT Trans - Architect - Dyn Playground.js");
                include("UIT Trans - Architect - Hybrid Modeller.js");
                include("UIT Trans - Architect - Rendered Extensions.js");
                
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                ////////////////////////////////////////////////// STRUCTURES ////////////////////////////////////////////////////
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                include("Init - Modules.js");
                include("Init - Factory Buttons.js");
                
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                //////////////////////////////////////////// INITIALISATION FUNCTION /////////////////////////////////////////////
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                inline function InitaliseSystem () {
                	
                	// Reset everything.
                	Engine.clearSampleMapPool();
                	Engine.clearMidiFilePool();
                	Engine.clearSampleMapPool();
                	Engine.rebuildCachedPools();
                
                	Engine.allNotesOff();
                	Settings.setDiskMode(0);
                	Settings.setZoomLevel(1.5);
                	Content.setUseHighResolutionForPanels(true);
                }
                
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                ////////////////////////////////////////////// PRISM STARTUP FUNCTION ////////////////////////////////////////////
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                inline function InitalisePrism() {
                
                	// ------------- Preferences
                
                	// Set Global Options values (no callbacks).
                	SetPreferencesToSafeValues();
                
                	// ------------- Foundation
                	
                	FOOTER_SetFrameworkState ("init");
                	HEADER_SetFrameworkState ("init");
                	
                	// ------------- Non-Audio Systems
                	
                	// Initialise the Global Operations GUI.
                	GLOBAL_SetFrameworkState ("init");
                	
                	// ------------- PRISM Systems
                	
                	PLAYER_SetFrameworkState ("init");
                	ENCODER_SetFrameworkState ("init");
                	TRANSFORMER_SetFrameworkState ("init");
                	
                	// ------------- Session
                	
                	SESSION_SetFrameworkState("init");
                	
                	// ------------- User Data
                	
                	HandleUserDataFileStartup ();
                }
                
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                ////////////////////////////////////////////////////// BEGIN /////////////////////////////////////////////////////
                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
                
                // Initialise the system.
                InitaliseSystem();
                
                // Initialise the PRISM.
                InitalisePrism();
                
                // ------------- Development Tools
                
                // Modelling module.
                include("Coding.js");
                
                // ------------- Logging and Meta
                
                // Log onOnit complete.
                g_executionFlags.onInitComplete = true;
                
                // Log start.
                Console.print("> ––––––––––––––––––––––––––––––––––– End: onInit <");
                
                
                
                
                d.healeyD 1 Reply Last reply Reply Quote 0
                • d.healeyD
                  d.healey @clevername27
                  last edited by

                  @clevername27 That might be the issue. HISE reads the zoom size from the settings.xml file in app data, and this probably happens after on init (I haven't checked). If that is the case, you'd need to call your function after on init completes.

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

                  clevername27C 1 Reply Last reply Reply Quote 0
                  • clevername27C
                    clevername27 @d.healey
                    last edited by clevername27

                    @d-healey Thank you for the ideas. I don't seem to be able to get it working—I'm guessing this is one of those things where there's a specific way it needs to be done? The resizing API call is working in the snippets, so that part works.

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

                      @clevername27 said in Settings.setZoomLevel()?:

                      there's a specific way it needs to be done?

                      As always I'd recommend making a separate test project to play around with.

                      So I just took a look at how I'm doing it. I'm calling setZoomLevel from within a panel's callback (I'm using the zoom panel method which I showed in a video a while back). But now where does the panel get it's value, looking at my script I see this pnlZoom.setValue(Settings.getZoomLevel()); in on init.

                      So it looks like setZoomLevel must update the value saved in the settings file (have a look to confirm), so at on init I'm reading it back so that the user starts with the last value they set.

                      What does this mean for you... I don't know, you'll have to play around. I always try to build my UIs to look right at 1x zoom on a 1920x1080 screen so I avoid this kind of issue. I saw it come up a few times recently and I think people were having to mess around with the xml files or something - a forum search might dig it up.

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

                      clevername27C 2 Replies Last reply Reply Quote 1
                      • clevername27C
                        clevername27 @d.healey
                        last edited by

                        @d-healey Cool - thank you!

                        1 Reply Last reply Reply Quote 0
                        • clevername27C
                          clevername27 @d.healey
                          last edited by clevername27

                          @d-healey You MADMAN—five Monkeys awarded to thee! 🐒🐒🐒🐒🐒

                          Like Sir David wrote, you need to resize a panel—any panel—and the whole interface will scale, accordingly. Here's code you can cut and paste:

                          Link Preview Image
                          [Feature Request] GUI Scaling with window handle?

                          @Christoph-Hart Do I need to parent the ZoomPanel ? If I make a child of ZoomPanel knob/Slider etc cursor are also being changed to doubleArrow Cursor

                          favicon

                          Forum (forum.hise.audio)

                          Important: Only the compiled version will resize—and if you think about it, that makes sense, because you can already resize within the HISE IDE.

                          1 Reply Last reply Reply Quote 0
                          • clevername27C clevername27 has marked this topic as solved on
                          • First post
                            Last post

                          33

                          Online

                          1.8k

                          Users

                          12.1k

                          Topics

                          105.6k

                          Posts