* Append a new track, it will be inserted at * index 0 and rendered last (top layer)
(Track: (new () => L) | L)
| 212 | * index 0 and rendered last (top layer) |
| 213 | */ |
| 214 | public shiftTrack<L extends Track<Clip>>(Track: (new () => L) | L): L { |
| 215 | // Check if track has been instantiated |
| 216 | const track = typeof Track == 'object' ? Track : new Track(); |
| 217 | |
| 218 | track.connect(this); |
| 219 | |
| 220 | this.stage.addChild(track.view); |
| 221 | this.tracks.unshift(track); |
| 222 | |
| 223 | track.bubble(this); |
| 224 | this.trigger('update', undefined); |
| 225 | |
| 226 | return track; |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Create a track with the given type |
no test coverage detected