stella-emu / stella

A multi-platform Atari 2600 Emulator
https://stella-emu.github.io
GNU General Public License v2.0
624 stars 111 forks source link

Allow selecting audio devices #682

Closed thrust26 closed 4 years ago

thrust26 commented 4 years ago

Sometimes (rarely) it is required to select an audio device manually.

https://atariage.com/forums/topic/307760-stella-62-released/?do=findComment&comment=4578022

sa666666 commented 4 years ago

Since SDL2 now exposes this info, I suppose it's easy enough to show a dropdown box to allow the user to select it. SDL1 never supported anything like this, which is why the code works the way it currently does.

thrust26 commented 4 years ago

Yup, already experimenting with it.

thrust26 commented 4 years ago

There seems to be no way to find out the default audio device used by SDL_OpenAudioDevice(nullptr,...). At least I found none.

To fix this gap, we will need a "Default" device option, which would use nullptr instead of the device name.

sa666666 commented 4 years ago

Makes sense, as this is what will be used 99.9% of the time anyway. Simply store "default" in the Variant, and then check on applying if "default" has been passed. If so, use nullptr instead.

thrust26 commented 4 years ago

I have implemented the code and it seems to work. However I have only two devices, and only the 2nd one creates sound (I don't use SPDIF).

I decided to store the number in the settings and not the rather complex name. Makes things much easier (for me and the user). @sa666666 Fine by you?