#include <canorusmlimport.h>

Public Member Functions | |
| CACanorusMLImport (QTextStream *stream=0) | |
| CACanorusMLImport (const QString stream) | |
| virtual | ~CACanorusMLImport () |
| void | initCanorusMLImport () |
| CADocument * | importDocumentImpl () |
| bool | startElement (const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &attributes) |
| bool | endElement (const QString &namespaceURI, const QString &localName, const QString &qName) |
| bool | fatalError (const QXmlParseException &exception) |
| bool | characters (const QString &ch) |
Private Member Functions | |
| void | importMark (const QXmlAttributes &attributes) |
| CADocument * | document () |
Private Attributes | |
| CADocument * | _document |
| QString | _version |
| QString | _errorMsg |
| QStack< QString > | _depth |
| CASheet * | _curSheet |
| CAContext * | _curContext |
| CAVoice * | _curVoice |
| CAKeySignature * | _curKeySig |
| CATimeSignature * | _curTimeSig |
| CAClef * | _curClef |
| CABarline * | _curBarline |
| CANote * | _curNote |
| CARest * | _curRest |
| CAMusElement * | _curMusElt |
| CASlur * | _curTie |
| CASlur * | _curSlur |
| CASlur * | _curPhrasingSlur |
| QHash < CALyricsContext *, int > | _lcMap |
| QHash< CASyllable *, int > | _syllableMap |
| QString | _cha |
Definition at line 28 of file canorusmlimport.h.
| CACanorusMLImport::CACanorusMLImport | ( | QTextStream * | stream = 0 |
) |
Copyright (c) 2006-2007, Matevž Jekovec, Canorus development team All Rights Reserved. See AUTHORS for a complete list of authors.
Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE.GPL for details.
Definition at line 45 of file canorusmlimport.cpp.
References initCanorusMLImport().

| CACanorusMLImport::CACanorusMLImport | ( | const QString | stream | ) |
Definition at line 50 of file canorusmlimport.cpp.
References initCanorusMLImport().

| CACanorusMLImport::~CACanorusMLImport | ( | ) | [virtual] |
Definition at line 55 of file canorusmlimport.cpp.
| void CACanorusMLImport::initCanorusMLImport | ( | ) |
Definition at line 58 of file canorusmlimport.cpp.
References _curBarline, _curClef, _curContext, _curKeySig, _curMusElt, _curNote, _curPhrasingSlur, _curRest, _curSheet, _curSlur, _curTie, _curTimeSig, _curVoice, and _document.
Referenced by CACanorusMLImport().

| CADocument * CACanorusMLImport::importDocumentImpl | ( | ) | [virtual] |
Opens a CanorusML source in and creates a document out of it. mainWin is needed for any UI settings stored in the file (the last viewports positions, current sheet etc.). CACanorusML uses SAX parser for reading.
Reimplemented from CAImport.
Definition at line 82 of file canorusmlimport.cpp.
References document(), and CAFile::stream().

| bool CACanorusMLImport::startElement | ( | const QString & | namespaceURI, | |
| const QString & | localName, | |||
| const QString & | qName, | |||
| const QXmlAttributes & | attributes | |||
| ) |
This function is called automatically by Qt SAX parser while reading the CanorusML source. This function is called when a new node is opened. It already reads node attributes.
The function returns true, if the node was successfully recognized and parsed; otherwise false.
Definition at line 124 of file canorusmlimport.cpp.
References _curBarline, _curClef, _curContext, _curKeySig, _curMusElt, _curNote, _curPhrasingSlur, _curRest, _curSheet, _curSlur, _curTie, _curTimeSig, _curVoice, _depth, _document, _errorMsg, _lcMap, _syllableMap, CASheet::addContext(), CADocument::addSheet(), CAStaff::addVoice(), CABarline::barlineTypeFromString(), CAClef::clefTypeFromString(), CASheet::context(), CASheet::contextCount(), CAContext::contextType(), CAFunctionMarking::functionTypeFromString(), importMark(), CAKeySignature::keySignatureType(), CAKeySignature::keySignatureTypeFromString(), CAKeySignature::MajorMinor, CAKeySignature::majorMinorGenderFromString(), CAKeySignature::Modus, CAKeySignature::modusFromString(), CASlur::PhrasingSlurType, CAPlayable::playableLengthFromString(), CARest::restTypeFromString(), CADocument::setArranger(), CADocument::setComments(), CADocument::setComposer(), CADocument::setCopyright(), CADocument::setDateCreated(), CADocument::setDateLastModified(), CADocument::setDedication(), CAKeySignature::setMajorMinorGender(), CAKeySignature::setModus(), CASlur::setNoteEnd(), CANote::setPhrasingSlurEnd(), CANote::setPhrasingSlurStart(), CADocument::setPoet(), CASlur::setSlurDirection(), CANote::setSlurEnd(), CANote::setSlurStart(), CASlur::setSlurStyle(), CANote::setStemDirection(), CADocument::setSubtitle(), CADocument::setTextTranslator(), CANote::setTieStart(), CADocument::setTimeEdited(), CADocument::setTitle(), CADocument::sheet(), CADocument::sheetCount(), CASlur::slurDirectionFromString(), CASlur::SlurPreferred, CASlur::slurStyleFromString(), CASlur::SlurType, CAPlayable::staff(), CAVoice::staff(), CAContext::Staff, CASheet::staffCount(), CANote::stemDirectionFromString(), CANote::StemNeutral, CASlur::TieType, CATimeSignature::timeSignatureTypeFromString(), CAStaff::voiceByName(), and CAStaff::voiceCount().
| bool CACanorusMLImport::endElement | ( | const QString & | namespaceURI, | |
| const QString & | localName, | |||
| const QString & | qName | |||
| ) |
This function is called automatically by Qt SAX parser while reading the CanorusML source. This function is called when a node has been closed (</nodeName>). Attributes for closed notes are usually not set in CanorusML format. That's why we need to store local node attributes (set when the node is opened) each time.
The function returns true, if the node was successfully recognized and parsed; otherwise false.
Definition at line 379 of file canorusmlimport.cpp.
References _cha, _curBarline, _curClef, _curContext, _curKeySig, _curNote, _curRest, _curSheet, _curTimeSig, _curVoice, _depth, _document, _lcMap, _syllableMap, _version, CAVoice::append(), CAMusElement::Barline, CAMusElement::Clef, CAVoice::contains(), CAContext::contextType(), CAMusElement::KeySignature, CAVoice::lastNote(), CADocument::sheetAt(), CADocument::sheetCount(), CAContext::Staff, CASheet::staffAt(), CASheet::staffCount(), CAStaff::synchronizeVoices(), CAMusElement::TimeSignature, CAMusElement::timeStart(), CANote::updateTies(), and CASheet::voiceList().

| bool CACanorusMLImport::fatalError | ( | const QXmlParseException & | exception | ) |
This method should be called when a critical error occurs while parsing the XML source.
Definition at line 106 of file canorusmlimport.cpp.
References _errorMsg.
| bool CACanorusMLImport::characters | ( | const QString & | ch | ) |
Stores the characters between the greater-lesser signs while parsing the XML file. This is usually needed for getting the property values stored not as node attributes, but between greater-lesser signs.
eg.
<length>127</length>
Definition at line 548 of file canorusmlimport.cpp.
References _cha.
| void CACanorusMLImport::importMark | ( | const QXmlAttributes & | attributes | ) | [private] |
Definition at line 554 of file canorusmlimport.cpp.
References _curMusElt, CAMusElement::addMark(), CAMark::Articulation, CAArticulation::articulationTypeFromString(), CAMusElement::Barline, CAMark::BookMark, CAMark::Crescendo, CACrescendo::crescendoTypeFromString(), CAMark::Dynamic, CAMark::Fermata, CAFermata::fermataTypeFromString(), CAMark::Fingering, CAFingering::fingerNumberFromString(), CAMark::InstrumentChange, CAMusElement::isPlayable(), CAMark::markTypeFromString(), CAMusElement::musElementType(), CAMark::Pedal, CAPlayable::playableLengthFromString(), CAMark::RehersalMark, CAMark::RepeatMark, CARepeatMark::repeatMarkTypeFromString(), CAMark::Ritardando, CARitardando::ritardandoTypeFromString(), CAMark::Tempo, and CAMark::Text.
Referenced by startElement().


| CACanorusMLImport::document | ( | ) | [inline, private] |
Returns the newly created document when reading the XML file.
Definition at line 48 of file canorusmlimport.h.
References _document.
Referenced by importDocumentImpl().

CACanorusMLImport::_document [private] |
Pointer to the document being read.
Definition at line 49 of file canorusmlimport.h.
Referenced by document(), endElement(), initCanorusMLImport(), and startElement().
CACanorusMLImport::_version [private] |
Document program version - which Canorus saved the file?
Definition at line 51 of file canorusmlimport.h.
Referenced by endElement().
CACanorusMLImport::_errorMsg [private] |
The error message content stored as QString, if the error happens.
Definition at line 52 of file canorusmlimport.h.
Referenced by fatalError(), and startElement().
CACanorusMLImport::_depth [private] |
Stack which represents the current depth of the document while SAX parsing. It contains the tag names as the values.
Definition at line 53 of file canorusmlimport.h.
Referenced by endElement(), and startElement().
CASheet* CACanorusMLImport::_curSheet [private] |
Definition at line 56 of file canorusmlimport.h.
Referenced by endElement(), initCanorusMLImport(), and startElement().
CAContext* CACanorusMLImport::_curContext [private] |
Definition at line 57 of file canorusmlimport.h.
Referenced by endElement(), initCanorusMLImport(), and startElement().
CAVoice* CACanorusMLImport::_curVoice [private] |
Definition at line 58 of file canorusmlimport.h.
Referenced by endElement(), initCanorusMLImport(), and startElement().
CAKeySignature* CACanorusMLImport::_curKeySig [private] |
Definition at line 59 of file canorusmlimport.h.
Referenced by endElement(), initCanorusMLImport(), and startElement().
CATimeSignature* CACanorusMLImport::_curTimeSig [private] |
Definition at line 60 of file canorusmlimport.h.
Referenced by endElement(), initCanorusMLImport(), and startElement().
CAClef* CACanorusMLImport::_curClef [private] |
Definition at line 61 of file canorusmlimport.h.
Referenced by endElement(), initCanorusMLImport(), and startElement().
CABarline* CACanorusMLImport::_curBarline [private] |
Definition at line 62 of file canorusmlimport.h.
Referenced by endElement(), initCanorusMLImport(), and startElement().
CANote* CACanorusMLImport::_curNote [private] |
Definition at line 63 of file canorusmlimport.h.
Referenced by endElement(), initCanorusMLImport(), and startElement().
CARest* CACanorusMLImport::_curRest [private] |
Definition at line 64 of file canorusmlimport.h.
Referenced by endElement(), initCanorusMLImport(), and startElement().
CAMusElement* CACanorusMLImport::_curMusElt [private] |
Definition at line 65 of file canorusmlimport.h.
Referenced by importMark(), initCanorusMLImport(), and startElement().
CASlur* CACanorusMLImport::_curTie [private] |
Definition at line 66 of file canorusmlimport.h.
Referenced by initCanorusMLImport(), and startElement().
CASlur* CACanorusMLImport::_curSlur [private] |
Definition at line 67 of file canorusmlimport.h.
Referenced by initCanorusMLImport(), and startElement().
CASlur* CACanorusMLImport::_curPhrasingSlur [private] |
Definition at line 68 of file canorusmlimport.h.
Referenced by initCanorusMLImport(), and startElement().
QHash<CALyricsContext*, int> CACanorusMLImport::_lcMap [private] |
QHash<CASyllable*, int> CACanorusMLImport::_syllableMap [private] |
CACanorusMLImport::_cha [private] |
Current characters being read using characters() method between the greater/lesser separators in XML file.
Definition at line 75 of file canorusmlimport.h.
Referenced by characters(), and endElement().
1.5.3