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_ */
Definition: playablelength.h:28
static const int playableLengthToTimeLength(CAPlayableLength length)
Definition: playablelength.cpp:107
Definition: playablelength.h:26
static CAMusicLength musicLengthFromString(const QString length)
Definition: playablelength.cpp:41
Definition: playablelength.h:22
CAMusicLength _musicLength
Definition: playablelength.h:54
bool operator==(CAPlayableLength)
Definition: playablelength.cpp:223
Represents a time signature in the staff.
Definition: timesignature.h:18
const int dotted()
Definition: playablelength.h:35
Definition: playablelength.h:19
Definition: playablelength.h:24
Musical length of notes and rests.
Definition: playablelength.h:16
static const int musicLengthToTimeLength(CAMusicLength l)
Definition: playablelength.h:47
static QList< CAPlayableLength > timeLengthToPlayableLengthList(int timeLength, bool longNotesFirst=true, int dotsLimit=4)
Definition: playablelength.cpp:167
Definition: playablelength.h:23
Definition: playablelength.h:25
static QList< CAPlayableLength > matchToBars(CAPlayableLength len, int timeStart, CABarline *lastBarline, CATimeSignature *ts, int dotsLimit=4)
Definition: playablelength.cpp:241
Definition: playablelength.h:20
bool operator!=(CAPlayableLength)
Definition: playablelength.cpp:233
Definition: playablelength.h:27
void setDotted(const int d)
Definition: playablelength.h:38
const CAMusicLength musicLength()
Definition: playablelength.h:34
CAMusicLength
Definition: playablelength.h:18
int _dotted
Definition: playablelength.h:55
CAPlayableLength()
Definition: playablelength.cpp:31
Music element which represents a barline in the score.
Definition: barline.h:17
static const QString musicLengthToString(CAMusicLength length)
Definition: playablelength.cpp:75
void setMusicLength(const CAMusicLength l)
Definition: playablelength.h:37
Definition: playablelength.h:21