small system-config-soundcard patch

Bastien Nocera <[email protected]>
Newsgroups gmane.linux.redhat.fedora.configuration
Message-ID <[email protected]>
Heya,

Attached is a small patch to system-config-soundcard. Here are some
details:
- replace deprecated function calls
- use a close button, instead of OK (I think the tool is instant-apply,
no?)
- list USB audio devices as well (I have a USB speaker system at
home...)

There are still a bunch of issues though:
- The playback code uses OSS (or OSS compatibility) even when on a 2.6
kernel, which won't work in a multi-soundcard setup
- The "primary audio device" drop-down doesn't seem to do anything. It
should probably, write a /etc/asoundrc with the default soundcard being
listed of "card 0".

We should probably allow system-config-soundcard to be run as a normal
user on 2.6, for a ~/.asoundrc to be written.

An example screenshot:
http://www.hadess.net/files/shots/11-07-2004.1.png
which doesn't look so good because of:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=79278

Cheers

---
Bastien Nocera <[email protected]> 
I have just watched The Big Blue on video but I couldn't see the
porpoise. -- reader Nibs Swenior

-- 
Fedora-config-list mailing list
[email protected]
http://www.redhat.com/mailman/listinfo/fedora-config-list
s-c-sndcard-usb.patch (text/x-patch, 3 KB)
Index: src/soundcard.py
===================================================================
RCS file: /usr/local/CVS/redhat-config-soundcard/src/soundcard.py,v
retrieving revision 1.48
diff -u -r1.48 soundcard.py
--- src/soundcard.py	16 Apr 2004 03:38:59 -0000	1.48
+++ src/soundcard.py	11 Jul 2004 14:10:11 -0000
@@ -50,7 +50,7 @@
     commentTag = _("Auto-detect and configure soundcard")
 
     def destroy(self, args):
-        gtk.mainquit()
+        gtk.main_quit()
     
     def __init__(self, doDebug=None, backend=None):
         self.doDebug = doDebug
@@ -181,9 +181,9 @@
             self.icon = gtk.Image()
             self.icon.set_from_pixbuf(p)
 
-    def okClicked(self, *args):
+    def closeClicked(self, *args):
         self.apply()
-        gtk.mainquit()
+        gtk.main_quit()
 
     def apply(self, *args):
         if self.doDebug:
@@ -223,7 +223,6 @@
             rc = dlg.run()
             dlg.destroy()
 
-            print rc
             if rc == gtk.RESPONSE_NO:
                 #Oh well, they couldn't hear the sound.  Notify the user and then quit.  We did our best
                 self.showErrorDialog(_("Automatic detection of the sound card did not work.  " \
@@ -291,8 +290,8 @@
         self.mainWindow.set_border_width(10)
         self.mainWindow.set_position(gtk.WIN_POS_CENTER)
         self.mainWindow.set_icon(iconPixbuf)
-        self.okButton = self.mainWindow.add_button('gtk-ok', 0)
-        self.okButton.connect("clicked", self.okClicked)
+        self.okButton = self.mainWindow.add_button('gtk-close', 0)
+        self.okButton.connect("clicked", self.closeClicked)
 
         self.toplevel.set_spacing(5)
         self.icon_box.pack_start(self.icon, gtk.FALSE)
@@ -306,7 +305,7 @@
         self.mainWindow.get_children()[0].remove(hsep)
         self.mainWindow.vbox.pack_start(self.toplevel)
         self.mainWindow.show_all()
-        gtk.mainloop()
+        gtk.main()
 
     #The getData function can return the name of the setting being changed
     #This is useful for the hardware screen in firstboot
Index: src/soundcardBackend.py
===================================================================
RCS file: /usr/local/CVS/redhat-config-soundcard/src/soundcardBackend.py,v
retrieving revision 1.32
diff -u -r1.32 soundcardBackend.py
--- src/soundcardBackend.py	16 Apr 2004 03:38:59 -0000	1.32
+++ src/soundcardBackend.py	11 Jul 2004 14:10:11 -0000
@@ -91,11 +91,19 @@
             if card.driver != "unknown":
                 self.cardList.append(card)
 
+        list = kudzu.probe(kudzu.CLASS_AUDIO, kudzu.BUS_USB, kudzu.PROBE_ALL)
+        for card in list:
+	    if card.driver == "snd-usb-audio":
+	        self.cardList.append(card)
+
         return self.cardList
 
     def getData(self, card):
         device, module, description = card
-        maker, model = string.split(description, "|")
+	if (string.count(description,"|") == 1):
+            maker, model = string.split(description, "|")
+	else:
+	    maker, model = string.split(description, " ", 1)
         return device, module, maker, model
 
     def playTestSound(self, module):
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.