BR_SetMediaTrackLayouts, graphical glitches #764

Closed
swiiscompos opened this Issue Aug 29, 2015 · 9 comments

Projects

None yet

2 participants

@swiiscompos

With some layouts the API function BR_SetMediaTrackLayouts creates glitches. For example in the default theme, if you change the TCP layout to "bd --- Small Full Meter" and then back to the default layout, it will break the later.

@Breeder
Contributor
Breeder commented Aug 29, 2015

ReaScript documentation (Help->ReaScript documentation) clearly states:

Note that in case of setting MCP layout, due to API limitations, MCP panel width is not updated to match the new layout. However, you can manually refresh it by calling the action "Mixer: Toggle master track visible" (just make sure to call it twice so master track visibility stays the same).

Why is this expected from the user and not done directly when the API is called?
Because you may be changing layout of multiple tracks and that means that those actions would be called multiple times (for each call to BR_SetMediaTrackLayouts the action would be called twice). Instead, user can simply call the action only 2 times, after setting all the layouts and thus not wasting CPU cycles on unneeded actions.

@swiiscompos

But the problem happens with the TCP.

@Breeder
Contributor
Breeder commented Aug 29, 2015

I see now that you wrote TCP and not MCP. Sorry about that, I missed it.
I guess you could employ the same trick but this time try and hide/show the track? I'll see if that works and I'll do it automatically in SWS for the next update.

@swiiscompos

It does work, thanks!

@Breeder
Contributor
Breeder commented Aug 29, 2015

Ah, thanks for testing it for me then :) I'll push the fix now

@swiiscompos

The MCP workaround is problematic for me because I'm using the function in a defer() script and it keeps changing the Master's visibility making the mixer useless. Any way to refresh the mcp panel width only when the layout is changed? Here is a post to Sexan's newest modification of my script: http://forum.cockos.com/showpost.php?p=1565504&postcount=5

@Breeder
Contributor
Breeder commented Aug 29, 2015

Function should return true if there were any changes so you can use that as the flag to refresh MCP with said actions

@swiiscompos

Me again. I was able to avoid successfully the glitches but the use of hide/unhide (they have to be toggle to keep visibility state) makes the tcp and arrange view blink in a visible and quite annoying way. Is it going to be transparent when integrated in the function?

@Breeder
Contributor
Breeder commented Sep 1, 2015

Latest pre introduces additional API for track layouts. You can use that now. I'll fix SWS api so it also uses this new native API calss

@Breeder Breeder self-assigned this Sep 1, 2015
@Breeder Breeder closed this in 2350251 Sep 10, 2015
@Breeder Breeder was unassigned by Jeff0S Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment