|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmusic.midi.DefaultRealTimeChannelManager
jcaas.midi.MIDIPlayer
public class MIDIPlayer
MIDIPlayer is the main class for the sub-system that is responsible for playing midi sound during program execution.
Constructor Summary | |
---|---|
MIDIPlayer(Score s)
Constructor, makes a player to play staff on channel 0, do not print notes and other information. |
|
MIDIPlayer(Score s,
boolean b)
Constructor, makes a player to play Staff on channel 0, information may be printed. |
Method Summary | |
---|---|
IRealTimeChannel |
getChannel(int i)
|
MMessage |
getInfo(int i,
MMessage m)
A method to get information about the Player and currently Playing Scores/Staffs. |
int |
getInstrument()
|
NoteWrapper |
getNext()
|
int |
getNumChans()
getNumChans returns the number of available channels |
short |
getPPQN()
|
Score |
getScore(int chan)
getScore returns the Score currently being played on a given channel. |
boolean |
passMessage(int i,
MMessage m)
A method to inform the Player/Score of changes it should make. |
NoteWrapper |
peek()
|
void |
play()
play starts and runs the infinite Staff-playing loop. |
void |
setEnqueuer(MIDIPlayerEnqueuer enqueuer)
|
void |
setPPQN(short ppqn)
|
boolean |
setScore(int chan,
Score stf)
setScore changes the Score on a given channel. |
boolean |
setScore(Score s)
A method to change the score of the MidiPlayer. |
Methods inherited from class jmusic.midi.DefaultRealTimeChannelManager |
---|
getTicker |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MIDIPlayer(Score s)
s-
- The Staff that is to be set to channel 0 initially.public MIDIPlayer(Score s, boolean b)
s
- - The Staff that is to be set to channel 0 initially.b
- - boolean that determines if note/state change information is printed.Method Detail |
---|
public void play()
public boolean setScore(int chan, Score stf)
chan
- - the int number of the channel to modify.stf
- - the new Score.
public int getNumChans()
public Score getScore(int chan)
chan
- - the int number of the channel to get the Score being played on.
public boolean passMessage(int i, MMessage m)
i
- the index of the staff/Score to modify.m
- the message to be implemented
public MMessage getInfo(int i, MMessage m)
i
- the index of the staff/score to get information abouttype
- the type of information to get
public boolean setScore(Score s)
s
- the new Score
public void setPPQN(short ppqn)
setPPQN
in interface IRealTimeChannel
public NoteWrapper getNext()
getNext
in interface IRealTimeChannel
public NoteWrapper peek()
peek
in interface IRealTimeChannel
public int getInstrument()
getInstrument
in interface IRealTimeChannel
public short getPPQN()
getPPQN
in interface IRealTimeChannel
public IRealTimeChannel getChannel(int i)
getChannel
in class DefaultRealTimeChannelManager
public void setEnqueuer(MIDIPlayerEnqueuer enqueuer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |