Forum

    • Register
    • Login
    • Search
    • Categories

    component data type wrong + uninitialized

    Bug Reports
    2
    3
    71
    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.
    • Dan Korneff
      Dan Korneff last edited by

      Hey guys!
      I'm working on a project and ran into a roadblock. For some reason, new components are are being added incorrectly to my project.
      The ScriptWatchTable is listing the data type for sliders and combo boxes as "string" and their values are "uninitialized"
      combo.png

      I can create a new project and add a component properly, but this current project is gummed up somewhere. I could easliy remake the whole thing (script is only 60 lines so far) but I'd rather solve the issue.
      Anyone seen this before? I can't find anything by searching.

      Dan Korneff - Producer / Mixer / Audio Nerd

      1 Reply Last reply Reply Quote 0
      • Dan Korneff
        Dan Korneff last edited by

        I tracked it down to a script I'm using for my meter. I'm essentially using this code below.
        Commenting out the line "return widget;" makes everything go back to normal.

         return widget;
        
        /** Creates a VU-Meter from a filmstrip for the master volume. */
        inline function createFilmStripVuMeter(name, x, y, isLeft)
        {
        	local widget = Content.addPanel(name, x, y);
            
            Content.setPropertiesFromJSON(name, {
              "width": 130, // this uses the exact dimensions of one filmstrip
              "height": 65,
              "opaque": true // opaque is important in order to increase the drawing performance
            });
            
            // Put the image in your image folder
            widget.loadImage("{PROJECT_FOLDER}vu_meter_128_frames.png", "filmstrip");
            
            widget.data.value = 0.0;
            widget.data.isLeft = isLeft;
            
            // Set the initial image 
            widget.setImage("filmstrip", 0, 0);
            
            widget.setTimerCallback(function()
            {
            	// Get the peak value from the master output
            	var newValue = Engine.getMasterPeakLevel(this.data.isLeft ? 0 : 1);
            	
            	if(newValue > this.data.value)
            		this.data.value = newValue;
            	else
            		// Just decay the current value (0.92 controls the decay time)
            		this.data.value = this.data.value * 0.92;
            	
            	// Calculate the filmstrip index
            	// this must be an integer value
            	// 84 is used instead of 128 because 84 is ~0dB which is
            	// more accurate for this example filmstrip
            	var index = parseInt(this.data.value * 84.0);
            	
            	// If you just want to paint one image, 
            	// you don't need the paint routine, but
            	// just use this method
            	// the yOffset is index * heightOfFilmstrip
            	this.setImage("filmstrip", 0, index * 65);	
            });
            
            widget.startTimer(30);
            return widget;
        };
        
        const var VuMeterLeft = createFilmStripVuMeter("VuMeterLeft", 11, 10, false);
        const var VuMeterRight = createFilmStripVuMeter("VuMeterRight", 160, 10, true);
        

        Dan Korneff - Producer / Mixer / Audio Nerd

        ustk 1 Reply Last reply Reply Quote 0
        • ustk
          ustk @Dan Korneff last edited by ustk

          @dustbro Since I don't have the filmstrip, I commented out the 3 associated lines, and magically the component appears to be correct.
          If I uncomment the lines, the issue comes back...

          I can't help pressing F5 in the forum...

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

          23
          Online

          1.1k
          Users

          6.8k
          Topics

          62.4k
          Posts