CALyricsContext Class Reference

One stanza line of lyrics. More...

#include <lyricscontext.h>

Inheritance diagram for CALyricsContext:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 CALyricsContext (const QString name, int stanzaNumber, CAVoice *v)
 CALyricsContext (const QString name, int stanzaNumber, CASheet *s)
 ~CALyricsContext ()
void clear ()
CALyricsContextclone (CASheet *s)
void cloneLyricsContextProperties (CALyricsContext *)
void repositSyllables ()
CAMusElementnext (CAMusElement *)
CAMusElementprevious (CAMusElement *)
QList< CAMusElement * > musElementList ()
bool remove (CAMusElement *)
void removeAt (int i)
bool addSyllable (CASyllable *, bool replace=true)
bool addEmptySyllable (int timeStart, int timeLength)
CASyllableremoveSyllableAtTimeStart (int timeStart)
CASyllablesyllableAt (int idx)
CASyllablesyllableAtTimeStart (int timeStart)
QList< CASyllable * > syllableList ()
int syllableCount ()
CAVoiceassociatedVoice ()
void setAssociatedVoice (CAVoice *v)
int stanzaNumber ()
void setStanzaNumber (int sn)
QString customStanzaName ()
void setCustomStanzaName (QString name)

Private Attributes

QList< CASyllable * > _syllableList
CAVoice_associatedVoice
int _stanzaNumber
QString _customStanzaName


Detailed Description

One stanza line of lyrics.

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 represents a single stanza of the lyrics. It consists of various syllables (text under every note) sorted by their timeStarts.

Every LyricsContext has its associated voice. This is the voice which the syllables are assigned to (one syllable per chord). Assocciated voice is a common LilyPond syntax .

If the user wants to create multiple stanzas, it should create multiple lyrics contexts - one for each stanza.

See also:
_syllableMap, CASyllable

Definition at line 19 of file lyricscontext.h.


Constructor & Destructor Documentation

CALyricsContext::CALyricsContext ( const QString  name,
int  stanzaNumber,
CAVoice v 
)

Definition at line 27 of file lyricscontext.cpp.

References _associatedVoice, CAContext::LyricsContext, setAssociatedVoice(), CAContext::setContextType(), and setStanzaNumber().

Referenced by clone().

Here is the call graph for this function:

Here is the caller graph for this function:

CALyricsContext::CALyricsContext ( const QString  name,
int  stanzaNumber,
CASheet s 
)

Definition at line 36 of file lyricscontext.cpp.

References _associatedVoice, CAContext::LyricsContext, setAssociatedVoice(), CAContext::setContextType(), and setStanzaNumber().

Here is the call graph for this function:

CALyricsContext::~CALyricsContext (  ) 

Definition at line 45 of file lyricscontext.cpp.

References associatedVoice(), clear(), and CAVoice::removeLyricsContext().

Here is the call graph for this function:


Member Function Documentation

void CALyricsContext::clear (  )  [virtual]

Implements CAContext.

Definition at line 52 of file lyricscontext.cpp.

References _syllableList.

Referenced by ~CALyricsContext().

Here is the caller graph for this function:

CALyricsContext * CALyricsContext::clone ( CASheet s  )  [virtual]

Clones the current context with the given parent sheet s.

See also:
CAMusElement::clone(), CADocument::clone()

Implements CAContext.

Definition at line 58 of file lyricscontext.cpp.

References _syllableList, addSyllable(), CALyricsContext(), cloneLyricsContextProperties(), CAContext::name(), CAMusElement::setContext(), and stanzaNumber().

Here is the call graph for this function:

void CALyricsContext::cloneLyricsContextProperties ( CALyricsContext lc  ) 

Sets the properties of the given lyrics context to this lyrics context.

Definition at line 73 of file lyricscontext.cpp.

References associatedVoice(), CAContext::name(), setAssociatedVoice(), CAContext::setName(), CAContext::setSheet(), setStanzaNumber(), CAContext::sheet(), and stanzaNumber().

Referenced by clone(), and CAMainWin::sourceViewPortCommit().

Here is the call graph for this function:

Here is the caller graph for this function:

void CALyricsContext::repositSyllables (  ) 

Keeps the content and order of the syllables, but changes startTimes and lengths according to the notes in associatedVoice. This function is usually called when associatedVoice is changed or the whole lyricsContext is initialized for the first time. If the notes and syllables aren't synchronized (too little syllables for notes) it adds empty syllables.

Definition at line 85 of file lyricscontext.cpp.

References _syllableList, addEmptySyllable(), associatedVoice(), CAVoice::getNoteList(), and removeAt().

Referenced by CAMainWin::deleteSelection(), CALilyPondImport::importLyricsContextImpl(), and setAssociatedVoice().

Here is the call graph for this function:

Here is the caller graph for this function:

CAMusElement * CALyricsContext::next ( CAMusElement elt  )  [virtual]

Implements CAContext.

Definition at line 113 of file lyricscontext.cpp.

References _syllableList, CAMusElement::musElementType(), and CAMusElement::Syllable.

Referenced by CAScoreViewPort::createTextEdit(), and CAMainWin::onTextEditKeyPressEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

CAMusElement * CALyricsContext::previous ( CAMusElement elt  )  [virtual]

Implements CAContext.

Definition at line 124 of file lyricscontext.cpp.

References _syllableList, CAMusElement::musElementType(), and CAMusElement::Syllable.

Referenced by CAMainWin::onTextEditKeyPressEvent().

Here is the call graph for this function:

QList< CAMusElement * > CALyricsContext::musElementList (  ) 

Definition at line 217 of file lyricscontext.cpp.

References _syllableList.

bool CALyricsContext::remove ( CAMusElement elt  )  [virtual]

Removes the given syllable from the list.

Implements CAContext.

Definition at line 138 of file lyricscontext.cpp.

References _syllableList, CAMusElement::musElementType(), and CAMusElement::Syllable.

Here is the call graph for this function:

void CALyricsContext::removeAt ( int  i  ) 

Removes the syllable at the given position.

Definition at line 154 of file lyricscontext.cpp.

References _syllableList.

Referenced by addSyllable(), removeSyllableAtTimeStart(), and repositSyllables().

Here is the caller graph for this function:

bool CALyricsContext::addSyllable ( CASyllable syllable,
bool  replace = true 
)

Adds a syllable to the context. The syllable at that location is replaced (default) by the new one, if replace is True. Time starts after the inserted syllable are increased for the length of the inserted syllable. Syllables are always sorted by their startTimes.

See also:
_syllableList

Definition at line 191 of file lyricscontext.cpp.

References _syllableList, removeAt(), CAMusElement::timeLength(), and CAMusElement::timeStart().

Referenced by clone(), and CALilyPondImport::importLyricsContextImpl().

Here is the call graph for this function:

Here is the caller graph for this function:

bool CALyricsContext::addEmptySyllable ( int  timeStart,
int  timeLength 
)

Adds an empty syllable to the context. This is useful when initializing the lyrics context or inserting a new note.

Definition at line 207 of file lyricscontext.cpp.

References _syllableList.

Referenced by repositSyllables().

Here is the caller graph for this function:

CASyllable * CALyricsContext::removeSyllableAtTimeStart ( int  timeStart  ) 

Removes the syllable at the given timeStart and updates the timeStarts for syllables after it. This function is usually called when removing the note.

Returns True if the syllable was found and removed; False otherwise.

Definition at line 166 of file lyricscontext.cpp.

References _syllableList, removeAt(), and CAMusElement::timeLength().

Here is the call graph for this function:

CASyllable* CALyricsContext::syllableAt ( int  idx  )  [inline]

Definition at line 39 of file lyricscontext.h.

References _syllableList.

Referenced by CALilyPondExport::exportLyricsContextImpl().

Here is the caller graph for this function:

CASyllable * CALyricsContext::syllableAtTimeStart ( int  timeStart  ) 

Definition at line 225 of file lyricscontext.cpp.

References _syllableList.

QList<CASyllable*> CALyricsContext::syllableList (  )  [inline]

Definition at line 41 of file lyricscontext.h.

References _syllableList.

Referenced by CACanorusMLExport::exportDocumentImpl().

Here is the caller graph for this function:

int CALyricsContext::syllableCount (  )  [inline]

Definition at line 42 of file lyricscontext.h.

References _syllableList.

Referenced by CALilyPondExport::exportLyricsContextImpl().

Here is the caller graph for this function:

CAVoice* CALyricsContext::associatedVoice (  )  [inline]

Definition at line 44 of file lyricscontext.h.

References _associatedVoice.

Referenced by cloneLyricsContextProperties(), CACanorusMLExport::exportDocumentImpl(), CALilyPondExport::exportScoreBlock(), CAMainWin::onTextEditKeyPressEvent(), CAEngraver::reposit(), repositSyllables(), CAMainWin::sourceViewPortCommit(), CAMainWin::updateContextToolBar(), and ~CALyricsContext().

Here is the caller graph for this function:

void CALyricsContext::setAssociatedVoice ( CAVoice v  )  [inline]

Definition at line 45 of file lyricscontext.h.

References _associatedVoice, CAVoice::addLyricsContext(), CAVoice::removeLyricsContext(), and repositSyllables().

Referenced by CALyricsContext(), and cloneLyricsContextProperties().

Here is the call graph for this function:

Here is the caller graph for this function:

int CALyricsContext::stanzaNumber (  )  [inline]

Definition at line 53 of file lyricscontext.h.

References _stanzaNumber.

Referenced by clone(), cloneLyricsContextProperties(), CACanorusMLExport::exportDocumentImpl(), and CAMainWin::updateContextToolBar().

Here is the caller graph for this function:

void CALyricsContext::setStanzaNumber ( int  sn  )  [inline]

Definition at line 54 of file lyricscontext.h.

References _stanzaNumber.

Referenced by CALyricsContext(), and cloneLyricsContextProperties().

Here is the caller graph for this function:

QString CALyricsContext::customStanzaName (  )  [inline]

Definition at line 55 of file lyricscontext.h.

References _customStanzaName.

void CALyricsContext::setCustomStanzaName ( QString  name  )  [inline]

Definition at line 56 of file lyricscontext.h.

References _customStanzaName.


Member Data Documentation

QList< CASyllable* > CALyricsContext::_syllableList [private]

Definition at line 59 of file lyricscontext.h.

Referenced by addEmptySyllable(), addSyllable(), clear(), clone(), musElementList(), next(), previous(), remove(), removeAt(), removeSyllableAtTimeStart(), repositSyllables(), syllableAt(), syllableAtTimeStart(), syllableCount(), and syllableList().

CAVoice* CALyricsContext::_associatedVoice [private]

Definition at line 60 of file lyricscontext.h.

Referenced by associatedVoice(), CALyricsContext(), and setAssociatedVoice().

int CALyricsContext::_stanzaNumber [private]

Definition at line 61 of file lyricscontext.h.

Referenced by setStanzaNumber(), and stanzaNumber().

QString CALyricsContext::_customStanzaName [private]

Definition at line 62 of file lyricscontext.h.

Referenced by customStanzaName(), and setCustomStanzaName().


The documentation for this class was generated from the following files:
Generated on Sat Feb 9 13:16:02 2008 for Canorus by  doxygen 1.5.3