vbAccelerator - Contents of code file: cRedbookDiscRecorder.cls

This file is part of the download VB5 IMAPI Library Source, which is described in the article Image Mastering API (IMAPI) Library for VB.

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

Private m_cRedbookMaster As IVBRedbookDiscMaster

Friend Sub fInit(cRedbook As IVBRedbookDiscMaster)
   Set m_cRedbookMaster = cRedbook
End Sub

Public Property Get AvailableTrackBlocks() As Long
Attribute AvailableTrackBlocks.VB_Description = "Gets the number of available
 blocks."
Dim lBlocks As Long
   If Not (m_cRedbookMaster Is Nothing) Then
      m_cRedbookMaster.GetAvailableAudioTrackBlocks lBlocks
      AvailableTrackBlocks = lBlocks
      Exit Property
   End If
End Property

Public Property Get AudioBlockSize() As Long
Attribute AudioBlockSize.VB_Description = "Gets the size in bytes of a single
 audio block on the CD."
Dim lBlocks As Long
   If Not (m_cRedbookMaster Is Nothing) Then
      m_cRedbookMaster.GetAudioBlockSize lBlocks
      AudioBlockSize = lBlocks
      Exit Property
   End If
End Property

Public Property Get TotalAudioBlocks() As Long
Attribute TotalAudioBlocks.VB_Description = "Gets the total number of audio
 blocks which can be added to the media."
Dim lBlocks As Long
   If Not (m_cRedbookMaster Is Nothing) Then
      m_cRedbookMaster.GetTotalAudioBlocks lBlocks
      TotalAudioBlocks = lBlocks
      Exit Property
   End If
End Property

Public Property Get UsedAudioBlocks() As Long
Attribute UsedAudioBlocks.VB_Description = "Gets the number of used audio
 blocks."
Dim lBlocks As Long
   If Not (m_cRedbookMaster Is Nothing) Then
      m_cRedbookMaster.GetUsedAudioBlocks lBlocks
      UsedAudioBlocks = lBlocks
      Exit Property
   End If
End Property

Public Property Get TotalAudioTracks() As Long
Attribute TotalAudioTracks.VB_Description = "Gets the total number of audio
 tracks added to the media."
Dim lTracks As Long
   If Not (m_cRedbookMaster Is Nothing) Then
      m_cRedbookMaster.GetTotalAudioTracks lTracks
      TotalAudioTracks = lTracks
      Exit Property
   End If
End Property

Public Sub CreateAudioTrack(ByVal nBlocks As Long)
Attribute CreateAudioTrack.VB_Description = "Creates a new audio track.  Up to
 99 tracks can be added to a CD."
   If Not (m_cRedbookMaster Is Nothing) Then
      m_cRedbookMaster.CreateAudioTrack nBlocks
      Exit Sub
   End If
End Sub

Public Sub CloseAudioTrack()
Attribute CloseAudioTrack.VB_Description = "Closes a track previously created
 using CreateAudioTrack."
   If Not (m_cRedbookMaster Is Nothing) Then
      m_cRedbookMaster.CloseAudioTrack
      Exit Sub
   End If
End Sub

Public Sub AddAudioTrackBlocks(ByVal lPtr As Long, ByVal lSize As Long)
Attribute AddAudioTrackBlocks.VB_Description = "Adds blocks of data to an audio
 track previously created with the CreateTrack method.  The input should be a
 pointer to 16bit stereo 44.1kHz data and the size must be an even multiple of
 the AudioBlockSize."
   If Not (m_cRedbookMaster Is Nothing) Then
      m_cRedbookMaster.AddAudioTrackBlocks lPtr, lSize
      Exit Sub
   End If
End Sub