]> git.mxchange.org Git - flightgear.git/commitdiff
List all available playback devices under '/sim/sound/devcies'
authorehofman <ehofman>
Sat, 28 Nov 2009 13:33:54 +0000 (13:33 +0000)
committerTim Moore <timoore@redhat.com>
Sun, 29 Nov 2009 14:57:17 +0000 (15:57 +0100)
src/Main/fg_init.cxx

index 3d253091d740ee5b434d5028b3564ba1ada646ff..6e99a68bc61d26554029258e77a57098d9269add 100644 (file)
@@ -1455,6 +1455,14 @@ bool fgInitSubsystems() {
     globals->get_soundmgr()->bind();
     globals->get_soundmgr()->init(fgGetString("/sim/sound/device-name", NULL));
 
+    vector <const char*>devices =
+                        globals->get_soundmgr()->get_available_devices();
+    for (int i=0; i<devices.size(); i++) {
+        SGPropertyNode *p = fgGetNode("/sim/sound/devices/device", i, true);
+        p->setStringValue(devices[i]);
+    }
+    devices.clear();
+
     ////////////////////////////////////////////////////////////////////
     // Initialize the property interpolator subsystem. Put into the INIT
     // group because the "nasal" subsystem may need it at GENERAL take-down.