Canorus  0.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
playablelength.h
Go to the documentation of this file.
1 
8 #ifndef PLAYABLELENGTH_H_
9 #define PLAYABLELENGTH_H_
10 
11 #include <QString>
12 
13 class CABarline;
14 class CATimeSignature;
15 
17 public:
19  Undefined = -1,
20  Breve = 0,
21  Whole = 1,
22  Half = 2,
23  Quarter = 4,
24  Eighth = 8,
25  Sixteenth = 16,
29  };
30 
33 
34  inline const CAMusicLength musicLength() { return _musicLength; }
35  inline const int dotted() { return _dotted; }
36 
37  inline void setMusicLength( const CAMusicLength l ) { _musicLength = l; }
38  inline void setDotted( const int d ) { _dotted = d; }
39 
42 
43  static const QString musicLengthToString( CAMusicLength length );
44  static CAMusicLength musicLengthFromString( const QString length );
45 
46  static const int playableLengthToTimeLength( CAPlayableLength length );
47  inline static const int musicLengthToTimeLength( CAMusicLength l ) {
49  }
50  static QList<CAPlayableLength> timeLengthToPlayableLengthList( int timeLength, bool longNotesFirst = true, int dotsLimit = 4 );
51  static QList<CAPlayableLength> matchToBars( CAPlayableLength len, int timeStart, CABarline *lastBarline, CATimeSignature *ts, int dotsLimit = 4 );
52 
53 private:
54  CAMusicLength _musicLength; // note, rest length (half, whole, quarter)
55  int _dotted; // number of dots
56 };
57 #endif /* PLAYABLELENGTH_H_ */