Go Back   Club CDFreaks - Knowledge is Power > International Chat: Software related > Nero SDK Discussion Forum


Commercial message



Nero SDK Discussion Forum Discuss, hello alexp at International Chat: Software related forum; hi i need to know about the importisotrack in the nero 6.3 SDK. How can i use this procedure kindly help me. any help will be appriciated thanks chouhanrakesh india


Reply
 
Thread Tools
Old 23-03-2004   #1 (permalink)
New on Forum
 
Join Date: Mar 2004
Location: india
Posts: 5
hello alexp

hi

i need to know about the importisotrack in the nero 6.3 SDK.

How can i use this procedure kindly help me.


any help will be appriciated

thanks

chouhanrakesh
india
chouhanrakesh is offline   Reply With Quote
Old 23-03-2004   #2 (permalink)
Nero Developer
 
Join Date: Oct 2003
Posts: 605
You should call ImportIsoTrack on a drive of interest with a track number and flags. When the operation finishes OnDoneImport and OnDoneImport2 will be fired. You can handle any of them and use the information provided as you find fit. The most common task is to import a previous track, add more files to it and then burn it back.
alexp is offline   Reply With Quote
Old 24-03-2004   #3 (permalink)
New on Forum
 
Join Date: Mar 2004
Location: india
Posts: 5
Hello alexp

i tried but i could nt able to use ImportIsoTrack procedure as the event OnDoneImport or OnDoneImport2 Does'nt fire automatically .

kindly give me the code to get the information about the previous burnt data on the multisesion disc.

that code should be on VB 6.0.

thanks for the previous reply.

have a nice day
chouhanrakesh
chouhanrakesh is offline   Reply With Quote
Old 24-03-2004   #4 (permalink)
Nero Developer
 
Join Date: Oct 2003
Posts: 605
Perhaps you could show us the relevant portions of your code and somebody would get an idea what is wrong?
alexp is offline   Reply With Quote
Old 24-03-2004   #5 (permalink)
CD Freaks Member
 
Join Date: Dec 2003
Location: uk
Posts: 234
Perhaps you could check the VB code in thread "drive ondoneimport never fires" - I initially had the problem you describe - but is now working ok.
unison is offline   Reply With Quote
Old 25-03-2004   #6 (permalink)
New on Forum
 
Join Date: Mar 2004
Location: india
Posts: 5
Hello alexp/unison

Hi

i am using the same code which have been provided in the OnDoneImport not fires thread ,

i want to get the information of the cd through CdInfo event
and thus this event fires and after that the event OnDoneImport Does fires.
what steps should be taken .


thanks for the previous reply

chouhanrakesh
india
chouhanrakesh is offline   Reply With Quote
Old 25-03-2004   #7 (permalink)
Nero Developer
 
Join Date: Oct 2003
Posts: 605
Are you using the most recent NeroCOM version?
Quote:
i want to get the information of the cd through CdInfo event
and thus this event fires and after that the event OnDoneImport Does fires.
what steps should be taken .
I am not sure I understand this part... Could you please rephrase?
alexp is offline   Reply With Quote
Old 25-03-2004   #8 (permalink)
CD Freaks Member
 
Join Date: Dec 2003
Location: uk
Posts: 234
With reference to the code below:

The drive.cdinfo call and the associated Drive_OnDoneCDInfo event gives the number of previous tracks (NumExistingTracks)

If this is non-zero then the last track only should be imported (NOT all tracks). This is done using the line Drive.ImportIsoTrack I, NERO_IMPORT_ISO_ONLY, in the associated event Drive_OnDoneImport2 the imported data should be copied from the parameter pfolder to the folder variable to be burnt to CD, I do this with the line Set Folder = pFolder

All that remains is add the new data to the same folder and then burn the whole lot to CD

Hope this make sense and solves your problem!

Option Explicit

' load references
Public WithEvents Nero As Nero
Public WithEvents Drive As NeroDrive

' variable for holding number of existing sessions on disc when cd info read
Dim NumExistingTracks As Integer

'flag for checking if drive event finished
Dim DriveFinished As Boolean

' list of available drives
Dim Drives As INeroDrives

Dim CancelPressed As Boolean

' main folder to be burnt
Dim Folder As INeroFolder

' main track to be burnt
Dim ISOTrack As NeroISOTrack

Private Sub AddMessage(ByVal Message As String)
lst_Messages.AddItem Message
If lst_Messages.ListCount <> 0 Then
lst_Messages.ListIndex = lst_Messages.ListCount - 1
lst_Messages.Refresh
End If
End Sub

' function for removing extra spaces and lines from messages
Private Sub SplitText(ByVal Data As String)
Dim Temp As String
Dim I As Integer

Temp = ""
For I = 1 To Len(Data)
If Mid$(Data, I, 1) = Chr$(13) Then
lst_Messages.AddItem Trim$(Temp)
Temp = ""
ElseIf Mid$(Data, I, 1) <> Chr$(10) Then
Temp = Temp + Mid$(Data, I, 1)
End If
Next
If Temp <> "" Then
AddMessage Trim$(Temp)
End If

End Sub

'Recursive function to build the Folders/Files to burn
Private Sub BuildFileFolderTree(ByRef nroFolderToUse As NeroFolder, ByRef folCurrent As Folder)
Dim folTMP As Folder
Dim filTMP As File
Dim nroFolTmp As NeroFolder
Dim nroFilTmp As NeroFile

'Add all files in the current directory
For Each filTMP In folCurrent.Files
Set nroFilTmp = New NeroFile
nroFilTmp.Name = filTMP.Name
nroFilTmp.SourceFilePath = filTMP.Path
nroFolderToUse.Files.Add nroFilTmp
Next

'Write the sub folders
For Each folTMP In folCurrent.SubFolders
Set nroFolTmp = New NeroFolder
nroFolTmp.Name = folTMP.Name
nroFolderToUse.Folders.Add nroFolTmp
Call BuildFileFolderTree(nroFolTmp, folTMP)
Next

End Sub

Private Sub cmd_Eject_Click()
Set Drive = Drives(lst_AvailableDevices.ListIndex)
Drive.EjectCD
End Sub

Private Sub cmd_Exit_Click()
End
End Sub

Private Sub cmd_Load_Click()
Set Drive = Drives(lst_AvailableDevices.ListIndex)
Drive.LoadCD
End Sub

Private Sub Drive_OnDoneErase(Ok As Boolean)
DriveFinished = True
End Sub

Private Sub Form_Initialize()
Dim myIndex As Integer
Dim Major_High As Integer
Dim Major_Low As Integer
Dim Minor_High As Integer
Dim Minor_Low As Integer
Dim ValidVersion As Boolean
Dim LastError As Long

On Error GoTo Exit_Me

Set Nero = New Nero

'check version OK
ValidVersion = True
Nero.APIVersion Major_High, Major_Low, Minor_High, Minor_Low
If Major_High < 6 Then
ValidVersion = False
ElseIf Major_High = 6 And Major_Low < 3 Then
ValidVersion = False
ElseIf Major_High = 6 And Major_Low = 3 And Minor_High < 1 Then
ValidVersion = False
ElseIf Major_High = 6 And Major_Low = 3 And Minor_High = 1 And Minor_Low < 6 Then
ValidVersion = False
End If

If Not ValidVersion Then
MsgBox "Nero Version 6.3.1.6 Or Greater Required!"
End
End If

fme_Progress.Visible = False
pgs_Burn.Value = 0

lst_Messages.Clear

Set Drives = Nero.GetDrives(NERO_MEDIA_CDR + NERO_MEDIA_CDRW)

For myIndex = 0 To Drives.Count - 1
lst_AvailableDevices.AddItem Drives(myIndex).DeviceName, myIndex
Next

'set to second item as I have 2 CDs for bending machines normally would use first as only 1 or allow to select?
lst_AvailableDevices.ListIndex = Drives.Count - 2

Set Folder = New NeroFolder

Set Drive = Drives(lst_AvailableDevices.ListIndex)
Drive.EjectCD
Exit Sub

Exit_Me:
MsgBox Error$
End
End Sub

Private Sub cmd_Abort_Click()
Dim Response As Long

Response = MsgBox("Abort May Cause CD To Become Non-Read/Writeable! Abort Anyway?", vbYesNo + vbExclamation)
If Response = vbYes Then
Nero.Abort
CancelPressed = True
AddMessage ""
AddMessage "Abort Pressed!"
End If
End Sub

Private Sub cmd_Burn_Click()
Dim Source_Dir As String
Dim FSO As New FileSystemObject
Dim DateFolder As NeroFolder
Dim I As Integer
Dim X As Long

On Error GoTo Exit_Me:

CancelPressed = False
cmd_Abort.Enabled = True
cmd_Burn.Enabled = False
cmd_Exit.Enabled = False

fme_Progress.Visible = True
fme_Messages.Visible = True
lst_Messages.Clear
Me.Refresh

Set Drive = Drives(lst_AvailableDevices.ListIndex)

'set to be whatever folder you need to backup
Source_Dir = "C:\unison\bend"
If opt_YBC.Value Then
Source_Dir = Source_Dir + "\ybc"
End If
If Opt_Log.Value Then
Source_Dir = Source_Dir + "\log"
End If
If Not FSO.FolderExists(Source_Dir) Then
MsgBox "Error - Source Folder Does Not Exist!"
GoTo Exit_Me
End If

Set Folder = New NeroFolder

AddMessage "Waiting For CD Ready..."
'delay 10s to allow CD to spin up (need programatic soln!)
Delay (10)

'check if multisession data
AddMessage "Checking CD For Existing Data"
DriveFinished = False
Drive.CDInfo NERO_READ_ISRC
' wait for event done and handled
While Not DriveFinished
If CancelPressed Then
GoTo Exit_Me
End If
X = DoEvents()
Wend

'if existing session then import the last one
If NumExistingTracks > 0 Then

AddMessage "Reading Existing Data From CD"

'read in the last session
I = NumExistingTracks - 1
DriveFinished = False

Drive.ImportIsoTrack I, NERO_IMPORT_ISO_ONLY

' wait for event done and handled
While Not DriveFinished
If CancelPressed Then
GoTo Exit_Me
End If
X = DoEvents()
Wend

End If

Set DateFolder = New NeroFolder
Set ISOTrack = New NeroISOTrack

If opt_Bend.Value Then
DateFolder.Name = "Bend " + Format(Now, "dd") + "-" + Format(Now, "mm") + "-" + Format(Now, "yyyy") + " - " + Format(Now, "hh") + "-" + Format(Now, "nn") + "-" + Format(Now, "ss")
End If
If opt_YBC.Value Then
DateFolder.Name = "YBC " + Format(Now, "dd") + "-" + Format(Now, "mm") + "-" + Format(Now, "yyyy") + " - " + Format(Now, "hh") + "-" + Format(Now, "nn") + "-" + Format(Now, "ss")
End If
If Opt_Log.Value Then
DateFolder.Name = "Log " + Format(Now, "dd") + "-" + Format(Now, "mm") + "-" + Format(Now, "yyyy") + " - " + Format(Now, "hh") + "-" + Format(Now, "nn") + "-" + Format(Now, "ss")
End If

' Add to folder tree
Folder.Folders.Add DateFolder

' recursively build folder tree
Call BuildFileFolderTree(DateFolder, FSO.GetFolder(Source_Dir))

ISOTrack.Name = "Unison"
ISOTrack.RootFolder = Folder
ISOTrack.BurnOptions = NERO_BURN_OPTION_CREATE_ISO_FS + NERO_BURN_OPTION_USE_JOLIET

If CancelPressed Then
GoTo Exit_Me
End If

' burn folder (check if underrun protection available and use if it is)
DriveFinished = False
If Drive.Capabilities And NERO_CAP_BUF_UNDERRUN_PROT Then
Drive.BurnIsoAudioCD "Unison", "Backup", 0, ISOTrack, Nothing, Nothing, NERO_BURN_FLAG_WRITE + NERO_BURN_FLAG_BUF_UNDERRUN_PROT + NERO_BURN_FLAG_CLOSE_SESSION, 0, NERO_MEDIA_CD
Else
Drive.BurnIsoAudioCD "Unison", "Backup", 0, ISOTrack, Nothing, Nothing, NERO_BURN_FLAG_WRITE + NERO_BURN_FLAG_CLOSE_SESSION, 0, NERO_MEDIA_CD
End If

While Not DriveFinished
If CancelPressed Then
GoTo Exit_Me
End If
X = DoEvents()
Wend

cmd_Abort.Enabled = False
cmd_Burn.Enabled = True
cmd_Exit.Enabled = True
pgs_Burn.Value = 0
fme_Progress.Visible = False
Exit Sub

Exit_Me:

lst_Messages.AddItem Error$
lst_Messages.AddItem Nero.LastError

cmd_Abort.Enabled = False
cmd_Burn.Enabled = True
cmd_Exit.Enabled = True
pgs_Burn.Value = 0
fme_Progress.Visible = False

End Sub

Private Sub drive_OnAborted(Abort As Boolean)
Abort = False
End Sub

Private Sub drive_OnAddLogLine(TextType As NEROLib.NERO_TEXT_TYPE, Text As String)
SplitText Text
End Sub

' event for burn complete prints results to message list
Private Sub drive_OnDoneBurn(StatusCode As NEROLib.NERO_BURN_ERROR)

SplitText Nero.ErrorLog
SplitText Nero.LastError

If StatusCode <> NEROLib.NERO_BURN_OK Then
AddMessage "Burn not finished successfully: " & StatusCode
Else
AddMessage "Burn finished successfully"
End If

DriveFinished = True

End Sub

'event for read cd info done
Private Sub Drive_OnDoneCDInfo(ByVal pCDInfo As NEROLib.INeroCDInfo)
'set number of existing sessions
On Local Error GoTo NoTracks:

NumExistingTracks = pCDInfo.Tracks.Count
'set done flag
DriveFinished = True
Exit Sub

NoTracks:
NumExistingTracks = 0
DriveFinished = True
End Sub

' importing of data done event
Private Sub Drive_OnDoneImport2(ByVal bOk As Boolean, ByVal pFolder As NEROLib.INeroFolder, ByVal pCDStamp As NEROLib.INeroCDStamp, ByVal pImportInfo As NEROLib.INeroImportDataTrackInfo, ByVal importResult As NEROLib.NERO_IMPORT_DATA_TRACK_RESULT)
Dim I As Integer

If bOk Then
Set Folder = pFolder
Else
MsgBox "Error Reading In Data"
End If
' set done flag
DriveFinished = True
End Sub

Private Sub drive_OnDoneWaitForMedia(Success As Boolean)
AddMessage "Done waiting for media."
End Sub

Private Sub drive_OnProgress(ProgressInPercent As Long, Abort As Boolean)
Abort = False
pgs_Burn.Value = ProgressInPercent
End Sub

Private Sub drive_OnSetPhase(Text As String)
SplitText Text
End Sub

Private Sub nero_OnMegaFatal()
AddMessage "A fatal error has occurred."
End Sub

Private Sub nero_OnNonEmptyCDRW(Response As NEROLib.NERO_RESPONSE)
AddMessage "CD-RW not empty!"
Response = NERO_RETURN_EXIT
End Sub

Private Sub nero_OnRestart()
AddMessage "The system is being restarted."
End Sub

Private Sub nero_OnWaitCD(WaitCD As NEROLib.NERO_WAITCD_TYPE, WaitCDLocalizedText As String)
SplitText WaitCDLocalizedText
End Sub

Private Sub nero_OnWaitCDDone()
AddMessage "Done waiting for CD."
End Sub

Private Sub nero_OnWaitCDMediaInfo(LastDetectedMedia As NEROLib.NERO_MEDIA_TYPE, LastDetectedMediaName As String, RequestedMedia As NEROLib.NERO_MEDIA_TYPE, RequestedMediaName As String)
AddMessage "Waiting for a particular media type: " + RequestedMediaName
End Sub

Private Sub nero_OnWaitCDReminder()
AddMessage "Still waiting for CD..."
End Sub

Public Sub Delay(ByVal Time As Single, Optional ByVal ForceWait As Boolean = False)
Dim Start
Dim X
Dim SleepVal As Long

Start = Timer
While Start + Time > Timer
If Start > Timer Then
Start = Timer
End If
If Not ForceWait Then
X = DoEvents()
End If
Wend
End Sub
unison is offline   Reply With Quote
Old 25-03-2004   #9 (permalink)
New on Forum
 
Join Date: Nov 2003
Posts: 8
Never Never Fires!!!

I use Nero 6.3.1.6

Public WithEvents mNero As Nero
Public WithEvents mDrive As NeroDrive
.....

Private Sub BurnIt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BurnIt.Click


mNero = New Nero()
mDrives = Nero.GetDrives(NERO_MEDIA_TYPE.NERO_MEDIA_CDRW)
mDrive = mDrives.Item(0)
mDrive.CDInfo(NERO_CDINFO_FLAGS.NERO_READ_ISRC)
==> NEVER FIRES!!!!!!!!!

End Sub

Private Sub mOnDoneCdInfo(ByVal pCDInfo As NEROLib.NeroCDInfo) Handles drive.OnDoneCDInfo

MessageBox.Show(pCDInfo.Title())

End Sub

WHYYYYYYYYYYYYY???????????
tarlik is offline   Reply With Quote
Old 25-03-2004   #10 (permalink)
Nero Developer
 
Join Date: Oct 2003
Posts: 605
I am not a VB expert but shouldn't the line:
Code:
Private Sub mOnDoneCdInfo(ByVal pCDInfo As NEROLib.NeroCDInfo) Handles drive.OnDoneCDInfo
...be somehow related to the mDrive variable? How does VB know which variable's event does that particular function handle?

Why not the following?
Code:
Private Sub mDrive_OnDoneCdInfo(ByVal pCDInfo As NEROLib.NeroCDInfo)
alexp is offline   Reply With Quote
Old 25-03-2004   #11 (permalink)
New on Forum
 
Join Date: Nov 2003
Posts: 8
This one doesn't work...

Private Sub mOnDoneCdInfo(ByVal pCDInfo As NEROLib.NeroCDInfo) Handles mDrive.OnDoneCDInfo

This one neither!

Private Sub mDrive_OnDoneCdInfo(ByVal pCDInfo As NEROLib.NeroCDInfo)


tarlik is offline   Reply With Quote
Old 25-03-2004   #12 (permalink)
CD Freaks Member
 
Join Date: Dec 2003
Location: uk
Posts: 234
Try mDrive.CDInfo NERO_CDINFO_FLAGS.NERO_READ_ISRC

i.e without the brackets
unison is offline   Reply With Quote
Old 25-03-2004   #13 (permalink)
New on Forum
 
Join Date: Nov 2003
Posts: 8
brackets are "necessary"
tarlik is offline   Reply With Quote
Old 25-03-2004   #14 (permalink)
CD Freaks Member
 
Join Date: Dec 2003
Location: uk
Posts: 234
Works for me without them, but when I but brackets in it doesn`t.
unison is offline   Reply With Quote
Old 26-03-2004   #15 (permalink)
New on Forum
 
Join Date: Nov 2003
Posts: 8
I have created a New solution in VS.NET 2003, cut and paste from VS.NET 2002 to new solution .... AND NOW... ALL EVENT FIRES!!!

.... i can't believe it!!!
tarlik is offline   Reply With Quote
 
Reply


If you can't find where you are looking for, then become a member and get an answer fast! We have thousands of people online every moment of the day to help you! Click here



Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
alexp or someone pleas healp !! Problem with EndTrack gapilazo Nero SDK Discussion Forum 2 01-02-2007 16:51
Problem with NeroImportDataTrack to alexp Ramiro_Mex Nero SDK Discussion Forum 9 30-06-2005 20:05
alexp or someone pleas healp !!!!!! gapilazo Nero SDK Discussion Forum 1 28-04-2005 14:19
Hi alexp , What is this Error? sureei666 Nero SDK Discussion Forum 1 02-04-2004 10:49


All times are GMT +2. The time now is 21:52.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0