Add "Mute Audio" button to Game view in editor

Update servers/audio_server.cpp

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Adam Scott <ascott.ca@gmail.com>

Fix a few lines for new member names

Add command-line argument `--debug-mute-audio`, and pass it to game if started with mute enabled

Apply suggestions from code review

Co-authored-by: arkology <43543909+arkology@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>

Fix icon for svgo
This commit is contained in:
Malcolm Anderson
2024-11-21 21:31:00 -08:00
parent 28102e6682
commit 6858607e74
12 changed files with 108 additions and 0 deletions

View File

@ -294,7 +294,11 @@ void AudioServer::_driver_process(int p_frames, int32_t *p_buffer) {
// The destination start for data will be the same in all cases.
int32_t *dest = &p_buffer[from_buf * (cs * 2) + (k * 2)];
#ifdef DEBUG_ENABLED
if (!debug_mute && master->channels[k].active) {
#else
if (master->channels[k].active) {
#endif // DEBUG_ENABLED
const AudioFrame *buf = master->channels[k].buffer.ptr();
for (int j = 0; j < to_copy; j++) {
@ -765,6 +769,16 @@ int AudioServer::thread_find_bus_index(const StringName &p_name) {
}
}
#ifdef DEBUG_ENABLED
void AudioServer::set_debug_mute(bool p_mute) {
debug_mute = p_mute;
}
bool AudioServer::get_debug_mute() const {
return debug_mute;
}
#endif // DEBUG_ENABLED
void AudioServer::set_bus_count(int p_count) {
ERR_FAIL_COND(p_count < 1);
ERR_FAIL_INDEX(p_count, 256);