1347 |
else if (strcmp(s, "_loop") == 0) eg(x).loop = ToInt(value); |
else if (strcmp(s, "_loop") == 0) eg(x).loop = ToInt(value); |
1348 |
else if (strcmp(s, "_loop_count") == 0) eg(x).loop_count = ToInt(value); |
else if (strcmp(s, "_loop_count") == 0) eg(x).loop_count = ToInt(value); |
1349 |
else if (strcmp(s, "_amplitude") == 0) eg(x).amplitude = ToFloat(value); |
else if (strcmp(s, "_amplitude") == 0) eg(x).amplitude = ToFloat(value); |
1350 |
|
else if (sscanf(s, "_amplitude_oncc%d", &y)) eg(x).amplitude_oncc.add( CC(y, check(key, 0.0f, 100.0f, ToFloat(value))) ); |
1351 |
|
else if (strcmp(s, "_volume") == 0) eg(x).volume = check(key, -144.0f, 6.0f, ToFloat(value)); |
1352 |
|
else if (sscanf(s, "_volume_oncc%d", &y)) eg(x).volume_oncc.add( CC(y, check(key, -144.0f, 6.0f, ToFloat(value))) ); |
1353 |
else if (strcmp(s, "_cutoff") == 0) eg(x).cutoff = ToFloat(value); |
else if (strcmp(s, "_cutoff") == 0) eg(x).cutoff = ToFloat(value); |
1354 |
|
else if (sscanf(s, "_cutoff_oncc%d", &y)) eg(x).cutoff_oncc.add( CC(y, check(key, -9600, 9600, ToInt(value))) ); |
1355 |
|
else if (strcmp(s, "_pitch") == 0) eg(x).pitch = check(key, -9600, 9600, ToInt(value)); |
1356 |
|
else if (sscanf(s, "_pitch_oncc%d", &y)) eg(x).pitch_oncc.add( CC(y, check(key, -9600, 9600, ToInt(value))) ); |
1357 |
|
else if (strcmp(s, "_resonance") == 0) eg(x).resonance = check(key, 0.0f, 40.0f, ToFloat(value)); |
1358 |
|
else if (sscanf(s, "_resonance_oncc%d", &y)) eg(x).resonance_oncc.add( CC(y, check(key, 0.0f, 40.0f, ToFloat(value))) ); |
1359 |
else std::cerr << "The opcode '" << key << "' is unsupported by libsfz!" << std::endl; |
else std::cerr << "The opcode '" << key << "' is unsupported by libsfz!" << std::endl; |
1360 |
} |
} |
1361 |
|
|
1583 |
} |
} |
1584 |
|
|
1585 |
EG::EG() : |
EG::EG() : |
1586 |
sustain(0), loop(0), loop_count(0), |
sustain(0), loop(0), loop_count(0), amplitude(0), |
1587 |
amplitude(0), cutoff(0) { |
cutoff(0), pitch(0), resonance(0), volume(-200) /* less than -144 dB is considered unset */ |
1588 |
} |
{ } |
1589 |
|
|
1590 |
void EG::Copy(const EG& eg) { |
void EG::Copy(const EG& eg) { |
1591 |
sustain = eg.sustain; |
sustain = eg.sustain; |
1592 |
loop = eg.loop; |
loop = eg.loop; |
1593 |
loop_count = eg.loop_count; |
loop_count = eg.loop_count; |
1594 |
amplitude = eg.amplitude; |
amplitude = eg.amplitude; |
1595 |
|
volume = eg.volume; |
1596 |
cutoff = eg.cutoff; |
cutoff = eg.cutoff; |
1597 |
|
pitch = eg.pitch; |
1598 |
|
resonance = eg.resonance; |
1599 |
node = eg.node; |
node = eg.node; |
1600 |
|
|
1601 |
|
amplitude_oncc = eg.amplitude_oncc; |
1602 |
|
volume_oncc = eg.volume_oncc; |
1603 |
|
cutoff_oncc = eg.cutoff_oncc; |
1604 |
|
pitch_oncc = eg.pitch_oncc; |
1605 |
|
resonance_oncc = eg.resonance_oncc; |
1606 |
} |
} |
1607 |
|
|
1608 |
LFO::LFO(): freq (-1),/* -1 is used to determine whether the LFO was initialized */ |
LFO::LFO(): freq (-1),/* -1 is used to determine whether the LFO was initialized */ |