Revision: 5854
          http://jnode.svn.sourceforge.net/jnode/?rev=5854&view=rev
Author:   lsantha
Date:     2011-08-21 15:30:55 +0000 (Sun, 21 Aug 2011)

Log Message:
-----------
Turn off all sounds when stopping the PC speaker device.

Modified Paths:
--------------
    trunk/gui/src/driver/org/jnode/driver/sound/speaker/pc/PCSpeakerDriver.java

Modified: 
trunk/gui/src/driver/org/jnode/driver/sound/speaker/pc/PCSpeakerDriver.java
===================================================================
--- trunk/gui/src/driver/org/jnode/driver/sound/speaker/pc/PCSpeakerDriver.java 
2011-08-21 15:25:19 UTC (rev 5853)
+++ trunk/gui/src/driver/org/jnode/driver/sound/speaker/pc/PCSpeakerDriver.java 
2011-08-21 15:30:55 UTC (rev 5854)
@@ -86,6 +86,7 @@
 
     /** A routine that releases all the resources back to the operating 
system. * */
     public void stopDevice() throws DriverException {
+        noSound();
         getDevice().unregisterAPI(SpeakerAPI.class);
         pitIO.release();
         speakIO.release();
@@ -142,6 +143,11 @@
         speakIO.outPortByte(SPEAKER_PORT, oldPort);
     }
 
+    public void noSound() {
+        int val = speakIO.inPortByte(SPEAKER_PORT);
+        speakIO.outPortByte(SPEAKER_PORT, val & 0xFC);
+    }
+
     private IOResource claimPorts(final ResourceManager rm, final 
ResourceOwner owner,
             final int low, final int length) throws ResourceNotFreeException, 
DriverException {
         try {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
Jnode-svn-commits mailing list
Jnode-svn-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jnode-svn-commits

Reply via email to