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

Method parseXml

packages/alphatab/src/importer/CapellaParser.ts:162–183  ·  view source on GitHub ↗
(xml: string, settings: Settings)

Source from the content-addressed store, hash-verified

160 private _initialTempo: number = -1;
161
162 public parseXml(xml: string, settings: Settings): void {
163 this._galleryObjects = new Map<string, DrawObject>();
164 this._tieStarts = [];
165 this._tieStartIds = new Map<number, boolean>();
166 this._voiceCounts = new Map<number, number>();
167 this._slurs = new Map<Beat, SlurDrawObject>();
168 this._crescendo = new Map<Beat, WedgeDrawObject>();
169 this._isFirstSystem = true;
170
171 const dom: XmlDocument = new XmlDocument();
172 try {
173 dom.parse(xml);
174 } catch (e) {
175 throw new UnsupportedFormatError('Could not parse XML', e as Error);
176 }
177
178 this._parseDom(dom);
179
180 this._consolidate();
181
182 this.score.finish(settings);
183 }
184
185 private _consolidate() {
186 ModelUtils.consolidate(this.score);

Callers 1

readScoreMethod · 0.95

Calls 4

parseMethod · 0.95
_parseDomMethod · 0.95
_consolidateMethod · 0.95
finishMethod · 0.45

Tested by

no test coverage detected