Mercurial > hg > mep
comparison MidiPlayer.java @ 4:5080b65e6963
Close MIDI sequencer and synthesizer properly and allow user to pass MIDI file directory as a command line argument
Ignore-this: dbf86cc9008fba00379b67dd541adb38
author | Marcus Pearce <m.pearce@gold.ac.uk> |
---|---|
date | Thu, 18 Nov 2010 11:47:32 +0000 |
parents | 93ed757b9871 |
children | 15f3b6d84c81 |
comparison
equal
deleted
inserted
replaced
3:6108a8aa9d82 | 4:5080b65e6963 |
---|---|
1 /*============================================================================= | 1 /*============================================================================= |
2 * File: MidiPlayer.java | 2 * File: MidiPlayer.java |
3 * Author: Marcus Pearce <m.pearce@gold.ac.uk> | 3 * Author: Marcus Pearce <m.pearce@gold.ac.uk> |
4 * Created: <2007-02-14 12:13:56 marcusp> | 4 * Created: <2007-02-14 12:13:56 marcusp> |
5 * Time-stamp: <2010-06-08 16:12:05 marcusp> | 5 * Time-stamp: <2010-11-18 11:01:56 marcusp> |
6 *============================================================================= | 6 *============================================================================= |
7 */ | 7 */ |
8 | 8 |
9 /* | 9 /* |
10 * Based on: | 10 * Based on: |
298 public void play() { | 298 public void play() { |
299 sequencer.start(); | 299 sequencer.start(); |
300 } | 300 } |
301 | 301 |
302 public void stop() { | 302 public void stop() { |
303 sequencer.close(); | 303 if (synthesizer != null) { |
304 } | 304 synthesizer.close(); |
305 } | |
306 if (sequencer != null) { | |
307 sequencer.close(); | |
308 } | |
309 sequencer = null; | |
310 synthesizer = null; | |
311 } | |
305 } | 312 } |