#include <lyricscontext.h>

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.
Definition at line 19 of file lyricscontext.h.
| 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().


| 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().

| CALyricsContext::~CALyricsContext | ( | ) |
Definition at line 45 of file lyricscontext.cpp.
References associatedVoice(), clear(), and CAVoice::removeLyricsContext().

| void CALyricsContext::clear | ( | ) | [virtual] |
Implements CAContext.
Definition at line 52 of file lyricscontext.cpp.
References _syllableList.
Referenced by ~CALyricsContext().

| CALyricsContext * CALyricsContext::clone | ( | CASheet * | s | ) | [virtual] |
Clones the current context with the given parent sheet s.
Implements CAContext.
Definition at line 58 of file lyricscontext.cpp.
References _syllableList, addSyllable(), CALyricsContext(), cloneLyricsContextProperties(), CAContext::name(), CAMusElement::setContext(), and stanzaNumber().

| 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().


| 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().


| 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().


| 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().

| QList< CAMusElement * > CALyricsContext::musElementList | ( | ) |
| 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.

| 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().

| 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.
Definition at line 191 of file lyricscontext.cpp.
References _syllableList, removeAt(), CAMusElement::timeLength(), and CAMusElement::timeStart().
Referenced by clone(), and CALilyPondImport::importLyricsContextImpl().


| 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().

| 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().

| CASyllable* CALyricsContext::syllableAt | ( | int | idx | ) | [inline] |
Definition at line 39 of file lyricscontext.h.
References _syllableList.
Referenced by CALilyPondExport::exportLyricsContextImpl().

| CASyllable * CALyricsContext::syllableAtTimeStart | ( | int | timeStart | ) |
| QList<CASyllable*> CALyricsContext::syllableList | ( | ) | [inline] |
Definition at line 41 of file lyricscontext.h.
References _syllableList.
Referenced by CACanorusMLExport::exportDocumentImpl().

| int CALyricsContext::syllableCount | ( | ) | [inline] |
Definition at line 42 of file lyricscontext.h.
References _syllableList.
Referenced by CALilyPondExport::exportLyricsContextImpl().

| 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().

| 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().


| int CALyricsContext::stanzaNumber | ( | ) | [inline] |
Definition at line 53 of file lyricscontext.h.
References _stanzaNumber.
Referenced by clone(), cloneLyricsContextProperties(), CACanorusMLExport::exportDocumentImpl(), and CAMainWin::updateContextToolBar().

| void CALyricsContext::setStanzaNumber | ( | int | sn | ) | [inline] |
Definition at line 54 of file lyricscontext.h.
References _stanzaNumber.
Referenced by CALyricsContext(), and cloneLyricsContextProperties().

| QString CALyricsContext::customStanzaName | ( | ) | [inline] |
| void CALyricsContext::setCustomStanzaName | ( | QString | name | ) | [inline] |
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] |
QString CALyricsContext::_customStanzaName [private] |
Definition at line 62 of file lyricscontext.h.
Referenced by customStanzaName(), and setCustomStanzaName().
1.5.3