diff options
Diffstat (limited to 'servers/audio')
-rw-r--r-- | servers/audio/audio_effect.cpp | 8 | ||||
-rw-r--r-- | servers/audio/audio_stream.cpp | 58 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_delay.cpp | 2 | ||||
-rw-r--r-- | servers/audio/effects/audio_effect_distortion.cpp | 2 | ||||
-rw-r--r-- | servers/audio/effects/reverb_filter.cpp | 8 |
5 files changed, 29 insertions, 49 deletions
diff --git a/servers/audio/audio_effect.cpp b/servers/audio/audio_effect.cpp index f38d0adfb2..ef0e3197e1 100644 --- a/servers/audio/audio_effect.cpp +++ b/servers/audio/audio_effect.cpp @@ -36,11 +36,9 @@ void AudioEffectInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_ } } bool AudioEffectInstance::process_silence() const { - bool ret; - if (GDVIRTUAL_CALL(_process_silence, ret)) { - return ret; - } - return false; + bool ret = false; + GDVIRTUAL_CALL(_process_silence, ret); + return ret; } void AudioEffectInstance::_bind_methods() { diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp index 1bfe6a3eb5..33d4c816f2 100644 --- a/servers/audio/audio_stream.cpp +++ b/servers/audio/audio_stream.cpp @@ -54,11 +54,9 @@ bool AudioStreamPlayback::is_playing() const { } int AudioStreamPlayback::get_loop_count() const { - int ret; - if (GDVIRTUAL_CALL(_get_loop_count, ret)) { - return ret; - } - return 0; + int ret = 0; + GDVIRTUAL_CALL(_get_loop_count, ret); + return ret; } double AudioStreamPlayback::get_playback_position() const { @@ -69,9 +67,7 @@ double AudioStreamPlayback::get_playback_position() const { ERR_FAIL_V_MSG(0, "AudioStreamPlayback::get_playback_position unimplemented!"); } void AudioStreamPlayback::seek(double p_time) { - if (GDVIRTUAL_CALL(_seek, p_time)) { - return; - } + GDVIRTUAL_CALL(_seek, p_time); } int AudioStreamPlayback::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) { @@ -201,58 +197,44 @@ Ref<AudioStreamPlayback> AudioStream::instantiate_playback() { } String AudioStream::get_stream_name() const { String ret; - if (GDVIRTUAL_CALL(_get_stream_name, ret)) { - return ret; - } - return String(); + GDVIRTUAL_CALL(_get_stream_name, ret); + return ret; } double AudioStream::get_length() const { - double ret; - if (GDVIRTUAL_CALL(_get_length, ret)) { - return ret; - } - return 0; + double ret = 0; + GDVIRTUAL_CALL(_get_length, ret); + return ret; } bool AudioStream::is_monophonic() const { - bool ret; - if (GDVIRTUAL_CALL(_is_monophonic, ret)) { - return ret; - } - return true; + bool ret = true; + GDVIRTUAL_CALL(_is_monophonic, ret); + return ret; } double AudioStream::get_bpm() const { double ret = 0; - if (GDVIRTUAL_CALL(_get_bpm, ret)) { - return ret; - } - return 0; + GDVIRTUAL_CALL(_get_bpm, ret); + return ret; } bool AudioStream::has_loop() const { bool ret = 0; - if (GDVIRTUAL_CALL(_has_loop, ret)) { - return ret; - } - return 0; + GDVIRTUAL_CALL(_has_loop, ret); + return ret; } int AudioStream::get_bar_beats() const { int ret = 0; - if (GDVIRTUAL_CALL(_get_bar_beats, ret)) { - return ret; - } - return 0; + GDVIRTUAL_CALL(_get_bar_beats, ret); + return ret; } int AudioStream::get_beat_count() const { int ret = 0; - if (GDVIRTUAL_CALL(_get_beat_count, ret)) { - return ret; - } - return 0; + GDVIRTUAL_CALL(_get_beat_count, ret); + return ret; } void AudioStream::tag_used(float p_offset) { diff --git a/servers/audio/effects/audio_effect_delay.cpp b/servers/audio/effects/audio_effect_delay.cpp index f71ff05b23..69c62e3a13 100644 --- a/servers/audio/effects/audio_effect_delay.cpp +++ b/servers/audio/effects/audio_effect_delay.cpp @@ -94,7 +94,7 @@ void AudioEffectDelayInstance::_process_chunk(const AudioFrame *p_src_frames, Au //apply lowpass and feedback gain AudioFrame fb_in = out * feedback_level_f * lpf_ic + h * lpf_c; - fb_in.undenormalise(); //avoid denormals + fb_in.undenormalize(); //avoid denormals h = fb_in; fb_buf[feedback_buffer_pos] = fb_in; diff --git a/servers/audio/effects/audio_effect_distortion.cpp b/servers/audio/effects/audio_effect_distortion.cpp index 5987ed7bb2..95156d8d66 100644 --- a/servers/audio/effects/audio_effect_distortion.cpp +++ b/servers/audio/effects/audio_effect_distortion.cpp @@ -50,7 +50,7 @@ void AudioEffectDistortionInstance::process(const AudioFrame *p_src_frames, Audi float lofi_mult = powf(2.0, 2.0 + (1.0 - drive_f) * 14); //goes from 16 to 2 bits for (int i = 0; i < p_frame_count * 2; i++) { - float out = undenormalise(src[i] * lpf_ic + lpf_c * h[i & 1]); + float out = undenormalize(src[i] * lpf_ic + lpf_c * h[i & 1]); h[i & 1] = out; float a = out; float ha = src[i] - out; //high freqs diff --git a/servers/audio/effects/reverb_filter.cpp b/servers/audio/effects/reverb_filter.cpp index 0363706714..2b60b73b7e 100644 --- a/servers/audio/effects/reverb_filter.cpp +++ b/servers/audio/effects/reverb_filter.cpp @@ -77,7 +77,7 @@ void Reverb::process(float *p_src, float *p_dst, int p_frames) { read_pos += echo_buffer_size; } - float in = undenormalise(echo_buffer[read_pos] * params.predelay_fb + p_src[i]); + float in = undenormalize(echo_buffer[read_pos] * params.predelay_fb + p_src[i]); echo_buffer[echo_buffer_pos] = in; @@ -111,7 +111,7 @@ void Reverb::process(float *p_src, float *p_dst, int p_frames) { c.pos = 0; } - float out = undenormalise(c.buffer[c.pos] * c.feedback); + float out = undenormalize(c.buffer[c.pos] * c.feedback); out = out * (1.0 - c.damp) + c.damp_h * c.damp; //lowpass c.damp_h = out; c.buffer[c.pos] = input_buffer[j] + out; @@ -138,7 +138,7 @@ void Reverb::process(float *p_src, float *p_dst, int p_frames) { ap=&allpass[m_ap]; \ if (ap->pos>=ap_size_limit[m_ap]) \ ap->pos=0; \ - aux=undenormalise(ap->buffer[ap->pos]); \ + aux=undenormalize(ap->buffer[ap->pos]); \ in=sample; \ sample=-in+aux; \ ap->pos++; @@ -163,7 +163,7 @@ void Reverb::process(float *p_src, float *p_dst, int p_frames) { } float aux = a.buffer[a.pos]; - a.buffer[a.pos] = undenormalise(allpass_feedback * aux + p_dst[j]); + a.buffer[a.pos] = undenormalize(allpass_feedback * aux + p_dst[j]); p_dst[j] = aux - allpass_feedback * a.buffer[a.pos]; a.pos++; } |