Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
playable.h
Go to the documentation of this file.
1 
8 #ifndef PLAYABLE_H_
9 #define PLAYABLE_H_
10 
11 #include "core/muselement.h"
12 #include "core/staff.h"
13 #include "core/playablelength.h"
14 #include "core/tuplet.h"
15 
16 class CAVoice;
17 
18 class CAPlayable : public CAMusElement {
19 public:
21  virtual ~CAPlayable();
22 
25  virtual CAPlayable* clone(CAContext* context) { CAPlayable* pl = clone(); pl->setContext(context); }
26  virtual CAPlayable* clone(CAVoice* voice=0)=0;
27 
28  CATuplet *tuplet() { return _tuplet; }
29  void setTuplet( CATuplet *t ) { _tuplet = t; }
30 
31  inline CAVoice *voice() { return _voice; }
32  void setVoice(CAVoice *v);
33  inline CAStaff* staff() { return static_cast<CAStaff*>(_context); }
34 
35  inline bool isFirstInTuplet() { return ( _tuplet && _tuplet->firstNote()==this); }
36  inline bool isLastInTuplet() { return ( _tuplet && _tuplet->lastNote()==this); }
37 
38  void resetTime();
39  void calculateTimeLength();
40 
41 protected:
45 };
46 #endif /* PLAYABLE_H_ */