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

#include <musicxmlexport.h>

Inheritance diagram for CAMusicXmlExport:
Inheritance graph
[legend]

Public Member Functions

 CAMusicXmlExport (QTextStream *stream=0)
 
virtual ~CAMusicXmlExport ()
 
CAVoicecurVoice ()
 
CASheetcurSheet ()
 
CADocumentcurDocument ()
 
CAContextcurContext ()
 
int curContextIndex ()
 
- Public Member Functions inherited from CAExport
 CAExport (QTextStream *stream=0)
 
virtual ~CAExport ()
 
virtual const QString readableStatus ()
 
void exportDocument (CADocument *, bool bStartThread=true)
 
void exportSheet (CASheet *)
 
void exportStaff (CAStaff *)
 
void exportVoice (CAVoice *)
 
void exportLyricsContext (CALyricsContext *)
 
void exportFunctionMarkContext (CAFunctionMarkContext *)
 
CADocumentexportedDocument ()
 
CASheetexportedSheet ()
 
CAStaffexportedStaff ()
 
CAVoiceexportedVoice ()
 
CALyricsContextexportedLyricsContext ()
 
CAFunctionMarkContextexportedFunctionMarkContext ()
 
virtual void setStreamToFile (const QString filename)
 
bool wait (unsigned long time=ULONG_MAX)
 
- 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 exportSheetImpl (CASheet *s)
 
void exportStaffImpl (CAStaff *, QDomElement &)
 
void exportMeasure (QList< CAVoice * > &, int *, QDomElement &)
 
void exportClef (CAClef *, QDomElement &)
 
void exportTimeSig (CATimeSignature *, QDomElement &)
 
void exportKeySig (CAKeySignature *, QDomElement &)
 
void exportNote (CANote *, QDomElement &)
 
void exportRest (CARest *, QDomElement &)
 
void setCurVoice (CAVoice *voice)
 
void setCurSheet (CASheet *sheet)
 
void setCurContext (CAContext *context)
 
void setCurContextIndex (int c)
 
void setCurDocument (CADocument *document)
 

Private Attributes

CAVoice_curVoice
 
CASheet_curSheet
 
CAContext_curContext
 
CADocument_curDocument
 
int _curContextIndex
 
QDomDocument * _xmlDoc
 

Additional Inherited Members

- Signals inherited from CAExport
void documentExported (CADocument *)
 
void sheetExported (CASheet *)
 
void staffExported (CAStaff *)
 
void voiceExported (CAVoice *)
 
void lyricsContextExported (CALyricsContext *)
 
void functionMarkContextExported (CAFunctionMarkContext *)
 
void exportDone (int status)
 
- Protected Member Functions inherited from CAExport
virtual void exportDocumentImpl (CADocument *)
 
virtual void exportStaffImpl (CAStaff *)
 
virtual void exportVoiceImpl (CAVoice *)
 
virtual void exportLyricsContextImpl (CALyricsContext *)
 
virtual void exportFunctionMarkContextImpl (CAFunctionMarkContext *)
 
QTextStream & out ()
 
void run ()
 
- 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)
 

Constructor & Destructor Documentation

◆ CAMusicXmlExport()

CAMusicXmlExport::CAMusicXmlExport ( 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 _xmlDoc.

◆ ~CAMusicXmlExport()

CAMusicXmlExport::~CAMusicXmlExport ( )
virtual

Member Function Documentation

◆ curContext()

CAContext* CAMusicXmlExport::curContext ( )
inline

References _curContext.

◆ curContextIndex()

int CAMusicXmlExport::curContextIndex ( )
inline

References _curContextIndex.

◆ curDocument()

CADocument* CAMusicXmlExport::curDocument ( )
inline

References _curDocument.

◆ curSheet()

CASheet* CAMusicXmlExport::curSheet ( )
inline

References _curSheet.

◆ curVoice()

CAVoice* CAMusicXmlExport::curVoice ( )
inline

References _curVoice.

◆ exportClef()

void CAMusicXmlExport::exportClef ( CAClef clef,
QDomElement &  xmlClef 
)
private

References _xmlDoc, CAClef::C, CAClef::c1(), CAClef::clefType(), CAClef::F, CAClef::G, CAClef::offset(), CAClef::PercussionHigh, CAClef::PercussionLow, and CAClef::Tab.

Referenced by exportMeasure().

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

◆ exportKeySig()

void CAMusicXmlExport::exportKeySig ( CAKeySignature key,
QDomElement &  xmlKey 
)
private

References _xmlDoc, CAKeySignature::diatonicKey(), CADiatonicKey::gender(), CADiatonicKey::Major, CADiatonicKey::Minor, and CADiatonicKey::numberOfAccs().

Referenced by exportMeasure().

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

◆ exportMeasure()

void CAMusicXmlExport::exportMeasure ( QList< CAVoice * > &  voiceList,
int *  curIndex,
QDomElement &  xmlMeasure 
)
private

Exports the voice elements at provided indices to the given DOM measure element.

References _xmlDoc, CAMusElement::Barline, CAMusElement::Clef, exportClef(), exportKeySig(), exportNote(), exportRest(), exportTimeSig(), CAMusElement::KeySignature, CAVoice::musElementList(), CAMusElement::musElementType(), CAMusElement::Note, CAPlayableLength::playableLengthToTimeLength(), CAMusElement::Rest, CAMusElement::TimeSignature, and CAVoice::voiceNumber().

Referenced by exportStaffImpl().

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

◆ exportNote()

void CAMusicXmlExport::exportNote ( CANote note,
QDomElement &  xmlNote 
)
private

◆ exportRest()

void CAMusicXmlExport::exportRest ( CARest rest,
QDomElement &  xmlNote 
)
private

References _xmlDoc.

Referenced by exportMeasure().

Here is the caller graph for this function:

◆ exportSheetImpl()

void CAMusicXmlExport::exportSheetImpl ( CASheet sheet)
privatevirtual

Exports the document to MusicXML 3.0 format. It uses DOM object internally for writing the XML output.

The implementation relies heavily on the tutorial found at musicxml.com.

Reimplemented from CAExport.

References _xmlDoc, CASheet::document(), exportStaffImpl(), CAExport::out(), setCurDocument(), setCurSheet(), and CASheet::staffList().

Here is the call graph for this function:

◆ exportStaffImpl()

void CAMusicXmlExport::exportStaffImpl ( CAStaff staff,
QDomElement &  xmlPart 
)
private

Exports the given staff to the provided DOM part element.

References _xmlDoc, exportMeasure(), and CAStaff::voiceList().

Referenced by exportSheetImpl().

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

◆ exportTimeSig()

void CAMusicXmlExport::exportTimeSig ( CATimeSignature time,
QDomElement &  xmlTime 
)
private

References _xmlDoc, CATimeSignature::beat(), and CATimeSignature::beats().

Referenced by exportMeasure().

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

◆ setCurContext()

void CAMusicXmlExport::setCurContext ( CAContext context)
inlineprivate

References _curContext.

◆ setCurContextIndex()

void CAMusicXmlExport::setCurContextIndex ( int  c)
inlineprivate

References _curContextIndex.

◆ setCurDocument()

void CAMusicXmlExport::setCurDocument ( CADocument document)
inlineprivate

References _curDocument.

Referenced by exportSheetImpl().

Here is the caller graph for this function:

◆ setCurSheet()

void CAMusicXmlExport::setCurSheet ( CASheet sheet)
inlineprivate

References _curSheet.

Referenced by exportSheetImpl().

Here is the caller graph for this function:

◆ setCurVoice()

void CAMusicXmlExport::setCurVoice ( CAVoice voice)
inlineprivate

References _curVoice.

Member Data Documentation

◆ _curContext

CAContext* CAMusicXmlExport::_curContext
private

Referenced by curContext(), and setCurContext().

◆ _curContextIndex

int CAMusicXmlExport::_curContextIndex
private

◆ _curDocument

CADocument* CAMusicXmlExport::_curDocument
private

Referenced by curDocument(), and setCurDocument().

◆ _curSheet

CASheet* CAMusicXmlExport::_curSheet
private

Referenced by curSheet(), and setCurSheet().

◆ _curVoice

CAVoice* CAMusicXmlExport::_curVoice
private

Referenced by curVoice(), and setCurVoice().

◆ _xmlDoc

QDomDocument* CAMusicXmlExport::_xmlDoc
private

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