How to copy buffered DVR data to a new file (Visual Basic)

The following subroutine for Visual Basic shows how to get the DVR Sink object from the ltmmPlayControl object and use it to copy DVR buffered data to a new file.

 

Private Sub DVRCopyToFile

   Dim first As Double
   Dim last As Double
   Dim total As Double
   Dim LTMMPlay As LTMMPlayCtrl
   Set LTMMPlay = MainFrm.LTMMPlay

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

   '' Get available range to copy
   Call DVRSink.GetAvailabilityInfo(first, last, total)

   '' Copy the data to the new file
   Call DVRSink.CopyBufferToFile("C:\Temp\DVR\Copied_Capture.mpg", first, last)

End Sub