Skip to content

Hide empty staves within a system #2329

@Danielku15

Description

@Danielku15

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.

Metadata

Metadata

Assignees

Labels

area-renderingEverything related to the renderingplatform-allAffects all platformsstate-acceptedThis is a valid topic to work on.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions