|
Canorus
0.7
|
One stanza line of lyrics. More...
#include <lyricscontext.h>

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 \lyricsto.
If the user wants to create multiple stanzas, it should create multiple lyrics contexts - one for each stanza.
\sa _syllableMap, CASyllable| CALyricsContext::CALyricsContext | ( | const QString | name, |
| int | stanzaNumber, | ||
| CAVoice * | v | ||
| ) |
References _associatedVoice, CAContext::LyricsContext, setAssociatedVoice(), CAContext::setContextType(), and setStanzaNumber().
Referenced by clone().


| CALyricsContext::CALyricsContext | ( | const QString | name, |
| int | stanzaNumber, | ||
| CASheet * | s | ||
| ) |
References _associatedVoice, CAContext::LyricsContext, setAssociatedVoice(), CAContext::setContextType(), and setStanzaNumber().

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

| 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.
References _syllableList.
Referenced by CAMainWin::pasteAt(), 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.
References _syllableList, removeAt(), CAMusElement::timeLength(), and CAMusElement::timeStart().
Referenced by clone(), CAMainWin::copySelection(), CALilyPondImport::importLyricsContextImpl(), and CAMainWin::pasteAt().


| CAVoice* CALyricsContext::associatedVoice | ( | ) | [inline] |
References _associatedVoice.
Referenced by cloneLyricsContextProperties(), CAMainWin::copySelection(), CACanorusMLExport::exportDocumentImpl(), CALilyPondExport::exportScoreBlock(), CAMainWin::onTextEditKeyPressEvent(), CAEngraver::reposit(), repositSyllables(), CAMainWin::sourceViewPortCommit(), CAMainWin::updateContextToolBar(), and ~CALyricsContext().

| void CALyricsContext::clear | ( | ) | [virtual] |
Implements CAContext.
References _syllableList.
Referenced by ~CALyricsContext().

| CALyricsContext * CALyricsContext::clone | ( | CASheet * | s | ) | [virtual] |
Clones the current context with the given parent sheet s.
Implements CAContext.
References _syllableList, addSyllable(), CALyricsContext(), cloneLyricsContextProperties(), CAContext::name(), and stanzaNumber().

Sets the properties of the given lyrics context to this lyrics context.
References associatedVoice(), CAContext::name(), setAssociatedVoice(), CAContext::setName(), CAContext::setSheet(), setStanzaNumber(), CAContext::sheet(), and stanzaNumber().
Referenced by clone(), and CAMainWin::sourceViewPortCommit().


| QString CALyricsContext::customStanzaName | ( | ) | [inline] |
References _customStanzaName.
| QList< CAMusElement * > CALyricsContext::musElementList | ( | ) |
References _syllableList.
| CAMusElement * CALyricsContext::next | ( | CAMusElement * | elt | ) | [virtual] |
Implements CAContext.
References _syllableList, CAMusElement::musElementType(), and CAMusElement::Syllable.
Referenced by CAScoreViewPort::createTextEdit(), and CAMainWin::onTextEditKeyPressEvent().


| CAMusElement * CALyricsContext::previous | ( | CAMusElement * | elt | ) | [virtual] |
Implements CAContext.
References _syllableList, CAMusElement::musElementType(), and CAMusElement::Syllable.
Referenced by CAMainWin::onTextEditKeyPressEvent().


| bool CALyricsContext::remove | ( | CAMusElement * | elt | ) | [virtual] |
Removes the given syllable from the list.
Implements CAContext.
References _syllableList, CAMusElement::musElementType(), and CAMusElement::Syllable.
Referenced by CAMainWin::deleteSelection().


| void CALyricsContext::removeAt | ( | int | i | ) |
Removes the syllable at the given position.
References _syllableList.
Referenced by addSyllable(), removeSyllableAtTimeStart(), and 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.
References _syllableList, removeAt(), and CAMusElement::timeLength().

| 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.
References _syllableList, addEmptySyllable(), associatedVoice(), CAVoice::getNoteList(), and removeAt().
Referenced by CAMusElementFactory::configureRest(), CAMainWin::deleteSelection(), CALilyPondImport::importLyricsContextImpl(), CAMainWin::pasteAt(), and setAssociatedVoice().


| void CALyricsContext::setAssociatedVoice | ( | CAVoice * | v | ) | [inline] |
References _associatedVoice, CAVoice::addLyricsContext(), CAVoice::removeLyricsContext(), and repositSyllables().
Referenced by CALyricsContext(), and cloneLyricsContextProperties().


| void CALyricsContext::setCustomStanzaName | ( | QString | name | ) | [inline] |
| void CALyricsContext::setStanzaNumber | ( | int | sn | ) | [inline] |
References _stanzaNumber.
Referenced by CALyricsContext(), and cloneLyricsContextProperties().

| int CALyricsContext::stanzaNumber | ( | ) | [inline] |
References _stanzaNumber.
Referenced by clone(), cloneLyricsContextProperties(), CACanorusMLExport::exportDocumentImpl(), and CAMainWin::updateContextToolBar().

| CASyllable* CALyricsContext::syllableAt | ( | int | idx | ) | [inline] |
References _syllableList.
Referenced by CALilyPondExport::exportLyricsContextImpl(), and CAMainWin::pasteAt().

| CASyllable * CALyricsContext::syllableAtTimeStart | ( | int | timeStart | ) |
References _syllableList.
| int CALyricsContext::syllableCount | ( | ) | [inline] |
References _syllableList.
Referenced by CALilyPondExport::exportLyricsContextImpl().

| QList<CASyllable*> CALyricsContext::syllableList | ( | ) | [inline] |
References _syllableList.
Referenced by CACanorusMLExport::exportDocumentImpl(), and CAMainWin::pasteAt().

CAVoice* CALyricsContext::_associatedVoice [private] |
Referenced by associatedVoice(), CALyricsContext(), and setAssociatedVoice().
QString CALyricsContext::_customStanzaName [private] |
Referenced by customStanzaName(), and setCustomStanzaName().
int CALyricsContext::_stanzaNumber [private] |
Referenced by setStanzaNumber(), and stanzaNumber().
QList< CASyllable* > CALyricsContext::_syllableList [private] |
1.8.0