Canorus
0.7
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
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
16
class
CAPlayableLength
{
17
public
:
18
enum
CAMusicLength
{
19
Undefined
= -1,
20
Breve
= 0,
21
Whole
= 1,
22
Half
= 2,
23
Quarter
= 4,
24
Eighth
= 8,
25
Sixteenth
= 16,
26
ThirtySecond
= 32,
27
SixtyFourth
= 64,
28
HundredTwentyEighth
= 128
29
};
30
31
CAPlayableLength
();
32
CAPlayableLength
(
CAMusicLength
l,
int
dotted
=0 );
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
40
bool
operator==
(
CAPlayableLength
);
41
bool
operator!=
(
CAPlayableLength
);
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 ) {
48
return
playableLengthToTimeLength
(
CAPlayableLength
(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_ */
Generated on Fri Jan 11 2013 14:40:12 for Canorus by
1.8.3