Canorus 0.0
mark.h
Go to the documentation of this file.
1
8#ifndef MARK_H_
9#define MARK_H_
10
11#include "score/muselement.h"
12
13class CAContext;
14
15class CAMark : public CAMusElement {
16public:
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); return c; }
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
53protected:
54 inline void setCommon( bool c ) { _common=c; }
55
56private:
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_ */
Line of music elements in the sheet.
Definition: context.h:16
Marks that depend on other music elements.
Definition: mark.h:15
CAMarkType
Definition: mark.h:17
@ Tempo
Definition: mark.h:20
@ Fingering
Definition: mark.h:31
@ Pedal
Definition: mark.h:24
@ Fermata
Definition: mark.h:28
@ Undefined
Definition: mark.h:18
@ RehersalMark
Definition: mark.h:27
@ Dynamic
Definition: mark.h:22
@ BookMark
Definition: mark.h:26
@ Ritardando
Definition: mark.h:21
@ Crescendo
Definition: mark.h:23
@ InstrumentChange
Definition: mark.h:25
@ Articulation
Definition: mark.h:30
@ RepeatMark
Definition: mark.h:29
@ Text
Definition: mark.h:19
CAMarkType _markType
Definition: mark.h:58
void setCommon(bool c)
Definition: mark.h:54
bool isCommon()
Definition: mark.h:48
virtual int compare(CAMusElement *elt)
Definition: mark.cpp:136
static CAMarkType markTypeFromString(const QString s)
Definition: mark.cpp:82
bool _common
Definition: mark.h:59
void setMarkType(CAMarkType type)
Definition: mark.h:46
CAMark(CAMarkType type, CAMusElement *associatedElt, int timeStart=-1, int timeLength=-1)
Definition: mark.cpp:19
virtual ~CAMark()
Definition: mark.cpp:126
void setAssociatedElement(CAMusElement *elt)
Definition: mark.h:43
static const QString markTypeToString(CAMarkType t)
Definition: mark.cpp:44
CAMusElement * _associatedElt
Definition: mark.h:57
virtual CAMark * clone(CAContext *context)
Definition: mark.h:38
CAMarkType markType()
Definition: mark.h:45
CAMusElement * associatedElement()
Definition: mark.h:42
An abstract class which represents every music element in the score.
Definition: muselement.h:21
virtual int timeStart() const
Definition: muselement.h:51
CAContext * context()
Definition: muselement.h:48
CAContext * _context
Definition: muselement.h:90
void setContext(CAContext *context)
Definition: muselement.h:49
virtual int timeLength() const
Definition: muselement.h:53