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
muselement.h
Go to the documentation of this file.
1
8
#ifndef MUSELEMENT_H_
9
#define MUSELEMENT_H_
10
11
#include <QString>
12
#include <QList>
13
#include <QColor>
14
15
class
CAContext
;
16
class
CAMusElement
;
17
class
CAPlayable
;
18
class
CAMark
;
19
20
class
CAMusElement
{
21
public
:
22
enum
CAMusElementType
{
23
Undefined
= 0,
24
Note
,
25
Rest
,
26
Barline
,
27
Clef
,
28
TimeSignature
,
29
KeySignature
,
30
Slur
,
31
Tuplet
,
32
Syllable
,
33
FunctionMark
,
34
Mark
35
};
36
37
CAMusElement
(
CAContext
*
context
,
int
timeStart
,
int
timeLength
=0);
38
virtual
~CAMusElement
();
39
40
virtual
CAMusElement
*
clone
(
CAContext
*
context
=0) = 0;
41
virtual
int
compare
(
CAMusElement
*elt) = 0;
42
43
CAMusElementType
musElementType
() {
return
_musElementType
; }
44
45
inline
CAContext
*
context
() {
return
_context
; }
46
inline
CAContext
*
setContext
(
CAContext
*
context
) {
_context
=
context
; }
47
48
inline
virtual
int
timeStart
() {
return
_timeStart
; }
49
inline
void
setTimeStart
(
int
time) {
_timeStart
= time; }
50
inline
virtual
int
timeLength
() {
return
_timeLength
; }
51
inline
void
setTimeLength
(
int
length) {
_timeLength
= length; }
52
inline
int
timeEnd
() {
return
timeStart
() +
timeLength
(); }
53
54
inline
const
QString
name
() {
return
_name
; }
55
inline
void
setName
(
const
QString
name
) {
_name
=
name
; }
56
57
inline
const
bool
isVisible
() {
return
_visible
; }
58
inline
void
setVisible
(
const
bool
v ) {
_visible
= v; }
59
60
inline
const
QColor
color
() {
return
_color
; }
61
inline
void
setColor
(
const
QColor c ) {
_color
= c; }
62
63
inline
const
QList<CAMark*>
markList
() {
return
_markList
; }
64
void
addMark
(
CAMark
*mark );
65
void
addMarks
( QList<CAMark*> marks );
66
inline
void
removeMark
(
CAMark
* mark ) {
_markList
.removeAll(mark); }
67
68
bool
isPlayable
();
69
70
static
const
QString
musElementTypeToString
(
CAMusElementType
);
71
static
CAMusElementType
musElementTypeFromString
(
const
QString);
72
73
protected
:
74
inline
void
setMusElementType
(
CAMusElementType
type ) {
_musElementType
= type; }
75
76
QList< CAMark* >
_markList
;
77
CAMusElementType
_musElementType
;
78
CAContext
*
_context
;
79
int
_timeStart
;
80
int
_timeLength
;
81
bool
_visible
;
82
QColor
_color
;
83
QString
_name
;
84
};
85
#endif
/* MUSELEMENT_H_ */
Generated on Fri Jan 11 2013 14:40:12 for Canorus by
1.8.3