From da879b45c4aa9720bbc9a7b803c0ee40f86901dc Mon Sep 17 00:00:00 2001
From: Jonathan Wilkes <jon.w.wilkes@gmail.com>
Date: Sun, 1 May 2016 18:03:54 -0400
Subject: [PATCH] report ALSA port connections in the dialog

---
 pd/nw/dialog_prefs.html | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/pd/nw/dialog_prefs.html b/pd/nw/dialog_prefs.html
index e58a17e14..78dbd5848 100644
--- a/pd/nw/dialog_prefs.html
+++ b/pd/nw/dialog_prefs.html
@@ -642,6 +642,14 @@ function midi_prefs_callback(attrs) {
             .style.setProperty("display", "none");
         document.getElementsByClassName("alsa_midi")[0]
             .style.setProperty("display", "inherit");
+        // For ALSA, we just set the number of ports we want
+        // for input and output. The tcl/tk interface just reused
+        // the first of the "indevs" for this value, so (for now)
+        // we repeat that mistake here...
+        document.getElementById("alsa_in_ports").value =
+            +get_attr("pd-indevs", attrs)[0];
+        document.getElementById("alsa_out_ports").value =
+            +get_attr("pd-outdevs", attrs)[0];
     } else {
         document.getElementsByClassName("midi_devices")[0]
             .style.setProperty("display", "inherit");
-- 
GitLab