| 1 | #cxx . . $ `<file>/nall/dsp/resample/cosine.hpp`/ifdef NALL_DSP_INTERNAL_HPPcxx . . $ `nall/dsp.hpp:11:9`! |
| 2 | |
| 3 | struct ResampleCosinecxx . . $ nall/ResampleCosine# : Resamplercxx . . $ nall/Resampler# { |
| 4 | inline void setFrequencycxx . . $ nall/ResampleCosine#setFrequency(49f6e7a06ebc5aa8).(); |
| 5 | inline void clearcxx . . $ nall/ResampleCosine#clear(49f6e7a06ebc5aa8).(); |
| 6 | inline void samplecxx . . $ nall/ResampleCosine#sample(49f6e7a06ebc5aa8).(); |
| 7 | ResampleCosinecxx . . $ nall/ResampleCosine#ResampleCosine(4d05a46e9b84fdde).(DSPcxx . . $ nall/DSP#& dsp) : Resamplercxx . . $ nall/Resampler#(dsp) {} |
| 8 | |
| 9 | realcxx . . $ `nall/dsp/core.hpp:10:9`! fractioncxx . . $ nall/ResampleCosine#fraction.; |
| 10 | realcxx . . $ `nall/dsp/core.hpp:10:9`! stepcxx . . $ nall/ResampleCosine#step.; |
| 11 | }; |
| 12 | |
| 13 | void ResampleCosinecxx . . $ nall/ResampleCosine#::setFrequencycxx . . $ nall/ResampleCosine#setFrequency(49f6e7a06ebc5aa8).() { |
| 14 | fractioncxx . . $ nall/ResampleCosine#fraction. = 0.0; |
| 15 | stepcxx . . $ nall/ResampleCosine#step. = dspcxx . . $ nall/Resampler#dsp..settingscxx . . $ nall/DSP#settings..frequencycxx . . $ nall/DSP#Settings#frequency. / frequencycxx . . $ nall/Resampler#frequency.; |
| 16 | } |
| 17 | |
| 18 | void ResampleCosinecxx . . $ nall/ResampleCosine#::clearcxx . . $ nall/ResampleCosine#clear(49f6e7a06ebc5aa8).() { |
| 19 | fractioncxx . . $ nall/ResampleCosine#fraction. = 0.0; |
| 20 | } |
| 21 | |
| 22 | void ResampleCosinecxx . . $ nall/ResampleCosine#::samplecxx . . $ nall/ResampleCosine#sample(49f6e7a06ebc5aa8).() { |
| 23 | while(fractioncxx . . $ nall/ResampleCosine#fraction. <= 1.0) { |
| 24 | realcxx . . $ `nall/dsp/core.hpp:10:9`! channel[dspcxx . . $ nall/Resampler#dsp..settingscxx . . $ nall/DSP#settings..channelscxx . . $ nall/DSP#Settings#channels.]; |
| 25 | |
| 26 | for(unsigned n = 0; n < dspcxx . . $ nall/Resampler#dsp..settingscxx . . $ nall/DSP#settings..channelscxx . . $ nall/DSP#Settings#channels.; n++) { |
| 27 | realcxx . . $ `nall/dsp/core.hpp:10:9`! a = dspcxx . . $ nall/Resampler#dsp..buffercxx . . $ nall/DSP#buffer..readcxx . . $ nall/DSP#Buffer#read(bd0dcd125246a5b7).(n, -1); |
| 28 | realcxx . . $ `nall/dsp/core.hpp:10:9`! b = dspcxx . . $ nall/Resampler#dsp..buffercxx . . $ nall/DSP#buffer..readcxx . . $ nall/DSP#Buffer#read(bd0dcd125246a5b7).(n, -0); |
| 29 | |
| 30 | realcxx . . $ `nall/dsp/core.hpp:10:9`! mu = fractioncxx . . $ nall/ResampleCosine#fraction.; |
| 31 | mu = (1.0 - coscxx . . $ cos(447c67c6676f75c3).(mu * 3.14159265)) / 2.0; |
| 32 | |
| 33 | channel[n] = a * (1.0 - mu) + b * mu; |
| 34 | } |
| 35 | |
| 36 | dspcxx . . $ nall/Resampler#dsp..writecxx . . $ nall/DSP#write(e6881f009d13a851).(channel); |
| 37 | fractioncxx . . $ nall/ResampleCosine#fraction. += stepcxx . . $ nall/ResampleCosine#step.; |
| 38 | } |
| 39 | |
| 40 | dspcxx . . $ nall/Resampler#dsp..buffercxx . . $ nall/DSP#buffer..rdoffsetcxx . . $ nall/DSP#Buffer#rdoffset.++; |
| 41 | fractioncxx . . $ nall/ResampleCosine#fraction. -= 1.0; |
| 42 | } |
| 43 | |
| 44 | #endif |