|
Canorus
0.0
|
Class for opening the Canorus documents. More...
#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) |
Public Member Functions inherited from CAImport | |
| CAImport (QTextStream *stream=0) | |
| CAImport (const QString stream) | |
| virtual | ~CAImport () |
| void | setStreamFromFile (const QString filename) |
| QString | fileName () |
| virtual const QString | readableStatus () |
| void | importDocument () |
| void | importSheet () |
| void | importStaff () |
| void | importVoice () |
| void | importLyricsContext () |
| void | importFunctionMarkContext () |
| CADocument * | importedDocument () |
| CASheet * | importedSheet () |
| CAStaff * | importedStaff () |
| CAVoice * | importedVoice () |
| CALyricsContext * | importedLyricsContext () |
| CAFunctionMarkContext * | importedFunctionMarkContext () |
Public Member Functions inherited from CAFile | |
| CAFile () | |
| virtual | ~CAFile () |
| const int | status () |
| const int | progress () |
| void | setStreamFromFile (const QString filename) |
| void | setStreamToFile (const QString filename) |
| void | setStreamFromDevice (QIODevice *device) |
| void | setStreamToDevice (QIODevice *device) |
| void | setStreamToString () |
| QString | getStreamAsString () |
Private Member Functions | |
| void | importMark (const QXmlAttributes &attributes) |
| void | importResource (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 |
| CAMusElement * | _prevMusElt |
| CAMark * | _curMark |
| CASlur * | _curTie |
| CASlur * | _curSlur |
| CATuplet * | _curTuplet |
| CASlur * | _curPhrasingSlur |
| CADiatonicPitch | _curDiatonicPitch |
| CADiatonicKey | _curDiatonicKey |
| CAPlayableLength | _curPlayableLength |
| CAPlayableLength | _curTempoPlayableLength |
| QHash< CALyricsContext *, int > | _lcMap |
| QHash< CASyllable *, int > | _syllableMap |
| QColor | _color |
| QString | _cha |
Additional Inherited Members | |
Signals inherited from CAImport | |
| void | documentImported (CADocument *) |
| void | sheetImported (CASheet *) |
| void | staffImported (CAStaff *) |
| void | voiceImported (CAVoice *) |
| void | lyricsContextImported (CALyricsContext *) |
| void | functionMarkContextImported (CAFunctionMarkContext *) |
| void | importDone (int status) |
Protected Member Functions inherited from CAImport | |
| virtual CASheet * | importSheetImpl () |
| virtual CAStaff * | importStaffImpl () |
| virtual CAVoice * | importVoiceImpl () |
| virtual CALyricsContext * | importLyricsContextImpl () |
| virtual CAFunctionMarkContext * | importFunctionMarkContextImpl () |
| QTextStream & | in () |
Protected Member Functions inherited from CAFile | |
| void | setStatus (const int status) |
| void | setProgress (const int progress) |
| QTextStream * | stream () |
| virtual void | setStream (QTextStream *stream) |
| QFile * | file () |
| void | setFile (QFile *file) |
Protected Attributes inherited from CAImport | |
| QString | _fileName |
Class for opening the Canorus documents.
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.
CACanorusMLImport class opens the XML based Canorus documents. It uses SAX parser for reading.
| CACanorusMLImport::CACanorusMLImport | ( | QTextStream * | stream = 0 | ) |
| CACanorusMLImport::CACanorusMLImport | ( | const QString | stream | ) |
|
virtual |
| 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.
Would set _cha value to "127".
References _cha.
|
inlineprivate |
Returns the newly created document when reading the XML file.
References _document.
Referenced by importDocumentImpl().

| 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.
References _cha, _curBarline, _curClef, _curContext, _curDiatonicKey, _curDiatonicPitch, _curKeySig, _curMark, _curMusElt, _curNote, _curPlayableLength, _curRest, _curSheet, _curTempoPlayableLength, _curTimeSig, _curTuplet, _curVoice, _depth, _document, _lcMap, _prevMusElt, _syllableMap, _version, CAVoice::append(), CATuplet::assignTimes(), CAMusElement::Barline, CAPlayable::calculateTimeLength(), CAMusElement::Clef, CAContext::contextType(), CAKeySignature::Custom, CAMusElement::FunctionMark, CAMusElement::KeySignature, CAKeySignature::keySignatureType(), CAVoice::lastNote(), CAKeySignature::MajorMinor, CAMark::markType(), CAKeySignature::Modus, CAVoice::musElementList(), CAMusElement::musElementType(), CAKeySignature::setDiatonicKey(), CANote::setDiatonicPitch(), CADiatonicKey::setDiatonicPitch(), CAPlayable::setPlayableLength(), CADocument::sheetList(), CAContext::Staff, CAMark::Tempo, CAMusElement::TimeSignature, CAMusElement::timeStart(), CAPlayable::tuplet(), 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.
References _errorMsg.
|
virtual |
Reimplemented from CAImport.
References CAImport::_fileName, document(), CADocument::setFileName(), and CAFile::stream().

|
private |
References _curMark, _curMusElt, _version, 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(), CAPlayableLength::musicLengthFromString(), CAMark::Pedal, CAMark::RehersalMark, CAMark::RepeatMark, CARepeatMark::repeatMarkTypeFromString(), CAMark::Ritardando, CARitardando::ritardandoTypeFromString(), CAMark::Tempo, CAMark::Text, and CAMark::Undefined.
Referenced by startElement().


|
private |
Imports the current resource.
References _document, CAFile::file(), CAImport::fileName(), CAResourceCtl::importResource(), CAResource::resourceTypeFromString(), and CAResource::setDescription().
Referenced by startElement().


| void CACanorusMLImport::initCanorusMLImport | ( | ) |
References _curBarline, _curClef, _curContext, _curKeySig, _curMark, _curMusElt, _curNote, _curPhrasingSlur, _curRest, _curSheet, _curSlur, _curTie, _curTimeSig, _curTuplet, _curVoice, _document, and _prevMusElt.
Referenced by CACanorusMLImport().

| 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.
References _color, _curBarline, _curClef, _curContext, _curDiatonicKey, _curDiatonicPitch, _curKeySig, _curMark, _curMusElt, _curNote, _curPhrasingSlur, _curPlayableLength, _curRest, _curSheet, _curSlur, _curTempoPlayableLength, _curTie, _curTimeSig, _curTuplet, _curVoice, _depth, _document, _errorMsg, _lcMap, _prevMusElt, _syllableMap, _version, CASheet::addContext(), CATuplet::addNote(), CAFiguredBassMark::addNumber(), CADocument::addSheet(), CAStaff::addVoice(), CABarline::barlineTypeFromString(), CAClef::clefTypeFromString(), CASheet::contextList(), CAContext::contextType(), CAKeySignature::Custom, CAFunctionMark::functionTypeFromString(), CADiatonicKey::genderFromString(), importMark(), importResource(), CAKeySignature::keySignatureTypeFromString(), CAKeySignature::MajorMinor, CAKeySignature::Modus, CAKeySignature::modusFromString(), CAPlayableLength::musicLengthFromString(), CASlur::noteStart(), CASlur::PhrasingSlurType, CARest::restTypeFromString(), CADocument::setArranger(), CAMusElement::setColor(), CADocument::setComments(), CADocument::setComposer(), CADocument::setCopyright(), CADocument::setDateCreated(), CADocument::setDateLastModified(), CADocument::setDedication(), CAVoice::setMidiChannel(), CAVoice::setMidiPitchOffset(), CAVoice::setMidiProgram(), 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(), CAMusElement::setTimeLength(), CADocument::setTitle(), CAPlayable::setTuplet(), CADocument::sheetList(), CASlur::slurDirectionFromString(), CASlur::SlurPreferred, CASlur::slurStyleFromString(), CASlur::SlurType, CAContext::Staff, CAPlayable::staff(), CAVoice::staff(), CASheet::staffList(), CANote::stemDirectionFromString(), CANote::StemNeutral, CASlur::TieType, CATimeSignature::timeSignatureTypeFromString(), CAMusElement::timeStart(), and CAStaff::voiceList().
|
private |
Current characters being read using characters() method between the greater/lesser separators in XML file.
Referenced by characters(), and endElement().
|
private |
Referenced by startElement().
|
private |
Referenced by endElement(), initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), and startElement().
|
private |
Referenced by endElement(), and startElement().
|
private |
Referenced by endElement(), initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), importMark(), initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), importMark(), initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), initCanorusMLImport(), and startElement().
|
private |
Referenced by initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), and startElement().
|
private |
Referenced by endElement(), initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), initCanorusMLImport(), and startElement().
|
private |
Referenced by initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), and startElement().
|
private |
Referenced by initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), initCanorusMLImport(), and startElement().
|
private |
Stack which represents the current depth of the document while SAX parsing. It contains the tag names as the values.
Referenced by endElement(), and startElement().
|
private |
Pointer to the document being read.
Referenced by document(), endElement(), importResource(), initCanorusMLImport(), and startElement().
|
private |
The error message content stored as QString, if the error happens.
Referenced by fatalError(), and startElement().
|
private |
Referenced by endElement(), and startElement().
|
private |
Referenced by endElement(), initCanorusMLImport(), and startElement().
|
private |
Referenced by endElement(), and startElement().
|
private |
Document program version - which Canorus saved the file?
Referenced by endElement(), importMark(), and startElement().