/** * Attempt to disable the high resolution timer by closing the {@link MidiDevice}. */ public static synchronized void disable() { if (MIDI_DEVICE != null && MIDI_DEVICE.isOpen()) { MIDI_DEVICE.close(); } isEnabled = false; } }
sb.append(eol); synthesizer.close();
@Override public void close() { System.out.println("Closing Receiver"); if (inDevice != null) inDevice.close(); }
/** * Attempt to disable the high resolution timer by closing the {@link MidiDevice}. */ public static synchronized void disable() { if (MIDI_DEVICE != null && MIDI_DEVICE.isOpen()) { MIDI_DEVICE.close(); } isEnabled = false; } }
/** * Attempt to disable the high resolution timer by closing the {@link MidiDevice}. */ public static synchronized void disable() { if (MIDI_DEVICE != null && MIDI_DEVICE.isOpen()) { MIDI_DEVICE.close(); } isEnabled = false; } }
/** * Closes the MIDI device. * * @param device the MIDI device. */ public static void close(MidiDevice device) { try { if (device != null && device.isOpen()) { device.close(); } } catch (Exception e) { logger.warn("close", e); } }
public void ensureDevClosed() { try { if (myDevice != null) { if (myDevice.isOpen()) { myDevice.close(); } } } catch (Throwable t) { getLogger().error("Problem closing device for: {}", this, t); } }
/** {@inheritDoc} */ @Override public void close() throws IOException { if (configuration == null) { return; } if (openedOutputDevice) { MidiDevice outputDevice = configuration.getOutputDevice(); if (outputDevice != null && outputDevice.isOpen()) { outputDevice.close(); } } if (openedInputDevice) { MidiDevice inputDevice = configuration.getInputDevice(); if (inputDevice != null && inputDevice.isOpen()) { inputDevice.close(); } } }
/** * Tries to detect a valid inbound communication channel, based on a known device signature * (see {@link net.thecodersbreakfast.lp4j.midi.MidiDeviceConfiguration#DEVICE_SIGNATURE}). * * @return A valid outbound communication channel, or {@code null} if non was found. * @throws MidiUnavailableException if the requested device is not available due to resource restrictions */ public static MidiDevice autodetectInputDevice() throws MidiUnavailableException { MidiDevice.Info[] midiDeviceInfo = MidiSystem.getMidiDeviceInfo(); for (MidiDevice.Info info : midiDeviceInfo) { if (info.getDescription().contains(DEVICE_SIGNATURE) || info.getName().contains(DEVICE_SIGNATURE)) { MidiDevice device = MidiSystem.getMidiDevice(info); if (device.getMaxTransmitters() == -1) { return device; } device.close(); } } return null; }
vanishedDevice.close(); // CoreMidiDestination close is safe to call even after the device is gone
timer.start(); JOptionPane.showMessageDialog(null, progress); sequencer.close(); timer.stop();
public static Transmitter getTransmitter(MidiDevice current) { if (current.getMaxTransmitters() != 0) { try { if (!current.isOpen()) { current.open(); } } catch (MidiUnavailableException e) { return null; } try { return current.getTransmitter(); } catch (MidiUnavailableException e) { current.close(); } } return null; }
public static Receiver getReceiver(MidiDevice current) { if (current.getMaxReceivers() != 0) { try { if (!current.isOpen()) { current.open(); } } catch (MidiUnavailableException e) { return null; } try { return current.getReceiver(); } catch (MidiUnavailableException e) { current.close(); } } return null; }
external.close();
JOptionPane.showMessageDialog(null, "Exit this dialog to end"); sequencer.stop(); sequencer.close();
midiDevice.close();
if(meta.getType() == 47) sequencer.close();