using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using NEROLib; namespace NeroFiddlesCOM.NET { /// /// Summary description for DriveInfo. /// public class DriveInfoForm : System.Windows.Forms.Form { private NeroDrive m_drive; private Nero m_nero; private ChooseMediaForm m_frmChooseMedia; private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox c_HostAdapterName; private System.Windows.Forms.TextBox c_HostAdapterNumber; private System.Windows.Forms.Label label2; private System.Windows.Forms.Button c_Close; private System.Windows.Forms.TextBox c_DeviceID; private System.Windows.Forms.Label label3; private System.Windows.Forms.TextBox c_DeviceType; private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox c_DriveLetter; private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label6; private System.Windows.Forms.ListView c_Capabilities; private System.Windows.Forms.Label label7; private System.Windows.Forms.TextBox c_BufUnderrunProt; private System.Windows.Forms.Label label8; private System.Windows.Forms.TextBox c_MediaSupport; private System.Windows.Forms.Label label9; private System.Windows.Forms.TextBox c_MediaReadSupport; private System.Windows.Forms.Label label10; private System.Windows.Forms.TextBox c_MandatoryBUPSpeed; private System.Windows.Forms.Label label11; private System.Windows.Forms.ListView c_SupportedAccessModes; private System.Windows.Forms.GroupBox groupBox1; private SpeedComboBox c_ReadSpeeds; private SpeedComboBox c_WriteSpeeds; private System.Windows.Forms.Label label12; private System.Windows.Forms.Label label13; private System.Windows.Forms.Button c_ChooseMedia; /// /// Required designer variable. /// private System.ComponentModel.Container components = null; public DriveInfoForm(Nero nero, NeroDrive drive) { // // Required for Windows Form Designer support // InitializeComponent(); c_ReadSpeeds.m_bUseMaximum = false; c_WriteSpeeds.m_bUseMaximum = false; m_nero = nero; m_drive = drive; m_frmChooseMedia = new ChooseMediaForm (m_nero); } /// /// Clean up any resources being used. /// protected override void Dispose( bool disposing ) { if( disposing ) { if(components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("Allowed"); System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("DAO"); System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem("Read CD Text"); System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem("Variable Pauses in TAO"); System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem("DAO Write CD Text"); System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem("Image Recorder"); System.Windows.Forms.ListViewItem listViewItem7 = new System.Windows.Forms.ListViewItem("Undetected"); System.Windows.Forms.ListViewItem listViewItem8 = new System.Windows.Forms.ListViewItem("IDE Bus"); System.Windows.Forms.ListViewItem listViewItem9 = new System.Windows.Forms.ListViewItem("SCSI Bus"); System.Windows.Forms.ListViewItem listViewItem10 = new System.Windows.Forms.ListViewItem("Buffer Underrun Protection"); System.Windows.Forms.ListViewItem listViewItem11 = new System.Windows.Forms.ListViewItem("Allow Change Booktype"); System.Windows.Forms.ListViewItem listViewItem12 = new System.Windows.Forms.ListViewItem("DVDPLUSVR Supported"); System.Windows.Forms.ListViewItem listViewItem13 = new System.Windows.Forms.ListViewItem("Duallayer DVD Supported"); System.Windows.Forms.ListViewItem listViewItem14 = new System.Windows.Forms.ListViewItem("eNoWriting"); System.Windows.Forms.ListViewItem listViewItem15 = new System.Windows.Forms.ListViewItem("ePacketWriting"); System.Windows.Forms.ListViewItem listViewItem16 = new System.Windows.Forms.ListViewItem("eManagedMRW"); System.Windows.Forms.ListViewItem listViewItem17 = new System.Windows.Forms.ListViewItem("eRawMRW"); this.c_Close = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.c_HostAdapterName = new System.Windows.Forms.TextBox(); this.c_HostAdapterNumber = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.c_DeviceID = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.c_DeviceType = new System.Windows.Forms.TextBox(); this.label4 = new System.Windows.Forms.Label(); this.c_DriveLetter = new System.Windows.Forms.TextBox(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.c_Capabilities = new System.Windows.Forms.ListView(); this.label7 = new System.Windows.Forms.Label(); this.c_BufUnderrunProt = new System.Windows.Forms.TextBox(); this.label8 = new System.Windows.Forms.Label(); this.c_MediaSupport = new System.Windows.Forms.TextBox(); this.label9 = new System.Windows.Forms.Label(); this.c_MediaReadSupport = new System.Windows.Forms.TextBox(); this.label10 = new System.Windows.Forms.Label(); this.c_MandatoryBUPSpeed = new System.Windows.Forms.TextBox(); this.c_SupportedAccessModes = new System.Windows.Forms.ListView(); this.label11 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.c_ChooseMedia = new System.Windows.Forms.Button(); this.c_ReadSpeeds = new SpeedComboBox(); this.c_WriteSpeeds = new SpeedComboBox(); this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // c_Close // this.c_Close.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.c_Close.Location = new System.Drawing.Point(320, 336); this.c_Close.Name = "c_Close"; this.c_Close.TabIndex = 23; this.c_Close.Text = "Close"; // // label1 // this.label1.Location = new System.Drawing.Point(8, 8); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(112, 16); this.label1.TabIndex = 0; this.label1.Text = "Host Adapter Name:"; // // c_HostAdapterName // this.c_HostAdapterName.Location = new System.Drawing.Point(8, 24); this.c_HostAdapterName.Name = "c_HostAdapterName"; this.c_HostAdapterName.ReadOnly = true; this.c_HostAdapterName.Size = new System.Drawing.Size(104, 20); this.c_HostAdapterName.TabIndex = 1; this.c_HostAdapterName.Text = ""; // // c_HostAdapterNumber // this.c_HostAdapterNumber.Location = new System.Drawing.Point(8, 64); this.c_HostAdapterNumber.Name = "c_HostAdapterNumber"; this.c_HostAdapterNumber.ReadOnly = true; this.c_HostAdapterNumber.Size = new System.Drawing.Size(48, 20); this.c_HostAdapterNumber.TabIndex = 9; this.c_HostAdapterNumber.Text = ""; // // label2 // this.label2.Location = new System.Drawing.Point(8, 48); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(120, 16); this.label2.TabIndex = 8; this.label2.Text = "Host Adapter Number:"; // // c_DeviceID // this.c_DeviceID.Location = new System.Drawing.Point(128, 24); this.c_DeviceID.Name = "c_DeviceID"; this.c_DeviceID.ReadOnly = true; this.c_DeviceID.Size = new System.Drawing.Size(40, 20); this.c_DeviceID.TabIndex = 3; this.c_DeviceID.Text = ""; // // label3 // this.label3.Location = new System.Drawing.Point(128, 8); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(56, 16); this.label3.TabIndex = 2; this.label3.Text = "Device ID:"; // // c_DeviceType // this.c_DeviceType.Location = new System.Drawing.Point(128, 64); this.c_DeviceType.Name = "c_DeviceType"; this.c_DeviceType.ReadOnly = true; this.c_DeviceType.Size = new System.Drawing.Size(120, 20); this.c_DeviceType.TabIndex = 11; this.c_DeviceType.Text = ""; // // label4 // this.label4.Location = new System.Drawing.Point(128, 48); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(72, 16); this.label4.TabIndex = 10; this.label4.Text = "Device Type:"; // // c_DriveLetter // this.c_DriveLetter.Location = new System.Drawing.Point(200, 24); this.c_DriveLetter.Name = "c_DriveLetter"; this.c_DriveLetter.ReadOnly = true; this.c_DriveLetter.Size = new System.Drawing.Size(40, 20); this.c_DriveLetter.TabIndex = 5; this.c_DriveLetter.Text = ""; // // label5 // this.label5.Location = new System.Drawing.Point(200, 8); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(72, 16); this.label5.TabIndex = 4; this.label5.Text = "Drive Letter:"; // // label6 // this.label6.Location = new System.Drawing.Point(8, 88); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(88, 16); this.label6.TabIndex = 14; this.label6.Text = "Capabilities:"; // // c_Capabilities // this.c_Capabilities.CheckBoxes = true; listViewItem1.StateImageIndex = 0; listViewItem1.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_ALLOWED; listViewItem2.StateImageIndex = 0; listViewItem2.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_DAO; listViewItem3.StateImageIndex = 0; listViewItem3.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_READ_CD_TEXT; listViewItem4.StateImageIndex = 0; listViewItem4.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_VARIABLE_PAUSES_IN_TAO; listViewItem5.StateImageIndex = 0; listViewItem5.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_DAO_WRITE_CD_TEXT; listViewItem6.StateImageIndex = 0; listViewItem6.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_IMAGE_RECORDER; listViewItem7.StateImageIndex = 0; listViewItem7.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_UNDETECTED; listViewItem8.StateImageIndex = 0; listViewItem8.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_IDE_BUS; listViewItem9.StateImageIndex = 0; listViewItem9.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_SCSI_BUS; listViewItem10.StateImageIndex = 0; listViewItem10.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_BUF_UNDERRUN_PROT; listViewItem11.StateImageIndex = 0; listViewItem11.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_ALLOW_CHANGE_BOOKTYPE; listViewItem12.StateImageIndex = 0; listViewItem12.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_DVDPLUSVR_SUPPORTED; listViewItem13.StateImageIndex = 0; listViewItem13.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_DUALLAYER_DVD_SUPPORTED; this.c_Capabilities.Items.AddRange(new System.Windows.Forms.ListViewItem[] { listViewItem1, listViewItem2, listViewItem3, listViewItem4, listViewItem5, listViewItem6, listViewItem7, listViewItem8, listViewItem9, listViewItem10, listViewItem11, listViewItem12, listViewItem13}); this.c_Capabilities.Location = new System.Drawing.Point(8, 104); this.c_Capabilities.Name = "c_Capabilities"; this.c_Capabilities.Size = new System.Drawing.Size(192, 152); this.c_Capabilities.TabIndex = 15; this.c_Capabilities.View = System.Windows.Forms.View.List; // // label7 // this.label7.Location = new System.Drawing.Point(272, 8); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(120, 16); this.label7.TabIndex = 6; this.label7.Text = "Buffer Underrun Prot:"; // // c_BufUnderrunProt // this.c_BufUnderrunProt.Location = new System.Drawing.Point(272, 24); this.c_BufUnderrunProt.Name = "c_BufUnderrunProt"; this.c_BufUnderrunProt.ReadOnly = true; this.c_BufUnderrunProt.Size = new System.Drawing.Size(120, 20); this.c_BufUnderrunProt.TabIndex = 7; this.c_BufUnderrunProt.Text = ""; // // label8 // this.label8.Location = new System.Drawing.Point(16, 272); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(88, 16); this.label8.TabIndex = 21; this.label8.Text = "Media Support:"; // // c_MediaSupport // this.c_MediaSupport.Location = new System.Drawing.Point(16, 288); this.c_MediaSupport.Name = "c_MediaSupport"; this.c_MediaSupport.ReadOnly = true; this.c_MediaSupport.Size = new System.Drawing.Size(288, 20); this.c_MediaSupport.TabIndex = 22; this.c_MediaSupport.Text = ""; // // label9 // this.label9.Location = new System.Drawing.Point(208, 104); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(120, 16); this.label9.TabIndex = 16; this.label9.Text = "Media Read Support:"; // // c_MediaReadSupport // this.c_MediaReadSupport.Location = new System.Drawing.Point(208, 120); this.c_MediaReadSupport.Name = "c_MediaReadSupport"; this.c_MediaReadSupport.ReadOnly = true; this.c_MediaReadSupport.Size = new System.Drawing.Size(184, 20); this.c_MediaReadSupport.TabIndex = 17; this.c_MediaReadSupport.Text = ""; // // label10 // this.label10.Location = new System.Drawing.Point(272, 48); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(128, 16); this.label10.TabIndex = 12; this.label10.Text = "Mandatory BUP Speed:"; // // c_MandatoryBUPSpeed // this.c_MandatoryBUPSpeed.Location = new System.Drawing.Point(272, 64); this.c_MandatoryBUPSpeed.Name = "c_MandatoryBUPSpeed"; this.c_MandatoryBUPSpeed.ReadOnly = true; this.c_MandatoryBUPSpeed.Size = new System.Drawing.Size(120, 20); this.c_MandatoryBUPSpeed.TabIndex = 13; this.c_MandatoryBUPSpeed.Text = ""; // // c_SupportedAccessModes // this.c_SupportedAccessModes.CheckBoxes = true; listViewItem14.StateImageIndex = 0; listViewItem14.Tag = NEROLib.AccessMode.eNoWriting; listViewItem15.StateImageIndex = 0; listViewItem15.Tag = NEROLib.AccessMode.ePacketWriting; listViewItem16.StateImageIndex = 0; listViewItem16.Tag = NEROLib.AccessMode.eManagedMRW; listViewItem17.StateImageIndex = 0; listViewItem17.Tag = NEROLib.AccessMode.eRawMRW; this.c_SupportedAccessModes.Items.AddRange(new System.Windows.Forms.ListViewItem[] { listViewItem14, listViewItem15, listViewItem16, listViewItem17}); this.c_SupportedAccessModes.Location = new System.Drawing.Point(208, 160); this.c_SupportedAccessModes.Name = "c_SupportedAccessModes"; this.c_SupportedAccessModes.Size = new System.Drawing.Size(120, 96); this.c_SupportedAccessModes.TabIndex = 19; this.c_SupportedAccessModes.View = System.Windows.Forms.View.List; // // label11 // this.label11.Location = new System.Drawing.Point(208, 144); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(136, 16); this.label11.TabIndex = 18; this.label11.Text = "Supported Access Modes:"; // // groupBox1 // this.groupBox1.Controls.Add(this.c_ChooseMedia); this.groupBox1.Controls.Add(this.c_ReadSpeeds); this.groupBox1.Controls.Add(this.c_WriteSpeeds); this.groupBox1.Controls.Add(this.label12); this.groupBox1.Controls.Add(this.label13); this.groupBox1.Location = new System.Drawing.Point(8, 256); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(304, 104); this.groupBox1.TabIndex = 20; this.groupBox1.TabStop = false; // // c_ChooseMedia // this.c_ChooseMedia.Location = new System.Drawing.Point(200, 72); this.c_ChooseMedia.Name = "c_ChooseMedia"; this.c_ChooseMedia.Size = new System.Drawing.Size(96, 23); this.c_ChooseMedia.TabIndex = 4; this.c_ChooseMedia.Text = "Choose Media"; this.c_ChooseMedia.Click += new System.EventHandler(this.c_ChooseMedia_Click); // // c_ReadSpeeds // this.c_ReadSpeeds.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.c_ReadSpeeds.Location = new System.Drawing.Point(8, 72); this.c_ReadSpeeds.Name = "c_ReadSpeeds"; this.c_ReadSpeeds.Size = new System.Drawing.Size(88, 21); this.c_ReadSpeeds.TabIndex = 1; // // c_WriteSpeeds // this.c_WriteSpeeds.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.c_WriteSpeeds.Location = new System.Drawing.Point(104, 72); this.c_WriteSpeeds.Name = "c_WriteSpeeds"; this.c_WriteSpeeds.Size = new System.Drawing.Size(88, 21); this.c_WriteSpeeds.TabIndex = 3; // // label12 // this.label12.Location = new System.Drawing.Point(8, 56); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(88, 16); this.label12.TabIndex = 0; this.label12.Text = "Read Speeds:"; // // label13 // this.label13.Location = new System.Drawing.Point(104, 56); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(80, 16); this.label13.TabIndex = 2; this.label13.Text = "Write Speeds:"; // // DriveInfoForm // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.CancelButton = this.c_Close; this.ClientSize = new System.Drawing.Size(402, 368); this.Controls.Add(this.c_SupportedAccessModes); this.Controls.Add(this.c_Capabilities); this.Controls.Add(this.c_HostAdapterName); this.Controls.Add(this.c_HostAdapterNumber); this.Controls.Add(this.c_DeviceID); this.Controls.Add(this.c_DeviceType); this.Controls.Add(this.c_DriveLetter); this.Controls.Add(this.c_BufUnderrunProt); this.Controls.Add(this.c_MediaSupport); this.Controls.Add(this.c_MediaReadSupport); this.Controls.Add(this.c_MandatoryBUPSpeed); this.Controls.Add(this.label1); this.Controls.Add(this.c_Close); this.Controls.Add(this.label2); this.Controls.Add(this.label3); this.Controls.Add(this.label4); this.Controls.Add(this.label5); this.Controls.Add(this.label6); this.Controls.Add(this.label7); this.Controls.Add(this.label8); this.Controls.Add(this.label9); this.Controls.Add(this.label10); this.Controls.Add(this.label11); this.Controls.Add(this.groupBox1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "DriveInfoForm"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "DriveInfo"; this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); } #endregion protected override void OnLoad(EventArgs e) { base.OnLoad (e); // On form load fill all the controls with the information // about the drive. // c_DeviceID.Text = m_drive.DeviceID.ToString (); switch (m_drive.DevType) { case NERO_SCSI_DEVTYPE.NERO_SCSI_DEVTYPE_WORM: c_DeviceType.Text = "Worm"; break; case NERO_SCSI_DEVTYPE.NERO_SCSI_DEVTYPE_CDROM: c_DeviceType.Text = "CDROM"; break; case NERO_SCSI_DEVTYPE.NERO_SCSI_DEVTYPE_UNSUPPORTED_WORM: c_DeviceType.Text = "Unsupported Worm"; break; default: c_DeviceType.Text = "Unknown"; break; } c_DriveLetter.Text = m_drive.DriveLetter.ToUpper ().ToString (); c_HostAdapterName.Text = m_drive.HostAdapterName; c_HostAdapterNumber.Text = m_drive.HostAdapterNo.ToString (); c_MandatoryBUPSpeed.Text = m_drive.MandatoryBUPSpeed.ToString (); // Fill in the capabilities list view. // foreach (ListViewItem lvi in c_Capabilities.Items) { lvi.Checked = 0 != (m_drive.Capabilities & (NERO_CAPABILITIES) lvi.Tag); } c_BufUnderrunProt.Text = m_drive.BufUnderrunProtName; c_MediaSupport.Text = m_nero.get_TypeNameOfMedia ((NERO_MEDIA_TYPE) m_drive.MediaSupport); c_MediaReadSupport.Text = m_nero.get_TypeNameOfMedia (m_drive.MediaReadSupport); // Fill in the supported access modes list view. // foreach (ListViewItem lvi in c_SupportedAccessModes.Items) { lvi.Checked = 0 != (m_drive.SupportedAccessModes & (int) (AccessMode) lvi.Tag); } UpdateSpeeds (); } private void UpdateSpeeds () { // Update the read and write speeds. These are dependant on the // chosen media. // c_ReadSpeeds.Populate (m_drive.get_AvailableSpeeds (NERO_ACCESSTYPE.NERO_ACCESSTYPE_READ, m_frmChooseMedia.GetMediaType ())); c_WriteSpeeds.Populate (m_drive.get_AvailableSpeeds (NERO_ACCESSTYPE.NERO_ACCESSTYPE_WRITE, m_frmChooseMedia.GetMediaType ())); } private void c_ChooseMedia_Click(object sender, System.EventArgs e) { if (DialogResult.OK == m_frmChooseMedia.ShowDialog (this)) { UpdateSpeeds (); } } } }