Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
fingering.h
Go to the documentation of this file.
1 
8 #ifndef FINGERING_H_
9 #define FINGERING_H_
10 
11 #include <QList>
12 #include "core/mark.h"
13 
14 class CANote;
15 
16 class CAFingering: public CAMark {
17 public:
19  First = 1,
20  Second = 2,
21  Third = 3,
22  Fourth = 4,
23  Fifth = 5,
30  };
31 
32  CAFingering( CAFingerNumber finger, CANote *m, bool italic=false );
33  CAFingering( QList<CAFingerNumber> fingers, CANote *m, bool italic=false );
34  virtual ~CAFingering();
35 
37  int compare(CAMusElement *elt);
38 
39  inline CAFingerNumber finger() { return (_fingerList.size()?_fingerList[0]:Undefined); }
40  inline void setFinger(CAFingerNumber f) { _fingerList.clear(); _fingerList << f; }
41  inline QList<CAFingerNumber>& fingerList() { return _fingerList; }
42  inline void addFinger( CAFingerNumber f ) { _fingerList << f; }
43  inline void removeFingerAt( int idx ) { _fingerList.removeAt(idx); }
44 
45  inline bool isOriginal() { return _original; }
46  inline void setOriginal( bool original ) { _original = original; }
47 
48  static const QString fingerNumberToString( CAFingerNumber n );
49  static CAFingerNumber fingerNumberFromString( const QString s );
50 
51 private:
52  QList<CAFingerNumber> _fingerList;
53  bool _original;
54 };
55 
56 #endif /* FINGERING_H_ */