58 |
public: |
public: |
59 |
EventGenerator(uint SampleRate); |
EventGenerator(uint SampleRate); |
60 |
void UpdateFragmentTime(uint SamplesToProcess); |
void UpdateFragmentTime(uint SamplesToProcess); |
61 |
|
void SetSampleRate(uint SampleRate); |
62 |
Event CreateEvent(); |
Event CreateEvent(); |
63 |
Event CreateEvent(int32_t FragmentPos); |
Event CreateEvent(int32_t FragmentPos); |
64 |
|
|
173 |
enum synth_param_t { |
enum synth_param_t { |
174 |
synth_param_volume, |
synth_param_volume, |
175 |
synth_param_volume_time, |
synth_param_volume_time, |
176 |
|
synth_param_volume_curve, |
177 |
synth_param_pitch, |
synth_param_pitch, |
178 |
synth_param_pitch_time, |
synth_param_pitch_time, |
179 |
|
synth_param_pitch_curve, |
180 |
synth_param_pan, |
synth_param_pan, |
181 |
synth_param_cutoff, |
synth_param_cutoff, |
182 |
synth_param_resonance, |
synth_param_resonance, |
353 |
*/ |
*/ |
354 |
template<typename T> |
template<typename T> |
355 |
void EventGenerator::scheduleAheadMicroSec(RTAVLTree<T>& queue, T& node, int32_t fragmentPosBase, uint64_t microseconds) { |
void EventGenerator::scheduleAheadMicroSec(RTAVLTree<T>& queue, T& node, int32_t fragmentPosBase, uint64_t microseconds) { |
356 |
node.scheduleTime = uiTotalSamplesProcessed + fragmentPosBase + float(uiSampleRate) * (float(microseconds) / 1000000.f); |
// round up (+1) if microseconds is not zero (i.e. because 44.1 kHz and |
357 |
|
// 1 us would yield in < 1 and thus would be offset == 0) |
358 |
|
const sched_time_t offset = |
359 |
|
(microseconds != 0LL) ? |
360 |
|
1.f + (float(uiSampleRate) * (float(microseconds) / 1000000.f)) |
361 |
|
: 0.f; |
362 |
|
node.scheduleTime = uiTotalSamplesProcessed + fragmentPosBase + offset; |
363 |
queue.insert(node); |
queue.insert(node); |
364 |
} |
} |
365 |
|
|