public void Initialize(Config config) { if (config == null) throw new ArgumentNullException("config"); HarmonicKeyDisplayMode = config.HarmonicKeyDisplayMode; RestrictBpmCompatibility = config.RestrictBpmCompatibility; StripMixedInKeyPrefixes = config.StripMixedInKeyPrefixes; SuggestBpmAdjustedTracks = config.SuggestBpmAdjustedTracks; AutoAdjustBpm = config.AutoAdjustBpm; ParseKeyAndBpmFromFilename = config.ParseKeyAndBpmFromFilename; }
public async Task InitializeAsync() { config = await reader.ReadAsync(filename); if (config == null) { log.Debug("Initializing MixPlanner with default config settings."); config = Config.DefaultConfig; await writer.WriteAsync(config, filename); } }
public async Task WriteAsync(Config config, string filename) { if (config == null) throw new ArgumentNullException("config"); if (filename == null) throw new ArgumentNullException("filename"); try { using (FileStream file = File.Open(filename, FileMode.Create, FileAccess.Write)) using (var writer = new StreamWriter(file)) { string json = await JsonConvert.SerializeObjectAsync( config, GlobalJsonSettings.Formatting, GlobalJsonSettings.Settings); await writer.WriteAsync(json); } } catch (Exception e) { Log.Error(String.Format("Error saving config {0}.", filename), e); } }
public async Task SaveAsync(Config config) { Config = config; await writer.WriteAsync(Config, filename); await Task.Run(() => messenger.SendToUI(new ConfigSavedEvent(config))); }
public ConfigSavedEvent(Config config) { if (config == null) throw new ArgumentNullException("config"); Config = config; }
public Task SaveAsync(Config config) { throw new System.NotImplementedException(); }