Processes the source to destination bus. The number of channels must match in source and destination.
| 64 | |
| 65 | // Processes the source to destination bus. The number of channels must match in source and destination. |
| 66 | virtual void process(ContextRenderLock & r, const lab::AudioBus * sourceBus, lab::AudioBus * destinationBus, int framesToProcess) override |
| 67 | { |
| 68 | int sourceNumChannels = sourceBus->numberOfChannels(); |
| 69 | int destNumChannels = destinationBus->numberOfChannels(); |
| 70 | |
| 71 | if (!destNumChannels) |
| 72 | return; |
| 73 | |
| 74 | // Get sample rate |
| 75 | internalSampleRate = r.context()->sampleRate(); |
| 76 | oneOverSampleRate = 1.0 / internalSampleRate; |
| 77 | |
| 78 | // copy attributes to run time variables |
| 79 | /// @fixme these values should be per sample, not per quantum |
| 80 | /// -or- they should be settings if they don't vary per sample |
| 81 | float v = m_threshold->value(); |
| 82 | if (v <= 0) |
| 83 | { |
| 84 | // dB to linear (could use the function from m_pd.h) |
| 85 | threshold = powf(10.f, (v * 0.05f)); |
| 86 | } |
| 87 | else |
| 88 | threshold = 0; |
| 89 | |
| 90 | /// @fixme these values should be per sample, not per quantum |
| 91 | /// -or- they should be settings if they don't vary per sample |
| 92 | v = m_ratio->value(); |
| 93 | if (v >= 1) |
| 94 | { |
| 95 | ratio = 1.f / v; |
| 96 | } |
| 97 | else |
| 98 | ratio = 1; |
| 99 | |
| 100 | /// @fixme these values should be per sample, not per quantum |
| 101 | /// -or- they should be settings if they don't vary per sample |
| 102 | v = m_attack->value(); |
| 103 | if (v >= 0.001f) |
| 104 | { |
| 105 | attack = v * 0.001; |
| 106 | } |
| 107 | else |
| 108 | attack = 0.000001; |
| 109 | |
| 110 | /// @fixme these values should be per sample, not per quantum |
| 111 | /// -or- they should be settings if they don't vary per sample |
| 112 | v = m_release->value(); |
| 113 | if (v >= 0.001f) |
| 114 | { |
| 115 | release = v * 0.001; |
| 116 | } |
| 117 | else |
| 118 | release = 0.000001; |
| 119 | |
| 120 | /// @fixme these values should be per sample, not per quantum |
| 121 | /// -or- they should be settings if they don't vary per sample |
| 122 | v = m_makeup->value(); |
| 123 | // dB to linear (could use the function from m_pd.h) |
nothing calls this directly
no test coverage detected