public function __construct(Song $song, $sHeader, $eHeader) { $this->song = $song; $this->sHeader = $sHeader; $this->eHeader = $eHeader; $this->count = $song->countMeasureHeaders(); $this->index = 0; $this->lastIndex = -1; $this->shouldPlay = true; $this->repeatOpen = true; $this->repeatAlternative = 0; $this->repeatStart = Duration::QUARTER_TIME; $this->repeatEnd = 0; $this->repeatMove = 0; $this->repeatStartIndex = 0; $this->repeatNumber = 0; }
private function writeMeasures(Song $song, Tempo $tempo) { for ($i = 0; $i < $song->countMeasureHeaders(); $i++) { $header = $song->getMeasureHeader($i); for ($j = 0; $j < $song->countTracks(); $j++) { $track = $song->getTrack($j); $measure = $track->getMeasure($i); $this->writeMeasure($measure, $header->getTempo()->getValue() != $tempo->getValue()); } $tempo->copyFrom($header->getTempo()); } }