audio_backend: Get name of standard device directly, without unnecessary enum StandardDeviceName

The StandardDeviceName enum was misleadingly *not* the name - the name
only came from get_standard_device_name.

Instead, simplify things, and just use two different trivial getters.
This commit is contained in:
Mads Kiilerich 2024-10-20 21:41:20 +02:00
parent 29e71b5c82
commit a3ac3c7201
9 changed files with 53 additions and 62 deletions

View file

@ -428,7 +428,7 @@ PortAudioBackend::enumerate_midi_options () const
{
if (_midi_options.empty()) {
_midi_options.push_back (winmme_driver_name);
_midi_options.push_back (get_standard_device_name(DeviceNone));
_midi_options.push_back (get_none_device_name ());
}
return _midi_options;
}
@ -436,7 +436,7 @@ PortAudioBackend::enumerate_midi_options () const
int
PortAudioBackend::set_midi_option (const std::string& opt)
{
if (opt != get_standard_device_name(DeviceNone) && opt != winmme_driver_name) {
if (opt != get_none_device_name () && opt != winmme_driver_name) {
return -1;
}
DEBUG_MIDI (string_compose ("Setting midi option to %1\n", opt));
@ -1220,7 +1220,7 @@ PortAudioBackend::register_system_audio_ports()
int
PortAudioBackend::register_system_midi_ports (std::string const& device)
{
if (_midi_driver_option == get_standard_device_name(DeviceNone)) {
if (_midi_driver_option == get_none_device_name ()) {
DEBUG_MIDI("No MIDI backend selected, not system midi ports available\n");
return 0;
}