alsa: allow environment variable ARDOUR_ALSA_DEVICE to identify a single, arbitrary...
authorPaul Davis <paul@linuxaudiosystems.com>
Sun, 21 Feb 2016 17:44:54 +0000 (12:44 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Sun, 21 Feb 2016 17:44:54 +0000 (12:44 -0500)
libs/ardouralsautil/devicelist.cc

index 3fdb1401af17338fabc8cb98597145d4af9359f5..f642733182f1926e8f025620498e83f32b53a705 100644 (file)
@@ -18,6 +18,8 @@
  */
 
 #include <alsa/asoundlib.h>
+#include <glib.h>
+
 #include "pbd/convert.h"
 #include "ardouralsautil/devicelist.h"
 
@@ -34,6 +36,12 @@ ARDOUR::get_alsa_audio_device_names (std::map<std::string, std::string>& devices
        string devname;
        int cardnum = -1;
        int device = -1;
+       const char* fixed_name;
+
+       if ((fixed_name = g_getenv ("ARDOUR_ALSA_DEVICE"))) {
+               devices.insert (make_pair<string,string> (fixed_name, fixed_name));
+               return;
+       }
 
        assert (duplex > 0);