Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tuplet.h
Go to the documentation of this file.
1 
8 #ifndef TUPLET_H_
9 #define TUPLET_H_
10 
11 #include "core/muselement.h"
12 
13 class CAContext;
14 class CAVoice;
15 
16 class CATuplet : public CAMusElement {
17 public:
18  CATuplet( int number, int actualNumber, QList<CAPlayable*> noteList );
19  CATuplet( int number, int actualNumber );
20  virtual ~CATuplet();
21 
23  CATuplet* clone(QList<CAPlayable*> newList);
24  int compare(CAMusElement*);
25 
26  inline int number() { return _number; }
27  inline void setNumber( int n ) { _number = n; }
28 
29  inline int actualNumber() { return _actualNumber; }
30  inline void setActualNumber( int n ) { _actualNumber = n; }
31 
32  inline QList<CAPlayable*>& noteList() { return _noteList; }
33  void addNote( CAPlayable* p );
34  inline void addNotes( QList<CAPlayable*> l ) { noteList() << l; }
35  inline void removeNote( CAPlayable* p ) { noteList().removeAll(p); }
36  inline CAPlayable *firstNote() { return noteList().front(); }
37  inline CAPlayable *lastNote() { return noteList().back(); }
38  inline bool containsNote( CAPlayable *p ) { return noteList().contains(p); }
40 
41  int timeLength();
42  int timeStart();
43 
44  void assignTimes();
45 
46 private:
47  void resetTimes();
48 
49  int _number;
51 
52  QList<CAPlayable*> _noteList;
53 };
54 
55 #endif /* TUPLET_H_ */