/
Voice.ts
62 lines (57 loc) · 1.55 KB
/
Voice.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import {Instrument} from "../Instrument";
import {VoiceEntry} from "./VoiceEntry";
/**
* A [[Voice]] contains all the [[VoiceEntry]]s in a voice in a [[StaffLine]].
*/
export class Voice {
private voiceEntries: VoiceEntry[] = [];
private parent: Instrument;
private visible: boolean;
private audible: boolean;
private following: boolean;
/**
* The Id given in the MusicXMl file to distinguish the different voices. It is unique per instrument.
*/
private voiceId: number;
private volume: number = 1;
constructor(parent: Instrument, voiceId: number) {
this.parent = parent;
this.visible = true;
this.audible = true;
this.following = true;
this.voiceId = voiceId;
}
public get VoiceEntries(): VoiceEntry[] {
return this.voiceEntries;
}
public get Parent(): Instrument {
return this.parent;
}
public get Visible(): boolean {
return this.visible;
}
public set Visible(value: boolean) {
this.visible = value;
}
public get Audible(): boolean {
return this.audible;
}
public set Audible(value: boolean) {
this.audible = value;
}
public get Following(): boolean {
return this.following;
}
public set Following(value: boolean) {
this.following = value;
}
public get VoiceId(): number {
return this.voiceId;
}
public get Volume(): number {
return this.volume;
}
public set Volume(value: number) {
this.volume = value;
}
}