import { PartListEntry } from "./PartListEntry" ; import { Repetition } from "./Repetition" ; import { Fraction } from "../../Common/DataObjects/Fraction" ; import { MusicSheet } from "../MusicSheet" ; export class SourceMusicPart extends PartListEntry { constructor ( musicSheet , startIndex ? , endIndex ? ) { super ( musicSheet ) ; this . musicSheet = musicSheet ; this . startIndex = startIndex ; this . endIndex = endIndex ; } protected parentRepetition : Repetition ; public get MeasuresCount ( ) : number { return this . endIndex - this . startIndex + 1 ; } public get StartIndex ( ) : number { return this . startIndex ; } public get EndIndex ( ) : number { return this . endIndex ; } public get ParentRepetition ( ) : Repetition { return this . parentRepetition ; } public set ParentRepetition ( value ) { this . parentRepetition = value ; } public get AbsoluteTimestamp ( ) : Fraction { return Fraction . createFromFraction ( this . musicSheet . SourceMeasures [ this . startIndex ] . AbsoluteTimestamp ) ; } public setStartIndex ( startIndex ) { this . startIndex = startIndex ; } public setEndIndex ( index ) { this . endIndex = index ; } }