rpms/system-config-soundcard/devel system-config-soundcard-1.2.14-dyn-keys.patch, NONE, 1.1 system-config-soundcard.spec, 1.23, 1.24

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Tue Jan 17 14:13:20 UTC 2006


Author: stransky

Update of /cvs/dist/rpms/system-config-soundcard/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv15294

Modified Files:
	system-config-soundcard.spec 
Added Files:
	system-config-soundcard-1.2.14-dyn-keys.patch 
Log Message:
added ainit configuration

system-config-soundcard-1.2.14-dyn-keys.patch:
 soundcard.py            |   13 ++++++++++++
 soundcardBackend.py     |   52 ++++++++++++++++++++++++++++++++++++++++++++++++
 system-config-soundcard |    1 
 3 files changed, 66 insertions(+)

--- NEW FILE system-config-soundcard-1.2.14-dyn-keys.patch ---
--- system-config-soundcard-1.2.14/src/soundcard.py.dyn	2005-10-26 15:04:26.000000000 +0200
+++ system-config-soundcard-1.2.14/src/soundcard.py	2006-01-17 14:53:07.000000000 +0100
@@ -189,6 +189,14 @@
 
             deviceTopBox.pack_start(button)
 
+            #Create a check-box for key config
+            button = gtk.CheckButton(_("Dynamic keys for dmix and dsnoop"))
+            button.set_active(self.soundcardBackend.getDynamicKeys())
+            button.connect("toggled", self.changeDynKeys)
+            button.show()
+   
+            deviceTopBox.pack_start(button)
+
             self.box.pack_start(self.notebook)
             self.box.pack_start(deviceTopBox)
 
@@ -256,6 +264,11 @@
         self.soundcardBackend.setHardwareDevice(widget.get_active())
         self.soundcardBackend.writeConfig()
 
+    def changeDynKeys(self, widget, data=None):
+        self.soundcardBackend.setDynamicKeys(widget.get_active())
+        self.soundcardBackend.writeConfig()
+        self.soundcardBackend.reconfigureDynamicKeys()
+
     def apply(self, *args):
         if self.doDebug:
             return
--- system-config-soundcard-1.2.14/src/system-config-soundcard.dyn	2005-10-04 12:53:25.000000000 +0200
+++ system-config-soundcard-1.2.14/src/system-config-soundcard	2006-01-17 13:45:08.000000000 +0100
@@ -9,6 +9,7 @@
 echo -e "------- /etc/asound.conf --------\n`cat /etc/asound.conf`\n" >> $LOG_FILE 2>&1
 echo -e "------- aplay -l --------\n`aplay -l 2>&1`\n" >> $LOG_FILE 2>&1
 echo -e "------- amixer --------\n`amixer`\n" >> $LOG_FILE 2>&1
+echo -e "------- /proc/asound/version --------\n`cat /proc/asound/version`\n" >> $LOG_FILE 2>&1
 echo -e "------- /proc/asound/modules --------\n`cat /proc/asound/modules`\n" >> $LOG_FILE 2>&1
 echo -e "------- /proc/asound/pcm --------\n`cat /proc/asound/pcm`\n" >> $LOG_FILE 2>&1
 
--- system-config-soundcard-1.2.14/src/soundcardBackend.py.dyn	2005-10-26 15:04:26.000000000 +0200
+++ system-config-soundcard-1.2.14/src/soundcardBackend.py	2006-01-17 15:07:52.000000000 +0100
@@ -119,6 +119,7 @@
         self.hardware_device = 0
         self.default_device = 0
         self.default_card = 0
+        self.dynamic_keys = 0
         self.readConfig()
 
     def probeCards(self):        
@@ -311,8 +312,23 @@
     def getHardwareDevice(self):
         return self.hardware_device        
 
+    def setDynamicKeys(self, state):
+        self.dynamic_keys = state;
+
+    def getDynamicKeys(self):
+        return self.dynamic_keys
+
+    def reconfigureDynamicKeys(self):
+        if self.dynamic_keys :
+            if os.path.exists("/var/run/console/console.lock"):
+                os.system("/usr/bin/ainit `cat /var/run/console/console.lock` start")
+        else:
+            if os.path.exists("/var/run/console/console.lock"):
+                os.system("/usr/bin/ainit `cat /var/run/console/console.lock` stop")
+
     def writeConfig(self):
 
+        # Writing to asound.conf
         index = self.default_card
         device = self.default_device
     
@@ -337,7 +353,28 @@
 	        fd.write(line)
 	    fd.close()
 
+        # re-writing ainit.conf
+        fd = open('/etc/alsa/ainit.conf', 'r')
+        lines = fd.readlines()
+        fd.close()
+
+        lines_out = []
+        for line in lines:                
+            line_tmp = string.split(string.strip(line))
+            if line_tmp != [] and cmp(string.lower(line_tmp[0]),"enable") == 0:
+                if self.dynamic_keys:
+                   lines_out.append("enable = yes\n")
+                else:
+                   lines_out.append("enable = no\n")
+            else:
+                lines_out.append(line)
+
+        fd = open('/etc/alsa/ainit.conf', 'w')
+        fd.writelines(lines_out)
+        fd.close()        
+
     def readConfig(self):
+        # Check alsa configuration
         try:            
             fd = open('/etc/asound.conf', 'r')
             line = fd.readline()
@@ -353,6 +390,21 @@
             self.hardware_device = 0
             self.default_device = 0
 
+        # Check ainit configuration
+        try:
+            fd = open('/etc/alsa/ainit.conf', 'r')                       
+            lines = fd.readlines()
+            fd.close()
+
+            for line in lines:                
+                line = string.split(string.strip(line))
+                if line != [] and cmp(string.lower(line[0]),"enable") == 0:
+                    self.dynamic_keys = (cmp(string.lower(line[2]),'yes') == 0)
+                    break;
+                    
+        except:
+            self.dynamic_keys = 0
+
         try:
             self.default_card = int(commands.getoutput('/bin/alsacard'))
         except:


Index: system-config-soundcard.spec
===================================================================
RCS file: /cvs/dist/rpms/system-config-soundcard/devel/system-config-soundcard.spec,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- system-config-soundcard.spec	12 Jan 2006 10:06:37 -0000	1.23
+++ system-config-soundcard.spec	17 Jan 2006 14:13:15 -0000	1.24
@@ -1,7 +1,7 @@
 Summary: A graphical interface for detecting and configuring soundcards
 Name: system-config-soundcard
 Version: 1.2.14
-Release: 2
+Release: 3
 URL: http://fedora.redhat.com/projects/config-tools/redhat-config-soundcard.html
 License: GPL
 ExclusiveOS: Linux
@@ -10,6 +10,7 @@
 BuildArch: noarch
 Source0: %{name}-%{version}.tar.bz2
 Patch1: system-config-soundcard-1.2.14-desktop.patch
+Patch2: system-config-soundcard-1.2.14-dyn-keys.patch
 BuildRequires: desktop-file-utils
 BuildRequires: gettext
 ExcludeArch: s390 s390x
@@ -20,7 +21,7 @@
 Requires: sox
 Requires: rhpl
 Requires: kudzu
-Requires: alsa-utils >= 1.0.9rf-3
+Requires: alsa-utils >= 1.0.11
 Requires: alsa-lib
 
 %description
@@ -30,6 +31,7 @@
 %prep
 %setup -q
 %patch1 -p1
+%patch2 -p1 -b .dyn
 
 %build
 make
@@ -83,6 +85,9 @@
 %ghost /root/scsound.log
 
 %changelog
+* Tue Jan 17 2006 Martin Stransky <stransky at redhat.com> 1.2.14-3
+- added ainit configuration
+
 * Thu Jan 12 2006 Martin Stransky <stransky at redhat.com> 1.2.14-2
 - added patch for menu entries (#177479)
 




More information about the fedora-cvs-commits mailing list