Section StaffTexts
StaffText utility functions
- See
- StaffText
Summary
| Return type | Function and summary |
|---|---|
| int | ApplyToAllSelectedStaffTexts(Score score, function processFunc, boolean printedStavesOnly) Apply a function to all selected StaffTexts, individually selected or inside range selection. |
| int | ApplyToAllStaffTexts(Score score, staves, int firstBar, int lastBar, function processFunc) Apply a function to all StaffTexts in the score, or staff, or in a range of bars. |
| boolean | EnsureObjectInStaffArea(Score score, Staff staff, obj) Ensure an object is in the Staff area, move it vertically if needed. |
| StaffTextIsRehearsalMark(StaffText txt) Returns true if the StaffText argument is generated by rehearsal mark (target). |
Functions
EnsureObjectInStaffArea(Score score, Staff staff, obj)
Ensure an object is in the Staff area, move it vertically if needed.
| Parameter | Type | Default | Description |
|---|---|---|---|
| score | Score | score | |
| staff | Staff | staff | |
| obj | Object: Dynamic, StaffText, FXProcessor, Picture |
- Return
- boolean:
trueif object has been moved vertically,falseotherwise.
ApplyToAllSelectedStaffTexts(Score score, function processFunc, boolean printedStavesOnly)
Apply a function to all selected StaffTexts, individually selected or inside range selection.
This browses selected StaffTexts on visible (printed) staves from first to last, excluding rehearsal mark (target) texts.
| Parameter | Type | Default | Description |
|---|---|---|---|
| score | Score | score | |
| processFunc | function | Function with two StaffText and Staff arguments, which returns true (= 1) if text has been processed, -1 to stop the process. Other returned values are ignored, process continue to next. | |
| printedStavesOnly | boolean | false | If true selected texts on not printed staves are skipped. This has no effect in Scroll mode where all staves are visible. |
- Return
- int: Number of processed texts
- Error
- if arguments are not valid.
ApplyToAllStaffTexts(Score score, staves, int firstBar, int lastBar, function processFunc)
Apply a function to all StaffTexts in the score, or staff, or in a range of bars.
Excludes rehearsal marks (targets) texts.
| Parameter | Type | Default | Description |
|---|---|---|---|
| score | Score | score | |
| staves | nil | ||
| firstBar | int | 1 | First bar to start applying the function. |
| lastBar | int | score.NumberOfBars | Last bar to stop applying the function. |
| processFunc | function | Function with two StaffText and Staff arguments, which returns true (= 1) if StaffText has been processed, -1 to stop the process. Other returned values are ignored, process continue to next StaffText. |
- Return
- int: Number of processed StaffTexts
- Error
- if arguments are not valid.
- See
- ApplyToAllSelectedStaffTexts
StaffTextIsRehearsalMark(StaffText txt)
Returns true if the StaffText argument is generated by rehearsal mark (target).
| Parameter | Type | Default | Description |
|---|---|---|---|
| txt | StaffText | txt |
- Return
- boolean