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

Private Attributes | |
| QList< CASyllable * > | _syllableList |
| CAVoice * | _associatedVoice |
| int | _stanzaNumber |
| QString | _customStanzaName |
Additional Inherited Members | |
Public Types inherited from CAContext | |
| enum | CAContextType { Staff, LyricsContext, FunctionMarkContext, FiguredBassContext } |
Protected Member Functions inherited from CAContext | |
| void | setContextType (CAContextType t) |
Protected Attributes inherited from CAContext | |
| CASheet * | _sheet |
| QString | _name |
| CAContextType | _contextType |
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.
References _associatedVoice, CAContext::LyricsContext, setAssociatedVoice(), CAContext::setContextType(), setStanzaNumber(), and stanzaNumber().
Referenced by clone().


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

| CALyricsContext::~CALyricsContext | ( | ) |
References associatedVoice(), clear(), and CAVoice::removeLyricsContext().

| bool CALyricsContext::addEmptySyllable | ( | int | timeStart, |
| int | timeLength | ||
| ) |
Adds an empty syllable to the context. This function is usually called 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, CAMusElement::timeLength(), and CAMusElement::timeStart().
Referenced by clone(), CAMainWin::copySelection(), CALilyPondImport::importLyricsContextImpl(), and CAMainWin::pasteAt().


|
inline |
References _associatedVoice.
Referenced by cloneLyricsContextProperties(), CAMainWin::copySelection(), CACanorusMLExport::exportDocumentImpl(), CALilyPondExport::exportScoreBlock(), CALayoutEngine::reposit(), repositSyllables(), CAMainWin::sourceViewCommit(), CAMainWin::updateContextToolBar(), and ~CALyricsContext().

|
virtual |
Implements CAContext.
References _syllableList.
Referenced by ~CALyricsContext().

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

| void CALyricsContext::cloneLyricsContextProperties | ( | CALyricsContext * | lc | ) |
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::sourceViewCommit().


|
inline |
References _customStanzaName.
|
virtual |
Implements CAContext.
References _syllableList, CAMusElement::musElementType(), and CAMusElement::Syllable.
Referenced by CAScoreView::createTextEdit(), and CAMainWin::onTextEditKeyPressEvent().


|
virtual |
Implements CAContext.
References _syllableList, CAMusElement::musElementType(), and CAMusElement::Syllable.
Referenced by CAMainWin::onTextEditKeyPressEvent().


|
virtual |
Removes the given syllable from the list.
Implements CAContext.
References _syllableList, CAMusElement::musElementType(), and CAMusElement::Syllable.
Referenced by CAMainWin::deleteSelection().


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


| void CALyricsContext::setAssociatedVoice | ( | CAVoice * | v | ) |
Sets a new associated voice and repositiones the syllables.
References _associatedVoice, CAVoice::addLyricsContext(), CAVoice::removeLyricsContext(), and repositSyllables().
Referenced by CALyricsContext(), and cloneLyricsContextProperties().


|
inline |
|
inline |
References _stanzaNumber.
Referenced by CALyricsContext(), and cloneLyricsContextProperties().

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

| CASyllable * CALyricsContext::syllableAtTimeStart | ( | int | timeStart | ) |
Finds the syllable with exactly the given timeStart or Null, if such a syllables doesn't exist.
References _syllableList.
|
inline |
References _syllableList.
Referenced by CACanorusMLExport::exportDocumentImpl(), CALilyPondExport::exportLyricsContextImpl(), and CAMainWin::pasteAt().

|
private |
Referenced by associatedVoice(), CALyricsContext(), and setAssociatedVoice().
|
private |
Referenced by customStanzaName(), and setCustomStanzaName().
|
private |
Referenced by setStanzaNumber(), and stanzaNumber().
|
private |
Referenced by addEmptySyllable(), addSyllable(), clear(), clone(), next(), previous(), remove(), removeSyllableAtTimeStart(), repositSyllables(), syllableAtTimeStart(), and syllableList().