Burning multiple user selectable files to disk

vbimport

#1

I am trying to help someone with an issue or two that they are having with programming the NERO API. I’m fairly new to VB and wonder if someone has a sample app written in a newer flavor of VB that I can take a look at. We are working in VB 2005.

Our particular problem relates to building the list of files so that nero can then record them to dvd. The process seems to involve instantiating an object reference to NeroFolder and then individual NeroFile. Each individual NeroFile is added to the NeroFolder via the following method: Folder.Files.Add(file). When we attempt to exceute the burn, we don’t get any errors and the disk is not recorded.

We are letting the user open a file selection browse dialog to select files to be burned. The list of user selected files is added to a listbox. When the user selects the option to initiate the burn, the selected files from the listbox are the ones we want burned to disk.

Here is a relevant bit of code:

    Dim Folder As INeroFolder
    Folder = New NEROLib.NeroFolder()

    Dim drives As NEROLib.INeroDrives
    drives = nero.GetDrives(NEROLib.NERO_MEDIA_TYPE.NERO_MEDIA_DVD_P And NERO_MEDIA_TYPE.NERO_MEDIA_DVD_M)
    drive = drives.Item(AvailableDevices.SelectedIndex)

    Dim ISOTrack As New NEROLib.NeroISOTrack
    ISOTrack = New NEROLib.NeroISOTrack
    ISOTrack.Name = "TestTrack"

    Dim i As Integer

    Dim file As NeroFile

    For Each i In List1.SelectedIndices

        file = New NeroFile

        ' List files in the listbox
        'MessageBox.Show(List1.Items(i).ToString)

        file.Name = List1.Items(i).ToString
        file.SourceFilePath = List1.Items(i).ToString
        Folder.Files.Add(file)

    Next

    Folder.Name = "TestFolder"

    ISOTrack.BurnOptions = NEROLib.NERO_BURN_OPTIONS.NERO_BURN_OPTION_CREATE_ISO_FS + NEROLib.NERO_BURN_OPTIONS.NERO_BURN_OPTION_USE_JOLIET

    drive.BurnIsoAudioCD("TrueView", "TrueView", 0, ISOTrack, Nothing, Nothing, NERO_BURN_FLAGS.NERO_BURN_FLAG_SIMULATE + NERO_BURN_FLAGS.NERO_BURN_FLAG_WRITE, 4, NERO_MEDIA_TYPE.NERO_MEDIA_DVD_P_R + NERO_MEDIA_TYPE.NERO_MEDIA_DVD_P_RW)

Any suggestions or pointers on how to burn a number of user selectable files to disk would be great.

Thanks,

Dan


#2

Nevermind, I figured that problem out. It’s been a few hours, but I think it was that the files were not being added to the root folder properly