Example #1
0
 public function testGetEventTypeName()
 {
     $eventNameMap = array(0x0 => 'Sequence Number', 0x1 => 'Text Event', 0x2 => 'Copyright Notice', 0x3 => 'Track Name', 0x4 => 'Instrument Name', 0x5 => 'Lyrics', 0x6 => 'Marker', 0x7 => 'Cue Point', 0x20 => 'Channel Prefix', 0x2f => 'End of Track', 0x51 => 'Set Tempo', 0x54 => 'SMTPE Offset', 0x58 => 'Time Signature', 0x59 => 'Key Signature', 0x7f => 'Sequencer Specific');
     foreach ($eventNameMap as $event => $name) {
         $this->assertEquals(MetaEventType::getEventTypeName($event), $name);
     }
 }
Example #2
0
 public function testToString()
 {
     $this->obj->expects($this->once())->method('getParamDescription')->will($this->returnValue('foo'));
     $this->obj->expects($this->once())->method('getSubtype')->will($this->returnValue(MetaEventType::SEQUENCE_NUMBER));
     $this->assertEquals(MetaEventType::getEventTypeName(MetaEventType::SEQUENCE_NUMBER) . ': foo', $this->obj->__toString());
 }
Example #3
0
 /**
  * Gets the string representation of this meta event
  *
  * @since 1.0
  * @uses  EventType::getEventName()
  * @uses  MetaEventType::getEventTypeName()
  * @uses  getParamDescription()
  * @uses  getType()
  * @uses  getSubtype()
  * 
  * @return string
  */
 public function __toString()
 {
     return MetaEventType::getEventTypeName($this->getSubtype()) . ': ' . $this->getParamDescription();
 }