diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 14:29:06 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:54:55 +0200 |
commit | 07bc4e2f96f8f47991339654ff4ab16acc19d44f (patch) | |
tree | 43cdc7cfe8239c23065616a931de3769d2db1e86 /scene/3d/audio_stream_player_3d.cpp | |
parent | 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (diff) | |
download | redot-engine-07bc4e2f96f8f47991339654ff4ab16acc19d44f.tar.gz |
Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
-o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
-o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```
This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.
This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.
Part of #33027.
Diffstat (limited to 'scene/3d/audio_stream_player_3d.cpp')
-rw-r--r-- | scene/3d/audio_stream_player_3d.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 83cf5b0142..4f37087d7e 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -645,6 +645,7 @@ Ref<AudioStream> AudioStreamPlayer3D::get_stream() const { void AudioStreamPlayer3D::set_unit_db(float p_volume) { unit_db = p_volume; } + float AudioStreamPlayer3D::get_unit_db() const { return unit_db; } @@ -652,6 +653,7 @@ float AudioStreamPlayer3D::get_unit_db() const { void AudioStreamPlayer3D::set_unit_size(float p_volume) { unit_size = p_volume; } + float AudioStreamPlayer3D::get_unit_size() const { return unit_size; } @@ -659,6 +661,7 @@ float AudioStreamPlayer3D::get_unit_size() const { void AudioStreamPlayer3D::set_max_db(float p_boost) { max_db = p_boost; } + float AudioStreamPlayer3D::get_max_db() const { return max_db; } @@ -667,6 +670,7 @@ void AudioStreamPlayer3D::set_pitch_scale(float p_pitch_scale) { ERR_FAIL_COND(p_pitch_scale <= 0.0); pitch_scale = p_pitch_scale; } + float AudioStreamPlayer3D::get_pitch_scale() const { return pitch_scale; } @@ -721,6 +725,7 @@ void AudioStreamPlayer3D::set_bus(const StringName &p_bus) { bus = p_bus; AudioServer::get_singleton()->unlock(); } + StringName AudioStreamPlayer3D::get_bus() const { for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { if (AudioServer::get_singleton()->get_bus_name(i) == bus) { @@ -733,6 +738,7 @@ StringName AudioStreamPlayer3D::get_bus() const { void AudioStreamPlayer3D::set_autoplay(bool p_enable) { autoplay = p_enable; } + bool AudioStreamPlayer3D::is_autoplay_enabled() { return autoplay; } @@ -743,6 +749,7 @@ void AudioStreamPlayer3D::_set_playing(bool p_enable) { else stop(); } + bool AudioStreamPlayer3D::_is_active() const { return active; } @@ -813,6 +820,7 @@ float AudioStreamPlayer3D::get_emission_angle_filter_attenuation_db() const { void AudioStreamPlayer3D::set_attenuation_filter_cutoff_hz(float p_hz) { attenuation_filter_cutoff_hz = p_hz; } + float AudioStreamPlayer3D::get_attenuation_filter_cutoff_hz() const { return attenuation_filter_cutoff_hz; } @@ -820,6 +828,7 @@ float AudioStreamPlayer3D::get_attenuation_filter_cutoff_hz() const { void AudioStreamPlayer3D::set_attenuation_filter_db(float p_db) { attenuation_filter_db = p_db; } + float AudioStreamPlayer3D::get_attenuation_filter_db() const { return attenuation_filter_db; } @@ -1014,5 +1023,6 @@ AudioStreamPlayer3D::AudioStreamPlayer3D() { AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp(this, &AudioStreamPlayer3D::_bus_layout_changed)); set_disable_scale(true); } + AudioStreamPlayer3D::~AudioStreamPlayer3D() { } |