(element: XmlNode)
| 274 | // <Score>...</Score> |
| 275 | // |
| 276 | private _parseScoreNode(element: XmlNode): void { |
| 277 | for (const c of element.childElements()) { |
| 278 | switch (c.localName) { |
| 279 | case 'Title': |
| 280 | this.score.title = c.innerText; |
| 281 | break; |
| 282 | case 'SubTitle': |
| 283 | this.score.subTitle = c.innerText; |
| 284 | break; |
| 285 | case 'Artist': |
| 286 | this.score.artist = c.innerText; |
| 287 | break; |
| 288 | case 'Album': |
| 289 | this.score.album = c.innerText; |
| 290 | break; |
| 291 | case 'Words': |
| 292 | this.score.words = c.innerText; |
| 293 | break; |
| 294 | case 'Music': |
| 295 | this.score.music = c.innerText; |
| 296 | break; |
| 297 | case 'WordsAndMusic': |
| 298 | const wordsAndMusic: string = c.innerText; |
| 299 | if (wordsAndMusic !== '') { |
| 300 | if (wordsAndMusic && !this.score.words) { |
| 301 | this.score.words = wordsAndMusic; |
| 302 | } |
| 303 | if (wordsAndMusic && !this.score.music) { |
| 304 | this.score.music = wordsAndMusic; |
| 305 | } |
| 306 | } |
| 307 | break; |
| 308 | case 'Copyright': |
| 309 | this.score.copyright = c.innerText; |
| 310 | break; |
| 311 | case 'Tabber': |
| 312 | this.score.tab = c.innerText; |
| 313 | break; |
| 314 | case 'Instructions': |
| 315 | this.score.instructions = c.innerText; |
| 316 | break; |
| 317 | case 'Notices': |
| 318 | this.score.notices = c.innerText; |
| 319 | break; |
| 320 | case 'ScoreSystemsDefaultLayout': |
| 321 | this.score.defaultSystemsLayout = GpifParser._parseIntSafe(c.innerText, 4); |
| 322 | break; |
| 323 | case 'ScoreSystemsLayout': |
| 324 | this.score.systemsLayout = GpifParser._splitSafe(c.innerText).map(i => |
| 325 | GpifParser._parseIntSafe(i, 4) |
| 326 | ); |
| 327 | break; |
| 328 | } |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | private static _parseIntSafe(text: string | undefined, fallback: number) { |
| 333 | if (!text) { |
no test coverage detected