예제 #1
0
 private function writeTrack(Track $track)
 {
     $channel = $this->getChannelRoute($track->getChannelId());
     $flags = 0;
     if ($this->isPercussionChannel($track->getSong(), $track->getChannelId())) {
         $flags |= 0x1;
     }
     $this->writeUnsignedByte($flags);
     $this->writeStringByte($track->getName(), 40);
     $this->writeInt(count($track->getStrings()));
     for ($i = 0; $i < 7; $i++) {
         $value = 0;
         if (count($track->getStrings()) > $i) {
             $string = $track->getStrings()[$i];
             $value = $string->getValue();
         }
         $this->writeInt($value);
     }
     $this->writeInt(1);
     $this->writeInt($channel->getChannel1() + 1);
     $this->writeInt($channel->getChannel2() + 1);
     $this->writeInt(24);
     $this->writeInt(min(max($track->getOffset(), 0), 12));
     $this->writeColor($track->getColor());
 }
예제 #2
0
 private function writeTrack(Track $track)
 {
     $channel = $this->getChannelRoute($track->getChannelId());
     $flags = 0;
     if ($this->isPercussionChannel($track->getSong(), $track->getChannelId())) {
         $flags |= 0x1;
     }
     $this->writeUnsignedByte($flags);
     $this->writeUnsignedByte(8 | $flags);
     $this->writeStringByte($track->getName(), 40);
     $this->writeInt(count($track->getStrings()));
     for ($i = 0; $i < 7; $i++) {
         $value = 0;
         if (count($track->getStrings()) > $i) {
             $string = $track->getStrings()[$i];
             $value = $string->getValue();
         }
         $this->writeInt($value);
     }
     $this->writeInt(1);
     $this->writeInt($channel->getChannel1() + 1);
     $this->writeInt($channel->getChannel2() + 1);
     $this->writeInt(24);
     $this->writeInt($track->getOffset());
     $this->writeColor($track->getColor());
     $this->writeBytes(array(67, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -1, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1));
 }