implementation of audio output switching or whatever#6531
Conversation
Verbalase
left a comment
There was a problem hiding this comment.
Because this PR is so awesome, I approve.
| return true; | ||
| } | ||
|
|
||
| private void ShowDeviceConfirmation(string deviceName) |
There was a problem hiding this comment.
Doing a popup box with the in-engine UI system is not a security boundary, content could just manipulate the UI tree directly.
There was a problem hiding this comment.
Didn't think about that, any alternatives off the top of your head? Or do we just trust forks not to be evil
There was a problem hiding this comment.
Didn't think about that, any alternatives off the top of your head? Or do we just trust forks not to be evil
It's probably fine to just not care tbh.
|
|
||
| /// <summary> | ||
| /// Gets the list of available audio output device names. | ||
| /// </summary> | ||
| IReadOnlyList<string> GetAudioDevices(); | ||
|
|
||
| /// <summary> | ||
| /// Gets the name of the currently active audio device. | ||
| /// Empty string means "system default". | ||
| /// </summary> | ||
| string GetCurrentDeviceName(); | ||
|
|
||
| /// <summary> | ||
| /// Whether the engine supports live audio device switching. (May not be supported on MacOS) | ||
| /// </summary> | ||
| bool CanSwitchDevice(); | ||
|
|
||
| /// <summary> | ||
| /// Requests switching to the given audio device. | ||
| /// This will show a confirmation dialog to the user. | ||
| /// </summary> | ||
| /// <param name="deviceName">Device name, or null/empty for system default.</param> | ||
| /// <returns>True if the switch was initiated, false if unsupported or another switch is pending.</returns> | ||
| bool RequestDeviceSwitch(string? deviceName); | ||
|
|
||
| /// <summary> | ||
| /// Raised when the audio device has changed. | ||
| /// </summary> | ||
| event Action? AudioDeviceChanged; |
There was a problem hiding this comment.
I really do not see what the point of all these public APIs is?
There was a problem hiding this comment.
Used by content settings menu
There was a problem hiding this comment.
Then shouldn't this be controlled by some CVar at least?
Essentially I got sick of restarting whenever my audio disconnects or switches
Automatically switches whenever device becomes unavailable, content unable to switch devices without a engine confirmation popup so no evil forks making a smite that changes to your speakers and plays ERP sounds or some shit
Content PR will drop if this gets merged
Screencast_20260417_231059.webm