M4L get Zoom Display (UI scaling control)

Blair's icon

Is there any way to get the value of the zoom display? I thought it would just be the zoom factor in max but its an independent thing, I'm wondering if anyone's been able to get it via LOM or something else?

11OLSEN's icon

Currently not. If your device is visible you can get the height and divide that by the default height of 169 pix.

Blair's icon

Do you mean getting it via the LOM or another way?

Blair's icon

function bang() {

lvl = this.patcher.getattr("zoomfactor")

outlet(0, lvl);

}

figured it out
Putting this code inside the js object, adding a metro and keeping it in the main patcher will give you the zoom level!

11OLSEN's icon

I meant it's not in the LOM. This does not work if device isn't visible. But it's better than nothing. Maybe you want to optimize like this:

var lvl
function bang() 
{	
    var newlvl = this.patcher.getattr("zoomfactor")
    if (newlvl != lvl)
    {
	lvl = newlvl
    	outlet(0, lvl);
    }
}

to prevent the js to constantly pumping messages through it's outlet

Source Audio's icon

Is zoom value you talk about not stored somewhere in live settings ?

11OLSEN's icon

Not in the moment you change it but probably when you quit Live.