Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
staff.h
Go to the documentation of this file.
1 
8 #ifndef STAFF_H_
9 #define STAFF_H_
10 
11 #include <QList>
12 #include <QString>
13 
14 class QPainter;
15 
16 #include "core/context.h"
17 #include "core/muselement.h"
18 
19 class CASheet;
20 class CAContext;
21 class CAVoice;
22 class CANote;
23 
24 class CAStaff : public CAContext {
25 public:
26  CAStaff( const QString name, CASheet *s, int numberOfLines = 5);
27  ~CAStaff();
28 
29  inline int numberOfLines() { return _numberOfLines; }
30  inline void setNumberOfLines(int val) { _numberOfLines = val; }
31  void clear();
32  CAStaff *clone( CASheet *s );
33 
34  inline int voiceCount() { return _voiceList.size(); }
35  inline CAVoice *voiceAt(int i) { return _voiceList[i]; }
36  inline int voiceIndex(CAVoice *voice) { return _voiceList.indexOf(voice); }
37  inline void removeVoice(CAVoice *voice) { _voiceList.removeAll(voice); }
38  inline QList<CAVoice*> voiceList() { return _voiceList; }
39  CAVoice *voiceByName(const QString name);
40 
41  void addVoice(CAVoice *voice);
42  CAVoice* addVoice();
43 
46  bool remove( CAMusElement *elt, bool updateSignTimes );
47  bool remove( CAMusElement *elt ) { return remove(elt, true); }
48 
49  int lastTimeEnd();
50  QList<CAMusElement*> getEltByType( CAMusElement::CAMusElementType type, int startTime );
51 
52  QList<CAPlayable*> getChord( int time );
53 
54  bool synchronizeVoices();
55 
56 private:
57  QList<CAVoice *> _voiceList;
58 
60 };
61 #endif /* STAFF_H_ */