Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
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 \lyricsto.

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

    \sa _syllableMap, CASyllable

Constructor & Destructor Documentation

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

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 
)

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

Here is the call graph for this function:


Member Function Documentation

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

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

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

Referenced by clone(), CAMainWin::copySelection(), CALilyPondImport::importLyricsContextImpl(), and CAMainWin::pasteAt().

Here is the call graph for this function:

Here is the caller graph for this function:

void CALyricsContext::clear ( ) [virtual]

Implements CAContext.

References _syllableList.

Referenced by ~CALyricsContext().

Here is the caller graph for this function:

Clones the current context with the given parent sheet s.

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

Implements CAContext.

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

Here is the call graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

QString CALyricsContext::customStanzaName ( ) [inline]

References _customStanzaName.

References _syllableList.

Implements CAContext.

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:

Implements CAContext.

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

Referenced by CAMainWin::onTextEditKeyPressEvent().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

void CALyricsContext::removeAt ( int  i)

Removes the syllable at the given position.

References _syllableList.

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

Here is the caller graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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:

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

References _customStanzaName, and CAContext::name().

Here is the call graph for this function:

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

References _stanzaNumber.

Referenced by CALyricsContext(), and cloneLyricsContextProperties().

Here is the caller graph for this function:

References _stanzaNumber.

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

Here is the caller graph for this function:

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

References _syllableList.

Referenced by CALilyPondExport::exportLyricsContextImpl(), and CAMainWin::pasteAt().

Here is the caller graph for this function:

References _syllableList.

References _syllableList.

Referenced by CALilyPondExport::exportLyricsContextImpl().

Here is the caller graph for this function:

References _syllableList.

Referenced by CACanorusMLExport::exportDocumentImpl(), and CAMainWin::pasteAt().

Here is the caller graph for this function:


Member Data Documentation

Referenced by setStanzaNumber(), and stanzaNumber().


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