using QuikDawEditor.Properties; using System.Diagnostics; using System.Windows; using System.Windows.Controls; using static QuikDawEditor.EDITING.VstMethods; namespace QuikDawEditor { public partial class ManageVstsWindow : Window { public ManageVstsWindow() { InitializeComponent(); DataContext = this; VstEffectsLV.ItemsSource = ScannedVstEffectReferences; VstInstrumentsLV.ItemsSource = ScannedVstInstrumentReferences; CouldNotLoadVstsLV32bit.ItemsSource = ReturnedWithErrorVstReferences32bit; CouldNotLoadVstsLVIgnored.ItemsSource = ReturnedWithErrorVstReferencesIgnored; CouldNotLoadVstsLVOther.ItemsSource = ReturnedWithErrorVstReferencesOther; TVI32bit.Header = "32bit plugins (" + ReturnedWithErrorVstReferences32bit.Count.ToString() + ")"; TVIIgnored.Header = "Ignored plugins (" + ReturnedWithErrorVstReferencesIgnored.Count.ToString() + ")"; TVIOther.Header = "Other unloadable plugins (" + ReturnedWithErrorVstReferencesOther.Count.ToString() + ")"; } public string ErrorProducingVstsCountString { get { return "(" + Properties.Settings.Default.ErrorProducingVsts.Count + ")"; } } public string VstEffectsCountString { get { return "(" + ScannedVstEffectReferences.Count + ")"; } } public string VstInstrumentsCountString { get { return "(" + ScannedVstInstrumentReferences.Count + ")"; } } private void AddDirectoryBut_Click(object sender, RoutedEventArgs e) { System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog(); fbd.SelectedPath = Properties.Settings.Default.DataDirectory; if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (fbd.SelectedPath == "C:\\") MessageBox.Show("Do not select main C drive as VST directory"); else { Properties.Settings.Default.ScanVstDirectories.Add(fbd.SelectedPath); Properties.Settings.Default.Save(); ScanVstDirectoriesLV.Items.Refresh(); } } } private void DeleteDirButton_Click(object sender, RoutedEventArgs e) { Button b = (Button)sender; string thisString = (string)(b.DataContext); Properties.Settings.Default.ScanVstDirectories.Remove(thisString); Properties.Settings.Default.Save(); ScanVstDirectoriesLV.Items.Refresh(); } private void Window_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key == System.Windows.Input.Key.Escape) this.Close(); } private void TreeViewItem_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) { e.Handled = false; } private void VstDirPathTextBlock_PreviewMouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { TextBlock thisTB = (TextBlock)sender; Process.Start("explorer.exe", thisTB.Text); } private void RemoveCrashIgnoreMenuItem_Click(object sender, RoutedEventArgs e) { MenuItem thisMI = (MenuItem)sender; string pathString = (string)thisMI.DataContext; Settings.Default.ErrorProducingVsts.Remove(pathString); Settings.Default.Save(); CrashPluginsLV.Items.Refresh(); } } }