()
| 243 | } |
| 244 | |
| 245 | private insertNewBar(): alphaTab.model.Bar { |
| 246 | const previousBar = this.staff.bars.length > 0 ? this.staff.bars[this.staff.bars.length - 1] : null; |
| 247 | const bar = new alphaTab.model.Bar(); |
| 248 | if (previousBar) { |
| 249 | bar.clef = previousBar.clef; |
| 250 | bar.clefOttava = previousBar.clefOttava; |
| 251 | bar.keySignature = previousBar.keySignature; |
| 252 | bar.keySignatureType = previousBar.keySignatureType; |
| 253 | } |
| 254 | this.staff.addBar(bar); |
| 255 | const voice = new alphaTab.model.Voice(); |
| 256 | bar.addVoice(voice); |
| 257 | |
| 258 | const beats = this.createEmptyBeatsForBar(); |
| 259 | for (let i = 0; i < beats.length; i++) { |
| 260 | voice.addBeat(beats[i]); |
| 261 | this.api.tickCache?.addBeat(beats[i], i * this.slotTicks, this.slotTicks); |
| 262 | } |
| 263 | return bar; |
| 264 | } |
| 265 | |
| 266 | private insertNewSystem(): void { |
| 267 | this.insertTickThreshold = -1; |
no test coverage detected