-
Notifications
You must be signed in to change notification settings - Fork 260
Hide empty staves within a system #2329
Copy link
Copy link
Labels
area-renderingEverything related to the renderingEverything related to the renderingplatform-allAffects all platformsAffects all platformsstate-acceptedThis is a valid topic to work on.This is a valid topic to work on.
Milestone
Metadata
Metadata
Assignees
Labels
area-renderingEverything related to the renderingEverything related to the renderingplatform-allAffects all platformsAffects all platformsstate-acceptedThis is a valid topic to work on.This is a valid topic to work on.
Type
Fields
Give feedbackNo fields configured for Feature.
Projects
Status
Done
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
isFirstInSystemto 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:
isEmptyhasChangesisRestOnlyBut we might need to adjust these properties for this need.