public abstract class MSplitter.Result.WriteOut extends Object
writeOut(int,MTree,RationalDuration.DottedBaseDuration,Rational,StemEnd,boolean,boolean,boolean)
open_proportion(Rational)
and close_proportion(Rational)
must be implemented by the caller, an instance must be constructed "inside" the
MSplitter.Result
, and then process()
must be called.
Modifier and Type | Field and Description |
---|---|
(package private) Stack<MTree.EssentialBracket> |
bracketStack
Keeps track of n-plet-brackets currently open.
|
(package private) PrimeFactors |
currentFactors
Prime factors of
currentProportion |
(package private) Rational |
currentProportion
Running state of the proportion to be applied to the printed symbols of
the currently visited node.
|
Constructor and Description |
---|
WriteOut() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close_proportion(Rational proportion)
Close an open tuplet bracket.
|
abstract void |
open_proportion(Rational proportion)
Start a new tuplet bracket.
|
void |
process()
Loop through all events in this result and call the call-back method
writeOut(int,MTree,RationalDuration.DottedBaseDuration,Rational,StemEnd,boolean,boolean,boolean)
for every single note symbol (/pause symbol) resulting from the preceding
notational split-and-merge process. |
protected void |
testCloseBrackets(Rational when)
Called for each node to close essential n-plet-brackets, iff their
end-of-duration is reached.
|
protected void |
testOpenBrackets(MTree start,
boolean printedNode)
Called for each node to open essential n-plet-brackets, iff necessary
for the following duration values.
|
abstract void |
writeOut(int index,
MTree node,
RationalDuration.DottedBaseDuration symbol,
Rational proportion,
StemEnd beams,
boolean isSound,
boolean isFirst,
boolean isLast)
Write out one symbol of an event.
|
protected void |
x_writeOut(int index,
List<MTree> nodes,
Rational currentProportion,
boolean isSound,
boolean isFirst,
boolean isLast)
A wrapper which calls the real "writeout()" for a list of nodes,
which come from a cache.
|
Rational currentProportion
PrimeFactors currentFactors
currentProportion
final Stack<MTree.EssentialBracket> bracketStack
protected void testCloseBrackets(Rational when)
close_proportion(Rational)
is called.protected void testOpenBrackets(MTree start, boolean printedNode)
open_proportion(Rational)
is called.
Brackets of an ancesteor are printed when the very first child/grandchild/etc.
is printed. But only iff that bracket is not "vanishing".
The call-backs open_proportion(Rational)
and
close_proportion(Rational)
get the rational factor of the
currently opened/closed bracket as an argument,
while the (readable) global currentProportion
holds the accumulated
effective proportion (also passed as a parameter to
writeOut(int,MTree,RationalDuration.DottedBaseDuration,Rational,StemEnd,boolean,boolean,boolean)
public void process()
writeOut(int,MTree,RationalDuration.DottedBaseDuration,Rational,StemEnd,boolean,boolean,boolean)
for every single note symbol (/pause symbol) resulting from the preceding
notational split-and-merge process.
Interspered are the calls to open_proportion(Rational)
and
close_proportion(Rational)
for proportions/n-plet-brackets in the correct nesting order.protected void x_writeOut(int index, List<MTree> nodes, Rational currentProportion, boolean isSound, boolean isFirst, boolean isLast)
process()
.public abstract void writeOut(int index, MTree node, RationalDuration.DottedBaseDuration symbol, Rational proportion, StemEnd beams, boolean isSound, boolean isFirst, boolean isLast)
index
- the index into the original event listnode
- the MTree node (for accessing "weight" etc.)symbol
- the (possibly dotted) symbol to printproportion
- the currently effective proportion (for convenience!)beams
- describes left and right beams and beamlets / flagsisSound
- whether the symbol is sound and not pause (for convenience)isFirst
- whether the symbol is the very first in the eventisLast
- whether the symbol is the very last in the eventpublic abstract void open_proportion(Rational proportion)
MTree.EssentialBracket
class.public abstract void close_proportion(Rational proportion)
MTree.EssentialBracket
class.