Package org.jfugue.player
Class Player
java.lang.Object
org.jfugue.player.Player
This is a player that is optimized for defining and playing music in a program.
It specifically parses music with a StaccatoParser and converts the music to
MIDI using a MidiParserListener.
This Player uses a ManagedPlayer but does not expose any of the ManagedPlayer's
ability to be managed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
void
delayPlay
(long millisToDelay, PatternProducer patternProducer) void
delayPlay
(long millisToDelay, PatternProducer... patternProducers) Returns the ManagedPlayer behind this Player.Returns the MidiParserListener used by this Player.getSequence
(String string) getSequence
(String... strings) getSequence
(PatternProducer patternProducer) getSequence
(PatternProducer... patternProducers) Returns the StaccatoParser used by this Player.void
void
void
This method plays a sequence by starting the sequence and waiting for the sequence to finish before continuing.void
play
(PatternProducer patternProducer) void
play
(PatternProducer... patternProducers)
-
Constructor Details
-
Player
public Player()
-
-
Method Details
-
getSequence
-
getSequence
-
getSequence
-
getSequence
-
play
-
play
-
play
-
play
-
play
This method plays a sequence by starting the sequence and waiting for the sequence to finish before continuing. It also converts InvalidMidiDataException and MidiUnavailableException to RuntimeExceptions for easier end-user programming. If you want to create an application where you catch those exceptions, you may want to use ManagedPlayer directly.- Parameters:
sequence
-
-
delayPlay
-
delayPlay
-
delayPlay
-
delayPlay
-
delayPlay
-
getManagedPlayer
Returns the ManagedPlayer behind this Player. You can start, pause, stop, resume, and seek a ManagedPlayer.- See Also:
-
getStaccatoParser
Returns the StaccatoParser used by this Player. The only thing you might want to do with this is set whether the parser throws an exception if an unknown token is found.- See Also:
-
getMidiParserListener
Returns the MidiParserListener used by this Player.- See Also:
-