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_ */
CAClef::offsetFromReadable
static const int offsetFromReadable(const int offsetInterval)
Definition:
clef.cpp:190
CAClef::Tablature
Definition:
clef.h:33
CAClef::Treble
Definition:
clef.h:22
CAClef::Varbaritone
Definition:
clef.h:30
CAClef::setClefType
void setClefType(CAClefType type)
Definition:
clef.cpp:99
CAClef::Bass
Definition:
clef.h:23
CAClef::PercussionHigh
Definition:
clef.h:40
CAClef::centerPitch
const int centerPitch()
Definition:
clef.h:53
CAClef::_centerPitch
int _centerPitch
Definition:
clef.h:70
CAClef
Definition:
clef.h:18
CAClef::compare
int compare(CAMusElement *elt)
Definition:
clef.cpp:122
CAClef::Tenor
Definition:
clef.h:28
CAClef::Tab
Definition:
clef.h:42
CAClef::clefTypeToString
static const QString clefTypeToString(CAClefType)
Definition:
clef.cpp:139
CAClef::c1
const int c1()
Definition:
clef.h:52
CAClef::clone
CAClef * clone(CAContext *context=0)
Definition:
clef.cpp:111
CAClef::CAClef
CAClef(CAPredefinedClefType type, CAStaff *staff, int time, int offsetInterval=0)
Definition:
clef.cpp:28
CAClef::French
Definition:
clef.h:24
CAClef::F
Definition:
clef.h:37
CAClef::CAPredefinedClefType
CAPredefinedClefType
Definition:
clef.h:20
CAClef::staff
CAStaff * staff()
Definition:
clef.h:48
CAClef::PercussionLow
Definition:
clef.h:41
CAClef::offsetToReadable
static const int offsetToReadable(const int offset)
Definition:
clef.cpp:177
CAClef::Baritone
Definition:
clef.h:29
CAClef::Soprano
Definition:
clef.h:25
CAClef::C
Definition:
clef.h:39
CAClef::CAClefType
CAClefType
Definition:
clef.h:36
CAMusElement
An abstract class which represents every music element in the score.
Definition:
muselement.h:20
CAClef::G
Definition:
clef.h:38
CAClef::_clefType
CAClefType _clefType
Definition:
clef.h:68
CAClef::Subbass
Definition:
clef.h:31
CAClef::Alto
Definition:
clef.h:27
CAClef::setPredefinedType
void setPredefinedType(CAPredefinedClefType type)
Definition:
clef.cpp:49
CAStaff
Represents a staff in the sheet.
Definition:
staff.h:24
CAClef::clefTypeFromString
static CAClefType clefTypeFromString(const QString)
Definition:
clef.cpp:156
CAClef::_c1
int _c1
Definition:
clef.h:69
CAMusElement::context
CAContext * context()
Definition:
muselement.h:45
CAClef::Undefined
Definition:
clef.h:21
CAClef::setOffset
void setOffset(int offset)
Definition:
clef.h:58
CAClef::Percussion
Definition:
clef.h:32
CAClef::offset
int offset()
Definition:
clef.h:59
CAClef::_offset
int _offset
Definition:
clef.h:71
CAContext
Line of music elements in the sheet.
Definition:
context.h:16
CAClef::Mezzosoprano
Definition:
clef.h:26
muselement.h
staff.h
CAClef::clefType
CAClefType clefType()
Definition:
clef.h:51
Generated on Wed Oct 15 2014 08:46:37 for Canorus by
1.8.8