コード例 #1
0
 /**
  * Reads NoteEffect
  * 
  * @param NoteEffect $noteEffect
  */
 public function readNoteEffects(NoteEffect $noteEffect)
 {
     $flags1 = intval($this->reader->readUnsignedByte());
     $flags2 = intval($this->reader->readUnsignedByte());
     $noteEffect->setHammer(($flags1 & 0x2) != 0);
     $noteEffect->setLetRing(($flags1 & 0x8) != 0);
     $noteEffect->setVibrato(($flags2 & 0x40) != 0 || $noteEffect->isVibrato());
     $noteEffect->setPalmMute(($flags2 & 0x2) != 0);
     $noteEffect->setStaccato(($flags2 & 0x1) != 0);
     if (($flags1 & 0x1) != 0) {
         $this->reader->factory('GuitarPro3Effects')->readBend($noteEffect);
     }
     if (($flags1 & 0x10) != 0) {
         $this->reader->readGrace($noteEffect);
     }
     if (($flags2 & 0x4) != 0) {
         $this->reader->factory('GuitarPro4Effects')->readTremoloPicking($noteEffect);
     }
     if (($flags2 & 0x8) != 0) {
         $noteEffect->setSlide(true);
         $this->reader->readByte();
     }
     if (($flags2 & 0x10) != 0) {
         $this->readHarmonic($noteEffect);
     }
     if (($flags2 & 0x20) != 0) {
         $this->readTrill($noteEffect);
     }
 }
コード例 #2
0
ファイル: GuitarPro3Effects.php プロジェクト: stdtabs/phptabs
 /**
  * Reads NoteEffect
  * 
  * @param NoteEffect $noteEffect
  * @return void
  */
 public function readNoteEffects(NoteEffect $effect)
 {
     $flags = $this->reader->readUnsignedByte();
     $effect->setHammer(($flags & 0x2) != 0);
     $effect->setSlide(($flags & 0x4) != 0);
     $effect->setLetRing(($flags & 0x8) != 0);
     if (($flags & 0x1) != 0) {
         $this->readBend($effect, $this->reader);
     }
     if (($flags & 0x10) != 0) {
         $this->readGrace($effect, $this->reader);
     }
 }