alphaTab.model.Bar
A bar is a single block within a track, also known as Measure.
class BarProperties​
barLineLeft​
The bar line to draw on the left side of the bar. Note that the combination with barLineRight of the previous bar matters.
If this bar has a Regular/Automatic style but the previous bar is customized, no additional line is drawn by this bar.
If both bars have a custom style, both bar styles are drawn.
- JavaScript
- C#
- Kotlin
barLineRight​
The bar line to draw on the right side of the bar. Note that the combination with barLineLeft of the next bar matters.
If this bar has a Regular/Automatic style but the next bar is customized, no additional line is drawn by this bar.
If both bars have a custom style, both bar styles are drawn.
- JavaScript
- C#
- Kotlin
barNumberDisplay​
How bar numbers should be displayed. If specified, overrides the value from the stylesheet on score level.
- JavaScript
- C#
- Kotlin
barNumberDisplay?: BarNumberDisplay;BarNumberDisplay BarNumberDisplay { get; set; }var barNumberDisplay: BarNumberDisplayclef​
Gets or sets the clef on this bar.
clefOttava​
Gets or sets the ottava applied to the clef.
displayScale​
A relative scale for the size of the bar when displayed. The scale is relative within a single line (system). The sum of all scales in one line make the total width, and then this individual scale gives the relative size.
- JavaScript
- C#
- Kotlin
displayScale: number;double DisplayScale { get; set; }var displayScale: DoubledisplayWidth​
An absolute width of the bar to use when displaying in single track display scenarios.
- JavaScript
- C#
- Kotlin
displayWidth: number;double DisplayWidth { get; set; }var displayWidth: DoublefilledVoices​
Gets the number of voices which have content within this stuff.
- JavaScript
- C#
- Kotlin
readonly filledVoices: Set<number>;Set<double> FilledVoices { get; }val filledVoices: Set<Double>hasChanges​
Whether this bar has any changes applied which are not related to the voices in it. (e.g. new key signatures)
- JavaScript
- C#
- Kotlin
readonly hasChanges: boolean;bool HasChanges { get; }val hasChanges: Booleanid​
Gets or sets the unique id of this bar.
- JavaScript
- C#
- Kotlin
id: number;double Id { get; set; }var id: Doubleindex​
Gets or sets the zero-based index of this bar within the staff.
- JavaScript
- C#
- Kotlin
index: number;double Index { get; set; }var index: DoubleisEmpty​
Whether this bar is fully empty (not even having rests).
- JavaScript
- C#
- Kotlin
readonly isEmpty: boolean;bool IsEmpty { get; }val isEmpty: BooleanisMultiVoice​
Gets a value indicating whether this bar contains multiple voices with notes.
- JavaScript
- C#
- Kotlin
readonly isMultiVoice: boolean;bool IsMultiVoice { get; }val isMultiVoice: BooleanisRestOnly​
Whether this bar is empty or has only rests.
- JavaScript
- C#
- Kotlin
readonly isRestOnly: boolean;bool IsRestOnly { get; }val isRestOnly: BooleankeySignature​
Gets or sets the key signature used on all bars.
- JavaScript
- C#
- Kotlin
keySignatureType​
Gets or sets the type of key signature (major/minor)
- JavaScript
- C#
- Kotlin
keySignatureType: KeySignatureType;KeySignatureType KeySignatureType { get; set; }var keySignatureType: KeySignatureTypemasterBar​
(no description)
nextBar​
Gets or sets the next bar that comes after this bar.
previousBar​
Gets or sets the previous bar that comes before this bar.
simileMark​
Gets or sets the simile mark on this bar.
- JavaScript
- C#
- Kotlin
staff​
Gets or sets the reference to the parent staff.
style​
The style customizations for this item.
sustainPedals​
The sustain pedal markers within this bar.
- JavaScript
- C#
- Kotlin
sustainPedals: SustainPedalMarker[];IList<SustainPedalMarker> SustainPedals { get; set; }var sustainPedals: alphaTab.collections.List<SustainPedalMarker>voices​
Gets or sets the list of voices contained in this bar.
Methods​
addVoice​
(no description)
| Parameter | Summary |
|---|---|
voiceAll | (no description) |
calculateDuration​
(no description)
- JavaScript
- C#
- Kotlin
calculateDuration(): numberdouble CalculateDuration()fun calculateDuration(): Doublefinish​
(no description)
| Parameter | Summary |
|---|---|
settingsAll | (no description) |
sharedDataBagAll | (no description) |
getActualBarLineLeft​
The bar line to draw on the left side of the bar with an "automatic" type resolved to the actual one.
- JavaScript
- C#
- Kotlin
getActualBarLineLeft(isFirstOfSystem: boolean): BarLineStyleBarLineStyle GetActualBarLineLeft(bool isFirstOfSystem)fun getActualBarLineLeft(isFirstOfSystem: Boolean): BarLineStyle| Parameter | Summary |
|---|---|
isFirstOfSystemAll | Whether the bar is the first one in the system. |
getActualBarLineRight​
The bar line to draw on the right side of the bar with an "automatic" type resolved to the actual one.
- JavaScript
- C#
- Kotlin
getActualBarLineRight(): BarLineStyleBarLineStyle GetActualBarLineRight()fun getActualBarLineRight(): BarLineStyle