* Initiates a rendering of the given score. * @param score The score containing the tracks to be rendered. * @param trackIndexes The indexes of the tracks from the song that should be rendered. If not provided, the first track of the * song will be shown. * @param renderHints Add
(score: Score, trackIndexes?: number[], renderHints?: RenderHints)
| 667 | * ``` |
| 668 | */ |
| 669 | public renderScore(score: Score, trackIndexes?: number[], renderHints?: RenderHints): void { |
| 670 | const tracks: Track[] = []; |
| 671 | if (!trackIndexes) { |
| 672 | if (score.tracks.length > 0) { |
| 673 | tracks.push(score.tracks[0]); |
| 674 | } |
| 675 | } else { |
| 676 | if (trackIndexes.length === 0) { |
| 677 | if (score.tracks.length > 0) { |
| 678 | tracks.push(score.tracks[0]); |
| 679 | } |
| 680 | } else if (trackIndexes.length === 1 && trackIndexes[0] === -1) { |
| 681 | for (const track of score.tracks) { |
| 682 | tracks.push(track); |
| 683 | } |
| 684 | } else { |
| 685 | for (const index of trackIndexes) { |
| 686 | if (index >= 0 && index <= score.tracks.length) { |
| 687 | tracks.push(score.tracks[index]); |
| 688 | } |
| 689 | } |
| 690 | } |
| 691 | } |
| 692 | this._internalRenderTracks(score, tracks, renderHints); |
| 693 | } |
| 694 | |
| 695 | /** |
| 696 | * Renders the given list of tracks. |
no test coverage detected