/// <summary> /// Main Load /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void frmMain_Load(object sender, EventArgs e) { try { this.Width = Convert.ToInt32(IniFiles.ReadINI(Application.StartupPath + @"\settings.ini", "Settings", "Width", "600")); this.Height = Convert.ToInt32(IniFiles.ReadINI(Application.StartupPath + @"\settings.ini", "Settings", "Height", "400")); this.Left = Convert.ToInt32(IniFiles.ReadINI(Application.StartupPath + @"\settings.ini", "Settings", "Left", "0")); this.Top = Convert.ToInt32(IniFiles.ReadINI(Application.StartupPath + @"\settings.ini", "Settings", "Top", "0")); this.Resize += new EventHandler(frmMain_Resize); this.FormClosed += FrmMain_FormClosed; _decodeController = new Mp3DecoderController(); _decodeController.PercentChanged += _decodeController_PercentChanged; tvwDecodeMp3s.DoubleClick += new EventHandler(tvwDecodeMp3s_DoubleClick); tvwDecodeMp3s.NodeMouseClick += new RadTreeView.TreeViewEventHandler(tvwDecodeMp3s_NodeMouseClick); AudioCdWriter.Finished += new __FL_CDAudioWriter_FinishedEventHandler(AudioCdWriter_Finished); AudioCdWriter.WriteProgress += new __FL_CDAudioWriter_WriteProgressEventHandler(AudioCdWriter_WriteProgress); ThisResize(); this.Visible = true; Application.DoEvents(); var init = new frmInit(); rwbMakeAudioCD.WaitingStep = 5; rwbMakeAudioCD.StartWaiting(); prgSpaceAvailable.Text = "Space Available"; prgDecode.Text = "Decode"; prgTotalProgress.Text = "Total Progress"; prgTrackProgress.Text = "Track Progress"; lblDecodeMp3Status.Text = ""; lblStatus.Text = ""; init.Show(this); init.BeginAbout(); foreach (var drive in System.IO.DriveInfo.GetDrives()) { var b = false; switch (drive.DriveType) { case DriveType.Network: b = true; break; case DriveType.Fixed: b = true; break; case DriveType.Removable: b = true; break; case DriveType.Unknown: b = true; break; } if (b) { tvwDecodeMp3s.Nodes.Add(new RadTreeNode() { Text = drive.Name }); } } init.SetProgress(25); init.ShowText("Detecting CD Drives"); init.SetProgress(30); foreach (var drive in Manager.GetCDVDROMs()) { if (drive != null) { var driveLetter = drive.ToString(); var info = DriveInfo.GetInfo(driveLetter); if (DriveInfo.WriteCapabilities != 0) { cboDrive.Items.Add(driveLetter + ": " + DriveInfo.Vendor + " " + DriveInfo.Product + " " + DriveInfo.Revision); cboMakeDataCDDrive.Items.Add(driveLetter + ": " + DriveInfo.Vendor + " " + DriveInfo.Product + " " + DriveInfo.Revision); } init.ShowText("Detecting Device " + driveLetter + ": " + DriveInfo.Vendor + " " + DriveInfo.Product + " " + DriveInfo.Revision); } } init.SetProgress(75); if (cboDrive.SelectedItem == null) { cboDrive.SelectedItem = cboDrive.Items.LastOrDefault(); } if (cboMakeDataCDDrive.SelectedItem == null) { cboMakeDataCDDrive.SelectedItem = cboMakeDataCDDrive.Items.LastOrDefault(); } var driveLetter2 = cboDrive.SelectedItem.Text.Split(' ')[0]; UpdateSpeed(driveLetter2); init.SetProgress(85); init.ShowText("All CD Drives Loaded."); init.SetProgress(90); init.EndAbout(); init.Close(); UpdateUsedSpace(driveLetter2); rwbMakeAudioCD.StopWaiting(); } catch { throw; } }