MuseScore  3.4
Music composition and notation
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Ms::MusicXMLParserPass2 Class Reference

#include <importmxmlpass2.h>

Collaboration diagram for Ms::MusicXMLParserPass2:
Collaboration graph
[legend]

Public Member Functions

 MusicXMLParserPass2 (Score *score, MusicXMLParserPass1 &pass1, MxmlLogger *logger)
 
Score::FileError parse (QIODevice *device)
 Parse MusicXML in device and extract pass 2 data. More...
 
void addSpanner (const MusicXmlSpannerDesc &desc)
 
MusicXmlExtendedSpannerDescgetSpanner (const MusicXmlSpannerDesc &desc)
 
void clearSpanner (const MusicXmlSpannerDesc &desc)
 

Private Member Functions

void initPartState (const QString &partId)
 Initialize members as required for reading the MusicXML part element. More...
 
SpannerSet findIncompleteSpannersAtPartEnd ()
 
Score::FileError parse ()
 Start the parsing process, after verifying the top-level node is score-partwise. More...
 
void scorePartwise ()
 Parse the MusicXML top-level (XPath /score-partwise) node. More...
 
void partList ()
 Parse the /score-partwise/part-list node. More...
 
void scorePart ()
 
void part ()
 Parse the /score-partwise/part node. More...
 
void measChordNote ()
 
void measChordFlush ()
 
void measure (const QString &partId, const Fraction time)
 Parse the /score-partwise/part/measure node. More...
 
void attributes (const QString &partId, Measure *measure, const Fraction &tick)
 Parse the /score-partwise/part/measure/attributes node. More...
 
void measureStyle (Measure *measure)
 Parse the /score-partwise/part/measure/measure-style node. More...
 
void print (Measure *measure)
 Parse the /score-partwise/part/measure/print node. More...
 
void barline (const QString &partId, Measure *measure, const Fraction &tick)
 Parse the /score-partwise/part/measure/barline node. More...
 
void key (const QString &partId, Measure *measure, const Fraction &tick)
 Parse the /score-partwise/part/measure/attributes/key node. More...
 
void clef (const QString &partId, Measure *measure, const Fraction &tick)
 Parse the /score-partwise/part/measure/attributes/clef node. More...
 
void time (const QString &partId, Measure *measure, const Fraction &tick)
 Parse the /score-partwise/part/measure/attributes/time node. More...
 
void divisions ()
 Parse the /score-partwise/part/measure/attributes/divisions node. More...
 
void transpose (const QString &partId)
 Parse the /score-partwise/part/measure/attributes/transpose node. More...
 
Notenote (const QString &partId, Measure *measure, const Fraction sTime, const Fraction prevTime, Fraction &missingPrev, Fraction &dura, Fraction &missingCurr, QString &currentVoice, GraceChordList &gcl, int &gac, Beam *&beam, FiguredBassList &fbl, int &alt, MxmlTupletStates &tupletStates, Tuplets &tuplets)
 Parse the /score-partwise/part/measure/note node. More...
 
void notePrintSpacingNo (Fraction &dura)
 Parse the /score-partwise/part/measure/note node for a note with print-spacing="no". More...
 
FiguredBassItemfigure (const int idx, const bool paren)
 Parse the /score-partwise/part/measure/harmony/figured-bass/figure node. More...
 
FiguredBassfiguredBass ()
 Parse the /score-partwise/part/measure/harmony/figured-bass node. More...
 
FretDiagramframe ()
 Parse the /score-partwise/part/measure/harmony/frame node. More...
 
void harmony (const QString &partId, Measure *measure, const Fraction sTime)
 Parse the /score-partwise/part/measure/harmony node. More...
 
Accidentalaccidental ()
 
void beam (Beam::Mode &beamMode)
 Parse the /score-partwise/part/measure/note/beam node. More...
 
void duration (Fraction &dura)
 Parse the /score-partwise/part/measure/note/duration node. More...
 
void forward (Fraction &dura)
 Parse the /score-partwise/part/measure/note/forward node. More...
 
void backup (Fraction &dura)
 Parse the /score-partwise/part/measure/note/backup node. More...
 
void timeModification (Fraction &timeMod, TDuration &normalType)
 
void stem (Direction &sd, bool &nost)
 Parse the /score-partwise/part/measure/note/stem node. More...
 
void doEnding (const QString &partId, Measure *measure, const QString &number, const QString &type, const QString &text)
 
void staffDetails (const QString &partId)
 Parse the /score-partwise/part/measure/attributes/staff-details node. More...
 
void staffTuning (StringData *t)
 Parse the /score-partwise/part/measure/attributes/staff-details/staff-tuning node. More...
 
void skipLogCurrElem ()
 Skip the current element, log debug as info. More...
 
void setMultiMeasureRestCount (int count)
 Set the multi-measure rest counter. More...
 
int getAndDecMultiMeasureRestCount ()
 Return current multi-measure rest counter. More...
 

Private Attributes

QXmlStreamReader _e
 
int _divs
 
Score *const _score
 
MusicXMLParserPass1_pass1
 
MxmlLogger_logger
 Error logger. More...
 
Fraction _timeSigDura
 
SlurStack _slurs { {} }
 
TrillStack _trills { {} }
 Current trills. More...
 
BracketsStack _brackets
 
OttavasStack _ottavas
 Current ottavas. More...
 
HairpinsStack _hairpins
 Current hairpins. More...
 
MusicXmlExtendedSpannerDesc _dummyNewMusicXmlSpannerDesc
 
Glissando_glissandi [MAX_NUMBER_LEVEL][2]
 Current slides ([0]) / glissandi ([1]) More...
 
Tie_tie
 
Volta_lastVolta
 
bool _hasDrumset
 drumset defined TODO: move to pass 1 More...
 
MusicXmlSpannerMap _spanners
 
MusicXmlExtendedSpannerDesc _pedal
 Current pedal. More...
 
Pedal_pedalContinue
 Current pedal type="change" requiring fixup. More...
 
Harmony_harmony
 Current harmony. More...
 
Chord_tremStart
 Starting chord for current tremolo. More...
 
FiguredBass_figBass
 Current figured bass element (to attach to next note) More...
 
int _multiMeasureRestCount
 
MusicXmlLyricsExtend _extendedLyrics
 Lyrics with "extend" requiring fixup. More...
 

Constructor & Destructor Documentation

◆ MusicXMLParserPass2()

Ms::MusicXMLParserPass2::MusicXMLParserPass2 ( Score score,
MusicXMLParserPass1 pass1,
MxmlLogger logger 
)

Member Function Documentation

◆ accidental()

Accidental* Ms::MusicXMLParserPass2::accidental ( )
private

◆ addSpanner()

void Ms::MusicXMLParserPass2::addSpanner ( const MusicXmlSpannerDesc desc)

◆ attributes()

void Ms::MusicXMLParserPass2::attributes ( const QString &  partId,
Measure measure,
const Fraction tick 
)
private

Parse the /score-partwise/part/measure/attributes node.

◆ backup()

void Ms::MusicXMLParserPass2::backup ( Fraction dura)
private

Parse the /score-partwise/part/measure/note/backup node.

◆ barline()

void Ms::MusicXMLParserPass2::barline ( const QString &  partId,
Measure measure,
const Fraction tick 
)
private

Parse the /score-partwise/part/measure/barline node.

◆ beam()

void Ms::MusicXMLParserPass2::beam ( Beam::Mode beamMode)
private

Parse the /score-partwise/part/measure/note/beam node.

Sets beamMode in case of begin, continue or end beam number 1.

◆ clearSpanner()

void Ms::MusicXMLParserPass2::clearSpanner ( const MusicXmlSpannerDesc desc)

◆ clef()

void Ms::MusicXMLParserPass2::clef ( const QString &  partId,
Measure measure,
const Fraction tick 
)
private

Parse the /score-partwise/part/measure/attributes/clef node.

◆ divisions()

void Ms::MusicXMLParserPass2::divisions ( )
private

Parse the /score-partwise/part/measure/attributes/divisions node.

◆ doEnding()

void Ms::MusicXMLParserPass2::doEnding ( const QString &  partId,
Measure measure,
const QString &  number,
const QString &  type,
const QString &  text 
)
private

◆ duration()

void Ms::MusicXMLParserPass2::duration ( Fraction dura)
private

Parse the /score-partwise/part/measure/note/duration node.

◆ figure()

FiguredBassItem * Ms::MusicXMLParserPass2::figure ( const int  idx,
const bool  paren 
)
private

Parse the /score-partwise/part/measure/harmony/figured-bass/figure node.

Return the result as a FiguredBassItem.

◆ figuredBass()

FiguredBass * Ms::MusicXMLParserPass2::figuredBass ( )
private

Parse the /score-partwise/part/measure/harmony/figured-bass node.

TODO check description: Set the FiguredBass state based on the MusicXML <figured-bass> node de. Note that onNote and ticks must be set by the MusicXML importer, as the required context is not present in the items DOM tree. Exception: if a <duration> element is present, tick can be set. Return the result as a FiguredBass if valid, non-empty figure(s) are found. Return 0 in case of error.

◆ findIncompleteSpannersAtPartEnd()

SpannerSet Ms::MusicXMLParserPass2::findIncompleteSpannersAtPartEnd ( )
private

◆ forward()

void Ms::MusicXMLParserPass2::forward ( Fraction dura)
private

Parse the /score-partwise/part/measure/note/forward node.

◆ frame()

FretDiagram * Ms::MusicXMLParserPass2::frame ( )
private

Parse the /score-partwise/part/measure/harmony/frame node.

Return the result as a FretDiagram.

◆ getAndDecMultiMeasureRestCount()

int Ms::MusicXMLParserPass2::getAndDecMultiMeasureRestCount ( )
private

Return current multi-measure rest counter.

Decrement counter if possible (not beyond -1).

◆ getSpanner()

MusicXmlExtendedSpannerDesc & Ms::MusicXMLParserPass2::getSpanner ( const MusicXmlSpannerDesc desc)

◆ harmony()

void Ms::MusicXMLParserPass2::harmony ( const QString &  partId,
Measure measure,
const Fraction  sTime 
)
private

Parse the /score-partwise/part/measure/harmony node.

◆ initPartState()

void Ms::MusicXMLParserPass2::initPartState ( const QString &  partId)
private

Initialize members as required for reading the MusicXML part element.

TODO: factor out part reading into a separate class TODO: preferably use automatically initialized variables Note that Qt automatically initializes new elements in QVector (tuplets).

◆ key()

void Ms::MusicXMLParserPass2::key ( const QString &  partId,
Measure measure,
const Fraction tick 
)
private

Parse the /score-partwise/part/measure/attributes/key node.

◆ measChordFlush()

void Ms::MusicXMLParserPass2::measChordFlush ( )
private

◆ measChordNote()

void Ms::MusicXMLParserPass2::measChordNote ( )
private

◆ measure()

void Ms::MusicXMLParserPass2::measure ( const QString &  partId,
const Fraction  time 
)
private

Parse the /score-partwise/part/measure node.

◆ measureStyle()

void Ms::MusicXMLParserPass2::measureStyle ( Measure measure)
private

Parse the /score-partwise/part/measure/measure-style node.

Initializes the "in multi-measure rest" state

◆ note()

Note * Ms::MusicXMLParserPass2::note ( const QString &  partId,
Measure measure,
const Fraction  sTime,
const Fraction  prevTime,
Fraction missingPrev,
Fraction dura,
Fraction missingCurr,
QString &  currentVoice,
GraceChordList gcl,
int &  gac,
Beam *&  beam,
FiguredBassList fbl,
int &  alt,
MxmlTupletStates tupletStates,
Tuplets tuplets 
)
private

Parse the /score-partwise/part/measure/note node.

◆ notePrintSpacingNo()

void Ms::MusicXMLParserPass2::notePrintSpacingNo ( Fraction dura)
private

Parse the /score-partwise/part/measure/note node for a note with print-spacing="no".

These are handled like a forward: only moving the time forward.

◆ parse() [1/2]

Score::FileError Ms::MusicXMLParserPass2::parse ( QIODevice *  device)

Parse MusicXML in device and extract pass 2 data.

◆ parse() [2/2]

Score::FileError Ms::MusicXMLParserPass2::parse ( )
private

Start the parsing process, after verifying the top-level node is score-partwise.

◆ part()

void Ms::MusicXMLParserPass2::part ( )
private

Parse the /score-partwise/part node.

◆ partList()

void Ms::MusicXMLParserPass2::partList ( )
private

Parse the /score-partwise/part-list node.

◆ print()

void Ms::MusicXMLParserPass2::print ( Measure measure)
private

Parse the /score-partwise/part/measure/print node.

◆ scorePart()

void Ms::MusicXMLParserPass2::scorePart ( )
private

◆ scorePartwise()

void Ms::MusicXMLParserPass2::scorePartwise ( )
private

Parse the MusicXML top-level (XPath /score-partwise) node.

◆ setMultiMeasureRestCount()

void Ms::MusicXMLParserPass2::setMultiMeasureRestCount ( int  count)
private

Set the multi-measure rest counter.

◆ skipLogCurrElem()

void Ms::MusicXMLParserPass2::skipLogCurrElem ( )
private

Skip the current element, log debug as info.

◆ staffDetails()

void Ms::MusicXMLParserPass2::staffDetails ( const QString &  partId)
private

Parse the /score-partwise/part/measure/attributes/staff-details node.

◆ staffTuning()

void Ms::MusicXMLParserPass2::staffTuning ( StringData t)
private

Parse the /score-partwise/part/measure/attributes/staff-details/staff-tuning node.

◆ stem()

void Ms::MusicXMLParserPass2::stem ( Direction sd,
bool &  nost 
)
private

Parse the /score-partwise/part/measure/note/stem node.

◆ time()

void Ms::MusicXMLParserPass2::time ( const QString &  partId,
Measure measure,
const Fraction tick 
)
private

Parse the /score-partwise/part/measure/attributes/time node.

◆ timeModification()

void Ms::MusicXMLParserPass2::timeModification ( Fraction timeMod,
TDuration normalType 
)
private

◆ transpose()

void Ms::MusicXMLParserPass2::transpose ( const QString &  partId)
private

Parse the /score-partwise/part/measure/attributes/transpose node.

Member Data Documentation

◆ _brackets

BracketsStack Ms::MusicXMLParserPass2::_brackets
private

◆ _divs

int Ms::MusicXMLParserPass2::_divs
private

◆ _dummyNewMusicXmlSpannerDesc

MusicXmlExtendedSpannerDesc Ms::MusicXMLParserPass2::_dummyNewMusicXmlSpannerDesc
private

◆ _e

QXmlStreamReader Ms::MusicXMLParserPass2::_e
private

◆ _extendedLyrics

MusicXmlLyricsExtend Ms::MusicXMLParserPass2::_extendedLyrics
private

Lyrics with "extend" requiring fixup.

◆ _figBass

FiguredBass* Ms::MusicXMLParserPass2::_figBass
private

Current figured bass element (to attach to next note)

◆ _glissandi

Glissando* Ms::MusicXMLParserPass2::_glissandi[MAX_NUMBER_LEVEL][2]
private

Current slides ([0]) / glissandi ([1])

◆ _hairpins

HairpinsStack Ms::MusicXMLParserPass2::_hairpins
private

Current hairpins.

◆ _harmony

Harmony* Ms::MusicXMLParserPass2::_harmony
private

Current harmony.

◆ _hasDrumset

bool Ms::MusicXMLParserPass2::_hasDrumset
private

drumset defined TODO: move to pass 1

◆ _lastVolta

Volta* Ms::MusicXMLParserPass2::_lastVolta
private

◆ _logger

MxmlLogger* Ms::MusicXMLParserPass2::_logger
private

Error logger.

◆ _multiMeasureRestCount

int Ms::MusicXMLParserPass2::_multiMeasureRestCount
private

◆ _ottavas

OttavasStack Ms::MusicXMLParserPass2::_ottavas
private

Current ottavas.

◆ _pass1

MusicXMLParserPass1& Ms::MusicXMLParserPass2::_pass1
private

◆ _pedal

MusicXmlExtendedSpannerDesc Ms::MusicXMLParserPass2::_pedal
private

Current pedal.

◆ _pedalContinue

Pedal* Ms::MusicXMLParserPass2::_pedalContinue
private

Current pedal type="change" requiring fixup.

◆ _score

Score* const Ms::MusicXMLParserPass2::_score
private

◆ _slurs

SlurStack Ms::MusicXMLParserPass2::_slurs { {} }
private

◆ _spanners

MusicXmlSpannerMap Ms::MusicXMLParserPass2::_spanners
private

◆ _tie

Tie* Ms::MusicXMLParserPass2::_tie
private

◆ _timeSigDura

Fraction Ms::MusicXMLParserPass2::_timeSigDura
private

◆ _tremStart

Chord* Ms::MusicXMLParserPass2::_tremStart
private

Starting chord for current tremolo.

◆ _trills

TrillStack Ms::MusicXMLParserPass2::_trills { {} }
private

Current trills.


The documentation for this class was generated from the following files: