DriveInfo.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. using System;
  2. using System.Drawing;
  3. using System.Collections;
  4. using System.ComponentModel;
  5. using System.Windows.Forms;
  6. using NEROLib;
  7. namespace NeroFiddlesCOM.NET
  8. {
  9. /// <summary>
  10. /// Summary description for DriveInfo.
  11. /// </summary>
  12. public class DriveInfoForm : System.Windows.Forms.Form
  13. {
  14. private NeroDrive m_drive;
  15. private Nero m_nero;
  16. private ChooseMediaForm m_frmChooseMedia;
  17. private System.Windows.Forms.Label label1;
  18. private System.Windows.Forms.TextBox c_HostAdapterName;
  19. private System.Windows.Forms.TextBox c_HostAdapterNumber;
  20. private System.Windows.Forms.Label label2;
  21. private System.Windows.Forms.Button c_Close;
  22. private System.Windows.Forms.TextBox c_DeviceID;
  23. private System.Windows.Forms.Label label3;
  24. private System.Windows.Forms.TextBox c_DeviceType;
  25. private System.Windows.Forms.Label label4;
  26. private System.Windows.Forms.TextBox c_DriveLetter;
  27. private System.Windows.Forms.Label label5;
  28. private System.Windows.Forms.Label label6;
  29. private System.Windows.Forms.ListView c_Capabilities;
  30. private System.Windows.Forms.Label label7;
  31. private System.Windows.Forms.TextBox c_BufUnderrunProt;
  32. private System.Windows.Forms.Label label8;
  33. private System.Windows.Forms.TextBox c_MediaSupport;
  34. private System.Windows.Forms.Label label9;
  35. private System.Windows.Forms.TextBox c_MediaReadSupport;
  36. private System.Windows.Forms.Label label10;
  37. private System.Windows.Forms.TextBox c_MandatoryBUPSpeed;
  38. private System.Windows.Forms.Label label11;
  39. private System.Windows.Forms.ListView c_SupportedAccessModes;
  40. private System.Windows.Forms.GroupBox groupBox1;
  41. private SpeedComboBox c_ReadSpeeds;
  42. private SpeedComboBox c_WriteSpeeds;
  43. private System.Windows.Forms.Label label12;
  44. private System.Windows.Forms.Label label13;
  45. private System.Windows.Forms.Button c_ChooseMedia;
  46. /// <summary>
  47. /// Required designer variable.
  48. /// </summary>
  49. private System.ComponentModel.Container components = null;
  50. public DriveInfoForm(Nero nero, NeroDrive drive)
  51. {
  52. //
  53. // Required for Windows Form Designer support
  54. //
  55. InitializeComponent();
  56. c_ReadSpeeds.m_bUseMaximum = false;
  57. c_WriteSpeeds.m_bUseMaximum = false;
  58. m_nero = nero;
  59. m_drive = drive;
  60. m_frmChooseMedia = new ChooseMediaForm (m_nero);
  61. }
  62. /// <summary>
  63. /// Clean up any resources being used.
  64. /// </summary>
  65. protected override void Dispose( bool disposing )
  66. {
  67. if( disposing )
  68. {
  69. if(components != null)
  70. {
  71. components.Dispose();
  72. }
  73. }
  74. base.Dispose( disposing );
  75. }
  76. #region Windows Form Designer generated code
  77. /// <summary>
  78. /// Required method for Designer support - do not modify
  79. /// the contents of this method with the code editor.
  80. /// </summary>
  81. private void InitializeComponent()
  82. {
  83. System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("Allowed");
  84. System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("DAO");
  85. System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem("Read CD Text");
  86. System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem("Variable Pauses in TAO");
  87. System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem("DAO Write CD Text");
  88. System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem("Image Recorder");
  89. System.Windows.Forms.ListViewItem listViewItem7 = new System.Windows.Forms.ListViewItem("Undetected");
  90. System.Windows.Forms.ListViewItem listViewItem8 = new System.Windows.Forms.ListViewItem("IDE Bus");
  91. System.Windows.Forms.ListViewItem listViewItem9 = new System.Windows.Forms.ListViewItem("SCSI Bus");
  92. System.Windows.Forms.ListViewItem listViewItem10 = new System.Windows.Forms.ListViewItem("Buffer Underrun Protection");
  93. System.Windows.Forms.ListViewItem listViewItem11 = new System.Windows.Forms.ListViewItem("Allow Change Booktype");
  94. System.Windows.Forms.ListViewItem listViewItem12 = new System.Windows.Forms.ListViewItem("DVDPLUSVR Supported");
  95. System.Windows.Forms.ListViewItem listViewItem13 = new System.Windows.Forms.ListViewItem("Duallayer DVD Supported");
  96. System.Windows.Forms.ListViewItem listViewItem14 = new System.Windows.Forms.ListViewItem("eNoWriting");
  97. System.Windows.Forms.ListViewItem listViewItem15 = new System.Windows.Forms.ListViewItem("ePacketWriting");
  98. System.Windows.Forms.ListViewItem listViewItem16 = new System.Windows.Forms.ListViewItem("eManagedMRW");
  99. System.Windows.Forms.ListViewItem listViewItem17 = new System.Windows.Forms.ListViewItem("eRawMRW");
  100. this.c_Close = new System.Windows.Forms.Button();
  101. this.label1 = new System.Windows.Forms.Label();
  102. this.c_HostAdapterName = new System.Windows.Forms.TextBox();
  103. this.c_HostAdapterNumber = new System.Windows.Forms.TextBox();
  104. this.label2 = new System.Windows.Forms.Label();
  105. this.c_DeviceID = new System.Windows.Forms.TextBox();
  106. this.label3 = new System.Windows.Forms.Label();
  107. this.c_DeviceType = new System.Windows.Forms.TextBox();
  108. this.label4 = new System.Windows.Forms.Label();
  109. this.c_DriveLetter = new System.Windows.Forms.TextBox();
  110. this.label5 = new System.Windows.Forms.Label();
  111. this.label6 = new System.Windows.Forms.Label();
  112. this.c_Capabilities = new System.Windows.Forms.ListView();
  113. this.label7 = new System.Windows.Forms.Label();
  114. this.c_BufUnderrunProt = new System.Windows.Forms.TextBox();
  115. this.label8 = new System.Windows.Forms.Label();
  116. this.c_MediaSupport = new System.Windows.Forms.TextBox();
  117. this.label9 = new System.Windows.Forms.Label();
  118. this.c_MediaReadSupport = new System.Windows.Forms.TextBox();
  119. this.label10 = new System.Windows.Forms.Label();
  120. this.c_MandatoryBUPSpeed = new System.Windows.Forms.TextBox();
  121. this.c_SupportedAccessModes = new System.Windows.Forms.ListView();
  122. this.label11 = new System.Windows.Forms.Label();
  123. this.groupBox1 = new System.Windows.Forms.GroupBox();
  124. this.c_ChooseMedia = new System.Windows.Forms.Button();
  125. this.c_ReadSpeeds = new SpeedComboBox();
  126. this.c_WriteSpeeds = new SpeedComboBox();
  127. this.label12 = new System.Windows.Forms.Label();
  128. this.label13 = new System.Windows.Forms.Label();
  129. this.groupBox1.SuspendLayout();
  130. this.SuspendLayout();
  131. //
  132. // c_Close
  133. //
  134. this.c_Close.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  135. this.c_Close.Location = new System.Drawing.Point(320, 336);
  136. this.c_Close.Name = "c_Close";
  137. this.c_Close.TabIndex = 23;
  138. this.c_Close.Text = "Close";
  139. //
  140. // label1
  141. //
  142. this.label1.Location = new System.Drawing.Point(8, 8);
  143. this.label1.Name = "label1";
  144. this.label1.Size = new System.Drawing.Size(112, 16);
  145. this.label1.TabIndex = 0;
  146. this.label1.Text = "Host Adapter Name:";
  147. //
  148. // c_HostAdapterName
  149. //
  150. this.c_HostAdapterName.Location = new System.Drawing.Point(8, 24);
  151. this.c_HostAdapterName.Name = "c_HostAdapterName";
  152. this.c_HostAdapterName.ReadOnly = true;
  153. this.c_HostAdapterName.Size = new System.Drawing.Size(104, 20);
  154. this.c_HostAdapterName.TabIndex = 1;
  155. this.c_HostAdapterName.Text = "";
  156. //
  157. // c_HostAdapterNumber
  158. //
  159. this.c_HostAdapterNumber.Location = new System.Drawing.Point(8, 64);
  160. this.c_HostAdapterNumber.Name = "c_HostAdapterNumber";
  161. this.c_HostAdapterNumber.ReadOnly = true;
  162. this.c_HostAdapterNumber.Size = new System.Drawing.Size(48, 20);
  163. this.c_HostAdapterNumber.TabIndex = 9;
  164. this.c_HostAdapterNumber.Text = "";
  165. //
  166. // label2
  167. //
  168. this.label2.Location = new System.Drawing.Point(8, 48);
  169. this.label2.Name = "label2";
  170. this.label2.Size = new System.Drawing.Size(120, 16);
  171. this.label2.TabIndex = 8;
  172. this.label2.Text = "Host Adapter Number:";
  173. //
  174. // c_DeviceID
  175. //
  176. this.c_DeviceID.Location = new System.Drawing.Point(128, 24);
  177. this.c_DeviceID.Name = "c_DeviceID";
  178. this.c_DeviceID.ReadOnly = true;
  179. this.c_DeviceID.Size = new System.Drawing.Size(40, 20);
  180. this.c_DeviceID.TabIndex = 3;
  181. this.c_DeviceID.Text = "";
  182. //
  183. // label3
  184. //
  185. this.label3.Location = new System.Drawing.Point(128, 8);
  186. this.label3.Name = "label3";
  187. this.label3.Size = new System.Drawing.Size(56, 16);
  188. this.label3.TabIndex = 2;
  189. this.label3.Text = "Device ID:";
  190. //
  191. // c_DeviceType
  192. //
  193. this.c_DeviceType.Location = new System.Drawing.Point(128, 64);
  194. this.c_DeviceType.Name = "c_DeviceType";
  195. this.c_DeviceType.ReadOnly = true;
  196. this.c_DeviceType.Size = new System.Drawing.Size(120, 20);
  197. this.c_DeviceType.TabIndex = 11;
  198. this.c_DeviceType.Text = "";
  199. //
  200. // label4
  201. //
  202. this.label4.Location = new System.Drawing.Point(128, 48);
  203. this.label4.Name = "label4";
  204. this.label4.Size = new System.Drawing.Size(72, 16);
  205. this.label4.TabIndex = 10;
  206. this.label4.Text = "Device Type:";
  207. //
  208. // c_DriveLetter
  209. //
  210. this.c_DriveLetter.Location = new System.Drawing.Point(200, 24);
  211. this.c_DriveLetter.Name = "c_DriveLetter";
  212. this.c_DriveLetter.ReadOnly = true;
  213. this.c_DriveLetter.Size = new System.Drawing.Size(40, 20);
  214. this.c_DriveLetter.TabIndex = 5;
  215. this.c_DriveLetter.Text = "";
  216. //
  217. // label5
  218. //
  219. this.label5.Location = new System.Drawing.Point(200, 8);
  220. this.label5.Name = "label5";
  221. this.label5.Size = new System.Drawing.Size(72, 16);
  222. this.label5.TabIndex = 4;
  223. this.label5.Text = "Drive Letter:";
  224. //
  225. // label6
  226. //
  227. this.label6.Location = new System.Drawing.Point(8, 88);
  228. this.label6.Name = "label6";
  229. this.label6.Size = new System.Drawing.Size(88, 16);
  230. this.label6.TabIndex = 14;
  231. this.label6.Text = "Capabilities:";
  232. //
  233. // c_Capabilities
  234. //
  235. this.c_Capabilities.CheckBoxes = true;
  236. listViewItem1.StateImageIndex = 0;
  237. listViewItem1.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_ALLOWED;
  238. listViewItem2.StateImageIndex = 0;
  239. listViewItem2.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_DAO;
  240. listViewItem3.StateImageIndex = 0;
  241. listViewItem3.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_READ_CD_TEXT;
  242. listViewItem4.StateImageIndex = 0;
  243. listViewItem4.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_VARIABLE_PAUSES_IN_TAO;
  244. listViewItem5.StateImageIndex = 0;
  245. listViewItem5.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_DAO_WRITE_CD_TEXT;
  246. listViewItem6.StateImageIndex = 0;
  247. listViewItem6.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_IMAGE_RECORDER;
  248. listViewItem7.StateImageIndex = 0;
  249. listViewItem7.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_UNDETECTED;
  250. listViewItem8.StateImageIndex = 0;
  251. listViewItem8.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_IDE_BUS;
  252. listViewItem9.StateImageIndex = 0;
  253. listViewItem9.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_SCSI_BUS;
  254. listViewItem10.StateImageIndex = 0;
  255. listViewItem10.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_BUF_UNDERRUN_PROT;
  256. listViewItem11.StateImageIndex = 0;
  257. listViewItem11.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_ALLOW_CHANGE_BOOKTYPE;
  258. listViewItem12.StateImageIndex = 0;
  259. listViewItem12.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_DVDPLUSVR_SUPPORTED;
  260. listViewItem13.StateImageIndex = 0;
  261. listViewItem13.Tag = NEROLib.NERO_CAPABILITIES.NERO_CAP_DUALLAYER_DVD_SUPPORTED;
  262. this.c_Capabilities.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
  263. listViewItem1,
  264. listViewItem2,
  265. listViewItem3,
  266. listViewItem4,
  267. listViewItem5,
  268. listViewItem6,
  269. listViewItem7,
  270. listViewItem8,
  271. listViewItem9,
  272. listViewItem10,
  273. listViewItem11,
  274. listViewItem12,
  275. listViewItem13});
  276. this.c_Capabilities.Location = new System.Drawing.Point(8, 104);
  277. this.c_Capabilities.Name = "c_Capabilities";
  278. this.c_Capabilities.Size = new System.Drawing.Size(192, 152);
  279. this.c_Capabilities.TabIndex = 15;
  280. this.c_Capabilities.View = System.Windows.Forms.View.List;
  281. //
  282. // label7
  283. //
  284. this.label7.Location = new System.Drawing.Point(272, 8);
  285. this.label7.Name = "label7";
  286. this.label7.Size = new System.Drawing.Size(120, 16);
  287. this.label7.TabIndex = 6;
  288. this.label7.Text = "Buffer Underrun Prot:";
  289. //
  290. // c_BufUnderrunProt
  291. //
  292. this.c_BufUnderrunProt.Location = new System.Drawing.Point(272, 24);
  293. this.c_BufUnderrunProt.Name = "c_BufUnderrunProt";
  294. this.c_BufUnderrunProt.ReadOnly = true;
  295. this.c_BufUnderrunProt.Size = new System.Drawing.Size(120, 20);
  296. this.c_BufUnderrunProt.TabIndex = 7;
  297. this.c_BufUnderrunProt.Text = "";
  298. //
  299. // label8
  300. //
  301. this.label8.Location = new System.Drawing.Point(16, 272);
  302. this.label8.Name = "label8";
  303. this.label8.Size = new System.Drawing.Size(88, 16);
  304. this.label8.TabIndex = 21;
  305. this.label8.Text = "Media Support:";
  306. //
  307. // c_MediaSupport
  308. //
  309. this.c_MediaSupport.Location = new System.Drawing.Point(16, 288);
  310. this.c_MediaSupport.Name = "c_MediaSupport";
  311. this.c_MediaSupport.ReadOnly = true;
  312. this.c_MediaSupport.Size = new System.Drawing.Size(288, 20);
  313. this.c_MediaSupport.TabIndex = 22;
  314. this.c_MediaSupport.Text = "";
  315. //
  316. // label9
  317. //
  318. this.label9.Location = new System.Drawing.Point(208, 104);
  319. this.label9.Name = "label9";
  320. this.label9.Size = new System.Drawing.Size(120, 16);
  321. this.label9.TabIndex = 16;
  322. this.label9.Text = "Media Read Support:";
  323. //
  324. // c_MediaReadSupport
  325. //
  326. this.c_MediaReadSupport.Location = new System.Drawing.Point(208, 120);
  327. this.c_MediaReadSupport.Name = "c_MediaReadSupport";
  328. this.c_MediaReadSupport.ReadOnly = true;
  329. this.c_MediaReadSupport.Size = new System.Drawing.Size(184, 20);
  330. this.c_MediaReadSupport.TabIndex = 17;
  331. this.c_MediaReadSupport.Text = "";
  332. //
  333. // label10
  334. //
  335. this.label10.Location = new System.Drawing.Point(272, 48);
  336. this.label10.Name = "label10";
  337. this.label10.Size = new System.Drawing.Size(128, 16);
  338. this.label10.TabIndex = 12;
  339. this.label10.Text = "Mandatory BUP Speed:";
  340. //
  341. // c_MandatoryBUPSpeed
  342. //
  343. this.c_MandatoryBUPSpeed.Location = new System.Drawing.Point(272, 64);
  344. this.c_MandatoryBUPSpeed.Name = "c_MandatoryBUPSpeed";
  345. this.c_MandatoryBUPSpeed.ReadOnly = true;
  346. this.c_MandatoryBUPSpeed.Size = new System.Drawing.Size(120, 20);
  347. this.c_MandatoryBUPSpeed.TabIndex = 13;
  348. this.c_MandatoryBUPSpeed.Text = "";
  349. //
  350. // c_SupportedAccessModes
  351. //
  352. this.c_SupportedAccessModes.CheckBoxes = true;
  353. listViewItem14.StateImageIndex = 0;
  354. listViewItem14.Tag = NEROLib.AccessMode.eNoWriting;
  355. listViewItem15.StateImageIndex = 0;
  356. listViewItem15.Tag = NEROLib.AccessMode.ePacketWriting;
  357. listViewItem16.StateImageIndex = 0;
  358. listViewItem16.Tag = NEROLib.AccessMode.eManagedMRW;
  359. listViewItem17.StateImageIndex = 0;
  360. listViewItem17.Tag = NEROLib.AccessMode.eRawMRW;
  361. this.c_SupportedAccessModes.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
  362. listViewItem14,
  363. listViewItem15,
  364. listViewItem16,
  365. listViewItem17});
  366. this.c_SupportedAccessModes.Location = new System.Drawing.Point(208, 160);
  367. this.c_SupportedAccessModes.Name = "c_SupportedAccessModes";
  368. this.c_SupportedAccessModes.Size = new System.Drawing.Size(120, 96);
  369. this.c_SupportedAccessModes.TabIndex = 19;
  370. this.c_SupportedAccessModes.View = System.Windows.Forms.View.List;
  371. //
  372. // label11
  373. //
  374. this.label11.Location = new System.Drawing.Point(208, 144);
  375. this.label11.Name = "label11";
  376. this.label11.Size = new System.Drawing.Size(136, 16);
  377. this.label11.TabIndex = 18;
  378. this.label11.Text = "Supported Access Modes:";
  379. //
  380. // groupBox1
  381. //
  382. this.groupBox1.Controls.Add(this.c_ChooseMedia);
  383. this.groupBox1.Controls.Add(this.c_ReadSpeeds);
  384. this.groupBox1.Controls.Add(this.c_WriteSpeeds);
  385. this.groupBox1.Controls.Add(this.label12);
  386. this.groupBox1.Controls.Add(this.label13);
  387. this.groupBox1.Location = new System.Drawing.Point(8, 256);
  388. this.groupBox1.Name = "groupBox1";
  389. this.groupBox1.Size = new System.Drawing.Size(304, 104);
  390. this.groupBox1.TabIndex = 20;
  391. this.groupBox1.TabStop = false;
  392. //
  393. // c_ChooseMedia
  394. //
  395. this.c_ChooseMedia.Location = new System.Drawing.Point(200, 72);
  396. this.c_ChooseMedia.Name = "c_ChooseMedia";
  397. this.c_ChooseMedia.Size = new System.Drawing.Size(96, 23);
  398. this.c_ChooseMedia.TabIndex = 4;
  399. this.c_ChooseMedia.Text = "Choose Media";
  400. this.c_ChooseMedia.Click += new System.EventHandler(this.c_ChooseMedia_Click);
  401. //
  402. // c_ReadSpeeds
  403. //
  404. this.c_ReadSpeeds.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  405. this.c_ReadSpeeds.Location = new System.Drawing.Point(8, 72);
  406. this.c_ReadSpeeds.Name = "c_ReadSpeeds";
  407. this.c_ReadSpeeds.Size = new System.Drawing.Size(88, 21);
  408. this.c_ReadSpeeds.TabIndex = 1;
  409. //
  410. // c_WriteSpeeds
  411. //
  412. this.c_WriteSpeeds.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
  413. this.c_WriteSpeeds.Location = new System.Drawing.Point(104, 72);
  414. this.c_WriteSpeeds.Name = "c_WriteSpeeds";
  415. this.c_WriteSpeeds.Size = new System.Drawing.Size(88, 21);
  416. this.c_WriteSpeeds.TabIndex = 3;
  417. //
  418. // label12
  419. //
  420. this.label12.Location = new System.Drawing.Point(8, 56);
  421. this.label12.Name = "label12";
  422. this.label12.Size = new System.Drawing.Size(88, 16);
  423. this.label12.TabIndex = 0;
  424. this.label12.Text = "Read Speeds:";
  425. //
  426. // label13
  427. //
  428. this.label13.Location = new System.Drawing.Point(104, 56);
  429. this.label13.Name = "label13";
  430. this.label13.Size = new System.Drawing.Size(80, 16);
  431. this.label13.TabIndex = 2;
  432. this.label13.Text = "Write Speeds:";
  433. //
  434. // DriveInfoForm
  435. //
  436. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  437. this.CancelButton = this.c_Close;
  438. this.ClientSize = new System.Drawing.Size(402, 368);
  439. this.Controls.Add(this.c_SupportedAccessModes);
  440. this.Controls.Add(this.c_Capabilities);
  441. this.Controls.Add(this.c_HostAdapterName);
  442. this.Controls.Add(this.c_HostAdapterNumber);
  443. this.Controls.Add(this.c_DeviceID);
  444. this.Controls.Add(this.c_DeviceType);
  445. this.Controls.Add(this.c_DriveLetter);
  446. this.Controls.Add(this.c_BufUnderrunProt);
  447. this.Controls.Add(this.c_MediaSupport);
  448. this.Controls.Add(this.c_MediaReadSupport);
  449. this.Controls.Add(this.c_MandatoryBUPSpeed);
  450. this.Controls.Add(this.label1);
  451. this.Controls.Add(this.c_Close);
  452. this.Controls.Add(this.label2);
  453. this.Controls.Add(this.label3);
  454. this.Controls.Add(this.label4);
  455. this.Controls.Add(this.label5);
  456. this.Controls.Add(this.label6);
  457. this.Controls.Add(this.label7);
  458. this.Controls.Add(this.label8);
  459. this.Controls.Add(this.label9);
  460. this.Controls.Add(this.label10);
  461. this.Controls.Add(this.label11);
  462. this.Controls.Add(this.groupBox1);
  463. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  464. this.MaximizeBox = false;
  465. this.MinimizeBox = false;
  466. this.Name = "DriveInfoForm";
  467. this.ShowInTaskbar = false;
  468. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  469. this.Text = "DriveInfo";
  470. this.groupBox1.ResumeLayout(false);
  471. this.ResumeLayout(false);
  472. }
  473. #endregion
  474. protected override void OnLoad(EventArgs e)
  475. {
  476. base.OnLoad (e);
  477. // On form load fill all the controls with the information
  478. // about the drive.
  479. //
  480. c_DeviceID.Text = m_drive.DeviceID.ToString ();
  481. switch (m_drive.DevType)
  482. {
  483. case NERO_SCSI_DEVTYPE.NERO_SCSI_DEVTYPE_WORM:
  484. c_DeviceType.Text = "Worm";
  485. break;
  486. case NERO_SCSI_DEVTYPE.NERO_SCSI_DEVTYPE_CDROM:
  487. c_DeviceType.Text = "CDROM";
  488. break;
  489. case NERO_SCSI_DEVTYPE.NERO_SCSI_DEVTYPE_UNSUPPORTED_WORM:
  490. c_DeviceType.Text = "Unsupported Worm";
  491. break;
  492. default:
  493. c_DeviceType.Text = "Unknown";
  494. break;
  495. }
  496. c_DriveLetter.Text = m_drive.DriveLetter.ToUpper ().ToString ();
  497. c_HostAdapterName.Text = m_drive.HostAdapterName;
  498. c_HostAdapterNumber.Text = m_drive.HostAdapterNo.ToString ();
  499. c_MandatoryBUPSpeed.Text = m_drive.MandatoryBUPSpeed.ToString ();
  500. // Fill in the capabilities list view.
  501. //
  502. foreach (ListViewItem lvi in c_Capabilities.Items)
  503. {
  504. lvi.Checked = 0 != (m_drive.Capabilities & (NERO_CAPABILITIES) lvi.Tag);
  505. }
  506. c_BufUnderrunProt.Text = m_drive.BufUnderrunProtName;
  507. c_MediaSupport.Text = m_nero.get_TypeNameOfMedia ((NERO_MEDIA_TYPE) m_drive.MediaSupport);
  508. c_MediaReadSupport.Text = m_nero.get_TypeNameOfMedia (m_drive.MediaReadSupport);
  509. // Fill in the supported access modes list view.
  510. //
  511. foreach (ListViewItem lvi in c_SupportedAccessModes.Items)
  512. {
  513. lvi.Checked = 0 != (m_drive.SupportedAccessModes & (int) (AccessMode) lvi.Tag);
  514. }
  515. UpdateSpeeds ();
  516. }
  517. private void UpdateSpeeds ()
  518. {
  519. // Update the read and write speeds. These are dependant on the
  520. // chosen media.
  521. //
  522. c_ReadSpeeds.Populate (m_drive.get_AvailableSpeeds (NERO_ACCESSTYPE.NERO_ACCESSTYPE_READ, m_frmChooseMedia.GetMediaType ()));
  523. c_WriteSpeeds.Populate (m_drive.get_AvailableSpeeds (NERO_ACCESSTYPE.NERO_ACCESSTYPE_WRITE, m_frmChooseMedia.GetMediaType ()));
  524. }
  525. private void c_ChooseMedia_Click(object sender, System.EventArgs e)
  526. {
  527. if (DialogResult.OK == m_frmChooseMedia.ShowDialog (this))
  528. {
  529. UpdateSpeeds ();
  530. }
  531. }
  532. }
  533. }