Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mark.h
Go to the documentation of this file.
1 
8 #ifndef MARK_H_
9 #define MARK_H_
10 
11 #include "core/muselement.h"
12 
13 class CAContext;
14 
15 class CAMark : public CAMusElement {
16 public:
17  enum CAMarkType {
18  Undefined = -1,
32  };
33 
34  CAMark( CAMarkType type, CAMusElement *associatedElt, int timeStart=-1, int timeLength=-1 );
36  virtual ~CAMark();
37 
38  virtual CAMark *clone(CAContext* context) { CAMark* c = clone(); c->setContext(context); }
39  virtual CAMark *clone(CAMusElement* elt=0);
40  virtual int compare( CAMusElement* elt );
41 
43  inline void setAssociatedElement( CAMusElement* elt ) { _associatedElt = elt; if(elt) _context = elt->context(); }
44 
45  inline CAMarkType markType() { return _markType; }
46  inline void setMarkType( CAMarkType type ) { _markType = type; }
47 
48  inline bool isCommon() { return _common; }
49 
50  static const QString markTypeToString( CAMarkType t );
51  static CAMarkType markTypeFromString( const QString s );
52 
53 protected:
54  inline void setCommon( bool c ) { _common=c; }
55 
56 private:
59  bool _common; // is mark assigned to a single element only or the whole chord - depends who deletes it!
60 };
61 
62 #endif /* MARK_H_ */