All Unit tests
Current file: C:\code\midiparser\src\Midi\Event\MetaEventType.php
Legend: executed not executed dead code

  Coverage
  Classes Functions / Methods Lines
Total
100.00%100.00%
100.00% 1 / 1
100.00%100.00%
100.00% 1 / 1
100.00%100.00%
100.00% 4 / 4
 
Midi\MetaEventType
100.00%100.00%
100.00% 1 / 1
100.00%100.00%
100.00% 1 / 1
100.00%100.00%
100.00% 4 / 4
 public static function getEventTypeName($eventType)
100.00%100.00%
100.00% 1 / 1
100.00%100.00%
100.00% 3 / 3


       1                 : <?php                                                                                             
       2                 :                                                                                                   
       3                 :     /**                                                                                           
       4                 :      * \Midi\Event\MetaEventType                                                                  
       5                 :      *                                                                                            
       6                 :      * @package    Midi                                                                           
       7                 :      * @subpackage Event                                                                          
       8                 :      * @copyright  © 2009 Tommy Montgomery <http://phpmidiparser.com/>                            
       9                 :      * @since      1.0                                                                            
      10                 :      */                                                                                           
      11                 :                                                                                                   
      12                 :     namespace Midi\Event;                                                                         
      13                 :                                                                                                   
      14                 :     /**                                                                                           
      15                 :      * Collection of constants representing the different                                         
      16                 :      * meta event types                                                                           
      17                 :      *                                                                                            
      18                 :      * @package    Midi                                                                           
      19                 :      * @subpackage Event                                                                          
      20                 :      * @since      1.0                                                                            
      21                 :      */                                                                                           
      22               1 :     final class MetaEventType {                                                                   
      23                 :         /**                                                                                       
      24                 :          *                                                                                        
      25                 :          *                                                                                        
      26                 :          * @var int                                                                               
      27                 :          */                                                                                       
      28                 :         const SEQUENCE_NUMBER       = 0x00;                                                       
      29                 :         /**                                                                                       
      30                 :          * Adds generic text content to a track                                                   
      31                 :          *                                                                                        
      32                 :          * @var int                                                                               
      33                 :          */                                                                                       
      34                 :         const TEXT_EVENT            = 0x01;                                                       
      35                 :         /**                                                                                       
      36                 :          * Adds a copyright notice to a track; should be in the                                   
      37                 :          * first track chunk                                                                      
      38                 :          *                                                                                        
      39                 :          * @var int                                                                               
      40                 :          */                                                                                       
      41                 :         const COPYRIGHT_NOTICE      = 0x02;                                                       
      42                 :         /**                                                                                       
      43                 :          * Name of the track                                                                      
      44                 :          *                                                                                        
      45                 :          * @var int                                                                               
      46                 :          */                                                                                       
      47                 :         const TRACK_NAME            = 0x03;                                                       
      48                 :         /**                                                                                       
      49                 :          *                                                                                        
      50                 :          *                                                                                        
      51                 :          * @var int                                                                               
      52                 :          */                                                                                       
      53                 :         const INSTRUMENT_NAME       = 0x04;                                                       
      54                 :         /**                                                                                       
      55                 :          *                                                                                        
      56                 :          *                                                                                        
      57                 :          * @var int                                                                               
      58                 :          */                                                                                       
      59                 :         const LYRICS                = 0x05;                                                       
      60                 :         /**                                                                                       
      61                 :          *                                                                                        
      62                 :          *                                                                                        
      63                 :          * @var int                                                                               
      64                 :          */                                                                                       
      65                 :         const MARKER                = 0x06;                                                       
      66                 :         /**                                                                                       
      67                 :          *                                                                                        
      68                 :          *                                                                                        
      69                 :          * @var int                                                                               
      70                 :          */                                                                                       
      71                 :         const CUE_POINT             = 0x07;                                                       
      72                 :         /**                                                                                       
      73                 :          *                                                                                        
      74                 :          *                                                                                        
      75                 :          * @var int                                                                               
      76                 :          */                                                                                       
      77                 :         const DEVICE_NAME           = 0x09;                                                       
      78                 :         /**                                                                                       
      79                 :          * Signifies the end of the track; should always be the                                   
      80                 :          * last event of each track                                                               
      81                 :          *                                                                                        
      82                 :          * @var int                                                                               
      83                 :          */                                                                                       
      84                 :         const END_OF_TRACK          = 0x2F;                                                       
      85                 :         /**                                                                                       
      86                 :          *                                                                                        
      87                 :          *                                                                                        
      88                 :          * @var int                                                                               
      89                 :          */                                                                                       
      90                 :         const CHANNEL_PREFIX        = 0x20;                                                       
      91                 :         /**                                                                                       
      92                 :          * Sets the tempo                                                                         
      93                 :          *                                                                                        
      94                 :          * @var int                                                                               
      95                 :          */                                                                                       
      96                 :         const SET_TEMPO             = 0x51;                                                       
      97                 :         /**                                                                                       
      98                 :          *                                                                                        
      99                 :          *                                                                                        
     100                 :          * @var int                                                                               
     101                 :          */                                                                                       
     102                 :         const SMPTE_OFFSET          = 0x54;                                                       
     103                 :         /**                                                                                       
     104                 :          * Sets the time signature                                                                
     105                 :          *                                                                                        
     106                 :          * @var int                                                                               
     107                 :          */                                                                                       
     108                 :         const TIME_SIGNATURE        = 0x58;                                                       
     109                 :         /**                                                                                       
     110                 :          * Sets the key signature                                                                 
     111                 :          *                                                                                        
     112                 :          * @var int                                                                               
     113                 :          */                                                                                       
     114                 :         const KEY_SIGNATURE         = 0x59;                                                       
     115                 :         /**                                                                                       
     116                 :          * Sequencer specific events                                                              
     117                 :          *                                                                                        
     118                 :          * @var int                                                                               
     119                 :          */                                                                                       
     120                 :         const SEQUENCER_SPECIFIC    = 0x7F;                                                       
     121                 :                                                                                                   
     122                 :         const UNKNOWN = -1;                                                                       
     123                 :                                                                                                   
     124                 :         private static $eventNameMap = array(                                                     
     125                 :             0x00 => 'Sequence Number',                                                            
     126                 :             0x01 => 'Text Event',                                                                 
     127                 :             0x02 => 'Copyright Notice',                                                           
     128                 :             0x03 => 'Track Name',                                                                 
     129                 :             0x04 => 'Instrument Name',                                                            
     130                 :             0x05 => 'Lyrics',                                                                     
     131                 :             0x06 => 'Marker',                                                                     
     132                 :             0x07 => 'Cue Point',                                                                  
     133                 :             0x20 => 'Channel Prefix',                                                             
     134                 :             0x2F => 'End of Track',                                                               
     135                 :             0x51 => 'Set Tempo',                                                                  
     136                 :             0x54 => 'SMTPE Offset',                                                               
     137                 :             0x58 => 'Time Signature',                                                             
     138                 :             0x59 => 'Key Signature',                                                              
     139                 :             0x7F => 'Sequencer Specific'                                                          
     140                 :         );                                                                                        
     141                 :                                                                                                   
     142                 :         /**                                                                                       
     143                 :          * Gets the name of the event type                                                        
     144                 :          *                                                                                        
     145                 :          * @since 1.0                                                                             
     146                 :          * @todo  The name of this function is inconsistent with {@link EventType::getEventName()}
     147                 :          *                                                                                        
     148                 :          * @param  int $eventType                                                                 
     149                 :          * @throws InvalidArgumentException                                                       
     150                 :          * @return string The friendly name of the event                                          
     151                 :          */                                                                                       
     152                 :         public static function getEventTypeName($eventType) {                                     
     153               3 :             if (!isset(self::$eventNameMap[$eventType])) {                                        
     154               1 :                 return 'Unknown';                                                                 
     155                 :             }                                                                                     
     156                 :                                                                                                   
     157               2 :             return self::$eventNameMap[$eventType];                                               
     158                 :         }                                                                                         
     159                 :     }                                                                                             
     160                 :                                                                                                   

Generated by PHPUnit 3.4.1 and Xdebug 2.0.5 using PHP 5.3.0 at Sun Oct 25 23:35:09 PDT 2009.