|
Canorus
0.7
|
Base class for import filters. More...
#include <import.h>

Base class for import filters.
Copyright (c) 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.
This class inherits CAFile and is the base class for any specific import filter (eg. LilyPond,
CanorusML, MusicXML etc.).
If a developer wants to write a new import filter, he should:
1) Create a new class with the base class CAImport
2) Implement CAImport constructors and at least importDocumentImpl() function which returns
the new CADocument.
3) Register the filter (put a new fileformat to CAFileFormats and add the filter to open/save
dialogs in CACanorus)
Optionally:
Developer should change the current status and progress while operations are in progress. He should
also rewrite the readableStatus() function.
The following example illustrates the usage of import class:
CAMyImportFilter import(); import.setStreamFromFile("jingle bells.xml"); import.importDocument(); import.wait(); setDocument( import.importedDocument() ); CACanorus::rebuildUI();
In Python the example is even more direct using the string as an input method:
lilyString = '\\relative c { \\clef "treble" \\time 4/4 c4 d e f | f e d c | c1 \\bar "|." }' myImport = CALilyPondImport( lilyString ) myImport.importVoice() myImport.wait() voice = myImport.importedVoice()
enum CAImport::CAImportPart [private] |
| CAImport::CAImport | ( | QTextStream * | stream = 0 | ) |
References setImportedDocument(), setImportedFunctionMarkContext(), setImportedLyricsContext(), setImportedSheet(), setImportedStaff(), setImportedVoice(), setImportPart(), CAFile::setStream(), and Undefined.

| CAImport::CAImport | ( | const QString | stream | ) |
References setImportedDocument(), setImportedFunctionMarkContext(), setImportedLyricsContext(), setImportedSheet(), setImportedStaff(), setImportedVoice(), setImportPart(), CAFile::setStream(), and Undefined.

| CAImport::~CAImport | ( | ) | [virtual] |
| void CAImport::documentImported | ( | CADocument * | ) | [signal] |
| void CAImport::functionMarkContextImported | ( | CAFunctionMarkContext * | ) | [signal] |
| void CAImport::importDocument | ( | ) |
References Document, setImportPart(), and CAFile::setStatus().
Referenced by CACanImport::importDocumentImpl(), CAMainWin::openDocument(), CAAutoRecovery::openRecovery(), and CAMainWin::sourceViewPortCommit().


| virtual CADocument* CAImport::importDocumentImpl | ( | ) | [inline, protected, virtual] |
Reimplemented in CACanorusMLImport, CAMidiImport, CAMusicXmlImport, and CACanImport.
References CAFile::setStatus().
Referenced by run().


| void CAImport::importDone | ( | int | status | ) | [signal] |
| CADocument* CAImport::importedDocument | ( | ) | [inline] |
References _importedDocument.
Referenced by CACanImport::importDocumentImpl(), CAMainWin::openDocument(), CAAutoRecovery::openRecovery(), and CAMainWin::sourceViewPortCommit().

| CAFunctionMarkContext* CAImport::importedFunctionMarkContext | ( | ) | [inline] |
References _importedFunctionMarkContext.
| CALyricsContext* CAImport::importedLyricsContext | ( | ) | [inline] |
References _importedLyricsContext.
Referenced by CAMainWin::sourceViewPortCommit().

| CASheet* CAImport::importedSheet | ( | ) | [inline] |
References _importedSheet.
| CAStaff* CAImport::importedStaff | ( | ) | [inline] |
References _importedStaff.
| CAVoice* CAImport::importedVoice | ( | ) | [inline] |
References _importedVoice.
Referenced by CAMainWin::sourceViewPortCommit().

| void CAImport::importFunctionMarkContext | ( | ) |
References FunctionMarkContext, setImportPart(), and CAFile::setStatus().

| virtual CAFunctionMarkContext* CAImport::importFunctionMarkContextImpl | ( | ) | [inline, protected, virtual] |
References CAFile::setStatus().
Referenced by run().


| void CAImport::importLyricsContext | ( | ) |
References LyricsContext, setImportPart(), and CAFile::setStatus().
Referenced by CAMainWin::sourceViewPortCommit().


| virtual CALyricsContext* CAImport::importLyricsContextImpl | ( | ) | [inline, protected, virtual] |
Reimplemented in CALilyPondImport.
References CAFile::setStatus().
Referenced by run().


| CAImportPart CAImport::importPart | ( | ) | [inline, private] |
| void CAImport::importSheet | ( | ) |
References setImportPart(), CAFile::setStatus(), and Sheet.

| virtual CASheet* CAImport::importSheetImpl | ( | ) | [inline, protected, virtual] |
Reimplemented in CAMidiImport.
References CAFile::setStatus().
Referenced by run().


| void CAImport::importStaff | ( | ) |
References setImportPart(), CAFile::setStatus(), and Staff.

| virtual CAStaff* CAImport::importStaffImpl | ( | ) | [inline, protected, virtual] |
References CAFile::setStatus().
Referenced by run().


| void CAImport::importVoice | ( | ) |
References setImportPart(), CAFile::setStatus(), and Voice.
Referenced by CAMainWin::sourceViewPortCommit().


| virtual CAVoice* CAImport::importVoiceImpl | ( | ) | [inline, protected, virtual] |
Reimplemented in CALilyPondImport.
References CAFile::setStatus().
Referenced by run().


| QTextStream& CAImport::in | ( | ) | [inline, protected] |
Reimplemented in CAMidiImport, and CALilyPondImport.
References CAFile::stream().

| void CAImport::lyricsContextImported | ( | CALyricsContext * | ) | [signal] |
| const QString CAImport::readableStatus | ( | ) | [virtual] |
Implements CAFile.
Reimplemented in CAMidiImport, CALilyPondImport, and CAMusicXmlImport.
References CAFile::status().
Referenced by CAMainWin::openDocument().


| void CAImport::run | ( | ) | [private] |
Executed when a new thread is dispatched. It looks which part of the document should be imported and starts the procedure. It emits the appropriate signal when the procedure is finished.
References Document, documentImported(), FunctionMarkContext, functionMarkContextImported(), importDocumentImpl(), importDone(), importFunctionMarkContextImpl(), importLyricsContextImpl(), importPart(), importSheetImpl(), importStaffImpl(), importVoiceImpl(), LyricsContext, lyricsContextImported(), setImportedDocument(), setImportedFunctionMarkContext(), setImportedLyricsContext(), setImportedSheet(), setImportedStaff(), setImportedVoice(), CAFile::setStatus(), Sheet, sheetImported(), Staff, staffImported(), CAFile::status(), CAFile::stream(), Voice, and voiceImported().

| void CAImport::setImportedDocument | ( | CADocument * | doc | ) | [inline, private] |
References _importedDocument.
Referenced by CAImport(), and run().

| void CAImport::setImportedFunctionMarkContext | ( | CAFunctionMarkContext * | fmc | ) | [inline, private] |
References _importedFunctionMarkContext.
Referenced by CAImport(), and run().

| void CAImport::setImportedLyricsContext | ( | CALyricsContext * | lc | ) | [inline, private] |
References _importedLyricsContext.
Referenced by CAImport(), and run().

| void CAImport::setImportedSheet | ( | CASheet * | sheet | ) | [inline, private] |
References _importedSheet.
Referenced by CAImport(), and run().

| void CAImport::setImportedStaff | ( | CAStaff * | staff | ) | [inline, private] |
References _importedStaff.
Referenced by CAImport(), and run().

| void CAImport::setImportedVoice | ( | CAVoice * | voice | ) | [inline, private] |
References _importedVoice.
Referenced by CAImport(), and run().

| void CAImport::setImportPart | ( | CAImportPart | part | ) | [inline, private] |
References _importPart.
Referenced by CAImport(), importDocument(), importFunctionMarkContext(), importLyricsContext(), importSheet(), importStaff(), and importVoice().

| void CAImport::sheetImported | ( | CASheet * | ) | [signal] |
| void CAImport::staffImported | ( | CAStaff * | ) | [signal] |
| void CAImport::voiceImported | ( | CAVoice * | ) | [signal] |
CADocument* CAImport::_importedDocument [private] |
Referenced by importedDocument(), and setImportedDocument().
Referenced by importedFunctionMarkContext(), and setImportedFunctionMarkContext().
CALyricsContext* CAImport::_importedLyricsContext [private] |
Referenced by importedLyricsContext(), and setImportedLyricsContext().
CASheet* CAImport::_importedSheet [private] |
Referenced by importedSheet(), and setImportedSheet().
CAStaff* CAImport::_importedStaff [private] |
Referenced by importedStaff(), and setImportedStaff().
CAVoice* CAImport::_importedVoice [private] |
Referenced by importedVoice(), and setImportedVoice().
CAImportPart CAImport::_importPart [private] |
Referenced by importPart(), and setImportPart().
1.8.0