You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
Add a bus_renamed AudioServer signal
This commit is contained in:
@@ -236,6 +236,14 @@ bool AudioStreamPlayer::_is_active() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void AudioStreamPlayer::_on_bus_layout_changed() {
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
void AudioStreamPlayer::_on_bus_renamed(int p_bus_index, const StringName &p_old_name, const StringName &p_new_name) {
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
void AudioStreamPlayer::set_stream_paused(bool p_pause) {
|
||||
// TODO this does not have perfect recall, fix that maybe? If there are zero playbacks registered with the AudioServer, this bool isn't persisted.
|
||||
for (Ref<AudioStreamPlayback> &playback : stream_playbacks) {
|
||||
@@ -303,10 +311,6 @@ void AudioStreamPlayer::_validate_property(PropertyInfo &p_property) const {
|
||||
}
|
||||
}
|
||||
|
||||
void AudioStreamPlayer::_bus_layout_changed() {
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
bool AudioStreamPlayer::has_stream_playback() {
|
||||
return !stream_playbacks.is_empty();
|
||||
}
|
||||
@@ -372,7 +376,8 @@ void AudioStreamPlayer::_bind_methods() {
|
||||
}
|
||||
|
||||
AudioStreamPlayer::AudioStreamPlayer() {
|
||||
AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp(this, &AudioStreamPlayer::_bus_layout_changed));
|
||||
AudioServer::get_singleton()->connect("bus_layout_changed", callable_mp(this, &AudioStreamPlayer::_on_bus_layout_changed));
|
||||
AudioServer::get_singleton()->connect("bus_renamed", callable_mp(this, &AudioStreamPlayer::_on_bus_renamed));
|
||||
}
|
||||
|
||||
AudioStreamPlayer::~AudioStreamPlayer() {
|
||||
|
||||
Reference in New Issue
Block a user