Package eu.bandm.music.entities
Class MTreeCollector<M>
java.lang.Object
eu.bandm.music.entities.MTreeCollector<M>
- Type Parameters:
M
- the class used as "meter names"
Constructs different mappings into MTreeSpecs and provides the retrievel methods:
- map "names for meters" at a particular time point to an MTreeSpec.
- map particular time point in a particular voice to an MTreeSpec
-
Co-operates with
MeasureCollector
: The latter collects the names of meters in the Main M-voice and stores them into barnum2metrum_explicit, which is passed to the methodinsertMVoice(Vox,SortedMap)
.
-
Field Summary
Modifier and TypeFieldDescriptionMap all measure numbers to the mtree spec which is valid in that measure, according to the global "M" voice.Where explicit meter name definitions are in the global M voice.protected final MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>>
Evidentprotected final String
Name of the parameter track to parse for mtree specifications.static final String
Constant operator to indicate that an mtree specification local to a voice shall be valid until the next explicit local entry or the next entry in the global M-Voice, whatever comes earlier.static final String
Constant operator to indicate that an mtree specification local to a voice shall be valid until the next explicit entry in this voice.List of all time points to parse.protected final Map<TpTop,
BigDecimal> Input data, linking the top time points to bar numbers / measure numbers.static final String
Constant operator to indicate that from here on the mtree specification in the M-Voice is again used in this voice.Map measure numbers to localdefinitions of meter names to mtree specs, per voices. -
Constructor Summary
ConstructorDescriptionMTreeCollector
(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, String paramNameMTree, Iterable<TpTop> topTps, Map<TpTop, BigDecimal> tp2barnum) Constructor for the user. -
Method Summary
Modifier and TypeMethodDescription(package private) void
checkNotTop
(Vox voice) Verify that mtree source text does appear only with top level time nodes, not with sub-nodes.get
(Vox v, BigDecimal t) Return the mtree specification valid for a particular voice and measure number.void
insertMVoice
(Vox voice, SortedMap<BigDecimal, M> explicitMeterNames) Analyse the "mtree" parameter track of the global metric "M" voice.void
insertVoice
(Vox voice) Analyse the "mtree" parameter track of a particular voice which is not the global metric "M" voice.void
insertVoice_noMTreeSpecs
(Vox voice) Add the map of all measure numbers to an mtree spec for a voice which is known to have no own/local mtree specifications.searchBackwards
(SortedMap<BigDecimal, M> explicitMeterNames, M metername, BigDecimal barnum) Search for the mtree spec definition for a particular meter name, which is valid at a particular measure number.
-
Field Details
-
runUpToExplicit
Constant operator to indicate that an mtree specification local to a voice shall be valid until the next explicit entry in this voice. (This is called "runrun mode".)- See Also:
-
runUpToCommon
Constant operator to indicate that an mtree specification local to a voice shall be valid until the next explicit local entry or the next entry in the global M-Voice, whatever comes earlier. (This is called "run mode".)- See Also:
-
useCommon
Constant operator to indicate that from here on the mtree specification in the M-Voice is again used in this voice.- See Also:
-
msg
Evident -
paramNameMTree
Name of the parameter track to parse for mtree specifications. Constant, set once on construction. -
topTps
List of all time points to parse. Constant, set once on construction. -
tp2barnum
Input data, linking the top time points to bar numbers / measure numbers. Constant, set once on construction. -
commonDefs
Map all measure numbers to the mtree spec which is valid in that measure, according to the global "M" voice. -
explicitCommons
Where explicit meter name definitions are in the global M voice. -
voiceDefs
Map measure numbers to localdefinitions of meter names to mtree specs, per voices.
-
-
Constructor Details
-
MTreeCollector
public MTreeCollector(MessageReceiver<SimpleMessage<eu.bandm.tools.util.xml.XMLDocumentIdentifier>> msg, String paramNameMTree, Iterable<TpTop> topTps, Map<TpTop, BigDecimal> tp2barnum) Constructor for the user.ATTENTION params 1 - 3 may be NULL fuer programmatic fill = direct write to map FIXME AUFRÄUMEN!!
-
-
Method Details
-
searchBackwards
@Opt public @Opt MTreeSpec searchBackwards(SortedMap<BigDecimal, M> explicitMeterNames, M metername, BigDecimal barnum) Search for the mtree spec definition for a particular meter name, which is valid at a particular measure number.- Parameters:
explicitMeterNames
- names by measure number ("bar number")metername
- the name to find a definition forbarnum
- the point where the definition shall be valid
-
insertMVoice
Analyse the "mtree" parameter track of the global metric "M" voice. Meter names are (together with tempo etc.) in the main param track, have been parsed byMeasureCollector
, and are passed as method argument.Here the meter names from the m voice are checked a second time: Each first occurance of a particular meter name must be accompanied by an mtree spec. Each later occurance can copy the last assignment.
- Parameters:
voice
- the global "M" voiceexplicitMeterNames
- the names of the meters collected in this voice (byMeasureCollector
) by measure numbers.
-
insertVoice
Analyse the "mtree" parameter track of a particular voice which is not the global metric "M" voice. Creates a map invoiceDefs
which maps every measure number to a meter definition.- Parameters:
voice
- to analyze.
-
checkNotTop
Verify that mtree source text does appear only with top level time nodes, not with sub-nodes. -
insertVoice_noMTreeSpecs
Add the map of all measure numbers to an mtree spec for a voice which is known to have no own/local mtree specifications. -
get
Return the mtree specification valid for a particular voice and measure number.
-