private void MTT_Click(object sender, EventArgs e) { MTT.Checked = !MTT.Checked; Properties.Settings.Default.MinimizeToTray = MTT.Checked; Properties.Settings.Default.Save(); if (Properties.Settings.Default.MinimizeToTray || Properties.Settings.Default.ShowBalloon) { NotifyArea.ShowIconTray(); } else { NotifyArea.HideIconTray(); } }
private void MainWindow_Load(object sender, EventArgs e) { // Initialize the menu Menu = ConverterMenu; // Initialize context menu for MIDIs list MIDIList.ContextMenu = ListMenu; Title = Text; SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); // Initialize threads KMCThreads.ConversionProcess.DoWork += ConverterFunctions.CPWork; KMCThreads.ConversionProcessRT.DoWork += ConverterFunctions.CPRWork; KMCThreads.PlaybackProcess.DoWork += ConverterFunctions.PBWork; KMCThreads.PlaybackProcessRT.DoWork += ConverterFunctions.PBRWork; // Notification icon in the system tray if (Properties.Settings.Default.MinimizeToTray || Properties.Settings.Default.ShowBalloon) { NotifyArea.ShowIconTray(); } // Initialize values for (int i = 0; i < 8; i++) { VSTs.VSTInfo[i] = new BASS_VST_INFO(); } try { // Generic settings VolumeBar.Value = Convert.ToInt32(Properties.Settings.Default.Volume * 10000.0f).LimitToRange(0, 10000); // Load settings CSFFS.Checked = Properties.Settings.Default.AudioEvents; ACFUWSTC.Checked = Properties.Settings.Default.AutoUpdateCheck; SCPIOTL.Checked = Properties.Settings.Default.ShowOldTimeInfo; RenderStandard.Checked = !Properties.Settings.Default.RealTimeSimulator; RenderRTS.Checked = Properties.Settings.Default.RealTimeSimulator; SBIOMB.Checked = Properties.Settings.Default.ShowBalloon; AFIT.Checked = Properties.Settings.Default.AskForIgnoreTracks; MTT.Checked = Properties.Settings.Default.MinimizeToTray; ChangeLanguage.Enabled = !Program.DebugLang; KMCThreads.GarbageCollector.DoWork += BasicFunctions.GCWork; KMCThreads.GarbageCollector.RunWorkerAsync(); KMCThreads.GetInfoWorker.DoWork += ConverterFunctions.GIWWork; KMCThreads.GetInfoWorker.RunWorkerAsync(); KMCThreads.RenderingTimer.Tick += ConverterFunctions.RTTick; KMCThreads.RenderingTimer.Interval = 10; KMCThreads.RenderingTimer.Enabled = true; KMCThreads.RenderingTimer.Start(); } catch (Exception exception2) { ErrorHandler errordialog = new ErrorHandler(Languages.Parse("FatalError"), exception2.ToString(), 1, 0); errordialog.ShowDialog(); } //Check if there are soundfonts if (SoundFonts != null) { SoundFontChain.SoundFonts = new String[SoundFonts.Count]; SoundFonts.CopyTo(SoundFontChain.SoundFonts, 0); foreach (String SF in SoundFonts) { KMCDialogs.SFDialog.SFList.Items.Add(SF); } } // Check if there are MIDIs if (MIDIs != null) { new AddingMIDIs(MIDIs.ToArray(), true).ShowDialog(); } }