private void Window_Loaded(object sender, RoutedEventArgs e) { Window_SourceInitialized(this, null); Focus(); Topmost = true; Topmost = false; BringIntoView(); Activate(); Keyboard.Focus(this); loaderSettings = settings.GetMIDILoaderSettings(); var ls = loaderSettings.Clone(); audioThreads.Maximum = Environment.ProcessorCount; audioThresh.Value = ls.EventVelocityThreshold; visibleThresh.Value = ls.NoteVelocityThreshold; audioThreads.Value = ls.EventPlayerThreads; removeOverlaps.IsChecked = loaderSettings.RemoveOverlaps; if (settings.General.SkipLoadSettings) { ContinueLoading(); } }
public MIDIMemoryFile(string path, MIDILoaderSettings settings, CancellationToken cancel) : base(path, settings, cancel) { }
public KivaSettings() { if (!Directory.Exists(SettingsFolderPath)) { Directory.CreateDirectory(SettingsFolderPath); } versionPath = Path.Combine(SettingsFolderPath, "meta.kvs"); midiPath = Path.Combine(SettingsFolderPath, "midi.kvs"); generalPath = Path.Combine(SettingsFolderPath, "general.kvs"); loadingSettings loading = new loadingSettings(); bool saveSettings = false; if (File.Exists(versionPath)) { loading.version = LoadSetings <versionSettings>(versionPath); } else { loading.version = new versionSettings() { version = VersionName, enableUpdates = EnableUpdates, installed = Installed }; } if (File.Exists(midiPath)) { loading.midi = LoadSetings <MIDILoaderSettings>(midiPath); } else { loading.midi = new MIDILoaderSettings(); saveSettings = true; } if (File.Exists(generalPath)) { loading.general = LoadSetings <GeneralSettings>(generalPath); } else { loading.general = new GeneralSettings(); saveSettings = true; } VersionName = (string)loading.version.version; EnableUpdates = (bool)loading.version.enableUpdates; Installed = (bool)loading.version.installed; if (saveSettings) { SaveSetings(loading.midi, midiPath); SaveSetings(loading.general, generalPath); } loaderSettings = (MIDILoaderSettings)loading.midi; General = loading.general; PaletteSettings.Reload(); if (!PaletteSettings.Palettes.ContainsKey(General.PaletteName)) { General.PaletteName = PaletteSettings.Palettes.Keys.First(); } General.PropertyChanged += (s, e) => { SaveSetings(General, generalPath); }; }
public void UpdateMIDILoaderSettings(MIDILoaderSettings s) { SaveSetings(s, midiPath); }