vbAccelerator - Contents of code file: frmOptions.frm

This file is part of the download VB6 CD Ripper, which is described in the article CD Ripping in VB Part 1.

VERSION 5.00
Begin VB.Form frmOptions 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "VB CD Ripper Options"
   ClientHeight    =   3750
   ClientLeft      =   4965
   ClientTop       =   3465
   ClientWidth     =   5775
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3750
   ScaleWidth      =   5775
   ShowInTaskbar   =   0   'False
   Begin VB.ComboBox cboDriveType 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   1440
      Style           =   2  'Dropdown List
      TabIndex        =   19
      Top             =   2220
      Width           =   4215
   End
   Begin VB.TextBox txtSpinUpTime 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4260
      TabIndex        =   17
      Top             =   1620
      Width           =   1395
   End
   Begin VB.TextBox txtCDSpeed 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4260
      TabIndex        =   15
      Top             =   1260
      Width           =   1395
   End
   Begin VB.TextBox txtBlockCompare 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4260
      TabIndex        =   12
      Top             =   900
      Width           =   1395
   End
   Begin VB.TextBox txtRetries 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4260
      TabIndex        =   11
      Top             =   540
      Width           =   1395
   End
   Begin VB.TextBox txtEndOffset 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   1440
      TabIndex        =   9
      Top             =   1620
      Width           =   1395
   End
   Begin VB.TextBox txtStartOffset 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   1440
      TabIndex        =   7
      Top             =   1260
      Width           =   1395
   End
   Begin VB.TextBox txtReadOverlap 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   1440
      TabIndex        =   5
      Top             =   900
      Width           =   1395
   End
   Begin VB.TextBox txtReadSectors 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   1440
      TabIndex        =   3
      Top             =   540
      Width           =   1395
   End
   Begin VB.ComboBox cboDrives 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   1440
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   60
      Width           =   4215
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "OK"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Left            =   2940
      TabIndex        =   20
      Top             =   3180
      Width           =   1335
   End
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   435
      Left            =   4320
      TabIndex        =   21
      Top             =   3180
      Width           =   1335
   End
   Begin VB.Label Label9 
      Caption         =   "Drive Type:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   18
      Top             =   2220
      Width           =   1335
   End
   Begin VB.Label Label8 
      Caption         =   "Spin Up Time (s):"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2940
      TabIndex        =   16
      Top             =   1680
      Width           =   1305
   End
   Begin VB.Label Label7 
      Caption         =   "CD Speed:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2940
      TabIndex        =   14
      Top             =   1320
      Width           =   1305
   End
   Begin VB.Label Label6 
      Caption         =   "Block Compare:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2940
      TabIndex        =   13
      Top             =   960
      Width           =   1305
   End
   Begin VB.Label Label5 
      Caption         =   "Retries:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2940
      TabIndex        =   10
      Top             =   600
      Width           =   1305
   End
   Begin VB.Label Label4 
      Caption         =   "End Offset:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   8
      Top             =   1680
      Width           =   1300
   End
   Begin VB.Label Label3 
      Caption         =   "Start Offset:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   6
      Top             =   1320
      Width           =   1300
   End
   Begin VB.Label Label2 
      Caption         =   "Read Overlap:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   4
      Top             =   960
      Width           =   1300
   End
   Begin VB.Label Label1 
      Caption         =   "Read Sectors:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   600
      Width           =   1300
   End
   Begin VB.Label lblDrives 
      Caption         =   "Drive:"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   1335
   End
End
Attribute VB_Name = "frmOptions"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private m_cRip As cCDRip
Private m_iLastIndex As Long

Public Property Let CRRip(cRip As cCDRip)
   Set m_cRip = cRip
End Property

Private Sub ShowDrives()
Dim i As Long
   
   For i = 1 To m_cRip.CDDriveCount
      cboDrives.AddItem m_cRip.CDDrive(i).Name
   Next i
   
   If (cboDrives.ListCount > 0) Then
      cboDrives.ListIndex = 0
   Else
      Dim ctl As Control
      Dim txt As TextBox
      Dim cbo As ComboBox
      For Each ctl In Me.Controls
         If (TypeOf ctl Is TextBox) Then
            Set txt = ctl
            txt.Enabled = False
            txt.Text = ""
            txt.BackColor = vbButtonFace
         ElseIf (TypeOf ctl Is ComboBox) Then
            Set cbo = ctl
            cbo.Enabled = False
            cbo.ListIndex = -1
            cbo.BackColor = vbButtonFace
         End If
      Next
      cmdOK.Enabled = False
   End If
   
End Sub

Private Sub cboDrives_Click()
   '
   If (m_iLastIndex > 0) And (m_iLastIndex <> cboDrives.ListIndex + 1) Then
      m_cRip.CDDrive(m_iLastIndex).Apply
   End If
   
   Dim cD As cDrive
   Set cD = m_cRip.CDDrive(cboDrives.ListIndex + 1)
   
   txtReadSectors.Text = cD.ReadSectors
   txtReadOverlap.Text = cD.ReadOverlap
   txtStartOffset.Text = cD.StartOffset
   txtEndOffset.Text = cD.EndOffset
   txtRetries.Text = cD.Retries
   txtBlockCompare.Text = cD.BlockCompare
   txtCDSpeed.Text = cD.CDSpeed
   txtSpinUpTime.Text = cD.SpinUpTime
   cboDriveType.ListIndex = cD.DriveType
   
   m_iLastIndex = cboDrives.ListIndex + 1
   
   '
End Sub

Private Sub cmdCancel_Click()
   Unload Me
End Sub

Private Sub cmdOK_Click()
   m_cRip.CDDrive(cboDrives.ListIndex + 1).Apply
   Unload Me
End Sub

Private Sub Form_Load()
   
   cboDriveType.AddItem "GENERIC"
   cboDriveType.AddItem "TOSHIBA"
   cboDriveType.AddItem "TOSHIBANEW"
   cboDriveType.AddItem "IBM"
   cboDriveType.AddItem "NEC"
   cboDriveType.AddItem "DEC"
   cboDriveType.AddItem "IMS"
   cboDriveType.AddItem "KODAK"
   cboDriveType.AddItem "RICOH"
   cboDriveType.AddItem "HP"
   cboDriveType.AddItem "PHILIPS"
   cboDriveType.AddItem "PLASMON"
   cboDriveType.AddItem "GRUNDIGCDR100IPW"
   cboDriveType.AddItem "MITSUMICDR"
   cboDriveType.AddItem "PLEXTOR"
   cboDriveType.AddItem "SONY"
   cboDriveType.AddItem "YAMAHA"
   cboDriveType.AddItem "NRC"
   cboDriveType.AddItem "IMSCDD5"
   cboDriveType.AddItem "CUSTOMDRIVE"
   
   ShowDrives
   
End Sub