FR: Shortcuts for layouts

Discussion about: tracktion.com
RELATED
PRODUCTS

Post

I would like to have an option to assing key shortcuts to different layouts, and add layouts to custom menu.

Post

If you mean custom view states, there is a quick macro you could run as a key command, that has a menu with a few:

Tracktion.showLoadViewStateMenu();

Track heights, and 'toggling' different views is pretty easy to do with macros. I think what you want can probably be done already, they just need to take that next step in releasing more macro knowledge to the public, or adding more to the API. In this case if I could just setProperty for the VIEWSTATE I think that's all I'd need for fully custom views on a key-command.

Hopefully that's what you are talking about.

Post

I find the macro programming section of the WF9 manual uselessly lacking in detail. Not sure if the new 11.5 manual improves that.

Kang should write an addendum. I'd read the heck out of that.
Spotify, Apple Music, YouTube, and even Deezer, whatever the hell Deezer is.

More fun at Twitter @watchfulactual

Post

Lol, thanks. I don't really know much about it, just very basic understanding of logic in general and copying what's available.

I found this too.

Tracktion.loadViewStateWithName ('default');

Which doesn't seem to do anything. You'd think it would go to the 'default' view that you can get from the command I listed previously, which would allow you to set, default, mixer, arrange, and minimal as separate key commands. It would also imply that you could save view state's which is exactly what we need for this, if I'm understanding the OP correctly.

Post

There IS a "save layout" feature, in that "window view" just to the left of the "eye" upper right. One of the options in there is to "save layout". Just a wild guess - if you have some favorites you can save, then maybe this function allows you to easily jump between those named layouts ?
Waveform 11; Win10 desktop/8 Gig; Win8 Laptop 4Gig; MPK261; VFX+disfunctional ESQ-1

Post

Peter Widdicombe wrote: Mon Feb 22, 2021 12:28 pm There IS a "save layout" feature, in that "window view" just to the left of the "eye" upper right. One of the options in there is to "save layout". Just a wild guess - if you have some favorites you can save, then maybe this function allows you to easily jump between those named layouts ?
Nice find, not sure I would have ever right-clicked that icon. That does allow you to save states and add them to the menu from the first macro I posted, which is cool. It seems like it definitely should allow you to load these (or custom ones) from the second macro I posted. I tried everything I could think of and can't get it to work. It feels like a bug, considering even the one in the API doesn't work.

edit: doesn't actually require a right click. I always thought that icon was related to docking or something, which I never do.

Post

I have made some Layouts and it looks like the API works if you include the correct name. I don't know how to recall any of the factory Layouts. I've been trying. They probably have names, but who knows what they are? Does anyone know how to list the properties of an object? Issues with the factory Layouts may have something to do with them being in a subfolder.

I made a custom Layout that I saved as "Composer" and this script loads it:
Tracktion.loadViewStateWithName ('Composer');
the old free version may not work boots successfully on new generations of computers, instruments, and hardware

Post

pough wrote: Mon Feb 22, 2021 7:49 pm I have made some Layouts and it looks like the API works if you include the correct name. I don't know how to recall any of the factory Layouts. I've been trying. They probably have names, but who knows what they are? Does anyone know how to list the properties of an object? Issues with the factory Layouts may have something to do with them being in a subfolder.

I made a custom Layout that I saved as "Composer" and this script loads it:
Tracktion.loadViewStateWithName ('Composer');
There you have it. That's really weird, I'm completely sure I tried that exactly as is, multiple times. :dog:

You are also right about the issue with the defaults. It's because they are in a 'factory' folder within the 'views' folder. If you put them directly in the 'views' folder (get to it by going to 'show layouts directory' when you click the layout icon, weirdly I can't figure out how to get there through windows explorer) and use proper punctuation it works and so do custom ones.. Thanks for pointing that out.

Post

pough wrote: Mon Feb 22, 2021 7:49 pm I have made some Layouts and it looks like the API works if you include the correct name. I don't know how to recall any of the factory Layouts. I've been trying. They probably have names, but who knows what they are? Does anyone know how to list the properties of an object? Issues with the factory Layouts may have something to do with them being in a subfolder.

I made a custom Layout that I saved as "Composer" and this script loads it:
Tracktion.loadViewStateWithName ('Composer');
Thats it! Thanks!
Is there any way to set a key to toggle between different wievs?
I've tried to use "if" but i suck at programming too much.

I don't think there is a command to get actual states name.

I've tried something like this:

Code: Select all

if (Tracktion.loadViewStateWithName () == 'x') {
Tracktion.loadViewStateWithName ('y');
} else {
Tracktion.loadViewStateWithName ('x');
}

Post

There's a Tracktion.getViewState() but I haven't managed to figure it out. It returns an object. I haven't managed to find the name property.

Is there any way to find out the properties of an object?
the old free version may not work boots successfully on new generations of computers, instruments, and hardware

Post

pough wrote: Tue Feb 23, 2021 10:18 pm There's a Tracktion.getViewState() but I haven't managed to figure it out. It returns an object. I haven't managed to find the name property.

Is there any way to find out the properties of an object?
Have you done the thing were you open an edit with notepad and go through and see properties and stuff. I'm not sure this is what you're talking about, but it's worth doing if you haven't.

Post

Not sure exactly what you're looking for, but you can create 2 really simple macros to set your desired views, and then call them up anytime with a keystroke...
W11view.jpg
With this <ctrl>F7 gives me a normal view, and <crtl>F8 gives me a mixer view; as those I had saved just previously.

The toughest part is finding a convenient/unused key combination.
You do not have the required permissions to view the files attached to this post.
Waveform 11; Win10 desktop/8 Gig; Win8 Laptop 4Gig; MPK261; VFX+disfunctional ESQ-1

Post

Kang wrote: Tue Feb 23, 2021 10:24 pm Have you done the thing were you open an edit with notepad and go through and see properties and stuff. I'm not sure this is what you're talking about, but it's worth doing if you haven't.
Good idea. I can find properties that way, but it looks like the ViewState includes specific details to do with the layout. But no name. So you can't check to see which named Layout is current.

Is there such a thing as a public variable?
the old free version may not work boots successfully on new generations of computers, instruments, and hardware

Post

Looks like variable are public if they're outside of any blocks and you don't use 'var' to declare them. I made this macro and set a keyboard shortcut to it. I can toggle between the two Layouts I have made.

Code: Select all

var viewOne = 'Composer';
var viewTwo = 'ClearMix';

// public variable myLayout: give it a default value if not yet instantiated
myLayout = (myLayout != '') ? myLayout : viewOne; // IMPORTANT NOT TO USE "var"

if( myLayout == viewOne ) {
    Tracktion.loadViewStateWithName (viewTwo);
    myLayout = viewTwo;
} else {
    Tracktion.loadViewStateWithName (viewOne);
    myLayout = viewOne;
}
the old free version may not work boots successfully on new generations of computers, instruments, and hardware

Post

pough wrote: Wed Feb 24, 2021 5:51 pm Looks like variable are public if they're outside of any blocks and you don't use 'var' to declare them. I made this macro and set a keyboard shortcut to it. I can toggle between the two Layouts I have made.

Code: Select all

var viewOne = 'Composer';
var viewTwo = 'ClearMix';

// public variable myLayout: give it a default value if not yet instantiated
myLayout = (myLayout != '') ? myLayout : viewOne; // IMPORTANT NOT TO USE "var"

if( myLayout == viewOne ) {
    Tracktion.loadViewStateWithName (viewTwo);
    myLayout = viewTwo;
} else {
    Tracktion.loadViewStateWithName (viewOne);
    myLayout = viewOne;
}
Nice! I like this one, thanks.

I'd love to add a Marker Track re-size (without it needing to be selected) to this if anyone has any ideas on that. Being able to select a specific track is still my white whale.

Post Reply

Return to “Tracktion”