Section StaffTexts

StaffText utility functions

See
StaffText

Summary

Return typeFunction and summary
intApplyToAllSelectedStaffTexts(Score score, function processFunc, boolean printedStavesOnly)
Apply a function to all selected StaffTexts, individually selected or inside range selection.
intApplyToAllStaffTexts(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.
booleanEnsureObjectInStaffArea(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.

ParameterTypeDefaultDescription
scoreScore score
staffStaff staff
obj  Object: Dynamic, StaffText, FXProcessor, Picture
Return
boolean: true if object has been moved vertically, false otherwise.

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.

ParameterTypeDefaultDescription
scoreScore score
processFuncfunction 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.
printedStavesOnlybooleanfalseIf 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.

ParameterTypeDefaultDescription
scoreScore score
staves nil
  • nil means all staves
  • a Staff object to apply only to that staff
  • a table of Staff to apply to a list of staves
firstBarint1First bar to start applying the function.
lastBarintscore.NumberOfBarsLast bar to stop applying the function.
processFuncfunction 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).

ParameterTypeDefaultDescription
txtStaffText txt
Return
boolean