MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / renderTracks

Method renderTracks

packages/alphatab/src/AlphaTabApiBase.ts:729–745  ·  view source on GitHub ↗

* Renders the given list of tracks. * @param tracks The tracks to render. They must all belong to the same score. * @param renderHints Additional hints to respect during layouting and rendering. * * @category Methods - Core * @since 0.9.4 * @example * JavaScript

(tracks: Track[], renderHints?: RenderHints)

Source from the content-addressed store, hash-verified

727 * ```
728 */
729 public renderTracks(tracks: Track[], renderHints?: RenderHints): void {
730 if (tracks.length > 0) {
731 const score: Score = tracks[0].score;
732 for (const track of tracks) {
733 if (track.score !== score) {
734 this.onError(
735 new AlphaTabError(
736 AlphaTabErrorType.General,
737 'All rendered tracks must belong to the same score.'
738 )
739 );
740 return;
741 }
742 }
743 this._internalRenderTracks(score, tracks, renderHints);
744 }
745 }
746
747 private _internalRenderTracks(score: Score, tracks: Track[], renderHints: RenderHints | undefined): void {
748 ModelUtils.applyPitchOffsets(this.settings, score);

Callers 2

rebuildMethod · 0.45
loadTexMethod · 0.45

Calls 2

onErrorMethod · 0.95
_internalRenderTracksMethod · 0.95

Tested by

no test coverage detected