Skip to content

Commit

Permalink
Use the Dummy audio driver in the project manager
Browse files Browse the repository at this point in the history
This prevents Godot from appearing in the list of applications
outputting sound in the OS while the user is in the project manager.
  • Loading branch information
Calinou committed May 6, 2021
1 parent 758bccf commit eb7903a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1311,8 +1311,16 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
display_driver_idx = 0;
}

if (audio_driver == "") { // specified in project.godot
audio_driver = GLOBAL_DEF_RST_NOVAL("audio/driver/driver", AudioDriverManager::get_driver(0)->get_name());
// If not overridden by `--audio-driver`:
if (audio_driver == "") {
if (project_manager) {
// The project manager doesn't need to play sound.
// Disable audio output so it doesn't appear in the list of applications outputting sound in the OS.
// This should also slightly speed up the project manager startup.
audio_driver = "Dummy";
} else {
audio_driver = GLOBAL_DEF_RST_NOVAL("audio/driver/driver", AudioDriverManager::get_driver(0)->get_name());
}
}

for (int i = 0; i < AudioDriverManager::get_driver_count(); i++) {
Expand Down

0 comments on commit eb7903a

Please sign in to comment.