1557 |
} |
} |
1558 |
|
|
1559 |
String Engine::Version() { |
String Engine::Version() { |
1560 |
String s = "$Revision: 1.58 $"; |
String s = "$Revision: 1.59 $"; |
1561 |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword |
1562 |
} |
} |
1563 |
|
|
1564 |
// static constant initializers |
// static constant initializers |
1565 |
const float* Engine::VolumeCurve(InitVolumeCurve()); |
const float* Engine::VolumeCurve(InitVolumeCurve()); |
1566 |
const float* Engine::PanCurve(InitPanCurve()); |
const float* Engine::PanCurve(InitPanCurve()); |
1567 |
|
const float* Engine::CrossfadeCurve(InitCrossfadeCurve()); |
1568 |
|
|
1569 |
float* Engine::InitVolumeCurve() { |
float* Engine::InitVolumeCurve() { |
1570 |
// line-segment approximation |
// line-segment approximation |
1585 |
return InitCurve(segments, 129); |
return InitCurve(segments, 129); |
1586 |
} |
} |
1587 |
|
|
1588 |
|
float* Engine::InitCrossfadeCurve() { |
1589 |
|
// line-segment approximation |
1590 |
|
const float segments[] = { |
1591 |
|
0, 0, 1, 0.03, 10, 0.1, 51, 0.58, 127, 1 |
1592 |
|
}; |
1593 |
|
return InitCurve(segments); |
1594 |
|
} |
1595 |
|
|
1596 |
float* Engine::InitCurve(const float* segments, int size) { |
float* Engine::InitCurve(const float* segments, int size) { |
1597 |
float* y = new float[size]; |
float* y = new float[size]; |
1598 |
for (int x = 0 ; x < size ; x++) { |
for (int x = 0 ; x < size ; x++) { |