123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658 |
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using NEROLib;
- namespace LYFZ.NeroDiscBurn.NET
- {
- /// <summary>
- /// Summary description for DiscInfo.
- /// </summary>
- public class DiscInfoForm : System.Windows.Forms.Form
- {
- private NeroDrive m_drive;
- private Nero m_nero;
- private string m_sImageFilepath;
- private _INeroDriveEvents_OnDoneCDInfoEventHandler m_evOnDoneCDInfo;
- private System.Windows.Forms.Button c_OK;
- private System.Windows.Forms.Label label1;
- private System.Windows.Forms.Label label2;
- private System.Windows.Forms.TextBox c_Artist;
- private System.Windows.Forms.TextBox c_Title;
- private System.Windows.Forms.Label label4;
- private System.Windows.Forms.TextBox c_FreeCapacityBlocks;
- private System.Windows.Forms.Label label6;
- private System.Windows.Forms.Label label7;
- private System.Windows.Forms.TextBox c_UnusedBlocks;
- private System.Windows.Forms.Label label9;
- private System.Windows.Forms.Label label5;
- private System.Windows.Forms.TextBox c_MediaType;
- private System.Windows.Forms.TextBox c_AvailableEraseMode;
- private System.Windows.Forms.Label label10;
- private System.Windows.Forms.Label label8;
- private System.Windows.Forms.TextBox c_Device;
- private System.Windows.Forms.Button c_Refresh;
- private System.Windows.Forms.Label label11;
- private System.Windows.Forms.ListView c_MediumFlags;
- private System.Windows.Forms.Label label12;
- private System.Windows.Forms.TextBox c_TotalCapacity;
- private System.Windows.Forms.Label label13;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
- private System.Windows.Forms.TextBox c_Layer0MaxBlocks;
- private System.Windows.Forms.Label label14;
- private System.Windows.Forms.Label label15;
- private System.Windows.Forms.CheckBox c_IsWritable;
- private System.Windows.Forms.Label label3;
- private System.Windows.Forms.ListView c_Tracks;
- private System.Windows.Forms.Label label16;
- private System.Windows.Forms.ColumnHeader columnHeader1;
- private System.Windows.Forms.ColumnHeader columnHeader2;
- private System.Windows.Forms.ColumnHeader columnHeader3;
- private System.Windows.Forms.ColumnHeader columnHeader4;
- private System.Windows.Forms.ColumnHeader columnHeader5;
- private System.Windows.Forms.ColumnHeader columnHeader6;
- private System.Windows.Forms.Button c_VMSInfo;
- private readonly NERO_MEDIUM_FLAGS [] m_nmf = {NERO_MEDIUM_FLAGS.NCDIMF_VIRTUALMULTISESSION, NERO_MEDIUM_FLAGS.NCDIMF_HDB_SUPPORTED};
- private ControlEnabler m_controlEnabler;
- // Constructor for getting disc info from a physical drive.
- //
- public DiscInfoForm(NeroDrive drive, Nero nero)
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
- m_controlEnabler = new ControlEnabler (this);
- m_drive = drive;
- m_nero = nero;
- }
- // Constructor for getting disc info from an image file.
- //
- public DiscInfoForm(string sImageFilepath, Nero nero)
- {
- InitializeComponent();
- m_nero = nero;
- m_sImageFilepath = sImageFilepath;
- }
- /// <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()
- {
- System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem("Virtual Multisession");
- System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem("HDB");
- this.c_OK = new System.Windows.Forms.Button();
- this.label1 = new System.Windows.Forms.Label();
- this.label2 = new System.Windows.Forms.Label();
- this.c_Artist = new System.Windows.Forms.TextBox();
- this.c_Title = new System.Windows.Forms.TextBox();
- this.label4 = new System.Windows.Forms.Label();
- this.c_FreeCapacityBlocks = new System.Windows.Forms.TextBox();
- this.label6 = new System.Windows.Forms.Label();
- this.label7 = new System.Windows.Forms.Label();
- this.c_UnusedBlocks = new System.Windows.Forms.TextBox();
- this.label9 = new System.Windows.Forms.Label();
- this.label5 = new System.Windows.Forms.Label();
- this.c_MediaType = new System.Windows.Forms.TextBox();
- this.c_AvailableEraseMode = new System.Windows.Forms.TextBox();
- this.label10 = new System.Windows.Forms.Label();
- this.label8 = new System.Windows.Forms.Label();
- this.c_Device = new System.Windows.Forms.TextBox();
- this.c_Refresh = new System.Windows.Forms.Button();
- this.label11 = new System.Windows.Forms.Label();
- this.c_MediumFlags = new System.Windows.Forms.ListView();
- this.label12 = new System.Windows.Forms.Label();
- this.c_TotalCapacity = new System.Windows.Forms.TextBox();
- this.label13 = new System.Windows.Forms.Label();
- this.c_Layer0MaxBlocks = new System.Windows.Forms.TextBox();
- this.label14 = new System.Windows.Forms.Label();
- this.label15 = new System.Windows.Forms.Label();
- this.c_IsWritable = new System.Windows.Forms.CheckBox();
- this.label3 = new System.Windows.Forms.Label();
- this.c_Tracks = new System.Windows.Forms.ListView();
- this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
- this.label16 = new System.Windows.Forms.Label();
- this.c_VMSInfo = new System.Windows.Forms.Button();
- this.SuspendLayout();
- //
- // c_OK
- //
- this.c_OK.DialogResult = System.Windows.Forms.DialogResult.Cancel;
- this.c_OK.Location = new System.Drawing.Point(470, 9);
- this.c_OK.Name = "c_OK";
- this.c_OK.Size = new System.Drawing.Size(90, 24);
- this.c_OK.TabIndex = 30;
- this.c_OK.Text = "OK";
- //
- // label1
- //
- this.label1.Location = new System.Drawing.Point(10, 43);
- this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(67, 17);
- this.label1.TabIndex = 0;
- this.label1.Text = "Artist:";
- //
- // label2
- //
- this.label2.Location = new System.Drawing.Point(10, 69);
- this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(67, 17);
- this.label2.TabIndex = 2;
- this.label2.Text = "Title:";
- //
- // c_Artist
- //
- this.c_Artist.Location = new System.Drawing.Point(77, 43);
- this.c_Artist.Name = "c_Artist";
- this.c_Artist.ReadOnly = true;
- this.c_Artist.Size = new System.Drawing.Size(297, 21);
- this.c_Artist.TabIndex = 1;
- //
- // c_Title
- //
- this.c_Title.Location = new System.Drawing.Point(77, 69);
- this.c_Title.Name = "c_Title";
- this.c_Title.ReadOnly = true;
- this.c_Title.Size = new System.Drawing.Size(297, 21);
- this.c_Title.TabIndex = 3;
- //
- // label4
- //
- this.label4.Location = new System.Drawing.Point(202, 95);
- this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(48, 17);
- this.label4.TabIndex = 6;
- this.label4.Text = "blocks";
- //
- // c_FreeCapacityBlocks
- //
- this.c_FreeCapacityBlocks.Location = new System.Drawing.Point(116, 95);
- this.c_FreeCapacityBlocks.Name = "c_FreeCapacityBlocks";
- this.c_FreeCapacityBlocks.ReadOnly = true;
- this.c_FreeCapacityBlocks.Size = new System.Drawing.Size(86, 21);
- this.c_FreeCapacityBlocks.TabIndex = 5;
- this.c_FreeCapacityBlocks.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- //
- // label6
- //
- this.label6.Location = new System.Drawing.Point(10, 95);
- this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(96, 17);
- this.label6.TabIndex = 4;
- this.label6.Text = "¿ÉÓÃÈÝÁ¿:";
- //
- // label7
- //
- this.label7.Location = new System.Drawing.Point(202, 121);
- this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(48, 17);
- this.label7.TabIndex = 9;
- this.label7.Text = "blocks";
- //
- // c_UnusedBlocks
- //
- this.c_UnusedBlocks.Location = new System.Drawing.Point(116, 121);
- this.c_UnusedBlocks.Name = "c_UnusedBlocks";
- this.c_UnusedBlocks.ReadOnly = true;
- this.c_UnusedBlocks.Size = new System.Drawing.Size(86, 21);
- this.c_UnusedBlocks.TabIndex = 8;
- this.c_UnusedBlocks.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- //
- // label9
- //
- this.label9.Location = new System.Drawing.Point(10, 121);
- this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(96, 17);
- this.label9.TabIndex = 7;
- this.label9.Text = "δʹÓÃ:";
- //
- // label5
- //
- this.label5.Location = new System.Drawing.Point(10, 172);
- this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(96, 18);
- this.label5.TabIndex = 13;
- this.label5.Text = "Media Type:";
- //
- // c_MediaType
- //
- this.c_MediaType.Location = new System.Drawing.Point(115, 172);
- this.c_MediaType.Name = "c_MediaType";
- this.c_MediaType.ReadOnly = true;
- this.c_MediaType.Size = new System.Drawing.Size(259, 21);
- this.c_MediaType.TabIndex = 14;
- //
- // c_AvailableEraseMode
- //
- this.c_AvailableEraseMode.Location = new System.Drawing.Point(115, 198);
- this.c_AvailableEraseMode.Name = "c_AvailableEraseMode";
- this.c_AvailableEraseMode.ReadOnly = true;
- this.c_AvailableEraseMode.Size = new System.Drawing.Size(259, 21);
- this.c_AvailableEraseMode.TabIndex = 16;
- //
- // label10
- //
- this.label10.Location = new System.Drawing.Point(10, 198);
- this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(96, 26);
- this.label10.TabIndex = 15;
- this.label10.Text = "Available Erase Modes:";
- //
- // label8
- //
- this.label8.Location = new System.Drawing.Point(10, 17);
- this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(67, 17);
- this.label8.TabIndex = 28;
- this.label8.Text = "Device:";
- //
- // c_Device
- //
- this.c_Device.Location = new System.Drawing.Point(77, 17);
- this.c_Device.Name = "c_Device";
- this.c_Device.ReadOnly = true;
- this.c_Device.Size = new System.Drawing.Size(297, 21);
- this.c_Device.TabIndex = 29;
- //
- // c_Refresh
- //
- this.c_Refresh.Location = new System.Drawing.Point(470, 78);
- this.c_Refresh.Name = "c_Refresh";
- this.c_Refresh.Size = new System.Drawing.Size(90, 24);
- this.c_Refresh.TabIndex = 26;
- this.c_Refresh.Text = "Refresh";
- this.c_Refresh.Click += new System.EventHandler(this.c_Refresh_Click);
- //
- // label11
- //
- this.label11.Location = new System.Drawing.Point(384, 155);
- this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(96, 17);
- this.label11.TabIndex = 17;
- this.label11.Text = "Medium Flags:";
- //
- // c_MediumFlags
- //
- this.c_MediumFlags.CheckBoxes = true;
- listViewItem1.StateImageIndex = 0;
- listViewItem2.StateImageIndex = 0;
- this.c_MediumFlags.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
- listViewItem1,
- listViewItem2});
- this.c_MediumFlags.Location = new System.Drawing.Point(384, 172);
- this.c_MediumFlags.MultiSelect = false;
- this.c_MediumFlags.Name = "c_MediumFlags";
- this.c_MediumFlags.Size = new System.Drawing.Size(163, 43);
- this.c_MediumFlags.TabIndex = 18;
- this.c_MediumFlags.UseCompatibleStateImageBehavior = false;
- this.c_MediumFlags.View = System.Windows.Forms.View.SmallIcon;
- //
- // label12
- //
- this.label12.Location = new System.Drawing.Point(202, 146);
- this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(48, 18);
- this.label12.TabIndex = 12;
- this.label12.Text = "blocks";
- //
- // c_TotalCapacity
- //
- this.c_TotalCapacity.Location = new System.Drawing.Point(115, 146);
- this.c_TotalCapacity.Name = "c_TotalCapacity";
- this.c_TotalCapacity.ReadOnly = true;
- this.c_TotalCapacity.Size = new System.Drawing.Size(85, 21);
- this.c_TotalCapacity.TabIndex = 11;
- this.c_TotalCapacity.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- //
- // label13
- //
- this.label13.Location = new System.Drawing.Point(10, 146);
- this.label13.Name = "label13";
- this.label13.Size = new System.Drawing.Size(96, 18);
- this.label13.TabIndex = 10;
- this.label13.Text = "×ÜÈÝÁ¿:";
- //
- // c_Layer0MaxBlocks
- //
- this.c_Layer0MaxBlocks.Location = new System.Drawing.Point(115, 233);
- this.c_Layer0MaxBlocks.Name = "c_Layer0MaxBlocks";
- this.c_Layer0MaxBlocks.ReadOnly = true;
- this.c_Layer0MaxBlocks.Size = new System.Drawing.Size(85, 21);
- this.c_Layer0MaxBlocks.TabIndex = 20;
- this.c_Layer0MaxBlocks.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- //
- // label14
- //
- this.label14.Location = new System.Drawing.Point(10, 233);
- this.label14.Name = "label14";
- this.label14.Size = new System.Drawing.Size(96, 17);
- this.label14.TabIndex = 19;
- this.label14.Text = "Max Layer 0 :";
- //
- // label15
- //
- this.label15.Location = new System.Drawing.Point(202, 233);
- this.label15.Name = "label15";
- this.label15.Size = new System.Drawing.Size(48, 17);
- this.label15.TabIndex = 21;
- this.label15.Text = "blocks";
- //
- // c_IsWritable
- //
- this.c_IsWritable.Enabled = false;
- this.c_IsWritable.Location = new System.Drawing.Point(269, 233);
- this.c_IsWritable.Name = "c_IsWritable";
- this.c_IsWritable.Size = new System.Drawing.Size(19, 17);
- this.c_IsWritable.TabIndex = 22;
- //
- // label3
- //
- this.label3.Location = new System.Drawing.Point(288, 233);
- this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(77, 17);
- this.label3.TabIndex = 23;
- this.label3.Text = "Is Writable?";
- //
- // c_Tracks
- //
- this.c_Tracks.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
- this.columnHeader1,
- this.columnHeader2,
- this.columnHeader3,
- this.columnHeader4,
- this.columnHeader5,
- this.columnHeader6});
- this.c_Tracks.FullRowSelect = true;
- this.c_Tracks.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
- this.c_Tracks.Location = new System.Drawing.Point(10, 276);
- this.c_Tracks.Name = "c_Tracks";
- this.c_Tracks.Size = new System.Drawing.Size(547, 120);
- this.c_Tracks.TabIndex = 25;
- this.c_Tracks.UseCompatibleStateImageBehavior = false;
- this.c_Tracks.View = System.Windows.Forms.View.Details;
- //
- // columnHeader1
- //
- this.columnHeader1.Text = "S#";
- this.columnHeader1.Width = 30;
- //
- // columnHeader2
- //
- this.columnHeader2.Text = "T#";
- this.columnHeader2.Width = 30;
- //
- // columnHeader3
- //
- this.columnHeader3.Text = "Type";
- //
- // columnHeader4
- //
- this.columnHeader4.Text = "Artist - Title";
- this.columnHeader4.Width = 150;
- //
- // columnHeader5
- //
- this.columnHeader5.Text = "Start Block";
- this.columnHeader5.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- this.columnHeader5.Width = 80;
- //
- // columnHeader6
- //
- this.columnHeader6.Text = "Length Blocks";
- this.columnHeader6.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
- this.columnHeader6.Width = 80;
- //
- // label16
- //
- this.label16.Location = new System.Drawing.Point(10, 258);
- this.label16.Name = "label16";
- this.label16.Size = new System.Drawing.Size(57, 18);
- this.label16.TabIndex = 24;
- this.label16.Text = "Tracks:";
- //
- // c_VMSInfo
- //
- this.c_VMSInfo.Location = new System.Drawing.Point(470, 112);
- this.c_VMSInfo.Name = "c_VMSInfo";
- this.c_VMSInfo.Size = new System.Drawing.Size(90, 25);
- this.c_VMSInfo.TabIndex = 27;
- this.c_VMSInfo.Text = "VMS Info";
- this.c_VMSInfo.Click += new System.EventHandler(this.c_VMSInfo_Click);
- //
- // DiscInfoForm
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
- this.CancelButton = this.c_OK;
- this.ClientSize = new System.Drawing.Size(575, 392);
- this.Controls.Add(this.c_VMSInfo);
- this.Controls.Add(this.label16);
- this.Controls.Add(this.c_Tracks);
- this.Controls.Add(this.label3);
- this.Controls.Add(this.c_IsWritable);
- this.Controls.Add(this.c_MediumFlags);
- this.Controls.Add(this.label11);
- this.Controls.Add(this.c_Artist);
- this.Controls.Add(this.c_Title);
- this.Controls.Add(this.c_FreeCapacityBlocks);
- this.Controls.Add(this.c_UnusedBlocks);
- this.Controls.Add(this.c_MediaType);
- this.Controls.Add(this.c_AvailableEraseMode);
- this.Controls.Add(this.c_Device);
- this.Controls.Add(this.c_TotalCapacity);
- this.Controls.Add(this.c_Layer0MaxBlocks);
- this.Controls.Add(this.label2);
- this.Controls.Add(this.label1);
- this.Controls.Add(this.c_OK);
- this.Controls.Add(this.label4);
- this.Controls.Add(this.label6);
- this.Controls.Add(this.label7);
- this.Controls.Add(this.label9);
- this.Controls.Add(this.label5);
- this.Controls.Add(this.label10);
- this.Controls.Add(this.label8);
- this.Controls.Add(this.c_Refresh);
- this.Controls.Add(this.label12);
- this.Controls.Add(this.label13);
- this.Controls.Add(this.label14);
- this.Controls.Add(this.label15);
- this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
- this.MaximizeBox = false;
- this.MinimizeBox = false;
- this.Name = "DiscInfoForm";
- this.ShowInTaskbar = false;
- this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
- this.Text = "DiscInfo";
- this.ResumeLayout(false);
- this.PerformLayout();
- }
- #endregion
- private void DisplayDiscInfo (NeroCDInfo cdinfo)
- {
- bool bEnableGetVMSInfo = false;
-
- if (cdinfo != null)
- {
- bEnableGetVMSInfo = 0 != (cdinfo.MediumFlags & NERO_MEDIUM_FLAGS.NCDIMF_VIRTUALMULTISESSION);
-
- c_IsWritable.Checked = cdinfo.IsWriteable;
- c_Artist.Text = cdinfo.Artist;
- c_Title.Text = cdinfo.Title;
- c_FreeCapacityBlocks.Text = cdinfo.FreeCapacityInBlocks.ToString ();
- c_UnusedBlocks.Text = ((uint) cdinfo.UnusedBlocks).ToString ();
- string sEraseModes = "";
- string [] sModes = new string[2] {"Entire", "Quick"};
- int iEraseModes = cdinfo.AvailableEraseModes;
- int i = 0;
- foreach (string sMode in sModes)
- {
- if (0 != (iEraseModes & (1<<i)))
- {
- if (sEraseModes != "")
- {
- sEraseModes += " ";
- }
-
- sEraseModes += sMode;
- }
- i ++;
- }
- c_AvailableEraseMode.Text = sEraseModes;
- c_MediaType.Text = m_nero.get_TypeNameOfMedia (cdinfo.MediaType);
- ShowMediumFlags (cdinfo.MediumFlags);
- c_TotalCapacity.Text = cdinfo.TotalCapacity.ToString ();
- c_Layer0MaxBlocks.Text = cdinfo.Layer0MaxBlocks.ToString ();
- c_Tracks.Items.Clear ();
- foreach (NeroTrack trk in cdinfo.Tracks)
- {
- ListViewItem lvi = c_Tracks.Items.Add (trk.SessionNumber.ToString ());
- c_Tracks.Items[lvi.Index].SubItems.Add (trk.TrackNumber.ToString ());
- string sTrackType = "Unknown";
- switch (trk.TrackType)
- {
- case NERO_TRACK_TYPE.NERO_TT_AUDIO:
- sTrackType = "Audio";
- break;
- case NERO_TRACK_TYPE.NERO_TT_DATA:
- sTrackType = "Data";
- break;
- }
- c_Tracks.Items[lvi.Index].SubItems.Add (sTrackType);
- string sArtist = trk.Artist == ""? "Unknown": trk.Artist;
- string sTitle = trk.Title == ""? "Unknown": trk.Title;
- c_Tracks.Items[lvi.Index].SubItems.Add (sArtist + " - " + sTitle);
- c_Tracks.Items[lvi.Index].SubItems.Add (trk.TrackStartBlk.ToString ());
- c_Tracks.Items[lvi.Index].SubItems.Add (trk.TrackLengthInBlks.ToString ());
- }
- }
- else
- {
- c_IsWritable.Checked = false;
- c_Artist.Text = "";
- c_Title.Text = "";
- c_FreeCapacityBlocks.Text = "";
- c_UnusedBlocks.Text = "";
- c_AvailableEraseMode.Text = "";
- c_MediaType.Text = "";
- c_TotalCapacity.Text = "";
- c_Layer0MaxBlocks.Text = "";
- c_Tracks.Items.Clear ();
- ShowMediumFlags (0);
- MessageBox.Show (this, "No disc!");
- }
- c_VMSInfo.Enabled = bEnableGetVMSInfo;
- }
- private void drive_OnDoneCDInfo(INeroCDInfo pCDInfo)
- {
- m_drive.OnDoneCDInfo -= m_evOnDoneCDInfo;
- this.Cursor = Cursors.Default;
- m_controlEnabler.EnableAllControls (true);
- DisplayDiscInfo ((NeroCDInfo) pCDInfo);
- }
- private void ShowMediumFlags (NERO_MEDIUM_FLAGS nmf)
- {
- int i = 0;
- foreach (NERO_MEDIUM_FLAGS flag in m_nmf)
- {
- c_MediumFlags.Items[i++].Checked = (0 != (nmf & flag));
- }
- }
- protected override void OnLoad(EventArgs e)
- {
- base.OnLoad (e);
- if (m_drive != null)
- {
- c_Device.Text = m_drive.DeviceName;
- m_evOnDoneCDInfo = new _INeroDriveEvents_OnDoneCDInfoEventHandler(drive_OnDoneCDInfo);
- m_drive.OnDoneCDInfo += m_evOnDoneCDInfo;
- }
- else
- {
- c_Device.Text = m_sImageFilepath;
- NeroCDInfo cdinfo = (NeroCDInfo) m_nero.GetDiscImageInfo (m_sImageFilepath);
- DisplayDiscInfo (cdinfo);
- }
- RefreshDiscInfo ();
- }
- private void RefreshDiscInfo ()
- {
- if (m_drive != null)
- {
- this.Cursor = Cursors.WaitCursor;
- m_controlEnabler.EnableAllControls (false);
- m_drive.CDInfo (NERO_CDINFO_FLAGS.NERO_READ_CD_TEXT);
- }
- }
- private void c_Refresh_Click(object sender, System.EventArgs e)
- {
- RefreshDiscInfo ();
- }
- private void c_VMSInfo_Click(object sender, System.EventArgs e)
- {
- VMSInfoForm frm = new VMSInfoForm();
- frm.m_drive = m_drive;
-
- frm.ShowDialog (this);
- }
- }
- }
|