From 47c558b98abf842910c780294314326662410cdf Mon Sep 17 00:00:00 2001 From: Saracen Date: Tue, 16 Jul 2019 04:10:26 +0100 Subject: [PATCH] Expose audio callbacks as signals. --- servers/audio_server.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index d25c27e1022..2cf6a67befa 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -338,6 +338,8 @@ void AudioServer::_mix_step() { E->get().callback(E->get().userdata); } + emit_signal("audio_mix_callback"); + for (int i = buses.size() - 1; i >= 0; i--) { //go bus by bus Bus *bus = buses[i]; @@ -1057,6 +1059,8 @@ void AudioServer::update() { E->get().callback(E->get().userdata); } + + emit_signal("audio_update_callback"); } void AudioServer::load_default_bus_layout() { @@ -1417,6 +1421,8 @@ void AudioServer::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_rate_scale"), "set_global_rate_scale", "get_global_rate_scale"); ADD_SIGNAL(MethodInfo("bus_layout_changed")); + ADD_SIGNAL(MethodInfo("audio_mix_callback")); + ADD_SIGNAL(MethodInfo("audio_update_callback")); BIND_ENUM_CONSTANT(SPEAKER_MODE_STEREO); BIND_ENUM_CONSTANT(SPEAKER_SURROUND_31);