Exemplo n.º 1
0
        private void OverrideLanguage_Load(object sender, EventArgs e)
        {
            try
            {
                // First of all, add all the languages to the combobox
                foreach (string x in Languages.LanguagesAvailable)
                {
                    LangSel.Items.Add(x);
                }

                // Then scan
                for (int i = 0; i <= Languages.LanguagesCodes.Length; i++)
                {
                    if (String.Equals(Languages.LanguagesCodes[i], Properties.Settings.Default.SelectedLang))
                    {
                        LangSel.SelectedIndex = i;
                        break;
                    }
                }

                // Then check if the override is enabled
                OverrideLanguageCheck.Checked = Properties.Settings.Default.LangOverride;
                LangSel.Enabled = Properties.Settings.Default.LangOverride;
            }
            catch (Exception ex)
            {
                ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(Languages.Parse("Error"), ex.ToString(), 0, 1);
                errordialog.ShowDialog();
            }
        }
Exemplo n.º 2
0
        private void Informations_Load(object sender, EventArgs e)
        {
            try
            {
                // Auto-update stuff
                System.Reflection.Assembly assembly  = System.Reflection.Assembly.GetExecutingAssembly();
                FileVersionInfo            Converter = FileVersionInfo.GetVersionInfo(assembly.Location);
                ThisVersion.Text = String.Format(MainWindow.res_man.GetString("CurrentVersion", MainWindow.cul), Converter.FileVersion.ToString());

                KeppyVer.Text = "Keppy's MIDI Converter " + Application.ProductVersion + ", by KaleidonKep99";
                if (IntPtr.Size == 8)
                {
                    Versionlabel.Text = String.Format(MainWindow.res_man.GetString("VersionLabel", MainWindow.cul), "x64", "SSE2");
                }
                else if (IntPtr.Size == 4)
                {
                    Versionlabel.Text = String.Format(MainWindow.res_man.GetString("VersionLabel", MainWindow.cul), "x86", "MMX");
                }

                TranslationInfo.Text = "Translated by " +
                                       MainWindow.res_man.GetString("ZZZTranslators", MainWindow.cul);
            }
            catch (Exception exception)
            {
                KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(MainWindow.res_man.GetString("FatalError", MainWindow.cul), exception.ToString(), 1, 0);
                errordialog.ShowDialog();
            }
        }
Exemplo n.º 3
0
        // Language overrides

        public static void ChangeLanguage(string selectedlanguage)
        {
            try
            {
                Properties.Settings.Default.SelectedLang = selectedlanguage;
                Properties.Settings.Default.Save();
            }
            catch (Exception exception)
            {
                KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler("Error", exception.ToString(), 0, 0);
                errordialog.ShowDialog();
            }
        }
Exemplo n.º 4
0
        public AdvancedSettings()
        {
            InitializeComponent();
            Delegate = this;
            InitializeLanguage();

            try
            {
                // W8
                if (MainWindow.KMCStatus.IsKMCBusy == true && MainWindow.KMCStatus.RenderingMode == false)
                {
                    AudioFreqLabel.Enabled = false;
                    FrequencyBox.Enabled   = false;
                    Label6.Enabled         = false;
                }
                else
                {
                    AudioFreqLabel.Enabled = true;
                    FrequencyBox.Enabled   = true;
                    Label6.Enabled         = true;
                }
                // K DONE
                MaxVoices.Value         = Properties.Settings.Default.Voices.LimitToRange(0, (Int32)MaxVoices.Maximum);
                OverrideTempoNow.Text   = String.Format(Languages.Parse("OverrideTempo"), MainWindow.KMCGlobals.OriginalTempo.ToString());
                FrequencyBox.Text       = Convert.ToString(Properties.Settings.Default.AudioFreq);
                SincInter.Checked       = Properties.Settings.Default.SincInter;
                BitrateBox.Text         = Convert.ToString(Properties.Settings.Default.Bitrate);
                RTFPS.Value             = Convert.ToDecimal(Properties.Settings.Default.RealTimeFPS);
                IgnoreNotes1.Checked    = Properties.Settings.Default.IgnoreNotes1;
                LoVel.Value             = Properties.Settings.Default.IgnoreNotesLow;
                HiVel.Value             = Properties.Settings.Default.IgnoreNotesHigh;
                Limit88.Checked         = Properties.Settings.Default.Limit88;
                Noteoff1.Checked        = Properties.Settings.Default.NoteOff1;
                FXDisable.Checked       = Properties.Settings.Default.DisableEffects;
                ConstantBitrate.Checked = Properties.Settings.Default.OverrideBitrate;
                TempoValue.Enabled      = OverrideTempoNow.Checked = Properties.Settings.Default.OverrideTempo;
                //
            }
            catch (Exception ex)
            {
                ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(Languages.Parse("FatalError"), ex.ToString(), 1, 0);
            }
        }
Exemplo n.º 5
0
        private void LoadVST(ref String VSTDLL, ref String VSTDLLDesc, ref Label Desc, ref Button Unload, ref Button Load, Int32 NumVST)
        {
            try
            {
                int status = 0;

                if (ModifierKeys == Keys.Shift)
                {
                    status = 1;
                }
                else if (ModifierKeys == Keys.Control)
                {
                    if (NumVST == 1)
                    {
                        if (Properties.Settings.Default.VSTiDisclaimer)
                        {
                            DialogResult dialogResult = MessageBox.Show(Languages.Parse("LegalWarningVSTi"), String.Format("{0} {1} - {2}", Program.Who, Program.Title, Languages.Parse("Warning")), MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                            if (dialogResult == DialogResult.Yes)
                            {
                                Properties.Settings.Default.VSTiDisclaimer = false;
                                Properties.Settings.Default.Save();
                                status = 2;
                                MessageBox.Show(Languages.Parse("VSTiModeOnLegal"), String.Format("{0} {1} - {2}", Program.Who, Program.Title, Languages.Parse("Warning")), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            }
                            else if (dialogResult == DialogResult.No)
                            {
                                Properties.Settings.Default.VSTiDisclaimer = true;
                                Properties.Settings.Default.Save();
                                return;
                            }
                        }
                        else
                        {
                            status = 2;
                            MessageBox.Show(Languages.Parse("VSTiModeOn"), String.Format("{0} {1} - {2}", Program.Who, Program.Title, Languages.Parse("Warning")), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                    else
                    {
                        status = 0;
                    }
                }

                InitStartDirectory();
                if (VSTImportDialog.ShowDialog() == DialogResult.OK)
                {
                    if (status == 1)
                    {
                        VSTDLL     = VSTImportDialog.FileName;
                        VSTDLLDesc = String.Format("{0} - ({1})", VSTImportDialog.FileName, Languages.Parse("NotVerified"));
                        Desc.Text  = String.Format("{0} - ({1})", VSTImportDialog.FileName, Languages.Parse("NotVerified"));
                        Bass.BASS_Free();
                        Unload.Enabled = true;
                        Load.Enabled   = false;
                        SaveDirectory(VSTImportDialog.FileName);
                    }
                    else if (status == 2)
                    {
                        Bass.BASS_Init(0, 44100, BASSInit.BASS_DEVICE_NOSPEAKER, IntPtr.Zero);
                        int VSTiTester = BassVst.BASS_VST_ChannelCreate(44100, 2, VSTImportDialog.FileName, BASSFlag.BASS_STREAM_DECODE);
                        MainWindow.VSTs.VSTInfo[NumVST - 1] = new BASS_VST_INFO();
                        bool Success = BassVst.BASS_VST_GetInfo(VSTiTester, MainWindow.VSTs.VSTInfo[NumVST - 1]);
                        Bass.BASS_Free();
                        if (Success)
                        {
                            String Lab = String.Format(Languages.Parse("VSTNameAndVersion"), MainWindow.VSTs.VSTInfo[NumVST - 1].productName, MainWindow.VSTs.VSTInfo[NumVST - 1].vendorName, MainWindow.VSTs.VSTInfo[NumVST - 1].vendorVersion);
                            VSTDLL         = VSTImportDialog.FileName;
                            VSTDLLDesc     = Lab;
                            Desc.Text      = Lab;
                            Unload.Enabled = true;
                            Load.Enabled   = false;
                            SaveDirectory(VSTImportDialog.FileName);
                        }
                        else
                        {
                            MessageBox.Show(String.Format(Languages.Parse("InvalidVSTLoaded"), Path.GetFileNameWithoutExtension(VSTImportDialog.FileName), bitreq, bitnow), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                        }
                    }
                    else
                    {
                        Un4seen.Bass.Bass.BASS_Init(0, 44100, BASSInit.BASS_DEVICE_NOSPEAKER, IntPtr.Zero);
                        int  Test      = Bass.BASS_StreamCreateDummy(44100, 2, BASSFlag.BASS_STREAM_DECODE, IntPtr.Zero);
                        int  VSTTester = BassVst.BASS_VST_ChannelSetDSP(Test, VSTImportDialog.FileName, BASSVSTDsp.BASS_VST_DEFAULT, 1);
                        bool Success   = BassVst.BASS_VST_GetInfo(VSTTester, MainWindow.VSTs.VSTInfo[NumVST - 1]);
                        if (Success)
                        {
                            VSTDLL     = VSTImportDialog.FileName;
                            VSTDLLDesc = String.Format(Languages.Parse("VSTNameAndVersion"), MainWindow.VSTs.VSTInfo[NumVST - 1].productName, MainWindow.VSTs.VSTInfo[NumVST - 1].vendorName, MainWindow.VSTs.VSTInfo[NumVST - 1].vendorVersion);
                            Desc.Text  = String.Format(Languages.Parse("VSTNameAndVersion"), MainWindow.VSTs.VSTInfo[NumVST - 1].productName, MainWindow.VSTs.VSTInfo[NumVST - 1].vendorName, MainWindow.VSTs.VSTInfo[NumVST - 1].vendorVersion);
                            Bass.BASS_Free();
                            Unload.Enabled = true;
                            Load.Enabled   = false;
                            SaveDirectory(VSTImportDialog.FileName);
                        }
                        else
                        {
                            MessageBox.Show(String.Format(Languages.Parse("InvalidVSTLoaded"), Path.GetFileNameWithoutExtension(VSTImportDialog.FileName), bitreq, bitnow), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                        }
                        BassVst.BASS_VST_ChannelRemoveDSP(Test, VSTTester);
                        Bass.BASS_StreamFree(Test);
                        Bass.BASS_Free();
                    }
                }
            }
            catch (Exception ex)
            {
                KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(Languages.Parse("Error"), ex.ToString(), 0, 1);
                errordialog.ShowDialog();
            }
        }
Exemplo n.º 6
0
 private void AdvancedSettings_Load(object sender, EventArgs e)
 {
     try
     {
         InitializeLanguage();
         // W8
         if (MainWindow.KMCGlobals.IsKMCBusy == true && MainWindow.KMCGlobals.RenderingMode == false)
         {
             Label5.Enabled       = false;
             FrequencyBox.Enabled = false;
             Label6.Enabled       = false;
             checkBox1.Text       = String.Format(MainWindow.res_man.GetString("OverrideTempo2", MainWindow.cul), MainWindow.KMCGlobals.OriginalTempo.ToString());
         }
         else
         {
             Label5.Enabled       = true;
             FrequencyBox.Enabled = true;
             Label6.Enabled       = true;
             checkBox1.Text       = String.Format(MainWindow.res_man.GetString("OverrideTempo1", MainWindow.cul), MainWindow.KMCGlobals.OriginalTempo.ToString());
         }
         // K DONE
         FrequencyBox.Text = Convert.ToString(Properties.Settings.Default.AudioFreq);
         BitrateBox.Text   = Convert.ToString(Properties.Settings.Default.OGGBitrate);
         RTFPS.Value       = Convert.ToDecimal(MainWindow.KMCGlobals.RTFPS);
         //
         if (Properties.Settings.Default.NoteOff1)
         {
             MainWindow.KMCGlobals.NoteOff1Event = true;
             Noteoff1.Checked = true;
         }
         else
         {
             MainWindow.KMCGlobals.NoteOff1Event = false;
             Noteoff1.Checked = false;
         }
         if (Properties.Settings.Default.DisableFX)
         {
             MainWindow.KMCGlobals.FXDisabled = true;
             FXDisable.Checked = true;
         }
         else
         {
             MainWindow.KMCGlobals.FXDisabled = false;
             FXDisable.Checked = false;
         }
         if (Properties.Settings.Default.OverrideOGG)
         {
             checkBox3.Checked = true;
         }
         else
         {
             checkBox3.Checked = false;
         }
         if (Properties.Settings.Default.TempoOverride)
         {
             label2.Enabled   = true;
             TempoVal.Enabled = true;
         }
         else
         {
             label2.Enabled   = false;
             TempoVal.Enabled = false;
         }
     }
     catch (Exception ex)
     {
         KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(MainWindow.res_man.GetString("FatalError", MainWindow.cul), ex.ToString(), 1, 0);
     }
 }
        private void forceCloseTheApplicationToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = MessageBox.Show(res_man.GetString("CrashQuestion", cul), "Hey!", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
            if (dialogResult == DialogResult.Yes)
            {
                this.Enabled = false;
                KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(res_man.GetString("FatalError", cul), res_man.GetString("CrashTriggeredByUser", cul), 1, 0);
                errordialog.ShowDialog();
                Application.Exit();
            }
            else if (dialogResult == DialogResult.No)
            {

            }
        }
 private void enabledToolStripMenuItem5_Click(object sender, EventArgs e)
 {
     try
     {
         enabledToolStripMenuItem5.Checked = true;
         disabledToolStripMenuItem5.Checked = false;
         Registry.CurrentUser.CreateSubKey("SOFTWARE\\Keppy's MIDI Converter\\Languages", Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree);
         RegistryKey Language = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Keppy's MIDI Converter\\Languages", true);
         Language.SetValue("langoverride", "1", Microsoft.Win32.RegistryValueKind.DWord);
         Language.Close();
         InitializeLanguage();
         // List
         ChineseCNOverride.Enabled = true;
         ChineseHKOverride.Enabled = true;
         ChineseTWOverride.Enabled = true;
         DutchOverride.Enabled = true;
         EnglishOverride.Enabled = true;
         EstonianOverride.Enabled = true;
         FrenchOverride.Enabled = true;
         GermanOverride.Enabled = true;
         IndonesianOverride.Enabled = true;
         ItalianOverride.Enabled = true;
         JapaneseOverride.Enabled = true;
         SpanishOverride.Enabled = true;
         TurkishOverride.Enabled = true;
     }
     catch (Exception exception)
     {
         KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler("Error", exception.Message.ToString(), 0, 0);
         errordialog.ShowDialog();
     }
 }
 private void enabledToolStripMenuItem2_Click(object sender, EventArgs e)
 {
     try
     {
         enabledToolStripMenuItem2.Checked = true;
         disabledToolStripMenuItem2.Checked = false;
         KMCGlobals.OldTimeThingy = true;
         Registry.CurrentUser.CreateSubKey("SOFTWARE\\Keppy's MIDI Converter\\Settings", Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree);
         RegistryKey Settings = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Keppy's MIDI Converter\\Settings", true);
         Settings.SetValue("oldtimethingy", "1", Microsoft.Win32.RegistryValueKind.DWord);
         Settings.Close();
     }
     catch (Exception exception)
     {
         KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler("Error", exception.ToString(), 0, 0);
         errordialog.ShowDialog();
     }
 }
Exemplo n.º 10
0
 // Language overrides
 private void ChangeLanguage(string selectedlanguage)
 {
     try
     {
         Registry.CurrentUser.CreateSubKey("SOFTWARE\\Keppy's MIDI Converter\\Languages", Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree);
         RegistryKey Settings = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Keppy's MIDI Converter\\Languages", true);
         Settings.SetValue("selectedlanguage", selectedlanguage, Microsoft.Win32.RegistryValueKind.String);
         Settings.Close();
         AdvancedSettings example = new AdvancedSettings();
         InitializeLanguage();
     }
     catch (Exception exception)
     {
         KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler("Error", exception.Message.ToString(), 0, 0);
         errordialog.ShowDialog();
     }
 }
Exemplo n.º 11
0
 private void BASSCloseStreamCrash(Exception ex)
 {
     BassEnc.BASS_Encode_Stop(Globals._Encoder);
     Bass.BASS_StreamFree(Globals._recHandle);
     Bass.BASS_Free();
     Globals.NewWindowName = "Keppy's MIDI Converter";
     Globals.RenderingMode = false;
     KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(res_man.GetString("NewValueTempo", cul), ex.ToString(), 0, 1);
     errordialog.ShowDialog();
 }
Exemplo n.º 12
0
 private void VolumeBar_Scroll(object sender, EventArgs e)
 {
     try
     {
         Registry.CurrentUser.CreateSubKey("SOFTWARE\\Keppy's MIDI Converter\\Settings", Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree);
         RegistryKey Settings = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Keppy's MIDI Converter\\Settings", true);
         Settings.SetValue("volume", VolumeBar.Value.ToString(), Microsoft.Win32.RegistryValueKind.DWord);
         Globals.Volume = Convert.ToInt32(this.VolumeBar.Value);
         Settings.Close();
         VolumeTip.SetToolTip(VolumeBar, Convert.ToString(Convert.ToInt32(Globals.Volume / 100)) + "%");
     }
     catch (Exception exception)
     {
         KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(res_man.GetString("Error", cul), exception.Message.ToString(), 0, 0);
         errordialog.ShowDialog();
     }
 }
Exemplo n.º 13
0
 private void VoiceLimit_ValueChanged(object sender, EventArgs e)
 {
     try
     {
         Registry.CurrentUser.CreateSubKey("SOFTWARE\\Keppy's MIDI Converter\\Settings", Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree);
         RegistryKey Settings = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Keppy's MIDI Converter\\Settings", true);
         Settings.SetValue("voices", VoiceLimit.Value.ToString(), Microsoft.Win32.RegistryValueKind.DWord);
         Globals.LimitVoicesInt = Convert.ToInt32(VoiceLimit.Value.ToString());
         Settings.Close();
     }
     catch (Exception exception)
     {
         KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(res_man.GetString("Error", cul), exception.Message.ToString(), 0, 0);
         errordialog.ShowDialog();
     }
 }
Exemplo n.º 14
0
 private void MainWindow_Load(object sender, EventArgs e)
 {
     BassNet.Registration("*****@*****.**", "2X203132524822");
     this.Menu = DefaultMenu;
     MIDIList.ContextMenu = DefMenu;
     // Fade in
     t1.Interval = 10; // Increases opacity every 10ms
     t1.Tick += new EventHandler(fadeIn);  // This calls the function that changes opacity
     t1.Start();
     // Fade in
     if (Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 1)
     {
         if (Environment.OSVersion.Version.Build == 2600)
         {
             // Continues
         }
         else
         {
             // If you're using Windows XP SP1 or older, the converter will close itself.
             KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(res_man.GetString("WinXPSP1NotSupportedTitle", cul), res_man.GetString("WinXPSP1NotSupportedMessage", cul), 1, 0);
             errordialog.ShowDialog();
             this.Hide();
             Application.ExitThread();
         }
     }
     else
     {
         try
         {
             RegistryKey Key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Keppy's MIDI Converter");
             if (Key != null)
             {
                 RegistryKey Language = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Keppy's MIDI Converter\\Languages", true);
                 try
                 {
                     if (Convert.ToInt32(Language.GetValue("langoverride", 0)) == 1)
                     {
                         enabledToolStripMenuItem5.PerformClick();
                     }
                     else
                     {
                         disabledToolStripMenuItem5.PerformClick();
                     }
                 }
                 catch
                 {
                     enabledToolStripMenuItem5.Checked = false;
                     disabledToolStripMenuItem5.Checked = true;
                     Language.SetValue("langoverride", "0", RegistryValueKind.DWord);
                 }
                 RegistryKey Settings = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Keppy's MIDI Converter\\Settings", true);
                 try
                 {
                     // Generic settings
                     VoiceLimit.Value = Convert.ToInt32(Settings.GetValue("voices", 1000));
                     VolumeBar.Value = Convert.ToInt32(Settings.GetValue("volume", 10000));
                     Globals.Volume = Convert.ToInt32(Settings.GetValue("volume", 10000));
                     Globals.Frequency = Convert.ToInt32(Settings.GetValue("audiofreq", 44100));
                     Globals.Bitrate = Convert.ToInt32(Settings.GetValue("oggbitrate", 256));
                     // Audio events
                     if (Convert.ToInt32(Settings.GetValue("audioevents", 1)) == 1)
                     {
                         enabledToolStripMenuItem4.Checked = true;
                         disabledToolStripMenuItem4.Checked = false;
                         Settings.SetValue("audioevents", "1", RegistryValueKind.DWord);
                     }
                     else
                     {
                         enabledToolStripMenuItem4.Checked = false;
                         disabledToolStripMenuItem4.Checked = true;
                         Settings.SetValue("audioevents", "0", RegistryValueKind.DWord);
                     }
                     // Autoupdate lel
                     if (Convert.ToInt32(Settings.GetValue("autoupdatecheck", 1)) == 1)
                     {
                         enabledToolStripMenuItem3.Checked = true;
                         disabledToolStripMenuItem3.Checked = false;
                         Settings.SetValue("autoupdatecheck", "1", RegistryValueKind.DWord);
                     }
                     else
                     {
                         enabledToolStripMenuItem3.Checked = false;
                         disabledToolStripMenuItem3.Checked = true;
                         Settings.SetValue("autoupdatecheck", "0", RegistryValueKind.DWord);
                     }
                     // Old time thingy for TheGhastModding lel
                     if (Convert.ToInt32(Settings.GetValue("oldtimethingy", 0)) == 1)
                     {
                         enabledToolStripMenuItem2.Checked = true;
                         disabledToolStripMenuItem2.Checked = false;
                         Globals.OldTimeThingy = true;
                         Settings.SetValue("oldtimethingy", "1", RegistryValueKind.DWord);
                     }
                     else
                     {
                         enabledToolStripMenuItem2.Checked = false;
                         disabledToolStripMenuItem2.Checked = true;
                         Globals.OldTimeThingy = false;
                         Settings.SetValue("oldtimethingy", "0", RegistryValueKind.DWord);
                     }
                     // Note off setting
                     if (Convert.ToInt32(Settings.GetValue("noteoff1", 0)) == 1)
                     {
                         Globals.NoteOff1Event = true;
                         Settings.SetValue("noteoff1", "1", RegistryValueKind.DWord);
                     }
                     else
                     {
                         Globals.NoteOff1Event = false;
                         Settings.SetValue("noteoff1", "0", RegistryValueKind.DWord);
                     }
                     // BASS default sound effects (Reverb and chorus)
                     if (Convert.ToInt32(Settings.GetValue("disablefx", 0)) == 1)
                     {
                         Globals.FXDisabled = true;
                         Settings.SetValue("disablefx", "1", RegistryValueKind.DWord);
                     }
                     else
                     {
                         Globals.FXDisabled = false;
                         Settings.SetValue("disablefx", "0", RegistryValueKind.DWord);
                     }
                     // OGG bitrate override
                     if (Convert.ToInt32(Settings.GetValue("overrideogg", 0)) == 1)
                     {
                         Globals.QualityOverride = true;
                         Settings.SetValue("overrideogg", "1", RegistryValueKind.DWord);
                     }
                     else
                     {
                         Globals.QualityOverride = false;
                         Settings.SetValue("overrideogg", "0", RegistryValueKind.DWord);
                     }
                     Globals.MIDILastDirectory = Settings.GetValue("lastmidifolder", System.Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)).ToString();
                     Globals.ExportLastDirectory = Settings.GetValue("lastexportfolder", System.Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)).ToString();
                     Settings.Close();
                 }
                 catch (Exception exception)
                 {
                     KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(res_man.GetString("FatalError", cul), exception.Message.ToString(), 1, 0);
                     errordialog.ShowDialog();
                     Settings.Close();
                 }
             }
             else if (Key == null)
             {
                 Registry.CurrentUser.CreateSubKey("SOFTWARE\\Keppy's MIDI Converter\\Settings");
                 RegistryKey Settings = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Keppy's MIDI Converter\\Settings", true);
                 VoiceLimit.Value = 100000;
                 Settings.SetValue("voices", "100000", RegistryValueKind.DWord);
                 Settings.SetValue("lastmidifolder", "", RegistryValueKind.String);
                 Settings.SetValue("lastsffolder", "", RegistryValueKind.String);
                 Settings.SetValue("lastexportfolder", "", RegistryValueKind.String);
                 Settings.SetValue("audioevents", "1", RegistryValueKind.DWord);
                 Settings.SetValue("autoupdatecheck", "1", RegistryValueKind.DWord);
                 Settings.SetValue("oldtimethingy", "0", RegistryValueKind.DWord);
                 Settings.SetValue("noteoff1", "0", RegistryValueKind.DWord);
                 Settings.SetValue("disablefx", "0", RegistryValueKind.DWord);
                 Settings.SetValue("maxcpu", "0", RegistryValueKind.DWord);
                 Settings.SetValue("audiofreq", "44100", RegistryValueKind.DWord);
                 Settings.SetValue("volume", "10000", RegistryValueKind.DWord);
                 Settings.Close();
             }
         }
         catch (Exception exception2)
         {
             KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(res_man.GetString("Error", cul), exception2.ToString(), 0, 0);
             errordialog.ShowDialog();
         }
         Globals.AutoShutDownEnabled = false;
         Globals.AutoClearMIDIListEnabled = false;
     }
 }
        private void Informations_Load(object sender, EventArgs e)
        {
            InitializeLanguage();
            try
            {
                // Auto-update stuff
                System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
                string SAS = null;
                FileVersionInfo Converter = FileVersionInfo.GetVersionInfo(assembly.Location);
                ThisVersion.Text = String.Format(res_man.GetString("CurrentVersion", cul), Converter.FileVersion.ToString());

                // STUFF
                if (IntPtr.Size == 8)
                {
                    Versionlabel.Text = String.Format(res_man.GetString("VersionLabel", cul), "64-bit", "SSE2");
                    SAS = "x64";
                }
                else if (IntPtr.Size == 4)
                {
                    Versionlabel.Text = String.Format(res_man.GetString("VersionLabel", cul), "32-bit", "MMX");
                    SAS = "x86";
                }
                KeppyVer.Text = "Keppy's MIDI Converter " + Application.ProductVersion + ", by KaleidonKep99";

                // OTHER STUFF
                FileVersionInfo basslibver = FileVersionInfo.GetVersionInfo(ExePath.ExecutablePath + @"\bass.dll");
                FileVersionInfo bassmidilibver = FileVersionInfo.GetVersionInfo(ExePath.ExecutablePath + @"\bassmidi.dll");
                FileVersionInfo bassenclibver = FileVersionInfo.GetVersionInfo(ExePath.ExecutablePath + @"\bassenc.dll");
                FileVersionInfo bassvstlibver = FileVersionInfo.GetVersionInfo(ExePath.ExecutablePath + @"\bass_vst.dll");

                // Print the file name and version number.
                String.Format(res_man.GetString("LibraryVersion", cul), basslibver.FileDescription, basslibver.FileVersion, basslibver.FilePrivatePart);
                BASSINFO.Text = String.Format(res_man.GetString("LibraryVersion", cul), basslibver.FileDescription, basslibver.FileVersion, basslibver.FilePrivatePart) +"\n" +
                    String.Format(res_man.GetString("LibraryVersion", cul), bassmidilibver.FileDescription, bassmidilibver.FileVersion, bassmidilibver.FilePrivatePart) + "\n" +
                    String.Format(res_man.GetString("LibraryVersion", cul), bassenclibver.FileDescription, bassenclibver.FileVersion, bassenclibver.FilePrivatePart) + "\n" +
                    String.Format(res_man.GetString("LibraryVersion", cul), bassvstlibver.FileDescription, bassvstlibver.FileVersion, bassvstlibver.FilePrivatePart);

                BASSINFO2.Text = "Translated by\n" +
                    res_man.GetString("ZZZTranslators", cul) + "\n\n" +
                     "KMC " + Application.ProductVersion + " " + SAS;
            }
            catch (Exception exception)
            {
                KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(res_man.GetString("FatalError", cul), exception.ToString(), 1, 0);
                errordialog.ShowDialog();
            }
        }
 private void BASSCloseStreamCrash(Exception ex)
 {
     Bass.BASS_StreamFree(KMCGlobals._recHandle);
     Bass.BASS_Free();
     KMCGlobals.NewWindowName = null;
     KMCGlobals.RenderingMode = false;
     KMCGlobals.eventc = 0;
     KMCGlobals.events = null;
     KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(res_man.GetString("Error", cul), ex.ToString(), 0, 1);
     errordialog.ShowDialog();
 }
Exemplo n.º 17
0
        private void LoadVST(ref String VSTDLL, ref String VSTDLLDesc, Label Desc, Button Unload, Button Load, Int32 NumVST)
        {
            try
            {
                int status = 0;

                if (ModifierKeys == Keys.Shift)
                {
                    status = 1;
                }
                else if (ModifierKeys == Keys.Control)
                {
                    if (NumVST == 1)
                    {
                        if (Properties.Settings.Default.VSTiDisclaimer)
                        {
                            DialogResult dialogResult = MessageBox.Show("By clicking 'Yes', you agree not to abuse the 'VST instrument' feature to create, disseminate, or make accessible anything exploiting the copyrighted/protected samples or files included within a VST (\"Visual Studio Technology\" plugin).\n\nSuch resultant files could include (but are not limited to):\nSoundFonts, VSTs, or any other usable tool that commits copyright infringement.\n\nSimply put it, you may not use this tool to commit piracy on a copyrighted/trademarked/protected VST, free or paid, unless you have permission from the developer.\nYou may create audio at will from the VST, but DO NOT use this export feature to extract/\"rip\" samples from the VST.\n\nThe author assumes no legal responsibility from the use of this tool.", "Keppy's MIDI Converter - Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                            if (dialogResult == DialogResult.Yes)
                            {
                                Properties.Settings.Default.VSTiDisclaimer = false;
                                Properties.Settings.Default.Save();
                                status = 2;
                                MessageBox.Show("VSTi mode activated.", "Keppy's MIDI Converter - Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                            }
                            else if (dialogResult == DialogResult.No)
                            {
                                Properties.Settings.Default.VSTiDisclaimer = true;
                                Properties.Settings.Default.Save();
                                return;
                            }
                        }
                        else
                        {
                            status = 2;
                            MessageBox.Show("VSTi mode activated.", "Keppy's MIDI Converter - Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        }
                    }
                    else
                    {
                        status = 0;
                    }
                }

                InitStartDirectory();
                if (VSTImportDialog.ShowDialog() == DialogResult.OK)
                {
                    BASS_VST_INFO VSTInfo = new BASS_VST_INFO();
                    if (status == 1)
                    {
                        VSTDLL     = VSTImportDialog.FileName;
                        VSTDLLDesc = VSTImportDialog.FileName + " (Not verified)";
                        Desc.Text  = VSTImportDialog.FileName + " (Not verified)";
                        Bass.BASS_Free();
                        Unload.Enabled = true;
                        Load.Enabled   = false;
                        SaveDirectory(VSTImportDialog.FileName);
                    }
                    else if (status == 2)
                    {
                        Un4seen.Bass.Bass.BASS_Init(0, 44100, BASSInit.BASS_DEVICE_NOSPEAKER, IntPtr.Zero);
                        int VSTiTester = BassVst.BASS_VST_ChannelCreate(44100, 2, VSTImportDialog.FileName, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT);
                        MainWindow.KMCGlobals.vstIInfo = new BASS_VST_INFO();
                        bool Success = BassVst.BASS_VST_GetInfo(VSTiTester, MainWindow.KMCGlobals.vstIInfo);
                        if (Success)
                        {
                            String Lab = String.Format("{0} by {1} (Version number: {2}", MainWindow.KMCGlobals.vstIInfo.productName, MainWindow.KMCGlobals.vstIInfo.vendorName, MainWindow.KMCGlobals.vstIInfo.vendorVersion);
                            VSTDLL         = VSTImportDialog.FileName;
                            VSTDLLDesc     = MainWindow.KMCGlobals.vstIInfo.productName + " by " + MainWindow.KMCGlobals.vstIInfo.vendorName + " (Version: " + MainWindow.KMCGlobals.vstIInfo.vendorVersion + ")";
                            Desc.Text      = MainWindow.KMCGlobals.vstIInfo.productName + " by " + MainWindow.KMCGlobals.vstIInfo.vendorName + " (Version: " + MainWindow.KMCGlobals.vstIInfo.vendorVersion + ")";
                            Unload.Enabled = true;
                            Load.Enabled   = false;
                            SaveDirectory(VSTImportDialog.FileName);
                            BassVst.BASS_VST_ChannelFree(VSTiTester);
                            Bass.BASS_Free();
                        }
                        else
                        {
                            MessageBox.Show(String.Format(MainWindow.res_man.GetString("InvalidVSTLoaded", MainWindow.cul), Path.GetFileNameWithoutExtension(VSTImportDialog.FileName), bitreq, bitnow), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            BassVst.BASS_VST_ChannelFree(VSTiTester);
                            Bass.BASS_Free();
                        }
                    }
                    else
                    {
                        Un4seen.Bass.Bass.BASS_Init(0, 44100, BASSInit.BASS_DEVICE_NOSPEAKER, IntPtr.Zero);
                        int  Test      = Bass.BASS_StreamCreateDummy(44100, 2, BASSFlag.BASS_STREAM_DECODE, IntPtr.Zero);
                        int  VSTTester = BassVst.BASS_VST_ChannelSetDSP(Test, VSTImportDialog.FileName, BASSVSTDsp.BASS_VST_DEFAULT, 1);
                        bool Success   = BassVst.BASS_VST_GetInfo(VSTTester, VSTInfo);
                        if (Success)
                        {
                            VSTDLL     = VSTImportDialog.FileName;
                            VSTDLLDesc = VSTInfo.productName + " by " + VSTInfo.vendorName + " (Version: " + VSTInfo.vendorVersion + ")";
                            Desc.Text  = VSTInfo.productName + " by " + VSTInfo.vendorName + " (Version: " + VSTInfo.vendorVersion + ")";
                            Bass.BASS_Free();
                            Unload.Enabled = true;
                            Load.Enabled   = false;
                            SaveDirectory(VSTImportDialog.FileName);
                            BassVst.BASS_VST_ChannelRemoveDSP(Test, VSTTester);
                            Bass.BASS_StreamFree(Test);
                            Bass.BASS_Free();
                        }
                        else
                        {
                            MessageBox.Show(String.Format(MainWindow.res_man.GetString("InvalidVSTLoaded", MainWindow.cul), Path.GetFileNameWithoutExtension(VSTImportDialog.FileName), bitreq, bitnow), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            BassVst.BASS_VST_ChannelRemoveDSP(Test, VSTTester);
                            Bass.BASS_StreamFree(Test);
                            Bass.BASS_Free();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler(MainWindow.res_man.GetString("Error", MainWindow.cul), ex.ToString(), 0, 1);
                errordialog.ShowDialog();
            }
        }
Exemplo n.º 18
0
 private void enabledToolStripMenuItem2_Click(object sender, EventArgs e)
 {
     try
     {
         enabledToolStripMenuItem2.Checked = true;
         disabledToolStripMenuItem2.Checked = false;
         Globals.OldTimeThingy = true;
         Registry.CurrentUser.CreateSubKey("SOFTWARE\\Keppy's MIDI Converter\\Settings", Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree);
         RegistryKey Settings = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Keppy's MIDI Converter\\Settings", true);
         Settings.SetValue("oldtimethingy", "1", Microsoft.Win32.RegistryValueKind.DWord);
         Globals.LimitVoicesInt = Convert.ToInt32(VoiceLimit.Value.ToString());
         Settings.Close();
         Process.Start(Application.ExecutablePath);
         Environment.Exit(-1);
     }
     catch (Exception exception)
     {
         KeppyMIDIConverter.ErrorHandler errordialog = new KeppyMIDIConverter.ErrorHandler("Error", exception.Message.ToString(), 0, 0);
         errordialog.ShowDialog();
     }
 }