コード例 #1
0
 public static void CloseApp()
 {
     Bass.BASS_StreamFree(KMCGlobals._recHandle);
     Bass.BASS_Free();
     if (Program.DeleteEncoder == true)
     {
         File.Delete(Program.OGGEnc);
         File.Delete(Program.MP3Enc);
     }
     NotifyArea.HideIconTray();
     Properties.Settings.Default.Save();
     Application.Exit();
 }
コード例 #2
0
 protected override void OnSizeChanged(EventArgs e)
 {
     base.OnSizeChanged(e);
     if (WindowState.Equals(FormWindowState.Minimized) && Properties.Settings.Default.MinimizeToTray)
     {
         Hide();
         if (Properties.Settings.Default.FirstTimeTray != false)
         {
             NotifyArea.ShowStatusTray(Languages.Parse("Information"), Languages.Parse("MinimizedToTray"), ToolTipIcon.Info);
             Properties.Settings.Default.FirstTimeTray = false;
             Properties.Settings.Default.Save();
         }
     }
 }
コード例 #3
0
        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();
            }
        }
コード例 #4
0
ファイル: BASSControl.cs プロジェクト: walney/KMC
        public static void BASSCloseStream(string message, string title, int type)
        {
            // Reset
            ReleaseResources(false, true);

            // Show message
            if (type == 0)
            {
                if (Properties.Settings.Default.ShowBalloon)
                {
                    MainWindow.Delegate.Invoke((MethodInvoker) delegate {
                        NotifyArea.ShowStatusTray(title, message, ToolTipIcon.Info);
                    });
                }
                else
                {
                    MainWindow.Delegate.Invoke((MethodInvoker) delegate {
                        MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    });
                }
            }
            else
            {
                if (Properties.Settings.Default.ShowBalloon)
                {
                    MainWindow.Delegate.Invoke((MethodInvoker) delegate {
                        NotifyArea.ShowStatusTray(title, message, ToolTipIcon.Info);
                    });
                }
            }

            // Last stuff then BOOPERS
            MainWindow.KMCGlobals.CancellationPendingValue = MainWindow.KMCConstants.IDLE;
            MainWindow.KMCGlobals.CurrentStatusTextString  = null;
            BasicFunctions.PlayConversionStop();
        }
コード例 #5
0
        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();
            }
        }