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

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

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

revision 112 by william, Thu Aug 23 04:13:19 2012 UTC revision 126 by william, Thu Aug 23 04:47:35 2012 UTC
# Line 31  namespace EmuXPortal.Api Line 31  namespace EmuXPortal.Api
31          string GameExeArgs { get; }          string GameExeArgs { get; }
32    
33    
34          void RefreshConfig();          void RefreshConfig(logger log);
35          void ReleasePlatformImageResource();          void ReleasePlatformImageResource();
36      }      }
37    
# Line 46  namespace EmuXPortal.Api Line 46  namespace EmuXPortal.Api
46          public static IEmuConfig Load(logger log,string config_path, string rom_path) { return new EmuConfig().Create(log, config_path, rom_path); }          public static IEmuConfig Load(logger log,string config_path, string rom_path) { return new EmuConfig().Create(log, config_path, rom_path); }
47          #endregion          #endregion
48          #region parse emu options          #region parse emu options
49          public static string GetEMUOptions(IRomConfig config)          public static string GetEMUOptions(logger log, IRomConfig config)
50          {          {
51              EMUOptions EMUOptions = new EMUOptions(config);              EMUOptions EMUOptions = new EMUOptions(log, config);
52              return EMUOptions.Options;              return EMUOptions.Options;
53          }          }
54          #endregion          #endregion
# Line 60  namespace EmuXPortal.Api Line 60  namespace EmuXPortal.Api
60              private const string ROM_PATH = "%ROM_PATH%";              private const string ROM_PATH = "%ROM_PATH%";
61              #endregion              #endregion
62              private Dictionary<string, string> options_dict = new Dictionary<string, string>();              private Dictionary<string, string> options_dict = new Dictionary<string, string>();
63              public EMUOptions(IRomConfig config)              public EMUOptions(logger log, IRomConfig config)
64              {              {
65                  init_dict(config);                  init_dict(config);
66                  config.Config.RefreshConfig();                  config.Config.RefreshConfig(log);
67                  string options = config.Config.EmuOptions;                  string options = config.Config.EmuOptions;
68                  string real_options = options;                  string real_options = options;
69                  foreach (KeyValuePair<string, string> pair in options_dict) { if (options.ToLower().Contains(pair.Key.ToLower())) { real_options = real_options.ToLower().Replace(pair.Key.ToLower(), pair.Value); } }                  foreach (KeyValuePair<string, string> pair in options_dict) { if (options.ToLower().Contains(pair.Key.ToLower())) { real_options = real_options.ToLower().Replace(pair.Key.ToLower(), pair.Value); } }
# Line 343  namespace EmuXPortal.Api Line 343  namespace EmuXPortal.Api
343              {              {
344                  return this.PlatformNameLong.CompareTo(obj.PlatformNameLong);                  return this.PlatformNameLong.CompareTo(obj.PlatformNameLong);
345              }              }
346              public void RefreshConfig()              public void RefreshConfig(logger log)
347              {              {
348                  log.WriteLine("Refreshing config for: {0} from {1}", this.ToString(), string.Format(@"{0}\{1}", EmuRomPath, EMU_CONFIG));                  log.WriteLine("Refreshing config for: {0} from {1}", this.ToString(), string.Format(@"{0}\{1}", EmuRomPath, EMU_CONFIG));
349                  this.Create(log,EmuRomPath);                  this.Create(log,EmuRomPath);

Legend:
Removed from v.112  
changed lines
  Added in v.126

  ViewVC Help
Powered by ViewVC 1.1.22