vbAccelerator - Contents of code file: cCDDriveRip.cls

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

VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
END
Attribute VB_Name = "cCDRip"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit

' ------------------------------------------------------------
' Name:   cCDRip
' Author: Steve McMahon (steve@vbaccelerator.com)
' Date:   2004-05-06
' Description:
' Wrapper around the CDRip.DLL API.
'
' See http://vbaccelerator.com/
' ------------------------------------------------------------

Private Declare Function CR_Init Lib "cdrip.dll" (ByVal sFileName As String) As
 Long
Private Declare Function CR_GetCDRipVersion Lib "cdrip.dll" () As Long
Private Declare Function CR_GetNumCDROM Lib "cdrip.dll" () As Long
Private Declare Function CR_GetActiveCDROM Lib "cdrip.dll" () As Long

Private m_sIniFile As String
Private m_bCreated As Boolean

Public Sub Create(ByVal sIniFile As String)
Dim e As ECDRipErrorCode
   If Not (m_bCreated) Then
      m_sIniFile = sIniFile
      e = CR_Init(sIniFile)
      If (e = CDEX_OK) Then
         m_bCreated = True
      End If
      CDRipErrHandler "cCDDriveRip_Create", e, True
   End If
End Sub

Public Property Get CDDriveCount() As Long
   CDRipErrHandler "cCDDriveRip.CDDriveCount", Abs(Not (m_bCreated)), False
   CDDriveCount = CR_GetNumCDROM()
End Property

Public Property Get Version() As Long
   Version = CR_GetCDRipVersion()
End Property

Public Property Get CDDrive(ByVal nIndex As Long) As cDrive
   Dim c As New cDrive
   c.fInit nIndex - 1
   Set CDDrive = c
End Property

Public Property Get ActiveCDDriveIndex() As Long
   ActiveCDDriveIndex = CR_GetActiveCDROM() + 1
End Property