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


Java Transmitter.close方法代码示例

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


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

示例1: close

import javax.sound.midi.Transmitter; //导入方法依赖的package包/类
/**
 * Closes the MIDI transmitter.
 *
 * @param transmitter the MIDI transmitter.
 */
public static void close(Transmitter transmitter) {
    try {
        if (transmitter != null) {
            transmitter.close();
        }
    } catch (Exception e) {
        logger.warn("close", e);
    }
}
 
开发者ID:softelnet,项目名称:sponge,代码行数:15,代码来源:MidiUtils.java

示例2: removeReceiverFromDevice

import javax.sound.midi.Transmitter; //导入方法依赖的package包/类
/**
 * Removes a midi receiver from a midi device
 * 
 * @param device
 *            The midi device
 * @param receiver
 *            The midi receiver
 * @throws MidiUnavailableException
 *             If midi device is not available
 */
public static void removeReceiverFromDevice(MidiDevice device,
		String receiverName) throws MidiUnavailableException {

	List<Transmitter> transmitters = device.getTransmitters();
	for (Transmitter transmitter : transmitters) {
		if (receiverName.equals(transmitter.getReceiver().getClass()
				.getName())) {
			transmitter.getReceiver().close();
			transmitter.setReceiver(null);
			transmitter.close();
		}
	}
}
 
开发者ID:aguelle,项目名称:MIDI-Automator,代码行数:24,代码来源:MidiUtils.java

示例3: closeAllTransmittersAndReceivers

import javax.sound.midi.Transmitter; //导入方法依赖的package包/类
/**
 * Closes all transmitters and receivers of the midi device
 * 
 * @param device
 */
public static void closeAllTransmittersAndReceivers(MidiDevice device) {

	for (Transmitter transmitter : device.getTransmitters()) {
		transmitter.close();
	}

	for (Receiver receiver : device.getReceivers()) {
		receiver.close();

	}
}
 
开发者ID:aguelle,项目名称:MIDI-Automator,代码行数:17,代码来源:MidiUtils.java

示例4: close

import javax.sound.midi.Transmitter; //导入方法依赖的package包/类
/**
 * Closes the Core MIDI Device, which also closes all its transmitters
 * 
 */

@Override
public void close() {

  if (isOpen.compareAndSet(true, false)) {

    try {

      // If the port is created then disconnect from it
      if (input.get() != null) {

        try {

          input.get().disconnectSource(this);

        } finally {

          input.set(null);

        }

      }

      // Close all our transmitters, which will also clear the list.
      // We iterate on a copy of the transmitter list to avoid issues with concurrent modification.
      for (Transmitter transmitter : getTransmitters()) {

        transmitter.close();

      }

    } catch (CoreMidiException e) {

      e.printStackTrace();

    }

  }

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


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