-
Notifications
You must be signed in to change notification settings - Fork 215
Description
Discussed in #2324
Current Situation
When a rendered staff in a system is completely empty, alphaTab still shows it.
Desired Behavior
There should be an option which triggers alphaTab to hide the staves in such cases. There should likely be separate options for single track (default: ShowEmptyStaves) and multi-track (default: HideEmptyStaves) to control this behavior.
Implementation notes
Due to the dynamic resizing and layouting of alphaTab it is not easy to detect from outside that a rendered staff is empty.
Hiding of staves should happen as part of the final steps on the layout process (likely finalizeSystem
?). When everything is "layed out" and horizontally sized accordingly, we know which bars made it to the system.
We then go through all staves again, and mark them as visible/invisible (separate flag on the renderstaff) and place them on the respective y-positions. This might require adjusting flags like isFirstInSystem
to ensure the accolade placement is still correct.
For the sake of simplicity we still keep all bar renderers active but just skip rendering of them. This ensures we have all objects available when resizing.
For checking whether the contained bars in a staff are empty, we might check some existing things:
isEmpty
hasChanges
isRestOnly
But we might need to adjust these properties for this need.