Esempio n. 1
0
 public function testGetEventName()
 {
     $eventNameMap = array(0x80 => 'Note Off', 0x90 => 'Note On', 0xa0 => 'Note Aftertouch', 0xb0 => 'Controller', 0xc0 => 'Program Change', 0xd0 => 'Channel Aftertouch', 0xe0 => 'Pitch Bend', 0xf0 => 'System Exclusive', 0xf1 => 'Undefined', 0xf2 => 'Song Position Pointer', 0xf3 => 'Song Select', 0xf4 => 'Undefined', 0xf5 => 'Undefined', 0xf6 => 'Tune Request', 0xf7 => 'Authorization', 0xf8 => 'Timing Clock', 0xf9 => 'Undefined', 0xfa => 'Sequence Start', 0xfb => 'Sequence Continue', 0xfc => 'Sequence Stop', 0xfd => 'Undefined', 0xfe => 'Active Sensing', 0xff => 'Meta');
     foreach ($eventNameMap as $event => $name) {
         $this->assertEquals(EventType::getEventName($event), $name);
     }
 }
Esempio n. 2
0
 public function testToString()
 {
     $this->obj->expects($this->once())->method('getType')->will($this->returnValue(EventType::NOTE_OFF));
     $this->obj->expects($this->once())->method('getParamDescription')->will($this->returnValue('bar'));
     $this->assertEquals(EventType::getEventName(EventType::NOTE_OFF) . ' (channel 1): bar', $this->obj->__toString());
 }
Esempio n. 3
0
 /**
  * Gets a string representation of this event
  *
  * @since 1.0
  * @uses    EventType::getEventName()
  * @uses    getType()
  * @uses    getParamDescription()
  * 
  * @return string
  */
 public function __toString()
 {
     return EventType::getEventName($this->getType()) . ' (channel ' . $this->channel . '): ' . $this->getParamDescription();
 }
Esempio n. 4
0
 /**
  * Gets the string representation of this event
  *
  * @since 1.0
  * @uses  EventType::getEventName()
  * @uses  getType()
  * 
  * @return string
  */
 public function __toString()
 {
     return EventType::getEventName($this->getType()) . ': manufacturer dependent';
 }
 public function testToString()
 {
     $this->assertEquals(EventType::getEventName(EventType::SYSTEM_EXCLUSIVE) . ': manufacturer dependent', $this->obj->__toString());
 }