Section Bars
Bars utility functions.
Summary
Constant | Type | Summary |
---|---|---|
BAR_STATE_AFTER_PRINT_REGION | int | Bar state visibility: not visible, after last printed bar |
BAR_STATE_BEFORE_PRINT_REGION | int | Bar state visibility: not visible, before first printed bar |
BAR_STATE_MULTI_FIRST | int | Bar visibility state: visible, first bar of a multi-rest or multi-repeat. |
BAR_STATE_MULTI_LAST | int | Bar visibility state: not visible, last bar of a multi-rest or multi-repeat. |
BAR_STATE_MULTI_MIDDLE | int | Bar visibility state: not visible, inside (but not last bar of) a multi-rest or multi-repeat. |
BAR_STATE_UNDEFINED | int | Bar visibility state: undefined: should not happen. |
BAR_STATE_VISIBLE | int | Bar visibility state: normal, visible. |
Return type | Function and summary |
---|---|
int | DontSplitTwoAndFourRepeats(Score score, int firstBar, int lastBar) In current view, avoid split (end of line) in the middle of %2 and %4 bar-repeats. |
table | GetBarVisibilityState(Score score, int firstBar, int lastBar) Get the visibility state of all bars between firstBar and lastBar. |
TargetHideBarNumbers(Score score) Hide bar numbers at bar that display a rehearsal mark, for all views. | |
TargetSplitMultiRests(Score score) Split multi-rests at all visible rehearsal marks, for all views. |
Constants
int BAR_STATE_UNDEFINED
Bar visibility state: undefined: should not happen.
int BAR_STATE_VISIBLE
Bar visibility state: normal, visible.
int BAR_STATE_MULTI_FIRST
Bar visibility state: visible, first bar of a multi-rest or multi-repeat.
int BAR_STATE_MULTI_MIDDLE
Bar visibility state: not visible, inside (but not last bar of) a multi-rest or multi-repeat.
int BAR_STATE_MULTI_LAST
Bar visibility state: not visible, last bar of a multi-rest or multi-repeat.
int BAR_STATE_BEFORE_PRINT_REGION
Bar state visibility: not visible, before first printed bar
int BAR_STATE_AFTER_PRINT_REGION
Bar state visibility: not visible, after last printed bar
Functions
TargetSplitMultiRests(Score score)
Split multi-rests at all visible rehearsal marks, for all views.
The property is set to the previous bar.
Parameter | Type | Default | Description |
---|---|---|---|
score | Score | score |
TargetHideBarNumbers(Score score)
Hide bar numbers at bar that display a rehearsal mark, for all views.
Common practice in orchestral score, rehearsal marks are framed big bar numbers, so no need to display regular bar numbers at these bars.
Parameter | Type | Default | Description |
---|---|---|---|
score | Score | score |
GetBarVisibilityState(Score score, int firstBar, int lastBar)
Get the visibility state of all bars between firstBar and lastBar.
Bars can be invisible if out of print region, in the middle or at the end of a multi-rest.
Parameter | Type | Default | Description |
---|---|---|---|
score | Score | score | |
firstBar | int | 1 | |
lastBar | int | score.NumberOfBars |
- Return
- table: A table of bar number to int value:
- BAR_STATE_VISIBLE: normal bar, visible,
- BAR_STATE_MULTI_FIRST: visible, first bar of a multi-rest or multi-repeat,
- BAR_STATE_MULTI_MIDDLE: not visible, inside (but not last bar of) a multi-rest or multi-repeat,
- BAR_STATE_MULTI_LAST: not visible, last bar of a multi-rest or multi-repeat,
- BAR_STATE_BEFORE_PRINT_REGION: not visible, before first printed bar,
- BAR_STATE_AFTER_PRINT_REGION: not visible, after last printed bar,
- BAR_STATE_UNDEFINED: should never happen because calculation is made by switching to Page mode if necessary.
- Example
local first,last = 10,35 local bsv = GetBarVisibilityState(FrontScore(), first, last) for i=first,last do if bsv[i] == BAR_STATE_MULTI_LAST then -- set force display bar number after a multi-rest FrontScore().GetGlobalBarSetting(i+1).IsForcedDisplay = true end FrontScore().Update() end
DontSplitTwoAndFourRepeats(Score score, int firstBar, int lastBar)
In current view, avoid split (end of line) in the middle of %2 and %4 bar-repeats.
Set global bar settings : DontBreakLine = true, EndOfLine = false, EndOfPage = false.
Parameter | Type | Default | Description |
---|---|---|---|
score | Score | score | |
firstBar | int | 1 | First bar where %2 and %4 are searched |
lastBar | int | score.NumberOfBars | Last bar where %2 and %4 are searched |
- Return
- int: Number of modified bars