banshee r3984 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Equalizer



Author: abock
Date: Tue May 27 21:19:58 2008
New Revision: 3984
URL: http://svn.gnome.org/viewvc/banshee?rev=3984&view=rev

Log:
2008-05-27  Aaron Bockover  <abock gnome org>

    * src/Core/Banshee.Services/Banshee.Equalizer/EqualizerManager.cs:
    Handle when the equalizer XML file does not exist



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Equalizer/EqualizerManager.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Equalizer/EqualizerManager.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Equalizer/EqualizerManager.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Equalizer/EqualizerManager.cs	Tue May 27 21:19:58 2008
@@ -138,9 +138,7 @@
                 // Set the actual equalizer gain on all bands to 0 dB,
                 // but don't change the gain in the dictionary (we can use/change those values
                 // later, but not affect the actual audio stream until we're enabled again).
-                
-                for (uint i = 0; i < eq.BandCount; i++)
-                {
+                for (uint i = 0; i < eq.BandCount; i++) {
                     ((IEqualizer) ServiceManager.PlayerEngine.ActiveEngine).SetEqualizerGain (i, 0);
                 }
                 
@@ -156,10 +154,18 @@
         public void Load (string path)
         {
             XmlDocument doc = new XmlDocument ();
-            doc.Load (path);
+            
+            try {
+                doc.Load (path);
+            } catch {
+            }
             
             Clear ();
             
+            if (doc.DocumentElement == null || doc.DocumentElement.ChildNodes == null) {
+                return;
+            }
+            
             foreach (XmlNode node in doc.DocumentElement.ChildNodes) {
                 if(node.Name != "equalizer") {
                     throw new XmlException ("equalizer node was expected");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]