Canorus  0.0
Public Member Functions | Private Attributes | List of all members
CASyllable Class Reference

Lyrics under the note. More...

#include <syllable.h>

Inheritance diagram for CASyllable:
Inheritance graph
[legend]

Public Member Functions

 CASyllable (QString text, bool hyphen, bool melisma, CALyricsContext *context, int timeStart, int timeLength, CAVoice *voice=0)
 
 ~CASyllable ()
 
void clear ()
 
bool hyphenStart ()
 
void setHyphenStart (bool h)
 
bool melismaStart ()
 
void setMelismaStart (bool m)
 
QString text ()
 
void setText (QString text)
 
CAVoiceassociatedVoice ()
 
void setAssociatedVoice (CAVoice *v)
 
CALyricsContextlyricsContext ()
 
CASyllableclone (CAContext *context)
 
int compare (CAMusElement *)
 
- Public Member Functions inherited from CAMusElement
 CAMusElement (CAContext *context, int timeStart, int timeLength=0)
 
virtual ~CAMusElement ()
 
CAMusElementType musElementType ()
 
CAContextcontext ()
 
void setContext (CAContext *context)
 
virtual int timeStart () const
 
void setTimeStart (int time)
 
virtual int timeLength () const
 
void setTimeLength (int length)
 
int timeEnd ()
 
virtual int realTimeStart ()
 
virtual int realTimeLength ()
 
int realTimeEnd ()
 
const QString name ()
 
void setName (const QString name)
 
const bool isVisible ()
 
void setVisible (const bool v)
 
const QColor color ()
 
void setColor (const QColor c)
 
const QList< CAMark * > markList ()
 
void addMark (CAMark *mark)
 
void addMarks (QList< CAMark * > marks)
 
void removeMark (CAMark *mark)
 
const QList< CANoteCheckerError * > & noteCheckerErrorList ()
 
void addNoteCheckerError (CANoteCheckerError *nce)
 
void removeNoteCheckerError (CANoteCheckerError *nce)
 
bool isPlayable ()
 

Private Attributes

bool _hyphenStart
 
bool _melismaStart
 
QString _text
 
CAVoice_associatedVoice
 

Additional Inherited Members

- Public Types inherited from CAMusElement
enum  CAMusElementType {
  Undefined = 0, Note, Rest, MidiNote,
  Barline, Clef, TimeSignature, KeySignature,
  Slur, Tuplet, Syllable, FunctionMark,
  FiguredBassMark, Mark
}
 
- Static Public Member Functions inherited from CAMusElement
static const QString musElementTypeToString (CAMusElementType)
 
static CAMusElementType musElementTypeFromString (const QString)
 
- Protected Member Functions inherited from CAMusElement
void setMusElementType (CAMusElementType type)
 
- Protected Attributes inherited from CAMusElement
CAMusElementType _musElementType
 
QList< CAMark * > _markList
 
QList< CANoteCheckerError * > _noteCheckerErrorList
 
CAContext_context
 
int _timeStart
 
int _timeLength
 
bool _visible
 
QColor _color
 
QString _name
 

Detailed Description

Lyrics under the note.

Copyright (c) 2007-2008, 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 one lyrics element above or below the note. It doesn't neccessarily consist of one syllable or even a word, but can contain multiple syllables and words (using an underscore _ or a dash -). Syllables are usually stored inside CALyricsContext.

Every lyrics element can finish with a hyphen (a horizontal middle line), with melisma (a horizontal underscore line) or without line at the end of the word.

Each syllable can have a custom associated voice, if set. Usually parent's (lyrics context) voice is taken.

Constructor & Destructor Documentation

◆ CASyllable()

CASyllable::CASyllable ( QString  text,
bool  hyphen,
bool  melisma,
CALyricsContext context,
int  timeStart,
int  timeLength,
CAVoice voice = 0 
)

Creates a new lyrics element with the given text, hyphenation hyphen and melisma properties, parent context, timeStart and timeLength. voice is a special per-syllable associated voice (default 0 - takes parent's voice).

References setAssociatedVoice(), setHyphenStart(), setMelismaStart(), CAMusElement::setMusElementType(), setText(), CAMusElement::Syllable, and text().

Referenced by clone().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~CASyllable()

CASyllable::~CASyllable ( )

Member Function Documentation

◆ associatedVoice()

CAVoice* CASyllable::associatedVoice ( )
inline

References _associatedVoice.

Referenced by clone().

Here is the caller graph for this function:

◆ clear()

void CASyllable::clear ( )

Clears the text and sets the default hyphen and melisma settings. This function is usually called when directly deleting the syllable - it shouldn't be actually removed, but only its text set to empty.

References setHyphenStart(), setMelismaStart(), and setText().

Referenced by CAMainWin::deleteSelection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clone()

CASyllable * CASyllable::clone ( CAContext context)
virtual

Clone the syllable using the given new context. If the given context is not a lyrics context, 0 is used instead.

Implements CAMusElement.

References CAMusElement::addMark(), associatedVoice(), CASyllable(), CAMusElement::context(), CAContext::contextType(), hyphenStart(), CAContext::LyricsContext, CAMusElement::markList(), melismaStart(), text(), CAMusElement::timeLength(), and CAMusElement::timeStart().

Referenced by CAMainWin::pasteAt().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compare()

int CASyllable::compare ( CAMusElement elt)
virtual

Compares the music element with the given elt and returns number of differences in their properties. Returns 0, if the music elements are exact; -1 if the music element type differs; otherwise number greater than 0.

This method is usually used when opening a score document where music elements are written in various voices (eg. barlines), but are eventually merged and written only once per staff.

Implements CAMusElement.

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

Here is the call graph for this function:

◆ hyphenStart()

bool CASyllable::hyphenStart ( )
inline

References _hyphenStart.

Referenced by clone(), CAScoreView::createTextEdit(), and CALilyPondExport::syllableToLilyPond().

Here is the caller graph for this function:

◆ lyricsContext()

CALyricsContext* CASyllable::lyricsContext ( )
inline

References CAMusElement::_context.

Referenced by CAMainWin::onTextEditKeyPressEvent().

Here is the caller graph for this function:

◆ melismaStart()

bool CASyllable::melismaStart ( )
inline

References _melismaStart.

Referenced by clone(), CAScoreView::createTextEdit(), and CALilyPondExport::syllableToLilyPond().

Here is the caller graph for this function:

◆ setAssociatedVoice()

void CASyllable::setAssociatedVoice ( CAVoice v)
inline

References _associatedVoice.

Referenced by CASyllable().

Here is the caller graph for this function:

◆ setHyphenStart()

void CASyllable::setHyphenStart ( bool  h)
inline

◆ setMelismaStart()

void CASyllable::setMelismaStart ( bool  m)
inline

References _melismaStart.

Referenced by CASyllable(), clear(), CAMainWin::confirmTextEdit(), and CALilyPondImport::importLyricsContextImpl().

Here is the caller graph for this function:

◆ setText()

void CASyllable::setText ( QString  text)
inline

References _text, and text().

Referenced by CASyllable(), clear(), and CAMainWin::confirmTextEdit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ text()

QString CASyllable::text ( )
inline

Member Data Documentation

◆ _associatedVoice

CAVoice* CASyllable::_associatedVoice
private

◆ _hyphenStart

bool CASyllable::_hyphenStart
private

Referenced by hyphenStart(), and setHyphenStart().

◆ _melismaStart

bool CASyllable::_melismaStart
private

Referenced by melismaStart(), and setMelismaStart().

◆ _text

QString CASyllable::_text
private

Referenced by setText(), and text().


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