From 99a484f1939a685cbfde14dfe90fddeccbacdbf6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 16 Sep 2014 08:59:27 +0200 Subject: [PATCH] ALSA backend: initial device selection --- libs/backends/alsa/alsa_audiobackend.cc | 1 + libs/backends/alsa/alsa_audiobackend.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/backends/alsa/alsa_audiobackend.cc b/libs/backends/alsa/alsa_audiobackend.cc index 936fc990ce..c137078db0 100644 --- a/libs/backends/alsa/alsa_audiobackend.cc +++ b/libs/backends/alsa/alsa_audiobackend.cc @@ -93,6 +93,7 @@ AlsaAudioBackend::enumerate_devices () const std::map devices; get_alsa_audio_device_names(devices); for (std::map::const_iterator i = devices.begin (); i != devices.end(); ++i) { + if (_audio_device == "") _audio_device = i->first; _audio_device_status.push_back (DeviceStatus (i->first, true)); } return _audio_device_status; diff --git a/libs/backends/alsa/alsa_audiobackend.h b/libs/backends/alsa/alsa_audiobackend.h index 29866ed4d5..dd24cb7753 100644 --- a/libs/backends/alsa/alsa_audiobackend.h +++ b/libs/backends/alsa/alsa_audiobackend.h @@ -306,7 +306,7 @@ class AlsaAudioBackend : public AudioBackend { static std::vector _audio_device_status; static std::vector _midi_device_status; - std::string _audio_device; + mutable std::string _audio_device; std::string _midi_driver_option; /* audio device reservation */