Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
syllable.h
Go to the documentation of this file.
1 
8 #ifndef SYLLABLE_H_
9 #define SYLLABLE_H_
10 
11 #include "core/muselement.h"
12 #include "core/lyricscontext.h"
13 
14 #include <QString>
15 
16 class CAVoice;
17 class CAContext;
18 
19 class CASyllable : public CAMusElement {
20 public:
21  CASyllable(QString text, bool hyphen, bool melisma, CALyricsContext *context, int timeStart, int timeLength, CAVoice *voice=0);
22  ~CASyllable();
23  void clear();
24 
25  inline bool hyphenStart() { return _hyphenStart; }
26  inline void setHyphenStart(bool h) { _hyphenStart = h; }
27  inline bool melismaStart() { return _melismaStart; }
28  inline void setMelismaStart(bool m) { _melismaStart = m; }
29  inline QString text() { return _text; }
30  inline void setText(QString text) { _text = text; }
32  inline void setAssociatedVoice(CAVoice* v) { _associatedVoice = v; }
33 
34  inline CALyricsContext *lyricsContext() { return static_cast<CALyricsContext*>(_context); }
35 
36  CASyllable* clone(CAContext* context);
37  int compare(CAMusElement*);
38 
39 private:
41  QString _text;
42  CAVoice *_associatedVoice; // per-syllable associated voice, 0 if preferred (parent's voice)
43 };
44 
45 #endif /* SYLLABLE_H_ */
~CASyllable()
Definition: syllable.cpp:39
void setText(QString text)
Definition: syllable.h:30
CAContext * _context
Definition: muselement.h:78
CASyllable * clone(CAContext *context)
Definition: syllable.cpp:57
void setMelismaStart(bool m)
Definition: syllable.h:28
QString _text
Definition: syllable.h:41
Class which represents a voice in the staff.
Definition: voice.h:22
virtual int timeStart()
Definition: muselement.h:48
QString text()
Definition: syllable.h:29
CASyllable(QString text, bool hyphen, bool melisma, CALyricsContext *context, int timeStart, int timeLength, CAVoice *voice=0)
Definition: syllable.cpp:29
void clear()
Definition: syllable.cpp:47
bool hyphenStart()
Definition: syllable.h:25
virtual int timeLength()
Definition: muselement.h:50
bool _hyphenStart
Definition: syllable.h:40
CAVoice * associatedVoice()
Definition: syllable.h:31
An abstract class which represents every music element in the score.
Definition: muselement.h:20
One stanza line of lyrics.
Definition: lyricscontext.h:19
CAVoice * _associatedVoice
Definition: syllable.h:42
CALyricsContext * lyricsContext()
Definition: syllable.h:34
bool _melismaStart
Definition: syllable.h:40
bool melismaStart()
Definition: syllable.h:27
void setAssociatedVoice(CAVoice *v)
Definition: syllable.h:32
CAContext * context()
Definition: muselement.h:45
Lyrics under the note.
Definition: syllable.h:19
int compare(CAMusElement *)
Definition: syllable.cpp:71
Line of music elements in the sheet.
Definition: context.h:16
void setHyphenStart(bool h)
Definition: syllable.h:26