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
clef.h
Go to the documentation of this file.
1
8
#ifndef CLEF_H_
9
#define CLEF_H_
10
11
#include <QString>
12
13
#include "
core/muselement.h
"
14
#include "
core/staff.h
"
15
16
class
CAContext
;
17
18
class
CAClef
:
public
CAMusElement
{
19
public
:
20
enum
CAPredefinedClefType
{
21
Undefined
=-1,
22
Treble
,
23
Bass
,
24
French
,
25
Soprano
,
26
Mezzosoprano
,
27
Alto
,
28
Tenor
,
29
Baritone
,
30
Varbaritone
,
31
Subbass
,
32
Percussion
,
33
Tablature
34
};
35
36
enum
CAClefType
{
37
F
,
38
G
,
39
C
,
40
PercussionHigh
,
41
PercussionLow
,
42
Tab
43
};
44
45
CAClef
(
CAPredefinedClefType
type,
CAStaff
*
staff
,
int
time,
int
offsetInterval=0 );
46
CAClef
(
CAClefType
type,
int
c1
,
CAStaff
*
staff
,
int
time,
int
offset
=0 );
47
CAClef
*
clone
(
CAContext
*
context
=0);
48
CAStaff
*
staff
() {
return
static_cast<
CAStaff
*
>
(
context
()); }
49
50
void
setPredefinedType
(
CAPredefinedClefType
type );
51
CAClefType
clefType
() {
return
_clefType
; }
52
const
int
c1
() {
return
_c1
; }
53
const
int
centerPitch
() {
return
_centerPitch
; }
54
int
compare
(
CAMusElement
*elt);
55
56
void
setClefType
(
CAClefType
type);
57
58
inline
void
setOffset
(
int
offset
) {
_c1
+=
_offset
;
_c1
-=(
_offset
=
offset
); }
59
inline
int
offset
() {
return
_offset
; }
60
61
static
const
QString
clefTypeToString
(
CAClefType
);
62
static
CAClefType
clefTypeFromString
(
const
QString);
63
64
static
const
int
offsetFromReadable
(
const
int
offsetInterval );
65
static
const
int
offsetToReadable
(
const
int
offset
);
66
67
private
:
68
CAClefType
_clefType
;
69
int
_c1
;
// Location of middle C in the staff from the bottom line up
70
int
_centerPitch
;
// Location of the clefs physical center (where the clef's glyph is going to be rendered)
71
int
_offset
;
72
};
73
#endif
/* CLEF_H_ */
Generated on Fri Jan 11 2013 14:40:12 for Canorus by
1.8.3