Section Pictures

Staff picture and graphic lines utility functions

See
Picture

Summary

Return typeFunction and summary
intApplyToAllGraphicLines(Score score, staves, int firstBar, int lastBar, function processFunc)
Apply a function to all graphic lines (Picture objectss) in the score, or staff, or in a range of bars.
intApplyToAllImages(Score score, staves, int firstBar, int lastBar, function processFunc)
Apply a function to all images (Picture objectss) in the score, or staff, or in a range of bars.
intApplyToAllSelectedGraphicLines(Score score, function processFunc, boolean printedStavesOnly)
Apply a function to all selected graphic lines (Picture objects), individually selected or inside range selection.
intApplyToAllSelectedImages(Score score, function processFunc, boolean printedStavesOnly)
Apply a function to all selected images (Picture objects), individually selected or inside range selection.
booleanEnsureObjectInStaffArea(Score score, Staff staff, obj)
Ensure an object is in the Staff area, move it vertically if needed.

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.

ApplyToAllSelectedGraphicLines(Score score, function processFunc, boolean printedStavesOnly)

Apply a function to all selected graphic lines (Picture objects), individually selected or inside range selection.

This browses selected graphic lines on visible (printed) staves from first to last.

ParameterTypeDefaultDescription
scoreScore score
processFuncfunction Function with two Picture and Staff arguments, which returns true (= 1) if graphic line has been processed, -1 to stop the process. Other returned values are ignored, process continue to next.
printedStavesOnlybooleanfalseIf true selected lines on not printed staves are skipped. This has no effect in Scroll mode where all staves are visible.
Return
int: Number of processed graphic lines
Error
if arguments are not valid.

ApplyToAllGraphicLines(Score score, staves, int firstBar, int lastBar, function processFunc)

Apply a function to all graphic lines (Picture objectss) in the score, or staff, or in a range of bars.

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 Picture and Staff arguments, which returns true (= 1) if graphic line has been processed, -1 to stop the process. Other returned values are ignored, process continue to next graphic line.
Return
int: Number of processed graphic lines
Error
if arguments are not valid.
See
ApplyToAllSelectedGraphicLines

ApplyToAllSelectedImages(Score score, function processFunc, boolean printedStavesOnly)

Apply a function to all selected images (Picture objects), individually selected or inside range selection.

This browses selected images on visible (printed) staves from first to last.

ParameterTypeDefaultDescription
scoreScore score
processFuncfunction Function with two Picture and Staff arguments, which returns true (= 1) if image has been processed, -1 to stop the process. Other returned values are ignored, process continue to next.
printedStavesOnlybooleanfalseIf true selected images on not printed staves are skipped. This has no effect in Scroll mode where all staves are visible.
Return
int: Number of processed images
Error
if arguments are not valid.

ApplyToAllImages(Score score, staves, int firstBar, int lastBar, function processFunc)

Apply a function to all images (Picture objectss) in the score, or staff, or in a range of bars.

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 Picture and Staff arguments, which returns true (= 1) if image has been processed, -1 to stop the process. Other returned values are ignored, process continue to next image.
Return
int: Number of processed images
Error
if arguments are not valid.
See
ApplyToAllSelectedImages