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_ */