Java 8 InvalidMidiDataException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 InvalidMidiDataException class.

This code example shows how to use the following methods:printStackTrace
                sequencer.setLoopCount(Sequencer.LOOP_CONTINUOUSLY);
            setPaused(false); 
        } 
        catch (InvalidMidiDataException e)
        { 
            e.printStackTrace();
        } 
    } 
 
    /** 
     * Stops the music being played, if any. 
     */ 
    public void stop() 
    { 
        if (sequencer == null || !sequencer.isOpen())
            return; 
 
        sequencer.stop();
        sequencer.setMicrosecondPosition(0);
    } 
3
CodeRank
This code example shows how to use the following methods:printStackTrace
 
	public static boolean playMidiQuietly(File file, float tempo, Set<Player> listeners)
	{ 
		try { MidiUtil.playMidi(file, tempo, listeners); }
		catch (MidiUnavailableException e) { e.printStackTrace(); return false; }
		catch (InvalidMidiDataException e) { e.printStackTrace(); return false; }
		catch (IOException e) { e.printStackTrace(); return false; }
 
		return true; 
	} 
	public static boolean playMidiQuietly(InputStream stream, float tempo, Set<Player> listeners)
	{ 
		try { MidiUtil.playMidi(stream, tempo, listeners); }
		catch (MidiUnavailableException e) { e.printStackTrace(); return false; }
		catch (InvalidMidiDataException e) { e.printStackTrace(); return false; }
		catch (IOException e) { e.printStackTrace(); return false; }
 
		return true; 
	} 
 
3
CodeRank
This code example shows how to use the following methods:printStackTrace
 
	public static boolean playMidiQuietly(File file, float tempo, Set<Player> listeners)
	{ 
		try { MidiUtil.playMidi(file, tempo, listeners); }
		catch (MidiUnavailableException e) { e.printStackTrace(); return false; }
		catch (InvalidMidiDataException e) { e.printStackTrace(); return false; }
		catch (IOException e) { e.printStackTrace(); return false; }
 
		return true; 
	} 
 
	public static boolean playMidiQuietly(File file, float tempo, Location loc)
	{ 
		try { MidiUtil.playMidi(file, tempo, loc); }
		catch (MidiUnavailableException e) { e.printStackTrace(); return false; }
		catch (InvalidMidiDataException e) { e.printStackTrace(); return false; }
		catch (IOException e) { e.printStackTrace(); return false; }
 
		return true; 
	} 
3
CodeRank
This code example shows how to use the following methods:getMessage
			// ignore, system doesn't have musical output devices! 
			System.err.println("Could not play Midi, no audio devices found!");
		} 
		catch (InvalidMidiDataException e) 
		{ 
			fail( e.getMessage() );
		} 
		catch (InterruptedException e)
		{ 
			fail( e.getMessage() );
		} 
	} 
	 
} 
3
CodeRank
See Code Examples for Java 8 InvalidMidiDataException Methods: