| |||||||
| Commercial message | |
| | |
|
![]() |
| | Thread Tools |
| | #1 (permalink) |
| New on Forum Join Date: Jan 2005 Location: Inchon
Posts: 10
| About Multisession... Hello All, I am using NeroAPI sample code(VC++). //////////////////////////////////////////////////////////////////////////////// int NumberTracks = nci->ncdiNumTracks; //from NERO_CD_INFO NERO_ISO_ITEM *niiTemp; void *pCDStamp=NULL; niiTemp = NeroImportIsoTrackEx(ndhDeviceHandle, NumberTracks, &pCDStamp, NIITEF_IMPORT_ISO_ONLY); //mniiFile array is burnt now //niiTemp is previous session. niiTemp->nextItem = &mniiFile[0]; mniiFile[m_cnt-1].nextItem = NULL; ... writeCD.nwcdIsoTrack = NeroCreateIsoTrackEx(niiTemp, "multi", NCITEF_CREATE_ISO_FS|NCITEF_USE_JOLIET); ... int iRes = NeroBurn(ndhDeviceHandle, NERO_ISO_AUDIO_CD, &writeCD, NBF_WRITE | NBF_CLOSE_SESSION, 0, &npProgress); ... //////////////////////////////////////////////////////////////////////// I am trying to burn multisession. But I have a problem. I have a disc that have been burnt 5 times using Nero program(multisession). If burning multisession with this disc continually, it always include new files and only first session. I don't know why happend in above code. Please let me know why. Thanks a lot in advance. regds |
| | |
| | #2 (permalink) |
| CD Freaks Member Join Date: Dec 2003 Location: uk
Posts: 234
| Re: About Multisession... Where have you got NumberTracks value from? I.e. have you done a cdinfo first to find the number of sessions? If not then NumberTracks will always be 0 and you will always import the first session. Mike |
| | |
| | #3 (permalink) | |
| Nero Developer Join Date: Oct 2003
Posts: 605
| The first obvious problem is the Quote:
If your intention is to import the last track, you should pass NumberTracks-1. In addition to this, the function you use is deprecated. You should use NeroImportDataTrack(). The code does not show whether you connect the entries from the mniiFile array properly. You only connect the first entry to the imported tree. | |
| | |
| | #4 (permalink) |
| New on Forum Join Date: Jan 2005 Location: Inchon
Posts: 10
| Re: About Multisession... Hi, alexp ///////////////////////////////////////////////////////////////////////////////// NERO_CD_INFO *nci = NeroGetCDInfo(ndhDeviceHandle, NGCDI_READ_CD_TEXT); CString str; str.Format("%d",nci->ncdiNumTracks); MessageBox(str); NERO_ISO_ITEM *niiTemp; void *pCDStamp=NULL; NERO_IMPORT_DATA_TRACK_RESULT nidtrResult; NERO_IMPORT_DATA_TRACK_INFO pInfo; niiTemp = NeroImportDataTrack(ndhDeviceHandle, nci->ncdiNumTracks-1, &pCDStamp,&pInfo, NIITEF_IMPORT_ISO_ONLY, &nidtrResult, NULL); niiTemp->nextItem = &mniiFile[0]; mniiFile[m_cnt-1].nextItem = NULL; /////////////////////////////////////////////////////////////// So, I changed the function NeroImportIsoTrackEx() to NeroImportDataTrack(). and I got the NumberTracks from NeroGetCDInfo(). But the working is same. I burned first session and current files. I still don't know the reason. If you know how to connect all things as first, second and third session, let me know that. Joon |
| | |
| | #5 (permalink) |
| Nero Developer Join Date: Oct 2003
Posts: 605
| I am not sure what exactly seems to be the problem, but if you burn a first session, then import it and burn the second one, then import the second and write the third, you will effectively get ALL files referenced in a third session, both the new ones and the ones from the first and second session. Perhaps this is the effect that you are seeing? If you continually import the last session, you will always have ALL files in your new session. As for the code, the following does not look promising, even though you are not complaining about any consequences this may have. Code: niiTemp->nextItem = &mniiFile[0]; mniiFile[m_cnt-1].nextItem = NULL; |
| | |
| | #6 (permalink) |
| New on Forum Join Date: Jan 2005 Location: Inchon
Posts: 10
| Re: About Multisession... Hi alexp, I think you may be right. So, I changed the code as : //before niiTemp->nextItem = &mniiFile[0]; mniiFile[m_cnt-1].nextItem = NULL; //after mniiFile[m_cnt-1].nextItem = niiTemp; In this code, I can burn last session all items. but I couldn't burn new files that saved already in the array of mniiFile. So, I think I have to find the last point in niiTemp. Right? If you have any ideas, let me know that. Joon |
| | |
| | #7 (permalink) |
| Nero Developer Join Date: Oct 2003
Posts: 605
| Huh... every time you are showing only portions of the code that does not work. I have twice already emphasized the importance of mniiFile interconnection but you never show how you do this. Your code clearly shows that you are either doing this incorrectly or not showing us everything. Your problem is definitely in the fact |
| | |
| | #8 (permalink) |
| New on Forum Join Date: Jan 2005 Location: Inchon
Posts: 10
| Re: About Multisession... Hi alexp, Sorry about that. This is my code but still is not working like multisession. //neroFiddlesDlg.h NERO_ISO_ITEM mniiFile[FILEMAXNUMBER]; //neroFiddlesDlg.cpp void CNeroFiddlesDlg::OnBrowse() { static char BASED_CODE szFilter[] = "All Files (*.*)|*.*||"; CFileDialog dlgOpen(TRUE, NULL, NULL, OFN_FILEMUSTEXIST, szFilter, this); if (dlgOpen.DoModal() == IDOK) AppendRealFile(dlgOpen.GetPathName(), dlgOpen.GetFileName()); } void CNeroFiddlesDlg::AppendRealFile(CString pathname, CString filename) { strcpy(mniiFile[m_cnt].fileName, filename); strcpy(mniiFile[m_cnt].sourceFilePath, pathname); mniiFile[m_cnt].isDirectory=FALSE; mniiFile[m_cnt].isReference=FALSE; m_FileList.AddString(filename); AppendFileString(pathname); if (pndiDeviceInfos->nsdisNumDevInfos > 0) mbtnBurn.EnableWindow(true); mniiFile[m_cnt].nextItem = &mniiFile[m_cnt+1]; m_cnt++; } void CNeroFiddlesDlg::OnBurn() { if (m_cnt == 0) { AppendString("You have to choose a file before you can start burning!"); } else { writeCD.nwcdpCDStamp=NULL; writeCD.nwcdArtist=NULL; writeCD.nwcdTitle=NULL; writeCD.nwcdCDExtra=FALSE; writeCD.nwcdNumTracks=0; writeCD.nwcdMediaType = MEDIA_CD; int i = mcbxDevices.GetCurSel(); NERO_SCSI_DEVICE_INFO* nsdiDevice = (NERO_SCSI_DEVICE_INFO*)mcbxDevices.GetItemDataPtr(i); ndhDeviceHandle = NeroOpenDevice(nsdiDevice); NERO_CD_INFO *nci = NeroGetCDInfo(ndhDeviceHandle, NGCDI_READ_CD_TEXT); NERO_ISO_ITEM *niiTemp; void *pCDStamp=NULL; NERO_IMPORT_DATA_TRACK_RESULT nidtrResult; NERO_IMPORT_DATA_TRACK_INFO pInfo; niiTemp = NeroImportDataTrack(ndhDeviceHandle, nci->ncdiNumTracks-1, &pCDStamp,&pInfo, NIITEF_IMPORT_ISO_ONLY, &nidtrResult, NULL); //before I did niiTemp->nextItem = &mniiFile[0]; mniiFile[m_cnt-1].nextItem = NULL; //after I did, but not working. //mniiFile[m_cnt-1].nextItem = niiTemp; if (!ndhDeviceHandle) { AppendString("Device could not be opened: "+(CString)nsdiDevice->nsdiDeviceName); } else { mbtnAbort.EnableWindow(true); mCancel.EnableWindow(false); mOK.EnableWindow(false); mcbxDevices.EnableWindow(false); mbtnBrowse.EnableWindow(false); mbtnBurn.EnableWindow(false); mpgsProgress.SetRange(0,100); writeCD.nwcdIsoTrack = NeroCreateIsoTrackEx(niiTemp, LABEL, NCITEF_CREATE_ISO_FS|NCITEF_USE_JOLIET); int iRes = NeroBurn(ndhDeviceHandle, NERO_ISO_AUDIO_CD, &writeCD, NBF_WRITE | NBF_CLOSE_SESSION, 0, &npProgress); NeroFreeIsoTrack(writeCD.nwcdIsoTrack); NeroCloseDevice(ndhDeviceHandle); mbtnAbort.EnableWindow(false); mCancel.EnableWindow(true); mOK.EnableWindow(true); mcbxDevices.EnableWindow(true); mbtnBrowse.EnableWindow(true); mbtnBurn.EnableWindow(true); mpgsProgress.SetPos(0); mbAborted = false; char* Log = NeroGetErrorLog(); AppendString(Log); NeroFreeMem(Log); switch(iRes) { case NEROAPI_BURN_OK: AppendString ("BurnCD() : burn successful"); break; case NEROAPI_BURN_UNKNOWN_CD_FORMAT: AppendString ("BurnCD() : unknown CD format"); break; case NEROAPI_BURN_INVALID_DRIVE: AppendString ("BurnCD() : invalid drive"); break; case NEROAPI_BURN_FAILED: AppendString ("BurnCD() : burn failed"); break; case NEROAPI_BURN_FUNCTION_NOT_ALLOWED: AppendString ("BurnCD() : function not allowed"); break; case NEROAPI_BURN_DRIVE_NOT_ALLOWED: AppendString ("BurnCD() : drive not allowed"); break; case NEROAPI_BURN_USER_ABORT: AppendString ("BurnCD() : user aborted"); break; case NEROAPI_BURN_BAD_MESSAGE_FILE: AppendString ("BurnCD() : bad message file"); break; default: AppendString ("BurnCD() : unknown error"); break; } } } } Please show me the way. bye for now. Joon |
| | |
| | #9 (permalink) |
| Nero Developer Join Date: Oct 2003
Posts: 605
| Are you setting the size of the NERO_ISO_ITEM structure anywhere (the itemSize field)? For future compatibility reasons you should best allocate NERO_ISO_ITEMs dynamically using NeroCreteIsoItem() which will always set the size for you. |
| | |
| | #10 (permalink) |
| New on Forum Join Date: Jan 2005 Location: Inchon
Posts: 10
| Re: About Multisession... Hi alexp, I don't understand it. In NeroAPI, I couldn't find setting the size of the NERO_ISO_ITEM. Does the itemSize mean the size of file or whole structure of NERO_ISO_ITEM? I don't know how to set. can you show the sample code for me? Joon |
| | |
| | #11 (permalink) |
| Nero Developer Join Date: Oct 2003
Posts: 605
| It should be set to sizeof (NERO_ISO_ITEM) but if you can't see it you are probably using an older NeroSDK. What is your SDK version? Perhaps you could use the newest SDK and see if that changes anything with respect to your problem. |
| | |
| | #13 (permalink) |
| New on Forum Join Date: Jan 2005 Location: Inchon
Posts: 10
| Re: About Multisession... Hi all, If you know the solution about my problem, just mail me. this is my address : jt1013@nate.com or jt1013@paran.com Joon |
| | |
| | #15 (permalink) |
| New on Forum Join Date: Jan 2005 Location: Inchon
Posts: 10
| Re: About Multisession... Hi alexp, I think the NeroAPI.h is to declare. So there is just the declaration of the function. I just would like to know example for itemSize. Please teach me the example for multisession. I am sorry that I am confused about your answer. joon |
| | |
| | #16 (permalink) |
| Nero Developer Join Date: Oct 2003
Posts: 605
| You shouldn't set itemSize manually. Please see my previous post http://club.cdfreaks.com/showpost.ph...99&postcount=9 You are generally on the right track but there seems to be some strange bug in your code. Unfortunately, we never saw your full code so it is hard to tell exactly where the bug is. For a working C++ example you can always refer to NeroCMD source available in the NeroSDK. |
| | |
| | #19 (permalink) |
| Nero Developer Join Date: Oct 2003
Posts: 605
| There are at least two major problems in your code. Apart from not using NeroCreateIsoItem() as previously advised, you are not even doing a basic memset (mniifile, 0, sizeof (mniifile)) in your constructor (which is a must-do if NERO_ISO_ITEMs are allocated statically). If you step through with the debugger you will soon realize the nasty 0xcccccccc values all over the place in your NERO_ISO_ITEM. Now, thanks to the other problem, the former one does not show (the app would crash). No matter what is your actual root NERO_ISO_ITEM you seem to keep passing the root item of the imported tree - niiTemp. As you add niiTemp to the end of the new content tree, passing just niiTemp to NeroCreateIsoTrackEx() gives you an ISO track with just files from the previous session. If you want to see any new files, you need to pass the actual root item of your tree which would probably be &mniifile[0]. Though, I would strongly advise you to rework your code a bit. It would be much simpler to do nothing when new files are added to the list. Only when in OnBurn() should you traverse the list and create a NERO_ISO_ITEM tree on the fly (using NeroCreateIsoItem()) and free it later when no longer needed. |
| | |
| |
| |
![]() |
| 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 | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multisession | yater | VSO Software | 3 | 15-01-2006 03:18 |
| I can help you with multisession | *x-siter* | Newbie Forum | 10 | 05-10-2005 22:36 |
| Multisession -R possible?? | xpfshost | Blank Media | 5 | 28-09-2005 03:22 |
| still trying multisession.. | kokoguy | Nero SDK Discussion Forum | 3 | 11-02-2004 17:17 |
| multisession | kokoguy | Nero SDK Discussion Forum | 10 | 15-01-2004 13:01 |