Canorus  0.0
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
CAMusicXmlImport Class Reference

#include <musicxmlimport.h>

Inheritance diagram for CAMusicXmlImport:
Inheritance graph
[legend]

Public Member Functions

 CAMusicXmlImport (QTextStream *stream=0)
 
 CAMusicXmlImport (const QString stream)
 
virtual ~CAMusicXmlImport ()
 
const QString readableStatus ()
 
- Public Member Functions inherited from CAImport
 CAImport (QTextStream *stream=0)
 
 CAImport (const QString stream)
 
virtual ~CAImport ()
 
void setStreamFromFile (const QString filename)
 
QString fileName ()
 
void importDocument ()
 
void importSheet ()
 
void importStaff ()
 
void importVoice ()
 
void importLyricsContext ()
 
void importFunctionMarkContext ()
 
CADocumentimportedDocument ()
 
CASheetimportedSheet ()
 
CAStaffimportedStaff ()
 
CAVoiceimportedVoice ()
 
CALyricsContextimportedLyricsContext ()
 
CAFunctionMarkContextimportedFunctionMarkContext ()
 
- 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 ()
 

Protected Member Functions

CADocumentimportDocumentImpl ()
 
- Protected Member Functions inherited from CAImport
virtual CASheetimportSheetImpl ()
 
virtual CAStaffimportStaffImpl ()
 
virtual CAVoiceimportVoiceImpl ()
 
virtual CALyricsContextimportLyricsContextImpl ()
 
virtual CAFunctionMarkContextimportFunctionMarkContextImpl ()
 
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)
 

Private Member Functions

void initMusicXmlImport ()
 
void readHeader ()
 
void readScorePartwise ()
 
void readScoreTimewise ()
 
void readWork ()
 
void readIdentification ()
 
void readDefaults ()
 
void readPartList ()
 
void readPart ()
 
void readMeasure (QString partId)
 
void readAttributes (QString partId)
 
void readNote (QString partId, int)
 
void readForward (QString partId, int)
 
void readSound (QString partId)
 
CAVoiceaddVoiceIfNeeded (QString partId, int staff, int voice)
 
void addStavesIfNeeded (QString partId, int staves)
 

Private Attributes

QString _musicXmlVersion
 
CADocument_document
 
QHash< QString, QHash< int, CAVoice * > > _partMapVoice
 
QHash< QString, QList< CAStaff * > > _partMapStaff
 
QHash< QString, QHash< int, CAClef * > > _partMapClef
 
QHash< QString, QHash< int, CAKeySignature * > > _partMapKeySig
 
QHash< QString, QHash< int, CATimeSignature * > > _partMapTimeSig
 
QHash< QString, int > _midiChannel
 
QHash< QString, int > _midiProgram
 
QHash< QString, QString > _partName
 
QHash< QString, int > _divisions
 
int _tempoBpm
 

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 Attributes inherited from CAImport
QString _fileName
 

Constructor & Destructor Documentation

◆ CAMusicXmlImport() [1/2]

CAMusicXmlImport::CAMusicXmlImport ( QTextStream *  stream = 0)

Copyright (c) 2008, 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.

References initMusicXmlImport().

Here is the call graph for this function:

◆ CAMusicXmlImport() [2/2]

CAMusicXmlImport::CAMusicXmlImport ( const QString  stream)

References initMusicXmlImport().

Here is the call graph for this function:

◆ ~CAMusicXmlImport()

CAMusicXmlImport::~CAMusicXmlImport ( )
virtual

Member Function Documentation

◆ addStavesIfNeeded()

void CAMusicXmlImport::addStavesIfNeeded ( QString  partId,
int  staves 
)
private

Assures that the given partId contains at least staves number of staves. Adds new staves, if needed and assings any clefs, key signatures or time signatures in the buffer to the new staff, if their number is the number of the new staff.

References _document, _partMapClef, _partMapKeySig, _partMapStaff, _partMapTimeSig, and CADocument::sheetList().

Referenced by readAttributes(), and readPart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addVoiceIfNeeded()

CAVoice * CAMusicXmlImport::addVoiceIfNeeded ( QString  partId,
int  staff,
int  voice 
)
private

Assures that the given partId and staff contains at least voice number of voices. Adds new voices, if needed and adds any clefs, key signatures or time signatures in the buffer to the new voice.

References _partMapClef, _partMapKeySig, _partMapStaff, _partMapTimeSig, _partMapVoice, CAStaff::addVoice(), CAVoice::append(), CAVoice::staff(), CAStaff::synchronizeVoices(), and CAStaff::voiceList().

Referenced by readForward(), and readNote().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ importDocumentImpl()

CADocument * CAMusicXmlImport::importDocumentImpl ( )
protectedvirtual

Opens a MusicXML source in and creates a document out of it. CAMusicXmlImport uses QXmlStreamReader and SAX model for reading.

Reimplemented from CAImport.

Reimplemented in CAMXLImport.

References _document, _musicXmlVersion, readHeader(), readScorePartwise(), readScoreTimewise(), CAFile::setStatus(), and CAFile::stream().

Referenced by CAMXLImport::importDocumentImpl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initMusicXmlImport()

void CAMusicXmlImport::initMusicXmlImport ( )
private

References _document, and _tempoBpm.

Referenced by CAMusicXmlImport().

Here is the caller graph for this function:

◆ readableStatus()

const QString CAMusicXmlImport::readableStatus ( )
virtual

Reimplemented from CAImport.

References CAImport::readableStatus(), and CAFile::status().

Here is the call graph for this function:

◆ readAttributes()

void CAMusicXmlImport::readAttributes ( QString  partId)
private

References _divisions, _partMapClef, _partMapKeySig, _partMapStaff, _partMapTimeSig, addStavesIfNeeded(), CAClef::Bass, CADiatonicKey::genderFromString(), CADiatonicKey::Major, and CAClef::Treble.

Referenced by readMeasure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readDefaults()

void CAMusicXmlImport::readDefaults ( )
private

Referenced by readScorePartwise().

Here is the caller graph for this function:

◆ readForward()

void CAMusicXmlImport::readForward ( QString  partId,
int  divisions 
)
private

References addVoiceIfNeeded(), CAVoice::append(), CARest::composeRests(), and CAVoice::lastTimeEnd().

Referenced by readMeasure().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readHeader()

void CAMusicXmlImport::readHeader ( )
private

Referenced by importDocumentImpl().

Here is the caller graph for this function:

◆ readIdentification()

void CAMusicXmlImport::readIdentification ( )
private

References _document, CADocument::setComposer(), CADocument::setCopyright(), and CADocument::setPoet().

Referenced by readScorePartwise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readMeasure()

void CAMusicXmlImport::readMeasure ( QString  partId)
private

References _divisions, _partMapStaff, readAttributes(), readForward(), readNote(), readSound(), CABarline::Single, CAStaff::synchronizeVoices(), and CAStaff::voiceList().

Referenced by readPart().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readNote()

void CAMusicXmlImport::readNote ( QString  partId,
int  divisions 
)
private

◆ readPart()

void CAMusicXmlImport::readPart ( )
private

References _partMapClef, _partMapKeySig, _partMapStaff, _partMapTimeSig, addStavesIfNeeded(), and readMeasure().

Referenced by readScorePartwise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readPartList()

void CAMusicXmlImport::readPartList ( )
private

References _document, _midiChannel, _midiProgram, _partName, and CADocument::addSheet().

Referenced by readScorePartwise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readScorePartwise()

void CAMusicXmlImport::readScorePartwise ( )
private

References _document, _midiChannel, _midiProgram, _partMapStaff, readDefaults(), readIdentification(), readPart(), readPartList(), readWork(), CADocument::setTitle(), and CAStaff::voiceList().

Referenced by importDocumentImpl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readScoreTimewise()

void CAMusicXmlImport::readScoreTimewise ( )
private

References _document.

Referenced by importDocumentImpl().

Here is the caller graph for this function:

◆ readSound()

void CAMusicXmlImport::readSound ( QString  partId)
private

References _tempoBpm.

Referenced by readMeasure().

Here is the caller graph for this function:

◆ readWork()

void CAMusicXmlImport::readWork ( )
private

References _document, and CADocument::setTitle().

Referenced by readScorePartwise().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _divisions

QHash<QString, int> CAMusicXmlImport::_divisions
private

Referenced by readAttributes(), and readMeasure().

◆ _document

CADocument* CAMusicXmlImport::_document
private

◆ _midiChannel

QHash<QString, int> CAMusicXmlImport::_midiChannel
private

Referenced by readPartList(), and readScorePartwise().

◆ _midiProgram

QHash<QString, int> CAMusicXmlImport::_midiProgram
private

Referenced by readPartList(), and readScorePartwise().

◆ _musicXmlVersion

QString CAMusicXmlImport::_musicXmlVersion
private

Referenced by importDocumentImpl().

◆ _partMapClef

QHash<QString, QHash<int, CAClef*> > CAMusicXmlImport::_partMapClef
private

◆ _partMapKeySig

QHash<QString, QHash<int, CAKeySignature*> > CAMusicXmlImport::_partMapKeySig
private

◆ _partMapStaff

QHash<QString, QList<CAStaff*> > CAMusicXmlImport::_partMapStaff
private

◆ _partMapTimeSig

QHash<QString, QHash<int, CATimeSignature*> > CAMusicXmlImport::_partMapTimeSig
private

◆ _partMapVoice

QHash<QString, QHash<int, CAVoice*> > CAMusicXmlImport::_partMapVoice
private

Referenced by addVoiceIfNeeded().

◆ _partName

QHash<QString, QString> CAMusicXmlImport::_partName
private

Referenced by readPartList().

◆ _tempoBpm

int CAMusicXmlImport::_tempoBpm
private

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