当前位置: 首页>>代码示例>>Java>>正文


Java ShortMessage.END_OF_EXCLUSIVE属性代码示例

本文整理汇总了Java中javax.sound.midi.ShortMessage.END_OF_EXCLUSIVE属性的典型用法代码示例。如果您正苦于以下问题:Java ShortMessage.END_OF_EXCLUSIVE属性的具体用法?Java ShortMessage.END_OF_EXCLUSIVE怎么用?Java ShortMessage.END_OF_EXCLUSIVE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.sound.midi.ShortMessage的用法示例。


在下文中一共展示了ShortMessage.END_OF_EXCLUSIVE属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: expectedDataLength

/**
 * Determine how many data bytes are expected for a given MIDI message other than a SYSEX message, which varies.
 *
 * @param status the status byte introducing the MIDI message.
 *
 * @return the number of data bytes which must be received for the message to be complete.
 *
 * @throws InvalidMidiDataException if the status byte is not valid.
 */
private int expectedDataLength (byte status) throws InvalidMidiDataException {

  // system common and system real-time messages

  switch( status &0xFF ) {

    case ShortMessage.TUNE_REQUEST:
    case ShortMessage.END_OF_EXCLUSIVE:

      // System real-time messages
    case ShortMessage.TIMING_CLOCK:  
    case 0xF9:  // Undefined
    case ShortMessage.START:  
    case ShortMessage.CONTINUE:  
    case ShortMessage.STOP:  
    case 0xFD:  // Undefined
    case ShortMessage.ACTIVE_SENSING:  
    case ShortMessage.SYSTEM_RESET:  
      return 0;

    case ShortMessage.MIDI_TIME_CODE:
    case ShortMessage.SONG_SELECT:  
      return 1;

    case ShortMessage.SONG_POSITION_POINTER:  
      return 2;

    default:  // Fall through to next switch

  }

  // channel voice and mode messages
  switch( status & 0xF0 ) {

    case ShortMessage.NOTE_OFF: 
    case ShortMessage.NOTE_ON:  
    case ShortMessage.POLY_PRESSURE:
    case ShortMessage.CONTROL_CHANGE:  
    case ShortMessage.PITCH_BEND: 
      return 2;

    case ShortMessage.PROGRAM_CHANGE:  
    case ShortMessage.CHANNEL_PRESSURE:  
      return 1;

    default:
      throw new InvalidMidiDataException("Invalid status byte: " + status);

  }

}
 
开发者ID:DerekCook,项目名称:CoreMidi4J,代码行数:60,代码来源:CoreMidiSource.java


注:本文中的javax.sound.midi.ShortMessage.END_OF_EXCLUSIVE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。