Section Views
View utility functions
- See
- View
Summary
| Return type | Function and summary |
|---|---|
| AddImagesDirectory(string path) Add a directory where script can search for pictures. | |
| int | AdjustStavesGroupSymbolPosition(Score score, table groups) Experimental: Adjust horizontal and vertical staves group symbole (braces and brackets). |
| int | ChooseNoteHeadShape(int defaultValue) Open a dialog to choose a note head shape. |
| int | ChooseView(Score score, boolean index, int (default=current) Ask the user to choose one view, or a value for ViewIndex. |
| int | StaffDeleteLocalMetrics(staves, int FirstBar, int lastBar, metricNames) Soft and precise deletion of local metrics (height, base line, numbers/chord)/lyrics vertical position) of a staff. |
Functions
ChooseNoteHeadShape(int defaultValue)
Open a dialog to choose a note head shape.
| Parameter | Type | Default | Description |
|---|---|---|---|
| defaultValue | int | SHAPE_NORMAL | One of SHAPE_* constants in MSDefine |
- Return
- int: One of SHAPE_* constants, or
nilif user cancelled the choice.
AdjustStavesGroupSymbolPosition(Score score, table groups)
Experimental: Adjust horizontal and vertical staves group symbole (braces and brackets).
| Parameter | Type | Default | Description |
|---|---|---|---|
| score | Score | score | |
| groups | table | nil | Table 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.
StaffDeleteLocalMetrics(staves, int FirstBar, int lastBar, metricNames)
Soft and precise deletion of local metrics (height, base line, numbers/chord)/lyrics vertical position) of a staff.
| Parameter | Type | Default | Description |
|---|---|---|---|
| staves | Staff or table of Staff. | ||
| FirstBar | int | 1 | Bar to start the deletion. |
| lastBar | int | Score.NumberOfBars | Bar to end the deletion. |
| metricNames | nil | string or table: one or several of following strings, "" or nil means all of them: :
|
- Return
- int: Number of affected bars, even if the changes may be not visibles on the score.
ChooseView(Score score, boolean index, int (default=current)
Ask the user to choose one view, or a value for ViewIndex.
| Parameter | Type | Default | Description |
|---|---|---|---|
| score | Score | score | |
| index | boolean | Add the choices
| |
| (default=current | int | 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".
| Parameter | Type | Default | Description |
|---|---|---|---|
| path | string | path |