Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes
CALilyPondImport Class Reference

#include <lilypondimport.h>

Inheritance diagram for CALilyPondImport:
Inheritance graph
[legend]

List of all members.

Classes

struct  CATime

Public Member Functions

 CALilyPondImport (const QString in)
 CALilyPondImport (QTextStream *in=0)
void setTemplateVoice (CAVoice *voice)
virtual ~CALilyPondImport ()
const QString readableStatus ()

Private Types

enum  CALilyPondDepth { Score, Layout, Voice, Chord }

Private Member Functions

void initLilyPondImport ()
CAVoiceimportVoiceImpl ()
CALyricsContextimportLyricsContextImpl ()
CAVoicecurVoice ()
void setCurVoice (CAVoice *voice)
const QString parseNextElement ()
const QString peekNextElement ()
void addError (QString description, int lineError=0, int charError=0)
CAPlayableLength playableLengthFromLilyPond (QString &playableElt, bool parse=false)
bool isNote (const QString elt)
CADiatonicPitch relativePitchFromLilyPond (QString &note, CADiatonicPitch prevPitch, bool parse=false)
bool isRest (const QString elt)
CARest::CARestType restTypeFromLilyPond (QString &rest, bool parse=false)
CAClef::CAPredefinedClefType predefinedClefTypeFromLilyPond (const QString clef)
int clefOffsetFromLilyPond (const QString clef)
CABarline::CABarlineType barlineTypeFromLilyPond (const QString bar)
CADiatonicKey::CAGender diatonicKeyGenderFromLilyPond (QString gender)
CATime timeSigFromLilyPond (QString time)
CAMusElementfindSharedElement (CAMusElement *elt)
QString & in ()
CALilyPondDepth curDepth ()
void pushDepth (CALilyPondDepth depth)
CALilyPondDepth popDepth ()
int curLine ()
int curChar ()
CAVoicetemplateVoice ()

Private Attributes

CAVoice_curVoice
CASlur_curSlur
CASlur_curPhrasingSlur
QStack< CALilyPondDepth_depth
int _curLine
int _curChar
QList< QString > _errors
QList< QString > _warnings
CAVoice_templateVoice

Static Private Attributes

static const QRegExp WHITESPACE_DELIMITERS = QRegExp("[\\s]")
static const QRegExp SYNTAX_DELIMITERS = QRegExp("[<>{}]")
static const QRegExp DELIMITERS

Member Enumeration Documentation

Enumerator:
Score 
Layout 
Voice 
Chord 

Constructor & Destructor Documentation

References initLilyPondImport().

Here is the call graph for this function:

CALilyPondImport::CALilyPondImport ( QTextStream *  in = 0)

References initLilyPondImport().

Here is the call graph for this function:


Member Function Documentation

void CALilyPondImport::addError ( QString  description,
int  lineError = 0,
int  charError = 0 
) [private]

References _curChar, _curLine, and _errors.

Referenced by importVoiceImpl().

Here is the caller graph for this function:

Genarates barline type from the LilyPond syntax for the given barline from format "barlineType".

References CABarline::Dotted, CABarline::Double, CABarline::End, CABarline::RepeatClose, CABarline::RepeatCloseOpen, CABarline::RepeatOpen, CABarline::Single, and CAImport::Undefined.

Referenced by importVoiceImpl().

Here is the caller graph for this function:

int CALilyPondImport::clefOffsetFromLilyPond ( const QString  constClef) [private]

Returns the Canorus octava or whichever interval above or below the clef.

Referenced by importVoiceImpl().

Here is the caller graph for this function:

int CALilyPondImport::curChar ( ) [inline, private]

References _curChar.

Referenced by readableStatus().

Here is the caller graph for this function:

References _depth.

Referenced by importVoiceImpl().

Here is the caller graph for this function:

int CALilyPondImport::curLine ( ) [inline, private]

References _curLine.

Referenced by readableStatus().

Here is the caller graph for this function:

CAVoice* CALilyPondImport::curVoice ( ) [inline, private]

References _curVoice.

Referenced by findSharedElement(), and importVoiceImpl().

Here is the caller graph for this function:

Returns the key signature gender from format \genderType.

References CADiatonicKey::Major, and CADiatonicKey::Minor.

Referenced by importVoiceImpl().

Here is the caller graph for this function:

Gathers a list of music elements with the given element's start time and returns the first music element in the gathered list with the same attributes.

This method is usually called when voices have "shared" music elements (barlines, clefs etc.). However, in LilyPond syntax the music element can/should be present in all the voices. This function finds this shared music element, if it already exists.

If the music element with the same properties exists, user should delete its own instance and add an already existing instance of the returned shared music element to the voice.

See also:
CAMusElement::compare()

References CAVoice::contains(), curVoice(), CAStaff::getEltByType(), CAMusElement::musElementType(), CAVoice::staff(), and CAMusElement::timeStart().

Referenced by importVoiceImpl().

Here is the call graph for this function:

Here is the caller graph for this function:

CAVoice * CALilyPondImport::importVoiceImpl ( ) [private, virtual]
QString& CALilyPondImport::in ( ) [inline, private]

Reimplemented from CAImport.

References CAFile::stream().

Referenced by importLyricsContextImpl(), importVoiceImpl(), parseNextElement(), and peekNextElement().

Here is the call graph for this function:

Here is the caller graph for this function:

References _curChar, _curLine, _curPhrasingSlur, _curSlur, and _templateVoice.

Referenced by CALilyPondImport().

Here is the caller graph for this function:

bool CALilyPondImport::isNote ( const QString  elt) [private]

Returns true, if the given LilyPond element is a note.

See also:
isRest()

Referenced by importVoiceImpl().

Here is the caller graph for this function:

bool CALilyPondImport::isRest ( const QString  elt) [private]

Returns true, if the given LilyPond element is a rest.

See also:
isNote()

Referenced by importVoiceImpl().

Here is the caller graph for this function:

    Returns the first element in input stream ended with one of the delimiters and shorten input stream for the element.
Todo:
Only one-character syntax delimiters are supported so far.
See also:
peekNextElement()

References DELIMITERS, and in().

Referenced by importLyricsContextImpl(), and importVoiceImpl().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the first element in input stream ended with one of the delimiters but don't shorten the stream.

See also:
parseNextElement()

References DELIMITERS, and in().

Referenced by importVoiceImpl().

Here is the call graph for this function:

Here is the caller graph for this function:

CAPlayableLength CALilyPondImport::playableLengthFromLilyPond ( QString &  elt,
bool  parse = false 
) [private]

Generates playable lentgth and number of dots from the note/rest string in LilyPond syntax. If the playable element doesn't include length, { CAPlayable::CAPlayableLength::Undefined, 0 } is returned. This function also shortens the given string for the playable length, if parse is True.

See also:
relativePitchFromString()

References CAPlayableLength::dotted(), CAPlayableLength::setDotted(), and CAPlayableLength::setMusicLength().

Referenced by importVoiceImpl().

Here is the call graph for this function:

Here is the caller graph for this function:

References _depth.

Referenced by importVoiceImpl().

Here is the caller graph for this function:

Genarates clef type from the LilyPond syntax for the given clef from format "clefType".

References CAClef::Alto, CAClef::Baritone, CAClef::Bass, CAClef::French, CAClef::Mezzosoprano, CAClef::Percussion, CAClef::Soprano, CAClef::Subbass, CAClef::Tablature, CAClef::Tenor, CAClef::Treble, and CAClef::Varbaritone.

Referenced by importVoiceImpl().

Here is the caller graph for this function:

void CALilyPondImport::pushDepth ( CALilyPondDepth  depth) [inline, private]

References _depth.

Referenced by importVoiceImpl().

Here is the caller graph for this function:

const QString CALilyPondImport::readableStatus ( ) [virtual]

Reimplemented from CAImport.

References curChar(), curLine(), and CAFile::status().

Here is the call graph for this function:

CADiatonicPitch CALilyPondImport::relativePitchFromLilyPond ( QString &  constNName,
CADiatonicPitch  prevPitch,
bool  parse = false 
) [private]

Generates the note pitch and number of accidentals from the note written in LilyPond syntax.

See also:
playableLengthFromLilyPond()

References CADiatonicPitch::noteName().

Referenced by importVoiceImpl().

Here is the call graph for this function:

Here is the caller graph for this function:

CARest::CARestType CALilyPondImport::restTypeFromLilyPond ( QString &  elt,
bool  parse = false 
) [private]

Genarates rest type from the LilyPond syntax for the given rest. This function also shortens the given string for the rest type, if parse is True.

References CARest::Hidden, and CARest::Normal.

Referenced by importVoiceImpl().

Here is the caller graph for this function:

void CALilyPondImport::setCurVoice ( CAVoice voice) [inline, private]

References _curVoice.

Referenced by importVoiceImpl().

Here is the caller graph for this function:

void CALilyPondImport::setTemplateVoice ( CAVoice voice) [inline]

References _templateVoice.

Referenced by CAMainWin::sourceViewPortCommit().

Here is the caller graph for this function:

CAVoice* CALilyPondImport::templateVoice ( ) [inline, private]

References _templateVoice.

Referenced by importVoiceImpl().

Here is the caller graph for this function:

Returns the time signature beat and beats in beats/beat format.

Referenced by importVoiceImpl().

Here is the caller graph for this function:


Member Data Documentation

Referenced by curVoice(), and setCurVoice().

Referenced by curDepth(), popDepth(), and pushDepth().

QList<QString> CALilyPondImport::_errors [private]

Referenced by addError().

QList<QString> CALilyPondImport::_warnings [private]
const QRegExp CALilyPondImport::DELIMITERS [static, private]
Initial value:

Combined WHITESPACE_DELIMITERS and SYNTAX_DELIMITERS.

Referenced by parseNextElement(), and peekNextElement().

const QRegExp CALilyPondImport::SYNTAX_DELIMITERS = QRegExp("[<>{}]") [static, private]

Delimiters which separate various music elements in LilyPond syntax, but are specific for LilyPond syntax. They are reported as its own element when parsing the next element.

See also:
nextElement(), parseNextElement()
const QRegExp CALilyPondImport::WHITESPACE_DELIMITERS = QRegExp("[\\s]") [static, private]

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.

    Delimiters which separate various music elements in LilyPond syntax. These are new lines, tabs, blanks etc.

    \sa nextElement(), parseNextElement()

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