-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSynthMode.cpp
61 lines (50 loc) · 981 Bytes
/
SynthMode.cpp
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
#include "SynthMode.h"
SynthType SynthMode::type() const
{
return m_type;
}
float SynthMode::volumeFrom() const
{
return m_volume_from;
}
float SynthMode::volumeTo() const
{
return m_volume_to;
}
float SynthMode::pitch() const
{
return m_pitch;
}
bool SynthMode::isDutySet() const
{
return (m_duty >= MinDuty && m_duty < MaxDuty);
}
float SynthMode::duty() const
{
return m_duty;
}
void SynthMode::setType(const SynthType& a_type)
{
if (SynthType::isValid(a_type))
m_type = a_type;
}
void SynthMode::setVolumeFrom(float a_volume)
{
if (a_volume >= MinVolume && a_volume <= MaxVolume)
m_volume_from = a_volume;
}
void SynthMode::setVolumeTo(float a_volume)
{
if (a_volume >= MinVolume && a_volume <= MaxVolume)
m_volume_to = a_volume;
}
void SynthMode::setPitch(float a_pitch)
{
if (a_pitch >= MinPitch || a_pitch <= MaxPitch)
m_pitch = a_pitch;
}
void SynthMode::setDuty(float a_duty)
{
if (a_duty >= MinDuty && a_duty <= MaxDuty)
m_duty = a_duty;
}