This sample will show you how to burn an audio cd from WAV, MP3, WMA, ACM, PCM, AIF, VOC, OGG, APE and more audio files, using Visual C#.
Requirements:
- Visual C# 2008/2010
- Audio Burner ActiveX | Download
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 | public Form1() { // // 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.components = new System.ComponentModel.Container(); System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1)); this.cmdRegistration = new System.Windows.Forms.Button(); this.cmdAbout = new System.Windows.Forms.Button(); this.Picture1 = new System.Windows.Forms.Panel(); this.lblTitleName = new System.Windows.Forms.Label(); this.lblTitle = new System.Windows.Forms.Label(); this.cmdDiskCapacity = new System.Windows.Forms.Button(); this.cmdDiskSize = new System.Windows.Forms.Button(); this.cmdIsReady = new System.Windows.Forms.Button(); this.cmdClose = new System.Windows.Forms.Button(); this.cmdOpenCD = new System.Windows.Forms.Button(); this.Frame1 = new System.Windows.Forms.GroupBox(); this.prgTrack = new AxMSComctlLib.AxProgressBar(); this.prgTotal = new AxMSComctlLib.AxProgressBar(); this.lblTrack = new System.Windows.Forms.Label(); this.lblTotal = new System.Windows.Forms.Label(); this.cmdBurn = new System.Windows.Forms.Button(); this.cmdMoveUp = new System.Windows.Forms.Button(); this.cmdMoveDown = new System.Windows.Forms.Button(); this.cmdAddFile = new System.Windows.Forms.Button(); this.cmdRemFile = new System.Windows.Forms.Button(); this.cmdOpenCloseDoor = new System.Windows.Forms.Button(); this.cmdCancel = new System.Windows.Forms.Button(); this.cboDrv = new System.Windows.Forms.ComboBox(); this.cboSpeed = new System.Windows.Forms.ComboBox(); this.Label3 = new System.Windows.Forms.Label(); this.Label4 = new System.Windows.Forms.Label(); this.Label5 = new System.Windows.Forms.Label(); this.ToolTip1 = new System.Windows.Forms.ToolTip(this.components); this.Label6 = new System.Windows.Forms.Label(); this.Label7 = new System.Windows.Forms.Label(); this.Label8 = new System.Windows.Forms.Label(); this.lblDiskSize = new System.Windows.Forms.Label(); this.lblDiskCapacity = new System.Windows.Forms.Label(); this.lblState = new System.Windows.Forms.Label(); this.Label2 = new System.Windows.Forms.Label(); this.Label1 = new System.Windows.Forms.Label(); this.cAudioBurner1 = new AxAudio_Burner_AX.AxcAudioBurner(); this.dlg = new AxMSComDlg.AxCommonDialog(); this.lstTracks = new System.Windows.Forms.ListBox(); this.sbar = new AxMSComctlLib.AxStatusBar(); this.Picture1.SuspendLayout(); this.Frame1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.prgTrack)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.prgTotal)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.cAudioBurner1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dlg)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.sbar)).BeginInit(); this.SuspendLayout(); // // cmdRegistration // this.cmdRegistration.BackColor = System.Drawing.SystemColors.Control; this.cmdRegistration.Cursor = System.Windows.Forms.Cursors.Default; this.cmdRegistration.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(177))); this.cmdRegistration.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdRegistration.Location = new System.Drawing.Point(464, 424); this.cmdRegistration.Name = "cmdRegistration"; this.cmdRegistration.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdRegistration.Size = new System.Drawing.Size(121, 33); this.cmdRegistration.TabIndex = 65; this.cmdRegistration.Text = "Registration >>"; this.cmdRegistration.Click += new System.EventHandler(this.cmdRegistration_Click); // // cmdAbout // this.cmdAbout.BackColor = System.Drawing.SystemColors.Control; this.cmdAbout.Cursor = System.Windows.Forms.Cursors.Default; this.cmdAbout.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cmdAbout.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdAbout.Location = new System.Drawing.Point(464, 464); this.cmdAbout.Name = "cmdAbout"; this.cmdAbout.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdAbout.Size = new System.Drawing.Size(121, 33); this.cmdAbout.TabIndex = 64; this.cmdAbout.Text = "About"; this.cmdAbout.Click += new System.EventHandler(this.cmdAbout_Click); // // Picture1 // this.Picture1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(63)), ((System.Byte)(63)), ((System.Byte)(63))); this.Picture1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.Picture1.Controls.Add(this.lblTitleName); this.Picture1.Controls.Add(this.lblTitle); this.Picture1.Cursor = System.Windows.Forms.Cursors.Default; this.Picture1.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Picture1.ForeColor = System.Drawing.SystemColors.InactiveBorder; this.Picture1.Location = new System.Drawing.Point(0, 0); this.Picture1.Name = "Picture1"; this.Picture1.RightToLeft = System.Windows.Forms.RightToLeft.No; this.Picture1.Size = new System.Drawing.Size(657, 57); this.Picture1.TabIndex = 63; this.Picture1.TabStop = true; // // lblTitleName // this.lblTitleName.AutoSize = true; this.lblTitleName.BackColor = System.Drawing.Color.Transparent; this.lblTitleName.Cursor = System.Windows.Forms.Cursors.Default; this.lblTitleName.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(177))); this.lblTitleName.ForeColor = System.Drawing.Color.White; this.lblTitleName.Location = new System.Drawing.Point(8, 8); this.lblTitleName.Name = "lblTitleName"; this.lblTitleName.RightToLeft = System.Windows.Forms.RightToLeft.No; this.lblTitleName.Size = new System.Drawing.Size(142, 23); this.lblTitleName.TabIndex = 33; this.lblTitleName.Text = "Audio Burner AX"; // // lblTitle // this.lblTitle.AutoSize = true; this.lblTitle.BackColor = System.Drawing.Color.Transparent; this.lblTitle.Cursor = System.Windows.Forms.Cursors.Default; this.lblTitle.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lblTitle.ForeColor = System.Drawing.Color.White; this.lblTitle.Location = new System.Drawing.Point(8, 32); this.lblTitle.Name = "lblTitle"; this.lblTitle.RightToLeft = System.Windows.Forms.RightToLeft.No; this.lblTitle.Size = new System.Drawing.Size(490, 16); this.lblTitle.TabIndex = 32; this.lblTitle.Text = "Burn Audio CDs from WAV, ACM, MP3, WMA, OGG, APE, SND, VOX, AIF and CDA audio for" + "mats."; // // cmdDiskCapacity // this.cmdDiskCapacity.BackColor = System.Drawing.SystemColors.Control; this.cmdDiskCapacity.Cursor = System.Windows.Forms.Cursors.Default; this.cmdDiskCapacity.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cmdDiskCapacity.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdDiskCapacity.Location = new System.Drawing.Point(88, 176); this.cmdDiskCapacity.Name = "cmdDiskCapacity"; this.cmdDiskCapacity.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdDiskCapacity.Size = new System.Drawing.Size(89, 21); this.cmdDiskCapacity.TabIndex = 53; this.cmdDiskCapacity.Text = "Disk Capacity"; this.cmdDiskCapacity.Click += new System.EventHandler(this.cmdDiskCapacity_Click); // // cmdDiskSize // this.cmdDiskSize.BackColor = System.Drawing.SystemColors.Control; this.cmdDiskSize.Cursor = System.Windows.Forms.Cursors.Default; this.cmdDiskSize.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cmdDiskSize.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdDiskSize.Location = new System.Drawing.Point(8, 176); this.cmdDiskSize.Name = "cmdDiskSize"; this.cmdDiskSize.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdDiskSize.Size = new System.Drawing.Size(81, 21); this.cmdDiskSize.TabIndex = 52; this.cmdDiskSize.Text = "Disk SIze"; this.cmdDiskSize.Click += new System.EventHandler(this.cmdDiskSize_Click); // // cmdIsReady // this.cmdIsReady.BackColor = System.Drawing.SystemColors.Control; this.cmdIsReady.Cursor = System.Windows.Forms.Cursors.Default; this.cmdIsReady.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cmdIsReady.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdIsReady.Location = new System.Drawing.Point(328, 176); this.cmdIsReady.Name = "cmdIsReady"; this.cmdIsReady.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdIsReady.Size = new System.Drawing.Size(81, 21); this.cmdIsReady.TabIndex = 51; this.cmdIsReady.Text = "Is Ready?"; this.cmdIsReady.Click += new System.EventHandler(this.cmdIsReady_Click); // // cmdClose // this.cmdClose.BackColor = System.Drawing.SystemColors.Control; this.cmdClose.Cursor = System.Windows.Forms.Cursors.Default; this.cmdClose.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cmdClose.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdClose.Location = new System.Drawing.Point(256, 176); this.cmdClose.Name = "cmdClose"; this.cmdClose.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdClose.Size = new System.Drawing.Size(65, 21); this.cmdClose.TabIndex = 50; this.cmdClose.Text = "Close CD"; this.cmdClose.Click += new System.EventHandler(this.cmdClose_Click); // // cmdOpenCD // this.cmdOpenCD.BackColor = System.Drawing.SystemColors.Control; this.cmdOpenCD.Cursor = System.Windows.Forms.Cursors.Default; this.cmdOpenCD.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cmdOpenCD.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdOpenCD.Location = new System.Drawing.Point(192, 176); this.cmdOpenCD.Name = "cmdOpenCD"; this.cmdOpenCD.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdOpenCD.Size = new System.Drawing.Size(65, 21); this.cmdOpenCD.TabIndex = 49; this.cmdOpenCD.Text = "Open CD"; this.cmdOpenCD.Click += new System.EventHandler(this.cmdOpenCD_Click); // // Frame1 // this.Frame1.BackColor = System.Drawing.SystemColors.Control; this.Frame1.Controls.Add(this.prgTrack); this.Frame1.Controls.Add(this.prgTotal); this.Frame1.Controls.Add(this.lblTrack); this.Frame1.Controls.Add(this.lblTotal); this.Frame1.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Frame1.ForeColor = System.Drawing.SystemColors.ControlText; this.Frame1.Location = new System.Drawing.Point(8, 520); this.Frame1.Name = "Frame1"; this.Frame1.RightToLeft = System.Windows.Forms.RightToLeft.No; this.Frame1.Size = new System.Drawing.Size(577, 65); this.Frame1.TabIndex = 48; this.Frame1.TabStop = false; // // prgTrack // this.prgTrack.ContainingControl = this; this.prgTrack.Location = new System.Drawing.Point(48, 40); this.prgTrack.Name = "prgTrack"; this.prgTrack.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("prgTrack.OcxState"))); this.prgTrack.Size = new System.Drawing.Size(512, 16); this.prgTrack.TabIndex = 18; // // prgTotal // this.prgTotal.ContainingControl = this; this.prgTotal.Location = new System.Drawing.Point(48, 16); this.prgTotal.Name = "prgTotal"; this.prgTotal.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("prgTotal.OcxState"))); this.prgTotal.Size = new System.Drawing.Size(512, 16); this.prgTotal.TabIndex = 17; // // lblTrack // this.lblTrack.AutoSize = true; this.lblTrack.BackColor = System.Drawing.SystemColors.Control; this.lblTrack.Cursor = System.Windows.Forms.Cursors.Default; this.lblTrack.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lblTrack.ForeColor = System.Drawing.SystemColors.ControlText; this.lblTrack.Location = new System.Drawing.Point(8, 40); this.lblTrack.Name = "lblTrack"; this.lblTrack.RightToLeft = System.Windows.Forms.RightToLeft.No; this.lblTrack.Size = new System.Drawing.Size(35, 16); this.lblTrack.TabIndex = 4; this.lblTrack.Text = "Track:"; // // lblTotal // this.lblTotal.AutoSize = true; this.lblTotal.BackColor = System.Drawing.SystemColors.Control; this.lblTotal.Cursor = System.Windows.Forms.Cursors.Default; this.lblTotal.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lblTotal.ForeColor = System.Drawing.SystemColors.ControlText; this.lblTotal.Location = new System.Drawing.Point(8, 16); this.lblTotal.Name = "lblTotal"; this.lblTotal.RightToLeft = System.Windows.Forms.RightToLeft.No; this.lblTotal.Size = new System.Drawing.Size(32, 16); this.lblTotal.TabIndex = 16; this.lblTotal.Text = "Total:"; // // cmdBurn // this.cmdBurn.BackColor = System.Drawing.SystemColors.Control; this.cmdBurn.Cursor = System.Windows.Forms.Cursors.Default; this.cmdBurn.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(177))); this.cmdBurn.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdBurn.Location = new System.Drawing.Point(464, 344); this.cmdBurn.Name = "cmdBurn"; this.cmdBurn.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdBurn.Size = new System.Drawing.Size(119, 29); this.cmdBurn.TabIndex = 47; this.cmdBurn.Text = "Burn disk"; this.cmdBurn.Click += new System.EventHandler(this.cmdBurn_Click); // // cmdMoveUp // this.cmdMoveUp.BackColor = System.Drawing.SystemColors.Control; this.cmdMoveUp.Cursor = System.Windows.Forms.Cursors.Default; this.cmdMoveUp.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cmdMoveUp.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdMoveUp.Location = new System.Drawing.Point(464, 256); this.cmdMoveUp.Name = "cmdMoveUp"; this.cmdMoveUp.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdMoveUp.Size = new System.Drawing.Size(119, 29); this.cmdMoveUp.TabIndex = 46; this.cmdMoveUp.Text = "Move up"; this.cmdMoveUp.Click += new System.EventHandler(this.cmdMoveUp_Click); // // cmdMoveDown // this.cmdMoveDown.BackColor = System.Drawing.SystemColors.Control; this.cmdMoveDown.Cursor = System.Windows.Forms.Cursors.Default; this.cmdMoveDown.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cmdMoveDown.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdMoveDown.Location = new System.Drawing.Point(464, 288); this.cmdMoveDown.Name = "cmdMoveDown"; this.cmdMoveDown.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdMoveDown.Size = new System.Drawing.Size(119, 29); this.cmdMoveDown.TabIndex = 45; this.cmdMoveDown.Text = "Move down"; this.cmdMoveDown.Click += new System.EventHandler(this.cmdMoveDown_Click); // // cmdAddFile // this.cmdAddFile.BackColor = System.Drawing.SystemColors.Control; this.cmdAddFile.Cursor = System.Windows.Forms.Cursors.Default; this.cmdAddFile.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cmdAddFile.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdAddFile.Location = new System.Drawing.Point(464, 176); this.cmdAddFile.Name = "cmdAddFile"; this.cmdAddFile.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdAddFile.Size = new System.Drawing.Size(119, 29); this.cmdAddFile.TabIndex = 44; this.cmdAddFile.Text = "Add files"; this.cmdAddFile.Click += new System.EventHandler(this.cmdAddFile_Click); // // cmdRemFile // this.cmdRemFile.BackColor = System.Drawing.SystemColors.Control; this.cmdRemFile.Cursor = System.Windows.Forms.Cursors.Default; this.cmdRemFile.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cmdRemFile.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdRemFile.Location = new System.Drawing.Point(464, 208); this.cmdRemFile.Name = "cmdRemFile"; this.cmdRemFile.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdRemFile.Size = new System.Drawing.Size(119, 29); this.cmdRemFile.TabIndex = 43; this.cmdRemFile.Text = "Remove files"; this.cmdRemFile.Click += new System.EventHandler(this.cmdRemFile_Click); // // cmdOpenCloseDoor // this.cmdOpenCloseDoor.BackColor = System.Drawing.SystemColors.Control; this.cmdOpenCloseDoor.Cursor = System.Windows.Forms.Cursors.Default; this.cmdOpenCloseDoor.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(177))); this.cmdOpenCloseDoor.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdOpenCloseDoor.Location = new System.Drawing.Point(424, 176); this.cmdOpenCloseDoor.Name = "cmdOpenCloseDoor"; this.cmdOpenCloseDoor.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdOpenCloseDoor.Size = new System.Drawing.Size(25, 21); this.cmdOpenCloseDoor.TabIndex = 40; this.cmdOpenCloseDoor.Text = "..."; // // cmdCancel // this.cmdCancel.BackColor = System.Drawing.SystemColors.Control; this.cmdCancel.Cursor = System.Windows.Forms.Cursors.Default; this.cmdCancel.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cmdCancel.ForeColor = System.Drawing.SystemColors.ControlText; this.cmdCancel.Location = new System.Drawing.Point(464, 376); this.cmdCancel.Name = "cmdCancel"; this.cmdCancel.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cmdCancel.Size = new System.Drawing.Size(121, 29); this.cmdCancel.TabIndex = 39; this.cmdCancel.Text = "Cancel"; this.cmdCancel.Click += new System.EventHandler(this.cmdCancel_Click); // // cboDrv // this.cboDrv.BackColor = System.Drawing.SystemColors.Window; this.cboDrv.Cursor = System.Windows.Forms.Cursors.Default; this.cboDrv.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboDrv.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cboDrv.ForeColor = System.Drawing.SystemColors.WindowText; this.cboDrv.Location = new System.Drawing.Point(8, 88); this.cboDrv.Name = "cboDrv"; this.cboDrv.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cboDrv.Size = new System.Drawing.Size(407, 21); this.cboDrv.TabIndex = 38; this.cboDrv.SelectedIndexChanged += new System.EventHandler(this.cboDrv_SelectedIndexChanged); // // cboSpeed // this.cboSpeed.BackColor = System.Drawing.SystemColors.Window; this.cboSpeed.Cursor = System.Windows.Forms.Cursors.Default; this.cboSpeed.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboSpeed.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.cboSpeed.ForeColor = System.Drawing.SystemColors.WindowText; this.cboSpeed.Location = new System.Drawing.Point(424, 88); this.cboSpeed.Name = "cboSpeed"; this.cboSpeed.RightToLeft = System.Windows.Forms.RightToLeft.No; this.cboSpeed.Size = new System.Drawing.Size(158, 21); this.cboSpeed.TabIndex = 37; // // Label3 // this.Label3.AutoSize = true; this.Label3.BackColor = System.Drawing.Color.Transparent; this.Label3.Cursor = System.Windows.Forms.Cursors.Default; this.Label3.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Label3.ForeColor = System.Drawing.SystemColors.ControlText; this.Label3.Location = new System.Drawing.Point(16, 120); this.Label3.Name = "Label3"; this.Label3.RightToLeft = System.Windows.Forms.RightToLeft.No; this.Label3.Size = new System.Drawing.Size(50, 16); this.Label3.TabIndex = 62; this.Label3.Text = "Disk Size"; // // Label4 // this.Label4.AutoSize = true; this.Label4.BackColor = System.Drawing.Color.Transparent; this.Label4.Cursor = System.Windows.Forms.Cursors.Default; this.Label4.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Label4.ForeColor = System.Drawing.SystemColors.ControlText; this.Label4.Location = new System.Drawing.Point(16, 136); this.Label4.Name = "Label4"; this.Label4.RightToLeft = System.Windows.Forms.RightToLeft.No; this.Label4.Size = new System.Drawing.Size(71, 16); this.Label4.TabIndex = 61; this.Label4.Text = "Disk Capacity"; // // Label5 // this.Label5.AutoSize = true; this.Label5.BackColor = System.Drawing.Color.Transparent; this.Label5.Cursor = System.Windows.Forms.Cursors.Default; this.Label5.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Label5.ForeColor = System.Drawing.SystemColors.ControlText; this.Label5.Location = new System.Drawing.Point(16, 152); this.Label5.Name = "Label5"; this.Label5.RightToLeft = System.Windows.Forms.RightToLeft.No; this.Label5.Size = new System.Drawing.Size(54, 16); this.Label5.TabIndex = 60; this.Label5.Text = "Disk State"; // // Label6 // this.Label6.AutoSize = true; this.Label6.BackColor = System.Drawing.Color.Transparent; this.Label6.Cursor = System.Windows.Forms.Cursors.Default; this.Label6.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Label6.ForeColor = System.Drawing.SystemColors.ControlText; this.Label6.Location = new System.Drawing.Point(104, 120); this.Label6.Name = "Label6"; this.Label6.RightToLeft = System.Windows.Forms.RightToLeft.No; this.Label6.Size = new System.Drawing.Size(8, 16); this.Label6.TabIndex = 59; this.Label6.Text = "-"; // // Label7 // this.Label7.AutoSize = true; this.Label7.BackColor = System.Drawing.Color.Transparent; this.Label7.Cursor = System.Windows.Forms.Cursors.Default; this.Label7.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Label7.ForeColor = System.Drawing.SystemColors.ControlText; this.Label7.Location = new System.Drawing.Point(104, 136); this.Label7.Name = "Label7"; this.Label7.RightToLeft = System.Windows.Forms.RightToLeft.No; this.Label7.Size = new System.Drawing.Size(8, 16); this.Label7.TabIndex = 58; this.Label7.Text = "-"; // // Label8 // this.Label8.AutoSize = true; this.Label8.BackColor = System.Drawing.Color.Transparent; this.Label8.Cursor = System.Windows.Forms.Cursors.Default; this.Label8.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Label8.ForeColor = System.Drawing.SystemColors.ControlText; this.Label8.Location = new System.Drawing.Point(104, 152); this.Label8.Name = "Label8"; this.Label8.RightToLeft = System.Windows.Forms.RightToLeft.No; this.Label8.Size = new System.Drawing.Size(8, 16); this.Label8.TabIndex = 57; this.Label8.Text = "-"; // // lblDiskSize // this.lblDiskSize.AutoSize = true; this.lblDiskSize.BackColor = System.Drawing.Color.Transparent; this.lblDiskSize.Cursor = System.Windows.Forms.Cursors.Default; this.lblDiskSize.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lblDiskSize.ForeColor = System.Drawing.SystemColors.ControlText; this.lblDiskSize.Location = new System.Drawing.Point(136, 120); this.lblDiskSize.Name = "lblDiskSize"; this.lblDiskSize.RightToLeft = System.Windows.Forms.RightToLeft.No; this.lblDiskSize.Size = new System.Drawing.Size(50, 16); this.lblDiskSize.TabIndex = 56; this.lblDiskSize.Text = "Disk Size"; // // lblDiskCapacity // this.lblDiskCapacity.AutoSize = true; this.lblDiskCapacity.BackColor = System.Drawing.Color.Transparent; this.lblDiskCapacity.Cursor = System.Windows.Forms.Cursors.Default; this.lblDiskCapacity.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lblDiskCapacity.ForeColor = System.Drawing.SystemColors.ControlText; this.lblDiskCapacity.Location = new System.Drawing.Point(136, 136); this.lblDiskCapacity.Name = "lblDiskCapacity"; this.lblDiskCapacity.RightToLeft = System.Windows.Forms.RightToLeft.No; this.lblDiskCapacity.Size = new System.Drawing.Size(71, 16); this.lblDiskCapacity.TabIndex = 55; this.lblDiskCapacity.Text = "Disk Capacity"; // // lblState // this.lblState.AutoSize = true; this.lblState.BackColor = System.Drawing.Color.Transparent; this.lblState.Cursor = System.Windows.Forms.Cursors.Default; this.lblState.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lblState.ForeColor = System.Drawing.SystemColors.ControlText; this.lblState.Location = new System.Drawing.Point(136, 152); this.lblState.Name = "lblState"; this.lblState.RightToLeft = System.Windows.Forms.RightToLeft.No; this.lblState.Size = new System.Drawing.Size(30, 16); this.lblState.TabIndex = 54; this.lblState.Text = "State"; // // Label2 // this.Label2.AutoSize = true; this.Label2.BackColor = System.Drawing.SystemColors.Control; this.Label2.Cursor = System.Windows.Forms.Cursors.Default; this.Label2.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Label2.ForeColor = System.Drawing.SystemColors.ControlText; this.Label2.Location = new System.Drawing.Point(424, 72); this.Label2.Name = "Label2"; this.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No; this.Label2.Size = new System.Drawing.Size(44, 16); this.Label2.TabIndex = 42; this.Label2.Text = "Speeds:"; // // Label1 // this.Label1.AutoSize = true; this.Label1.BackColor = System.Drawing.SystemColors.Control; this.Label1.Cursor = System.Windows.Forms.Cursors.Default; this.Label1.Font = new System.Drawing.Font("Arial", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Label1.ForeColor = System.Drawing.SystemColors.ControlText; this.Label1.Location = new System.Drawing.Point(8, 72); this.Label1.Name = "Label1"; this.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No; this.Label1.Size = new System.Drawing.Size(28, 16); this.Label1.TabIndex = 41; this.Label1.Text = "CDs:"; // // cAudioBurner1 // this.cAudioBurner1.Enabled = true; this.cAudioBurner1.Location = new System.Drawing.Point(536, 120); this.cAudioBurner1.Name = "cAudioBurner1"; this.cAudioBurner1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("cAudioBurner1.OcxState"))); this.cAudioBurner1.Size = new System.Drawing.Size(34, 34); this.cAudioBurner1.TabIndex = 67; this.cAudioBurner1.Error += new AxAudio_Burner_AX.__cAudioBurner_ErrorEventHandler(this.cAudioBurner1_Error); this.cAudioBurner1.Finished += new System.EventHandler(this.cAudioBurner1_Finished); this.cAudioBurner1.ClosingSession += new System.EventHandler(this.cAudioBurner1_ClosingSession); this.cAudioBurner1.BurnProgress += new AxAudio_Burner_AX.__cAudioBurner_BurnProgressEventHandler(this.cAudioBurner1_BurnProgress); this.cAudioBurner1.StartWriting += new System.EventHandler(this.cAudioBurner1_StartWriting); this.cAudioBurner1.ClosingTrack += new AxAudio_Burner_AX.__cAudioBurner_ClosingTrackEventHandler(this.cAudioBurner1_ClosingTrack); this.cAudioBurner1.CacheProgress += new AxAudio_Burner_AX.__cAudioBurner_CacheProgressEventHandler(this.cAudioBurner1_CacheProgress); this.cAudioBurner1.StartCaching += new System.EventHandler(this.cAudioBurner1_StartCaching); // // dlg // this.dlg.Enabled = true; this.dlg.Location = new System.Drawing.Point(464, 128); this.dlg.Name = "dlg"; this.dlg.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("dlg.OcxState"))); this.dlg.Size = new System.Drawing.Size(32, 32); this.dlg.TabIndex = 68; // // lstTracks // this.lstTracks.Location = new System.Drawing.Point(8, 200); this.lstTracks.Name = "lstTracks"; this.lstTracks.Size = new System.Drawing.Size(448, 303); this.lstTracks.TabIndex = 69; // // sbar // this.sbar.Dock = System.Windows.Forms.DockStyle.Bottom; this.sbar.Location = new System.Drawing.Point(0, 582); this.sbar.Name = "sbar"; this.sbar.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("sbar.OcxState"))); this.sbar.Size = new System.Drawing.Size(608, 24); this.sbar.TabIndex = 70; // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(608, 606); this.Controls.Add(this.sbar); this.Controls.Add(this.lstTracks); this.Controls.Add(this.dlg); this.Controls.Add(this.cAudioBurner1); this.Controls.Add(this.cmdAbout); this.Controls.Add(this.Picture1); this.Controls.Add(this.cmdDiskCapacity); this.Controls.Add(this.cmdDiskSize); this.Controls.Add(this.cmdIsReady); this.Controls.Add(this.cmdClose); this.Controls.Add(this.cmdOpenCD); this.Controls.Add(this.Frame1); this.Controls.Add(this.cmdBurn); this.Controls.Add(this.cmdMoveUp); this.Controls.Add(this.cmdMoveDown); this.Controls.Add(this.cmdAddFile); this.Controls.Add(this.cmdRemFile); this.Controls.Add(this.cmdOpenCloseDoor); this.Controls.Add(this.cmdCancel); this.Controls.Add(this.cboDrv); this.Controls.Add(this.cboSpeed); 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.lblDiskSize); this.Controls.Add(this.lblDiskCapacity); this.Controls.Add(this.lblState); this.Controls.Add(this.Label2); this.Controls.Add(this.Label1); this.Controls.Add(this.cmdRegistration); this.Name = "Form1"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.Picture1.ResumeLayout(false); this.Frame1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.prgTrack)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.prgTotal)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.cAudioBurner1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dlg)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.sbar)).EndInit(); this.ResumeLayout(false); } #endregion /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); } private void Form1_Load(object sender, System.EventArgs e) { // 1) Init the component with your license key. // // 2) This function must be call before using // any functinality of the component. // // 3) For trial mode use "Trial Mode." cAudioBurner1.Init("Trail Mode"); // List the writeable CDs: ListCdsX(); } private void ListCdsX() { // List the CDs without using VB6 collection: short cntr; int lNumOfCDDrives; // Get supported writable Cds without a collection. lNumOfCDDrives = cAudioBurner1.GetCdsX(); for (cntr = 1; (cntr <= lNumOfCDDrives); cntr++) { cboDrv.Items.Add(cAudioBurner1.GetCdsXVal(cntr)); } if ((cboDrv.Items.Count > 0)) { cboDrv.SelectedIndex = 0; } } private void cmdDiskSize_Click(object sender, System.EventArgs e) { // Get the media cd size: string drv = cboDrv.SelectedItem.ToString().Substring(0,1); MessageBox.Show("Size:" + cAudioBurner1.DiskSize(drv)); } private void cmdDiskCapacity_Click(object sender, System.EventArgs e) { // Get the media cd capacity: string drv = cboDrv.SelectedItem.ToString().Substring(0,1); MessageBox.Show("Cap:" + (cAudioBurner1.DiskCapacity(drv) / (153535 / 60)) + " Min"); } private void cmdOpenCD_Click(object sender, System.EventArgs e) { // Open the CD door: string drv = cboDrv.SelectedItem.ToString().Substring(0,1); cAudioBurner1.OpenDrive(drv); } private void cmdClose_Click(object sender, System.EventArgs e) { // Close the CD door: string drv = cboDrv.SelectedItem.ToString().Substring(0,1); cAudioBurner1.CloseDrive(drv); } private void cmdIsReady_Click(object sender, System.EventArgs e) { // Check if the cd drive and the cd media are ready to use: string drv = cboDrv.SelectedItem.ToString().Substring(0,1); MessageBox.Show(cAudioBurner1.IsLegalMedia(drv)); } private void cmdAddFile_Click(object sender, System.EventArgs e) { // Add audio files you wish to burn to the list view. dlg.ShowOpen(); // Add the selected file if ((lstTracks.Items.Count == 99)) { MessageBox.Show("Maximum 99 tracks allowed."); return; } if (!cAudioBurner1.AddFile(dlg.FileName)) { MessageBox.Show((dlg.FileName + ("\r\n" + " is not supported."))); } // Display the tracks in the list view. ListTracks(); } private void ListTracks() { int cTracksCounter; short cntr; // Get the number of tracks to burn: cTracksCounter = cAudioBurner1.GetTracksX(); // List the cTracks in the list view: lstTracks.Items.Clear(); for (cntr = 1; (cntr <= cTracksCounter); cntr++) { //lstTracks.ListItems.Add(ref oIndex,ref oKey,ref oText,ref oSmallIcon,ref oIcon); lstTracks.Items.Add(cAudioBurner1.GetTracksXVal((cntr - 1))); // TODO: Labeled Arguments not supported. Argument: 1 := 'Text' // TODO: Labeled Arguments not supported. Argument: 2 := 'SmallIcon' //lstTracks.. (cntr).SubItems(1) = (FormatTime(cAudioBurner1.TrackLength(cntr)) + " min"); //lstTracks.ListItems.Item(cntr).SubItems(2) = cAudioBurner1.GetTracksXVal((cntr - 1)); } } private void cmdRemFile_Click(object sender, System.EventArgs e) { // Remove the audio file from the files list to burn: cAudioBurner1.RemoveTrack((short)lstTracks.SelectedIndex); // List the tracks: ListTracks(); } private void cmdMoveUp_Click(object sender, System.EventArgs e) { // Move the selected audio file one step up: cAudioBurner1.MoveUp((short)lstTracks.SelectedIndex); // List the tracks: ListTracks(); } private void cmdMoveDown_Click(object sender, System.EventArgs e) { // Move the selected audio file one step down: cAudioBurner1.MoveDown((short)lstTracks.SelectedIndex); // List the tracks: ListTracks(); } private void cmdBurn_Click(object sender, System.EventArgs e) { string sStrID; // Check if there is any file to burn: if ((cAudioBurner1.TrackCount() > 0)) { // Set the progress bar to max: prgTotal.Max = cAudioBurner1.TrackCount(); sStrID = cboDrv.SelectedItem.ToString().Substring(0,1); // If there is no necessary to decode the audio files // before the burning, set this flag to false. cAudioBurner1.Decode = true; //&HFFFF = MAX SPEED. USE THE GETSPEED FUN TO FIND //THE SUPPORTED SPEEDS OF THE DRIVE. cAudioBurner1.Burn(sStrID, 65535); // Release the CD drive so it can be read fron the explorer: cAudioBurner1.ReleaseCD(); // The release function erase all data: ListTracks(); // Open the cd drive: cmdOpenCD_Click(cmdOpenCD, new System.EventArgs()); } else { MessageBox.Show("Nothing to burn."); } } private void cmdCancel_Click(object sender, System.EventArgs e) { //Cancel the burning process: cAudioBurner1.Cancel(); } private void cmdRegistration_Click(object sender, System.EventArgs e) { //Display registration: cAudioBurner1.DisplayRegistration(); } private void cmdAbout_Click(object sender, System.EventArgs e) { //Display About message box with the license details. cAudioBurner1.About(); } private void cAudioBurner1_BurnProgress(object sender, AxAudio_Burner_AX.__cAudioBurner_BurnProgressEvent e) { prgTrack.Value = e.percent; prgTotal.Value = e.track; System.Windows.Forms.Application.DoEvents(); } private void cAudioBurner1_CacheProgress(object sender, AxAudio_Burner_AX.__cAudioBurner_CacheProgressEvent e) { prgTrack.Value = e.percent; System.Windows.Forms.Application.DoEvents(); } private void cAudioBurner1_ClosingSession(object sender, System.EventArgs e) { sbar.SimpleText = "Closing session..."; } private void cAudioBurner1_ClosingTrack(object sender, AxAudio_Burner_AX.__cAudioBurner_ClosingTrackEvent e) { sbar.SimpleText = "Closing track..."; } private void cAudioBurner1_Error(object sender, AxAudio_Burner_AX.__cAudioBurner_ErrorEvent e) { MessageBox.Show(("Error:" + (e.errDescription + ("(" + (e.errnum + ")"))))); } private void cAudioBurner1_Finished(object sender, System.EventArgs e) { prgTotal.Value = prgTotal.Max; sbar.SimpleText = "Finished."; } private void cAudioBurner1_StartCaching(object sender, System.EventArgs e) { sbar.SimpleText = "Caching track..."; } private void cAudioBurner1_StartWriting(object sender, System.EventArgs e) { sbar.SimpleText = "Writing track..."; } private void cboDrv_SelectedIndexChanged(object sender, System.EventArgs e) { //int x = int.Parse(cboDrv.SelectedItem.ToString().Substring(0,1)); // List the speeds of the selected drive: ListSpeedsX(); // Display the information about the selected drive: lblDiskSize.Text = cAudioBurner1.DiskSize(cboDrv.SelectedItem.ToString().Substring(0,1)).ToString(); lblDiskCapacity.Text = cAudioBurner1.DiskCapacity(cboDrv.SelectedItem.ToString().Substring(0,1).ToString()).ToString() ; lblState.Text = cAudioBurner1.IsLegalMedia(cboDrv.SelectedItem.ToString().Substring(0,1)); // Empty is OK if ((lblState.Text == "")) { lblState.Text = "OK - Ready to be burn."; lblState.ForeColor = System.Drawing.ColorTranslator.FromOle(32768); } else { lblState.ForeColor = System.Drawing.Color.Red; //lblState.Font = VB6.FontChangeBold(lblState.Font, true); } } private void ListSpeedsX() { short cntr; string sStrID; int lNumOfSpeeds; // Get the drive ID sStrID = cboDrv.SelectedItem.ToString().Substring(0,1); // Add the CD speeds in the cSpeeds collection: lNumOfSpeeds = cAudioBurner1.GetSpeedsX(sStrID); // List the speeds in the combo-box cboSpeed.Items.Clear(); for (cntr = 1; (cntr <= lNumOfSpeeds); cntr++) { System.Diagnostics.Debug.Write(cAudioBurner1.GetSpeedsXVal(cntr) + (" KB/s ")); cboSpeed.Items.Add(cAudioBurner1.GetSpeedsXVal(cntr) + (" KB/s ")); } // Add Max cboSpeed.Items.Add("Max."); cboSpeed.SelectedIndex = (cboSpeed.Items.Count - 1); } |
Links:
read the original story ...