Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lyricscontext.h
Go to the documentation of this file.
1 
8 #ifndef LYRICSCONTEXT_H_
9 #define LYRICSCONTEXT_H_
10 
11 #include "core/context.h"
12 #include "core/voice.h"
13 
14 #include <QList>
15 #include <QHash>
16 
17 class CASyllable;
18 
19 class CALyricsContext : public CAContext {
20 public:
21  CALyricsContext( const QString name, int stanzaNumber, CAVoice *v );
22  CALyricsContext( const QString name, int stanzaNumber, CASheet *s );
24  void clear();
27 
28  void repositSyllables();
29 
32  QList<CAMusElement*> musElementList();
33  bool remove( CAMusElement* );
34  void removeAt( int i );
35 
36  bool addSyllable( CASyllable*, bool replace=true );
37  bool addEmptySyllable( int timeStart, int timeLength );
38  CASyllable* removeSyllableAtTimeStart( int timeStart );
39  CASyllable* syllableAt( int idx ) { return _syllableList[idx]; }
40  CASyllable* syllableAtTimeStart( int timeStart );
41  inline QList<CASyllable*> syllableList() { return _syllableList; }
42  inline int syllableCount() { return _syllableList.size(); }
43 
45  inline void setAssociatedVoice( CAVoice *v ) {
46  if (_associatedVoice)
48  if (v)
49  v->addLyricsContext(this);
50  _associatedVoice = v;
52  }
53  inline int stanzaNumber() { return _stanzaNumber; }
54  inline void setStanzaNumber( int sn ) { _stanzaNumber = sn; }
55  inline QString customStanzaName() { return _customStanzaName; }
56  inline void setCustomStanzaName( QString name ) { _customStanzaName = name; }
57 
58 private:
59  QList< CASyllable* > _syllableList;
63 };
64 
65 #endif /* LYRICSCONTEXT_H_ */