ChooseBurnFlags.cs 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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 ChooseBurnFlagsForm.
  11. /// </summary>
  12. public class ChooseBurnFlagsForm : System.Windows.Forms.Form
  13. {
  14. private System.Windows.Forms.Button c_OK;
  15. private System.Windows.Forms.Button c_Cancel;
  16. private System.Windows.Forms.Label label9;
  17. private System.Windows.Forms.ListView c_BurnFlags;
  18. /// <summary>
  19. /// Required designer variable.
  20. /// </summary>
  21. private System.ComponentModel.Container components = null;
  22. public ChooseBurnFlagsForm()
  23. {
  24. //
  25. // Required for Windows Form Designer support
  26. //
  27. InitializeComponent();
  28. }
  29. /// <summary>
  30. /// Clean up any resources being used.
  31. /// </summary>
  32. protected override void Dispose( bool disposing )
  33. {
  34. if( disposing )
  35. {
  36. if(components != null)
  37. {
  38. components.Dispose();
  39. }
  40. }
  41. base.Dispose( disposing );
  42. }
  43. #region Windows Form Designer generated code
  44. /// <summary>
  45. /// Required method for Designer support - do not modify
  46. /// the contents of this method with the code editor.
  47. /// </summary>
  48. private void InitializeComponent()
  49. {
  50. System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("Speed Test");
  51. System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("Simulate");
  52. System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem("Write");
  53. System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem("DAO");
  54. System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem("Close Session");
  55. System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem("CD Text");
  56. System.Windows.Forms.ListViewItem listViewItem7 = new System.Windows.Forms.ListViewItem("Buffer Underrun Protection");
  57. System.Windows.Forms.ListViewItem listViewItem8 = new System.Windows.Forms.ListViewItem("Disable Abort");
  58. System.Windows.Forms.ListViewItem listViewItem9 = new System.Windows.Forms.ListViewItem("Detect Non-Empty Rewritable");
  59. System.Windows.Forms.ListViewItem listViewItem10 = new System.Windows.Forms.ListViewItem("Disable Eject");
  60. System.Windows.Forms.ListViewItem listViewItem11 = new System.Windows.Forms.ListViewItem("Verify");
  61. System.Windows.Forms.ListViewItem listViewItem12 = new System.Windows.Forms.ListViewItem("DVD+ Burn 30mm At Least");
  62. System.Windows.Forms.ListViewItem listViewItem13 = new System.Windows.Forms.ListViewItem("CD Text is Japanese");
  63. System.Windows.Forms.ListViewItem listViewItem14 = new System.Windows.Forms.ListViewItem("Booktype DVDROM");
  64. System.Windows.Forms.ListViewItem listViewItem15 = new System.Windows.Forms.ListViewItem("No Booktype Change");
  65. this.c_OK = new System.Windows.Forms.Button();
  66. this.c_Cancel = new System.Windows.Forms.Button();
  67. this.label9 = new System.Windows.Forms.Label();
  68. this.c_BurnFlags = new System.Windows.Forms.ListView();
  69. this.SuspendLayout();
  70. //
  71. // c_OK
  72. //
  73. this.c_OK.DialogResult = System.Windows.Forms.DialogResult.OK;
  74. this.c_OK.Location = new System.Drawing.Point(208, 8);
  75. this.c_OK.Name = "c_OK";
  76. this.c_OK.TabIndex = 2;
  77. this.c_OK.Text = "OK";
  78. //
  79. // c_Cancel
  80. //
  81. this.c_Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
  82. this.c_Cancel.Location = new System.Drawing.Point(208, 40);
  83. this.c_Cancel.Name = "c_Cancel";
  84. this.c_Cancel.TabIndex = 3;
  85. this.c_Cancel.Text = "Cancel";
  86. //
  87. // label9
  88. //
  89. this.label9.Location = new System.Drawing.Point(8, 8);
  90. this.label9.Name = "label9";
  91. this.label9.Size = new System.Drawing.Size(100, 16);
  92. this.label9.TabIndex = 0;
  93. this.label9.Text = "Burn flags:";
  94. //
  95. // c_BurnFlags
  96. //
  97. this.c_BurnFlags.CheckBoxes = true;
  98. this.c_BurnFlags.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
  99. this.c_BurnFlags.HideSelection = false;
  100. listViewItem1.StateImageIndex = 0;
  101. listViewItem1.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_SPEED_TEST;
  102. listViewItem2.StateImageIndex = 0;
  103. listViewItem2.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_SIMULATE;
  104. listViewItem3.Checked = true;
  105. listViewItem3.StateImageIndex = 1;
  106. listViewItem3.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE;
  107. listViewItem4.Checked = true;
  108. listViewItem4.StateImageIndex = 1;
  109. listViewItem4.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_DAO;
  110. listViewItem5.Checked = true;
  111. listViewItem5.StateImageIndex = 1;
  112. listViewItem5.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_CLOSE_SESSION;
  113. listViewItem6.Checked = true;
  114. listViewItem6.StateImageIndex = 1;
  115. listViewItem6.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_CD_TEXT;
  116. listViewItem7.Checked = true;
  117. listViewItem7.StateImageIndex = 1;
  118. listViewItem7.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_BUF_UNDERRUN_PROT;
  119. listViewItem8.Checked = true;
  120. listViewItem8.StateImageIndex = 1;
  121. listViewItem8.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_DISABLE_ABORT;
  122. listViewItem9.Checked = true;
  123. listViewItem9.StateImageIndex = 1;
  124. listViewItem9.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_DETECT_NON_EMPTY_CDRW;
  125. listViewItem10.StateImageIndex = 0;
  126. listViewItem10.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_DISABLE_EJECT;
  127. listViewItem11.StateImageIndex = 0;
  128. listViewItem11.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_VERIFY;
  129. listViewItem12.StateImageIndex = 0;
  130. listViewItem12.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_DVDP_BURN_30MM_AT_LEAST;
  131. listViewItem13.StateImageIndex = 0;
  132. listViewItem13.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_CD_TEXT_IS_JAPANESE;
  133. listViewItem14.StateImageIndex = 0;
  134. listViewItem14.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_BOOKTYPE_DVDROM;
  135. listViewItem15.StateImageIndex = 0;
  136. listViewItem15.Tag = NEROLib.NERO_BURN_FLAGS.NERO_BURN_FLAG_NO_BOOKTYPE_CHANGE;
  137. this.c_BurnFlags.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
  138. listViewItem1,
  139. listViewItem2,
  140. listViewItem3,
  141. listViewItem4,
  142. listViewItem5,
  143. listViewItem6,
  144. listViewItem7,
  145. listViewItem8,
  146. listViewItem9,
  147. listViewItem10,
  148. listViewItem11,
  149. listViewItem12,
  150. listViewItem13,
  151. listViewItem14,
  152. listViewItem15});
  153. this.c_BurnFlags.Location = new System.Drawing.Point(8, 24);
  154. this.c_BurnFlags.Name = "c_BurnFlags";
  155. this.c_BurnFlags.Size = new System.Drawing.Size(192, 160);
  156. this.c_BurnFlags.TabIndex = 1;
  157. this.c_BurnFlags.View = System.Windows.Forms.View.SmallIcon;
  158. //
  159. // ChooseBurnFlagsForm
  160. //
  161. this.AcceptButton = this.c_OK;
  162. this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
  163. this.CancelButton = this.c_Cancel;
  164. this.ClientSize = new System.Drawing.Size(288, 190);
  165. this.Controls.Add(this.label9);
  166. this.Controls.Add(this.c_BurnFlags);
  167. this.Controls.Add(this.c_OK);
  168. this.Controls.Add(this.c_Cancel);
  169. this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
  170. this.MaximizeBox = false;
  171. this.MinimizeBox = false;
  172. this.Name = "ChooseBurnFlagsForm";
  173. this.ShowInTaskbar = false;
  174. this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
  175. this.Text = "Choose Burn Flags";
  176. this.ResumeLayout(false);
  177. }
  178. #endregion
  179. // This is a public function that tells the caller
  180. // state of the selected burn flags at any time.
  181. //
  182. public NERO_BURN_FLAGS GetBurnFlags ()
  183. {
  184. // Burn flags are just flags so use uint until
  185. // we collect all flags. Then cast it back to
  186. // NERO_BURN_FLAGS.
  187. //
  188. uint bf = 0;
  189. foreach (ListViewItem lvi in c_BurnFlags.Items)
  190. {
  191. if (lvi.Checked)
  192. {
  193. bf |= (uint) (NERO_BURN_FLAGS) lvi.Tag;
  194. }
  195. }
  196. return (NERO_BURN_FLAGS) bf;
  197. }
  198. // Return a textual representation of the set of
  199. // burn flags.
  200. //
  201. public new string ToString ()
  202. {
  203. string s = "";
  204. foreach (ListViewItem lvi in c_BurnFlags.Items)
  205. {
  206. if (lvi.Checked)
  207. {
  208. if (s != "")
  209. {
  210. s += " + ";
  211. }
  212. s += lvi.Text;
  213. }
  214. }
  215. return s;
  216. }
  217. }
  218. }