/[EmuXPortal]/trunk/EmuXPortal/Api/RomParser.cs
ViewVC logotype

Diff of /trunk/EmuXPortal/Api/RomParser.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/EmuXPortal/Api/RomParser.cs	2014/08/05 04:13:36	237
+++ trunk/EmuXPortal/Api/RomParser.cs	2014/08/05 04:50:39	238
@@ -3,36 +3,36 @@
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
-using EmuXPortal.Logging;
 using System.IO;
 using System.Diagnostics;
+using Enterprise.Logging;
 
 namespace EmuXPortal.Api
 {
     public class RomParser :IDisposable
     {
         private IEmuConfig Config { get; set; }
-        public RomParser(logger log, IEmuConfig config)
+        public RomParser(IEmuConfig config)
         {
             this.Config = config;
             if (!this.Config.IsFavorites)
             {
-                List<IRomConfigPair> roms = GetRoms(log);
-                log.WriteLine("Found {0} Roms", roms.Count);
-                this.Roms = GenerateRomConfig(log, roms, config);
+                List<IRomConfigPair> roms = GetRoms();
+                 gLog.Debug.WriteLine("Found {0} Roms", roms.Count);
+                this.Roms = GenerateRomConfig(roms, config);
             }
             else
             {
-                this.Roms = RomFavorite.GetRoms(log);
-                log.WriteLine("Found {0} Roms", this.Roms.Count);
+                this.Roms = RomFavorite.GetRoms();
+                 gLog.Debug.WriteLine("Found {0} Roms", this.Roms.Count);
             }
         }
         public List<IRomConfig> Roms { get; private set; }
-        private List<IRomConfigPair> GetRoms(logger log)
+        private List<IRomConfigPair> GetRoms()
         {
-            if (Config.HasExternalConfigs) { return GetRomsEX(log); }
+            if (Config.HasExternalConfigs) { return GetRomsEX(); }
             string path = Config.EmuRomPath; string searchPattern = Config.Extenstions;
-            log.WriteLine("Searching for Roms in Folder: {0}", path);
+            gLog.Debug.WriteLine("Searching for Roms in Folder: {0}", path);
             Predicate<string> rom_predicate = new Predicate<string>(delegate(string t)
                 {
                     string search_exts = searchPattern.Replace("*", "");
@@ -61,7 +61,7 @@
             return rompairlist;
         }
 
-        private List<IRomConfigPair> GetRomsEX(logger log)
+        private List<IRomConfigPair> GetRomsEX()
         {
             List<IEmuConfig> configs = Config.ExternalConfigs;
             List<IRomConfigPair> roms = new List<IRomConfigPair>();
@@ -69,13 +69,13 @@
 
             foreach (IEmuConfig config in configs)
             {
-                var reconfig = FixExternalConfig(log,Config, config);
+                var reconfig = FixExternalConfig(Config, config);
                roms.Add(new RomConfigPair(reconfig.GameExe, reconfig));
             }
 
             return roms;
         }
-        private IEmuConfig FixExternalConfig(logger log,IEmuConfig parent_config, IEmuConfig child_config)
+        private IEmuConfig FixExternalConfig(IEmuConfig parent_config, IEmuConfig child_config)
         {
             string PlatformNameShort = child_config.PlatformNameShort.Contains("Unknown") ? parent_config.PlatformNameShort != "" ? parent_config.PlatformNameShort : "" : child_config.PlatformNameShort;
             string PlatformNameLong = child_config.PlatformNameLong.Contains("Unknown") ? parent_config.PlatformNameLong != "" ? parent_config.PlatformNameLong : "" : child_config.PlatformNameLong;
@@ -86,9 +86,7 @@
 
 
             
-            EmuXPortal.Api.EmuConfigLoader.EmuConfig c = new EmuConfigLoader.EmuConfig(log, 
-                PlatformNameShort, PlatformNameLong, PlatformImage,
-                Extenstions, EmuPath, EmuOptions);
+            EmuXPortal.Api.EmuConfigLoader.EmuConfig c = new EmuConfigLoader.EmuConfig(PlatformNameShort, PlatformNameLong, PlatformImage,Extenstions, EmuPath, EmuOptions);
             c.EmuRomPath = string.IsNullOrEmpty(child_config.EmuRomPath) ? string.IsNullOrEmpty(parent_config.EmuRomPath) ? "" : parent_config.EmuRomPath : child_config.EmuRomPath;
 
                         
@@ -100,11 +98,11 @@
             c.GameImage = child_config.GameImage;
             return c;
         }
-        private List<IRomConfig> GenerateRomConfig(logger log, List<IRomConfigPair> roms, IEmuConfig config)
+        private List<IRomConfig> GenerateRomConfig(List<IRomConfigPair> roms, IEmuConfig config)
         {
             List<IRomConfig> romconfigs = new List<IRomConfig>();
-            log.WriteLine("Generating Rom Configs");
-            foreach (IRomConfigPair rom in roms) { romconfigs.Add(RomLoader.Load(log, rom.RomFile, rom.RomConfig)); }
+            gLog.Debug.WriteLine("Generating Rom Configs");
+            foreach (IRomConfigPair rom in roms) { romconfigs.Add(RomLoader.Load(rom.RomFile, rom.RomConfig)); }
             return romconfigs;
         }
 

 

  ViewVC Help
Powered by ViewVC 1.1.22