Exemplo n.º 1
0
 /**
  * Instantiates a new Player object, which is used for playing music. The <code>connected</code>
  * parameter is passed directly to MidiSystem.getSequencer. Pass false when you do not want to
  * copy a live synthesizer - for example, if your Player is on a server, and you don't want to
  * create new synthesizers every time the constructor is called.
  */
 public Player(boolean connected) {
   try {
     // Get default sequencer.
     setSequencer(MidiSystem.getSequencer(connected)); // use non
     // connected
     // sequencer so
     // no copy of
     // live
     // synthesizer
     // will be
     // created.
   } catch (MidiUnavailableException e) {
     throw new JFugueException(
         JFugueException.SEQUENCER_DEVICE_NOT_SUPPORTED_WITH_EXCEPTION + e.getMessage());
   }
   initParser();
 }
Exemplo n.º 2
0
 /**
  * Creates a new Player instance using a Sequencer that you have provided.
  *
  * @param sequencer The Sequencer to send the MIDI events
  */
 public Player(Sequencer sequencer) {
   setSequencer(sequencer);
   initParser();
 }