Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
/home/iurt/rpm/BUILD/canorus-0.7.R1002/src/import/musicxmlimport.h
Go to the documentation of this file.
00001 
00008 #ifndef MUSICXMLIMPORT_H_
00009 #define MUSICXMLIMPORT_H_
00010 
00011 #include <QXmlStreamReader>
00012 #include <QString>
00013 #include <QStack>
00014 #include <QHash>
00015 #include <QMultiHash>
00016 
00017 #include "core/playablelength.h"
00018 #include "core/diatonicpitch.h"
00019 #include "import/import.h"
00020 
00021 class CADocument;
00022 class CASheet;
00023 class CAStaff;
00024 class CAClef;
00025 class CAKeySignature;
00026 class CATimeSignature;
00027 
00028 class CAMusicXmlImport: public CAImport, private QXmlStreamReader {
00029 public:
00030         CAMusicXmlImport( QTextStream *stream=0 );
00031         CAMusicXmlImport( const QString stream );
00032         virtual ~CAMusicXmlImport();
00033 
00034         const QString readableStatus();
00035 
00036 private:
00037         void initMusicXmlImport();
00038         CADocument* importDocumentImpl();
00039 
00040         void readHeader();
00041         void readScorePartwise();
00042         void readScoreTimewise();
00043         void readWork();
00044         void readIdentification();
00045         void readDefaults();
00046         void readPartList();
00047         void readPart();
00048         void readMeasure( QString partId );
00049         void readAttributes( QString partId );
00050         void readNote( QString partId, int );
00051         void readForward( QString partId, int );
00052         CAVoice *addVoiceIfNeeded( QString partId, int staff, int voice );
00053 
00054         QString         _musicXmlVersion;
00055 
00056         CADocument *_document;
00057         QHash<QString, QHash<int, CAVoice*> > _partMapVoice; // part name -> map of voice number : voice
00058         QHash<QString, QList<CAStaff*> > _partMapStaff; // part name -> list of staffs
00059         QHash<QString, QHash<int, CAClef*> > _partMapClef; // part name -> map of staff number : last clef
00060         QHash<QString, QHash<int, CAKeySignature*> > _partMapKeySig; // part name -> map of staff number : last keysig
00061         QHash<QString, QHash<int, CATimeSignature*> > _partMapTimeSig; // part name -> map of staff number : last timesig
00062         QHash<QString, int> _midiChannel;
00063         QHash<QString, int> _midiProgram;
00064         QHash<QString, QString> _partName;
00065         QHash<QString, int> _divisions; // part name -> divisions
00066 };
00067 
00068 #endif /* MUSICXMLIMPORT_H_ */