Section Views

View utility functions

See
View

Summary

Return typeFunction and summary
 AddImagesDirectory(string path)
Add a directory where script can search for pictures.
intAdjustStavesGroupSymbolPosition(Score score, table groups)
Experimental: Adjust horizontal and vertical staves group symbole (braces and brackets).
intChooseNoteHeadShape(int defaultValue)
Open a dialog to choose a note head shape.
intChooseView(Score score, boolean index, int (default=current)
Ask the user to choose one view, or a value for ViewIndex.

Functions

ChooseNoteHeadShape(int defaultValue)

Open a dialog to choose a note head shape.

ParameterTypeDefaultDescription
defaultValueintSHAPE_NORMALOne of SHAPE_* constants in MSDefine
Return
int: One of SHAPE_* constants, or nil if user cancelled the choice.

AdjustStavesGroupSymbolPosition(Score score, table groups)

Experimental: Adjust horizontal and vertical staves group symbole (braces and brackets).

ParameterTypeDefaultDescription
scoreScore score
groupstablenilTable of StavesGroup to modify, others are unchanged. nil or empty table means all staves group of score.
Return
int: Number of modified staves group symbols.

ChooseView(Score score, boolean index, int (default=current)

Ask the user to choose one view, or a value for ViewIndex.

ParameterTypeDefaultDescription
scoreScore score
indexboolean Add the choices
  • 0 = all views
  • -1 = general view
  • -2 = all views including staff
  • -3 = all views except general view
(default=currentint view) selected index
Return
int: view index

AddImagesDirectory(string path)

Add a directory where script can search for pictures.

Menus and other Component may include image (picture) which are searched by file name in some Harmony's subdirs, but not in relative paths from the current script. If you script embed images, it is good practice to call AddImagesDirectory(GetCurrentScript()) just after Include "SMUtils".

ParameterTypeDefaultDescription
pathstring path