How to Set DVR Buffer Locations on More Than One Physical Disk (Visual Basic)

The following subroutine for VB shows how to get the DVR Sink object from the ltmmPlayControl object, using it to set DVR buffer location settings on physical disks C: and D:.

 

Private Sub MultipleDVRBufferSettingsEx

   On Error GoTo HandleError
   Dim ltmmPlayCtrl1 As LTMMPlayCtrl
   Set ltmmPlayCtrl1 = MainForm.ltmmPlayCtrl

   Dim DVRSink As LMDVRSinkLib.LMDVRSink
   Set DVRSink = ltmmPlayCtrl1.GetSubObject(ltmmPlay_Object.ltmmPlay_Object_SourceFilter)

   '' Tell sink we are starting to change settings
   DVRSink.StartChangingAttributes

   '' Set Two buffer locations
   DVRSink.FolderCount = 2

   '' Set base file name
   DVRSink.BaseName = "Capture.LBL"

   '' Set buffer folder 1 location
   DVRSink.FolderName(0) = "C:\Temp\DVR"

   '' Set buffer folder 1 to have 2 buffer data files, each at 16MB max file size
   Call DVRSink.SetBufferSize(0, 2, 16 * 1024000)

   '' Set buffer folder 2 location
   DVRSink.FolderName(1) = "D:\Temp\DVR"

   '' Set buffer folder 2 to have 4 buffer data files, each at 8MB max file size
   Call DVRSink.SetBufferSize(1, 4, 8192000)

   '' Tell sink to apply the changes
   DVRSink.StopChangingAttributes(False)

   Exit Sub
HandleError:
   If Err.Number <> 0 Then MsgBox Err.Description + " Error code = " + str(Err.Number) + "."
End Sub