home *** CD-ROM | disk | FTP | other *** search
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
-
- namespace DiskWriter
- {
- /// <summary>
- /// Summary description for frmWrite.
- /// </summary>
- public class frmWrite : System.Windows.Forms.Form
- {
- internal System.Windows.Forms.GroupBox GroupBox1;
- internal System.Windows.Forms.ProgressBar ProgressBar3;
- internal System.Windows.Forms.CheckBox OptimalSpeedCheck;
- internal System.Windows.Forms.Label Label2;
- internal System.Windows.Forms.CheckBox FinilizeCDCheck;
- internal System.Windows.Forms.CheckBox TestWriteCheck;
- internal System.Windows.Forms.ComboBox speedCombo;
- internal System.Windows.Forms.Label Label1;
- internal System.Windows.Forms.GroupBox GroupBox2;
- internal System.Windows.Forms.TextBox txtDiscLabel;
- internal System.Windows.Forms.Label Label3;
- internal System.Windows.Forms.RadioButton optISOLevel2;
- internal System.Windows.Forms.RadioButton optISOLevel1;
- internal System.Windows.Forms.RadioButton optJoliet;
- internal System.Windows.Forms.GroupBox GroupBox3;
- internal System.Windows.Forms.RadioButton optDataMode2;
- internal System.Windows.Forms.RadioButton optDataMode1;
- internal System.Windows.Forms.Button WriteBtn;
- internal System.Windows.Forms.Button CancelBtn;
- internal System.Windows.Forms.GroupBox frmProgress;
- internal System.Windows.Forms.Label Label9;
- internal System.Windows.Forms.Label ProgressLbl;
- internal System.Windows.Forms.ProgressBar ProgressBar1;
- internal System.Windows.Forms.Label driveWritedBlocksLbl;
- internal System.Windows.Forms.Label driveEstBlocksLbl;
- internal System.Windows.Forms.Label driveBufferLbl;
- internal System.Windows.Forms.Label driveStatusLbl;
- internal System.Windows.Forms.Label Label7;
- internal System.Windows.Forms.Label Label6;
- internal System.Windows.Forms.Label Label5;
- internal System.Windows.Forms.Label Label4;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- ///
-
- private System.ComponentModel.Container components = null;
- bool WriteInProgress;
- int writeSpeed;
- int speed;
- internal System.Windows.Forms.ProgressBar ProgressBar2;
- public Form1 frm;
-
- public frmWrite()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- //
- // TODO: Add any constructor code after InitializeComponent call
- //
- }
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if(components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.GroupBox1 = new System.Windows.Forms.GroupBox();
- this.ProgressBar3 = new System.Windows.Forms.ProgressBar();
- this.OptimalSpeedCheck = new System.Windows.Forms.CheckBox();
- this.Label2 = new System.Windows.Forms.Label();
- this.FinilizeCDCheck = new System.Windows.Forms.CheckBox();
- this.TestWriteCheck = new System.Windows.Forms.CheckBox();
- this.speedCombo = new System.Windows.Forms.ComboBox();
- this.Label1 = new System.Windows.Forms.Label();
- this.GroupBox2 = new System.Windows.Forms.GroupBox();
- this.txtDiscLabel = new System.Windows.Forms.TextBox();
- this.Label3 = new System.Windows.Forms.Label();
- this.optISOLevel2 = new System.Windows.Forms.RadioButton();
- this.optISOLevel1 = new System.Windows.Forms.RadioButton();
- this.optJoliet = new System.Windows.Forms.RadioButton();
- this.GroupBox3 = new System.Windows.Forms.GroupBox();
- this.optDataMode2 = new System.Windows.Forms.RadioButton();
- this.optDataMode1 = new System.Windows.Forms.RadioButton();
- this.WriteBtn = new System.Windows.Forms.Button();
- this.CancelBtn = new System.Windows.Forms.Button();
- this.frmProgress = new System.Windows.Forms.GroupBox();
- this.ProgressBar2 = new System.Windows.Forms.ProgressBar();
- this.Label9 = new System.Windows.Forms.Label();
- this.ProgressLbl = new System.Windows.Forms.Label();
- this.ProgressBar1 = new System.Windows.Forms.ProgressBar();
- this.driveWritedBlocksLbl = new System.Windows.Forms.Label();
- this.driveEstBlocksLbl = new System.Windows.Forms.Label();
- this.driveBufferLbl = new System.Windows.Forms.Label();
- this.driveStatusLbl = new System.Windows.Forms.Label();
- this.Label7 = new System.Windows.Forms.Label();
- this.Label6 = new System.Windows.Forms.Label();
- this.Label5 = new System.Windows.Forms.Label();
- this.Label4 = new System.Windows.Forms.Label();
- this.GroupBox1.SuspendLayout();
- this.GroupBox2.SuspendLayout();
- this.GroupBox3.SuspendLayout();
- this.frmProgress.SuspendLayout();
- this.SuspendLayout();
- //
- // GroupBox1
- //
- this.GroupBox1.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.ProgressBar3,
- this.OptimalSpeedCheck,
- this.Label2,
- this.FinilizeCDCheck,
- this.TestWriteCheck,
- this.speedCombo,
- this.Label1});
- this.GroupBox1.Location = new System.Drawing.Point(8, 8);
- this.GroupBox1.Name = "GroupBox1";
- this.GroupBox1.Size = new System.Drawing.Size(168, 205);
- this.GroupBox1.TabIndex = 1;
- this.GroupBox1.TabStop = false;
- this.GroupBox1.Text = "Burn Options";
- //
- // ProgressBar3
- //
- this.ProgressBar3.Location = new System.Drawing.Point(3, 195);
- this.ProgressBar3.Maximum = 64;
- this.ProgressBar3.Minimum = 1;
- this.ProgressBar3.Name = "ProgressBar3";
- this.ProgressBar3.Size = new System.Drawing.Size(157, 8);
- this.ProgressBar3.TabIndex = 6;
- this.ProgressBar3.Value = 1;
- this.ProgressBar3.Visible = false;
- //
- // OptimalSpeedCheck
- //
- this.OptimalSpeedCheck.Location = new System.Drawing.Point(147, 174);
- this.OptimalSpeedCheck.Name = "OptimalSpeedCheck";
- this.OptimalSpeedCheck.Size = new System.Drawing.Size(15, 14);
- this.OptimalSpeedCheck.TabIndex = 5;
- this.OptimalSpeedCheck.Text = "CheckBox1";
- this.OptimalSpeedCheck.CheckedChanged += new System.EventHandler(this.OptimalSpeedCheck_CheckedChanged);
- //
- // Label2
- //
- this.Label2.Location = new System.Drawing.Point(11, 175);
- this.Label2.Name = "Label2";
- this.Label2.Size = new System.Drawing.Size(124, 15);
- this.Label2.TabIndex = 4;
- this.Label2.Text = "Detect Speed Optimals:";
- //
- // FinilizeCDCheck
- //
- this.FinilizeCDCheck.Location = new System.Drawing.Point(12, 98);
- this.FinilizeCDCheck.Name = "FinilizeCDCheck";
- this.FinilizeCDCheck.Size = new System.Drawing.Size(88, 20);
- this.FinilizeCDCheck.TabIndex = 3;
- this.FinilizeCDCheck.Text = "Finalise Disc";
- //
- // TestWriteCheck
- //
- this.TestWriteCheck.Location = new System.Drawing.Point(12, 74);
- this.TestWriteCheck.Name = "TestWriteCheck";
- this.TestWriteCheck.Size = new System.Drawing.Size(87, 17);
- this.TestWriteCheck.TabIndex = 2;
- this.TestWriteCheck.Text = "Test Write";
- //
- // speedCombo
- //
- this.speedCombo.Location = new System.Drawing.Point(57, 33);
- this.speedCombo.Name = "speedCombo";
- this.speedCombo.Size = new System.Drawing.Size(105, 21);
- this.speedCombo.TabIndex = 1;
- this.speedCombo.Text = "Speed";
- this.speedCombo.SelectedIndexChanged += new System.EventHandler(this.speedCombo_SelectedIndexChanged);
- //
- // Label1
- //
- this.Label1.Location = new System.Drawing.Point(13, 34);
- this.Label1.Name = "Label1";
- this.Label1.Size = new System.Drawing.Size(44, 18);
- this.Label1.TabIndex = 0;
- this.Label1.Text = "Speed:";
- //
- // GroupBox2
- //
- this.GroupBox2.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.txtDiscLabel,
- this.Label3,
- this.optISOLevel2,
- this.optISOLevel1,
- this.optJoliet});
- this.GroupBox2.Location = new System.Drawing.Point(184, 8);
- this.GroupBox2.Name = "GroupBox2";
- this.GroupBox2.Size = new System.Drawing.Size(336, 146);
- this.GroupBox2.TabIndex = 2;
- this.GroupBox2.TabStop = false;
- this.GroupBox2.Text = "Disc Compilation";
- //
- // txtDiscLabel
- //
- this.txtDiscLabel.Location = new System.Drawing.Point(83, 113);
- this.txtDiscLabel.Name = "txtDiscLabel";
- this.txtDiscLabel.Size = new System.Drawing.Size(240, 20);
- this.txtDiscLabel.TabIndex = 4;
- this.txtDiscLabel.Text = "New Disc";
- this.txtDiscLabel.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- //
- // Label3
- //
- this.Label3.Location = new System.Drawing.Point(14, 116);
- this.Label3.Name = "Label3";
- this.Label3.Size = new System.Drawing.Size(61, 18);
- this.Label3.TabIndex = 3;
- this.Label3.Text = "Disc Label:";
- //
- // optISOLevel2
- //
- this.optISOLevel2.Location = new System.Drawing.Point(14, 81);
- this.optISOLevel2.Name = "optISOLevel2";
- this.optISOLevel2.Size = new System.Drawing.Size(308, 19);
- this.optISOLevel2.TabIndex = 2;
- this.optISOLevel2.Text = "ISO Level 2 (Maximum 31 chars)";
- this.optISOLevel2.CheckedChanged += new System.EventHandler(this.optISOLevel2_Click);
- //
- // optISOLevel1
- //
- this.optISOLevel1.Location = new System.Drawing.Point(14, 57);
- this.optISOLevel1.Name = "optISOLevel1";
- this.optISOLevel1.Size = new System.Drawing.Size(307, 17);
- this.optISOLevel1.TabIndex = 1;
- this.optISOLevel1.Text = "ISO Level 1 (Maximum 11 = 8 + 3 chars)";
- this.optISOLevel1.CheckedChanged += new System.EventHandler(this.optISOLevel1_Click);
- //
- // optJoliet
- //
- this.optJoliet.Checked = true;
- this.optJoliet.Location = new System.Drawing.Point(13, 33);
- this.optJoliet.Name = "optJoliet";
- this.optJoliet.Size = new System.Drawing.Size(309, 16);
- this.optJoliet.TabIndex = 0;
- this.optJoliet.TabStop = true;
- this.optJoliet.Text = "Joliet (Multilanguage Support)";
- this.optJoliet.CheckedChanged += new System.EventHandler(this.optJoliet_Click);
- //
- // GroupBox3
- //
- this.GroupBox3.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.optDataMode2,
- this.optDataMode1});
- this.GroupBox3.Location = new System.Drawing.Point(184, 160);
- this.GroupBox3.Name = "GroupBox3";
- this.GroupBox3.Size = new System.Drawing.Size(336, 52);
- this.GroupBox3.TabIndex = 3;
- this.GroupBox3.TabStop = false;
- this.GroupBox3.Text = "Format";
- //
- // optDataMode2
- //
- this.optDataMode2.Location = new System.Drawing.Point(160, 24);
- this.optDataMode2.Name = "optDataMode2";
- this.optDataMode2.Size = new System.Drawing.Size(143, 16);
- this.optDataMode2.TabIndex = 1;
- this.optDataMode2.Text = "Data Mode 2/XA";
- //
- // optDataMode1
- //
- this.optDataMode1.Checked = true;
- this.optDataMode1.Location = new System.Drawing.Point(17, 24);
- this.optDataMode1.Name = "optDataMode1";
- this.optDataMode1.Size = new System.Drawing.Size(118, 16);
- this.optDataMode1.TabIndex = 0;
- this.optDataMode1.TabStop = true;
- this.optDataMode1.Text = "Data Mode 1";
- //
- // WriteBtn
- //
- this.WriteBtn.Location = new System.Drawing.Point(528, 16);
- this.WriteBtn.Name = "WriteBtn";
- this.WriteBtn.Size = new System.Drawing.Size(96, 32);
- this.WriteBtn.TabIndex = 5;
- this.WriteBtn.Text = "Write";
- this.WriteBtn.Click += new System.EventHandler(this.WriteBtn_Click);
- //
- // CancelBtn
- //
- this.CancelBtn.Location = new System.Drawing.Point(528, 64);
- this.CancelBtn.Name = "CancelBtn";
- this.CancelBtn.Size = new System.Drawing.Size(96, 32);
- this.CancelBtn.TabIndex = 6;
- this.CancelBtn.Text = "Cancel";
- this.CancelBtn.Click += new System.EventHandler(this.CancelBtn_Click);
- //
- // frmProgress
- //
- this.frmProgress.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.ProgressBar2,
- this.Label9,
- this.ProgressLbl,
- this.ProgressBar1,
- this.driveWritedBlocksLbl,
- this.driveEstBlocksLbl,
- this.driveBufferLbl,
- this.driveStatusLbl,
- this.Label7,
- this.Label6,
- this.Label5,
- this.Label4});
- this.frmProgress.Location = new System.Drawing.Point(0, 216);
- this.frmProgress.Name = "frmProgress";
- this.frmProgress.Size = new System.Drawing.Size(632, 116);
- this.frmProgress.TabIndex = 7;
- this.frmProgress.TabStop = false;
- this.frmProgress.Text = "Progress";
- //
- // ProgressBar2
- //
- this.ProgressBar2.Location = new System.Drawing.Point(120, 72);
- this.ProgressBar2.Name = "ProgressBar2";
- this.ProgressBar2.Size = new System.Drawing.Size(503, 15);
- this.ProgressBar2.TabIndex = 12;
- //
- // Label9
- //
- this.Label9.Location = new System.Drawing.Point(12, 92);
- this.Label9.Name = "Label9";
- this.Label9.Size = new System.Drawing.Size(97, 16);
- this.Label9.TabIndex = 11;
- this.Label9.Text = "Disk Total:";
- //
- // ProgressLbl
- //
- this.ProgressLbl.Location = new System.Drawing.Point(12, 74);
- this.ProgressLbl.Name = "ProgressLbl";
- this.ProgressLbl.Size = new System.Drawing.Size(97, 16);
- this.ProgressLbl.TabIndex = 10;
- this.ProgressLbl.Text = "Write:";
- //
- // ProgressBar1
- //
- this.ProgressBar1.Location = new System.Drawing.Point(121, 95);
- this.ProgressBar1.Name = "ProgressBar1";
- this.ProgressBar1.Size = new System.Drawing.Size(503, 15);
- this.ProgressBar1.TabIndex = 9;
- //
- // driveWritedBlocksLbl
- //
- this.driveWritedBlocksLbl.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.driveWritedBlocksLbl.Location = new System.Drawing.Point(520, 46);
- this.driveWritedBlocksLbl.Name = "driveWritedBlocksLbl";
- this.driveWritedBlocksLbl.Size = new System.Drawing.Size(104, 18);
- this.driveWritedBlocksLbl.TabIndex = 7;
- this.driveWritedBlocksLbl.Text = "0";
- this.driveWritedBlocksLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- //
- // driveEstBlocksLbl
- //
- this.driveEstBlocksLbl.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.driveEstBlocksLbl.Location = new System.Drawing.Point(520, 22);
- this.driveEstBlocksLbl.Name = "driveEstBlocksLbl";
- this.driveEstBlocksLbl.Size = new System.Drawing.Size(104, 18);
- this.driveEstBlocksLbl.TabIndex = 6;
- this.driveEstBlocksLbl.Text = "0";
- this.driveEstBlocksLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- //
- // driveBufferLbl
- //
- this.driveBufferLbl.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.driveBufferLbl.Location = new System.Drawing.Point(120, 48);
- this.driveBufferLbl.Name = "driveBufferLbl";
- this.driveBufferLbl.Size = new System.Drawing.Size(104, 18);
- this.driveBufferLbl.TabIndex = 5;
- this.driveBufferLbl.Text = "0";
- this.driveBufferLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- //
- // driveStatusLbl
- //
- this.driveStatusLbl.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.driveStatusLbl.Location = new System.Drawing.Point(120, 24);
- this.driveStatusLbl.Name = "driveStatusLbl";
- this.driveStatusLbl.Size = new System.Drawing.Size(104, 18);
- this.driveStatusLbl.TabIndex = 4;
- this.driveStatusLbl.Text = "Idle";
- this.driveStatusLbl.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
- //
- // Label7
- //
- this.Label7.Location = new System.Drawing.Point(408, 50);
- this.Label7.Name = "Label7";
- this.Label7.Size = new System.Drawing.Size(106, 16);
- this.Label7.TabIndex = 3;
- this.Label7.Text = "Current Block:";
- //
- // Label6
- //
- this.Label6.Location = new System.Drawing.Point(408, 24);
- this.Label6.Name = "Label6";
- this.Label6.Size = new System.Drawing.Size(105, 16);
- this.Label6.TabIndex = 2;
- this.Label6.Text = "Estimated Blocks:";
- //
- // Label5
- //
- this.Label5.Location = new System.Drawing.Point(11, 46);
- this.Label5.Name = "Label5";
- this.Label5.Size = new System.Drawing.Size(97, 18);
- this.Label5.TabIndex = 1;
- this.Label5.Text = "Buffer (%):";
- //
- // Label4
- //
- this.Label4.Location = new System.Drawing.Point(11, 22);
- this.Label4.Name = "Label4";
- this.Label4.Size = new System.Drawing.Size(97, 16);
- this.Label4.TabIndex = 0;
- this.Label4.Text = "Drive Status:";
- //
- // frmWrite
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(632, 333);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.frmProgress,
- this.CancelBtn,
- this.WriteBtn,
- this.GroupBox3,
- this.GroupBox2,
- this.GroupBox1});
- this.Name = "frmWrite";
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
- this.Text = "frmWrite";
- this.Load += new System.EventHandler(this.frmWrite_Load);
- this.GroupBox1.ResumeLayout(false);
- this.GroupBox2.ResumeLayout(false);
- this.GroupBox3.ResumeLayout(false);
- this.frmProgress.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
- #endregion
-
- private void frmWrite_Load(object sender, System.EventArgs e)
- {
- frm = (Form1)this.Owner;;
- writeSpeed = frm.DataCDWriter1.driveMaxWSpeed;
- WriteInProgress = false;
- LoadSpeedCombo();
- }
-
- private void OptimalSpeedCheck_CheckedChanged(object sender, System.EventArgs e)
- {
- LoadSpeedCombo();
- }
-
- public void LoadSpeedCombo()
- {
- speedCombo.Items.Clear();
- ProgressBar3.Visible = true;
-
- if(OptimalSpeedCheck.Checked != false)
- {
- for(speed = 64 ; speed > 0 ; speed = speed - 2)
- {
- frm.DataCDWriter1.writeSpeed = (short)speed;
- ProgressBar3.Value = 65 - speed;
- if(frm.DataCDWriter1.writeSpeed == speed )
- {
- speedCombo.Items.Add(speed);
- }
- }
- }
- else
- {
- for(speed = frm.DataCDWriter1.driveMaxWSpeed ; speed > 0 ; speed = speed - 2)
- {
- speedCombo.Items.Add(speed);
- }
- }
-
- if( speedCombo.Items.Count > 0 )
- {
- speedCombo.SelectedIndex = 0;
- }
-
- ProgressBar3.Value = 1;
- ProgressBar3.Visible = false;
- }
-
- private void WriteBtn_Click(object sender, System.EventArgs e)
- {
- bool test;
- bool finalize;
- int idx;
-
- Inactive();
-
- idx = 0;
- speed = (int)speedCombo.Items[idx];
- frm.DataCDWriter1.writeSpeed = (short)speed;
- frm.DataCDWriter1.volumeLabel = txtDiscLabel.Text;
-
- driveStatusLbl.Text = "Prepare...";
- this.Refresh();
-
- WriteBtn.Enabled = false;
- this.Refresh();
-
- if(TestWriteCheck.Checked == false)
- {
- frm.DataCDWriter1.writeSimulate = false;
- }
- else
- {
- frm.DataCDWriter1.writeSimulate = true;
- }
-
- if(FinilizeCDCheck.Checked == false)
- {
- frm.DataCDWriter1.writeFinalizeCD = false;
- }
- else
- {
- frm.DataCDWriter1.writeFinalizeCD = true;
- }
-
- frm.err = false;
- this.Refresh();
-
- idx = speedCombo.SelectedIndex;
- speed = (int)speedCombo.Items[idx];
- frm.DataCDWriter1.writeSpeed = (short)speed;
-
- frm.OperationProgress = false;
- frm.writeProgress = 0;
- frm.DataCDWriter1.StartWrite();
- if( frm.err == true )
- {
- driveStatusLbl.Text = "Idle";
- StopWrite();
- frm.err = false;
- frm.WrtiteInProgress = false;
- }
- else
- {
- frm.WrtiteInProgress = true;
- WriteInProgress = true;
- }
- }
-
- private void CancelBtn_Click(object sender, System.EventArgs e)
- {
- if( WriteInProgress == true )
- {
- frm.DataCDWriter1.StopWrite();
- driveStatusLbl.Text = "Idle";
- StopWrite();
- }
- else
- {
- this.Hide();
- }
- }
-
- private void Active()
- {
- speedCombo.Enabled = true;
- WriteBtn.Enabled = true;
- optJoliet.Enabled = true;
- optISOLevel1.Enabled = true;
- optISOLevel2.Enabled = true;
- txtDiscLabel.Enabled = true;
- TestWriteCheck.Enabled = true;
- FinilizeCDCheck.Enabled = true;
- optDataMode1.Enabled = true;
- optDataMode2.Enabled = true;
- OptimalSpeedCheck.Enabled = true;
- }
-
- private void Inactive()
- {
- OptimalSpeedCheck.Enabled = false;
- speedCombo.Enabled = false;
- WriteBtn.Enabled = false;
- optJoliet.Enabled = false;
- optISOLevel1.Enabled = false;
- optISOLevel2.Enabled = false;
- txtDiscLabel.Enabled = false;
- TestWriteCheck.Enabled = false;
- FinilizeCDCheck.Enabled = false;
- optDataMode1.Enabled = false;
- optDataMode2.Enabled = false;
- }
-
- private void StopWrite()
- {
- ProgressLbl.Text = "Write Tracks:";
- driveEstBlocksLbl.Text = "";
- driveWritedBlocksLbl.Text = "";
- driveBufferLbl.Text = "";
- ProgressBar1.Value = 0;
- ProgressBar2.Value = 0;
- frm.RefreshDiskInfo();
- WriteInProgress = false;
- frm.WrtiteInProgress = false;
- WriteBtn.Enabled = true;
- CancelBtn.Enabled = true;
- frm.err = false;
- Active();
- }
-
- private void optISOLevel1_Click(object sender, System.EventArgs e)
- {
- frm.DataCDWriter1.volumeFileSystem = NCTDISCWRITERLib.FILE_SYSTEM.ISO_LEVEL_1;
- }
-
- private void optISOLevel2_Click(object sender, System.EventArgs e)
- {
- frm.DataCDWriter1.volumeFileSystem = NCTDISCWRITERLib.FILE_SYSTEM.ISO_LEVEL_2;
-
- }
-
- private void optJoliet_Click(object sender, System.EventArgs e)
- {
- frm.DataCDWriter1.volumeFileSystem = NCTDISCWRITERLib.FILE_SYSTEM.JOLIET;
- }
-
- private void speedCombo_SelectedIndexChanged(object sender, System.EventArgs e)
- {
- int idx;
- idx = speedCombo.SelectedIndex;
- speed = (int)speedCombo.Items[idx];
- frm.DataCDWriter1.writeSpeed = (short)speed;
- }
-
- public void OperationProgress(int Percent)
- {
- if( (frm.err == true) || (WriteInProgress == false) )
- {
- driveStatusLbl.Text = "Idle";
- StopWrite();
- return;
- }
-
- switch(frm.DataCDWriter1.driveOperation)
- {
- case NCTDISCWRITERLib.OPERATION.WRITE_DISC:
- {
- switch(frm.DataCDWriter1.writePhase)
- {
- case NCTDISCWRITERLib.WRITE_PHASE.FILL_BUFFER:
- driveStatusLbl.Text = "Fill Buffer...";
- break;
- case NCTDISCWRITERLib.WRITE_PHASE.WRITE_TRACK:
- driveStatusLbl.Text = "Write Track...";
- break;
- case NCTDISCWRITERLib.WRITE_PHASE.CLOSE_TRACK:
- driveStatusLbl.Text = "Close Track...";
- break;
- }
- ProgressBar1.Value = Percent * 2 / 3;
- ProgressBar2.Value = Percent;
- driveEstBlocksLbl.Text = frm.DataCDWriter1.writeTotalBlocks.ToString();
- driveWritedBlocksLbl.Text = frm.DataCDWriter1.writeCurrentBlock.ToString();
- driveBufferLbl.Text = frm.DataCDWriter1.driveBufferUsagePercent.ToString();
- break;
- }
- case NCTDISCWRITERLib.OPERATION.FINALIZE_DISC:
- {
- driveStatusLbl.Text = "Finalise Disc...";
- ProgressLbl.Text = "Finalise:";
- CancelBtn.Enabled = false;
- ProgressBar1.Value = 100 * 2 / 3 + Percent / 3 - 5;
- ProgressBar2.Value = Percent;
- driveWritedBlocksLbl.Text = frm.DataCDWriter1.writeCurrentBlock.ToString();
- if( Percent == 100 )
- {
- ProgressBar2.Value = 100;
- ProgressBar1.Value = 100;
- driveStatusLbl.Text = "Idle";
- MessageBox.Show("Write Complete!");
- StopWrite();
- frm.WrtiteInProgress = false;
- return;
- }
- break;
- }
- }
- Application.DoEvents();
- }
- }
- }
-