diff options
author | Michael Alexsander <michaelalexsander@protonmail.com> | 2020-05-07 13:46:33 -0300 |
---|---|---|
committer | Michael Alexsander <michaelalexsander@protonmail.com> | 2021-08-07 12:32:42 -0300 |
commit | 4bef90039989c585086ba232fc58119dccf333ee (patch) | |
tree | 355fdd75071d5370d32be99e953a2129ac2f8b07 /servers/audio_server.cpp | |
parent | 3177da1d053a6132668e12a8d8af82366f5c4ac9 (diff) |
Invert how `global_rate_scale` value works, and rename it to `playback_speed_scale`
Diffstat (limited to 'servers/audio_server.cpp')
-rw-r--r-- | servers/audio_server.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 076cbb58af..4c54188cb2 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -913,14 +913,14 @@ bool AudioServer::is_bus_channel_active(int p_bus, int p_channel) const { return buses[p_bus]->channels[p_channel].active; } -void AudioServer::set_global_rate_scale(float p_scale) { +void AudioServer::set_playback_speed_scale(float p_scale) { ERR_FAIL_COND(p_scale <= 0); - global_rate_scale = p_scale; + playback_speed_scale = p_scale; } -float AudioServer::get_global_rate_scale() const { - return global_rate_scale; +float AudioServer::get_playback_speed_scale() const { + return playback_speed_scale; } void AudioServer::init_channels_and_buffers() { @@ -1277,8 +1277,8 @@ void AudioServer::_bind_methods() { ClassDB::bind_method(D_METHOD("get_bus_peak_volume_left_db", "bus_idx", "channel"), &AudioServer::get_bus_peak_volume_left_db); ClassDB::bind_method(D_METHOD("get_bus_peak_volume_right_db", "bus_idx", "channel"), &AudioServer::get_bus_peak_volume_right_db); - ClassDB::bind_method(D_METHOD("set_global_rate_scale", "scale"), &AudioServer::set_global_rate_scale); - ClassDB::bind_method(D_METHOD("get_global_rate_scale"), &AudioServer::get_global_rate_scale); + ClassDB::bind_method(D_METHOD("set_playback_speed_scale", "scale"), &AudioServer::set_playback_speed_scale); + ClassDB::bind_method(D_METHOD("get_playback_speed_scale"), &AudioServer::get_playback_speed_scale); ClassDB::bind_method(D_METHOD("lock"), &AudioServer::lock); ClassDB::bind_method(D_METHOD("unlock"), &AudioServer::unlock); @@ -1302,7 +1302,7 @@ void AudioServer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "bus_count"), "set_bus_count", "get_bus_count"); ADD_PROPERTY(PropertyInfo(Variant::STRING, "device"), "set_device", "get_device"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "global_rate_scale"), "set_global_rate_scale", "get_global_rate_scale"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "playback_speed_scale"), "set_playback_speed_scale", "get_playback_speed_scale"); ADD_SIGNAL(MethodInfo("bus_layout_changed")); @@ -1322,7 +1322,7 @@ AudioServer::AudioServer() { #endif mix_time = 0; mix_size = 0; - global_rate_scale = 1; + playback_speed_scale = 1; } AudioServer::~AudioServer() { |