| |||||||
| Commercial message | |
| | |
|
![]() |
| | Thread Tools |
| | #1 (permalink) |
| CD Freaks Rookie Join Date: Aug 2004
Posts: 30
| about the MergeIsoTrack funcation in the nerocmd? just now ,I am using the NeroApi to burn the Multsession disk; now,,there are two problem has affect me: 1, the diffrent between Multsession and no Multsession is : in the burn function we using the NBF_CLOSE_SESSION; is It true or flase; 2, bellow this function coming from the neroCmd has maze me : the ppItemFirst is come from the disk ,or not?? the ppItemFirst or pItemToAdd is we wanted?? 3, in this funcation ,,if the (*ppItemFirst)->isDirectory is false; then and the pItemToAdd->isDirectory is true; I found the funcation do not anything ,,the pItemToAdd is not be add to the ppItemFirst; can somebody can tell me ??am I right,or wrong,,thank you!!! bool CBurnContext::MergeIsoTrack (const PARAMETERS & params, NERO_ISO_ITEM ** ppItemFirst, NERO_ISO_ITEM * pItemToAdd) { bool bSuccess = true; // Two loops. Outter loops the first tree, the inner loops the second // tree. // for (; bSuccess && *ppItemFirst != NULL; ppItemFirst = &(*ppItemFirst)->nextItem) { for (NERO_ISO_ITEM ** ppItemSecond = &pItemToAdd; *ppItemSecond != NULL; ) { // Compare entry names... // if ((*ppItemFirst)->isDirectory == (*ppItemSecond)->isDirectory && 0 == stricmp (GetFilename (*ppItemFirst), GetFilename (*ppItemSecond))) { bool bReplace = true; // The items point to the same file/directory. We need // to remove one of them. Which one is removed depends // on whether "--backup" is specified on command line. // If it is a directory, make sure to recurse anyway // because the trees below may not be identical. // if ((*ppItemFirst)->isDirectory) { bSuccess = MergeIsoTrack (params, &(*ppItemFirst)->subDirFirstItem, (*ppItemSecond)->subDirFirstItem); (*ppItemSecond)->subDirFirstItem = NULL; if (!bSuccess) { break; } // Since the item is a directory, we won't replace // the old one as it doesn't matter which one we // keep. Directory is just a name. It has no file // access time stamp. // bReplace = false; } else { // If there is a file name conflict between iso items // that don't belong to imported sessions, ask the user // what to do. // if (!(*ppItemFirst)->isReference) { printf ("\nThere is a file name conflict!\n" "%s\n" "%s\n" "Do you want to use the first or second file, or to exit?\n", GetFilenameSourcePath (*ppItemFirst), GetFilenameSourcePath (*ppItemSecond)); static const CResponsePairs mapping[] = { "First", DLG_RETURN_TRUE, "Second", DLG_RETURN_FALSE, "Exit", DLG_RETURN_CANCEL, NULL }; CResponse response (mapping, 0); NeroUserDlgInOut result = response; // If the user chose to quit, then obey and quit. // if (result == DLG_RETURN_CANCEL) { bSuccess = false; break; } else { // Otherwise, choose between first and second // file. // bReplace = (result == DLG_RETURN_FALSE); } } else { // If no "--backup" was specified, always replace // the old files. // if (!params.GetBackup ()) { bReplace = true; } else { // If there is a "--backup" command line, // replace the old one only if older in terms // of access times. // time_t timeOld = mktime (&(*ppItemFirst)->entryTime); time_t timeNew = mktime (&(*ppItemSecond)->entryTime); bReplace = timeOld < timeNew; } } } if (bReplace) { // We will now switch places of items in the first and // second tree. Since one of the items has to be deleted // eventually, this operation will essentially keep // the item from the second tree and delete the item // from the first tree. // NERO_ISO_ITEM * pTempItem = *ppItemSecond; *ppItemSecond = *ppItemFirst; *ppItemFirst = pTempItem; pTempItem = (*ppItemSecond)->nextItem; (*ppItemSecond)->nextItem = (*ppItemFirst)->nextItem; (*ppItemFirst)->nextItem = pTempItem; } // Remove the item from the second tree. // NERO_ISO_ITEM * pTempItem = *ppItemSecond; *ppItemSecond = pTempItem->nextItem; pTempItem->nextItem = NULL; DeleteIsoItemTree (pTempItem); } else { // No match, advance to the next item. // ppItemSecond = &(*ppItemSecond)->nextItem; } } } // Attach whatever is left of the new tree to the main tree. // *ppItemFirst = pItemToAdd; // Returning true means, everything is fine, continue. // return bSuccess; } |
| | |
| | #2 (permalink) | ||
| Nero Developer Join Date: Oct 2003
Posts: 605
| Quote:
Quote:
| ||
| | |
| | #3 (permalink) |
| CD Freaks Rookie Join Date: Aug 2004
Posts: 30
| Re: about the MergeIsoTrack funcation in the nerocmd? Thank you! give me advice! but now,I using the funcation : iRes = NeroBurn (m_ndhDeviceHandle ,NERO_ISO_AUDIO_MEDIA ,&writeCD, NBF_WRITE // NBF_SIMULATE Write and simulate are not mutually exclusive, we just use either one or the other here. | NBF_DISABLE_ABORT | NBF_DETECT_NON_EMPTY_CDRW | NBF_SPEED_IN_KBS | NBF_CLOSE_SESSION | NBF_CD_TEXT | NBF_DISABLE_EJECT |NCITEF_CREATE_ISO_FS ,0, &m_npProgress); finally , after complete the burn ,I use to add another session,but can not,then I use the nero application to detect the disk;the nero tell me ,the disk that I burn is not multsession disk; I do not knew why?? 2, bellow this function coming from the neroCmd has maze me : the ppItemFirst is come from the disk ,or not?? the ppItemFirst or pItemToAdd is we wanted?? means: I do not understand the funcation; for example:in the nerocmd,the ppItemFirst seem to come from the NeroImportDataTrack();the pItemToAdd is the Item that we add to the ppItemFirst;can you tell me my understand is ture or false? can you tell me finally ,,,, the Item added to disk is the ppItemFirst or the pItemToAdd?? 3, in this funcation ,,if the (*ppItemFirst)->isDirectory is false; then and the pItemToAdd->isDirectory is true; I found the funcation do not anything ,,the pItemToAdd is not be add to the ppItemFirst; mens : when I use the funcation ,,if the (*ppItemFirst)->isDirectory is false; and the pItemToAdd->isDirectory is true; I found the funcation do not anything ,,the pItemToAdd is not be add to the ppItemFirst ; |
| | |
| | #4 (permalink) | ||||
| Nero Developer Join Date: Oct 2003
Posts: 605
| Quote:
Quote:
Quote:
Quote:
| ||||
| | |
| | #5 (permalink) | |
| Nero Developer Join Date: Oct 2003
Posts: 605
| Quote:
| |
| | |
| | #6 (permalink) | |
| CD Freaks Rookie Join Date: Aug 2004
Posts: 30
| Re: about the MergeIsoTrack funcation in the nerocmd? Quote:
Your mean is : the ppItemToAdd include all the Item(include the previouse session 's Items,and the Item that you want to add to disk), and the pfirstItem is the Item that has burned on disk;then this funcation will remove any duplicate/unwanted items from the ppItemToAdd; is that right; | |
| | |
| | #7 (permalink) |
| CD Freaks Rookie Join Date: Aug 2004
Posts: 30
| Re: about the MergeIsoTrack funcation in the nerocmd? my funcation is that:this funcation is changed from the nerocmd 'MergeIsoTrack(); maybe ,,anybody ,can tell my whether it can run?; thank you ! BOOL CCDWriterDlg::AddIsoTrack (NERO_ISO_ITEM ** ppItemFirst, NERO_ISO_ITEM * pItemToAdd) { BOOL bSuccess = TRUE; // 双层循环. 外层循环是对应于ppItemFirst及其tree, 内层循环对应于pItemToAdd及其tree; for (; bSuccess && *ppItemFirst != NULL; ppItemFirst = &(*ppItemFirst)->nextItem) { for (NERO_ISO_ITEM ** ppItemSecond = &pItemToAdd; *ppItemSecond != NULL; ) { // 比较ppItemFirst中的实体与pItemToAdd中的实体, if ( (*ppItemFirst)->isDirectory == (*ppItemSecond)->isDirectory && 0 == stricmp ((*ppItemFirst)->fileName, (*ppItemSecond)->fileName)) { BOOL bReplace = TRUE; // 如果实体(文件,或者是文件目录)是相同的; // 我们就删除该文件,如果是文件目录,则需要一个循环来 // 遍历该目录,看其中的文件是否都相同,如果不是,则不能够直接 // 删除该目录,而应该只删除一不部分; if ((*ppItemFirst)->isDirectory) { bSuccess = AddIsoTrack (&(*ppItemFirst)->subDirFirstItem, (*ppItemSecond)->subDirFirstItem); (*ppItemSecond)->subDirFirstItem = NULL; if (!bSuccess) { break; } bReplace = FALSE; } else { // 如果是一个文件,则要求用户该怎么作?! if (!(*ppItemFirst)->isReference)// 如果没有指向文件; { NeroUserDlgInOut result = DLG_RETURN_FALSE ; if (result == DLG_RETURN_EXIT/*DLG_RETURN_CANCEL*/) { bSuccess = FALSE; break; } else { bReplace = (result == DLG_RETURN_FALSE); } } else { bReplace = TRUE; } } if (bReplace) { NERO_ISO_ITEM * pTempItem = *ppItemSecond; *ppItemSecond = *ppItemFirst; *ppItemFirst = pTempItem; pTempItem = (*ppItemSecond)->nextItem; (*ppItemSecond)->nextItem = (*ppItemFirst)->nextItem; (*ppItemFirst)->nextItem = pTempItem; } NERO_ISO_ITEM * pTempItem = *ppItemSecond; *ppItemSecond = pTempItem->nextItem; pTempItem->nextItem = NULL; ReleaseIsoItemTree(pTempItem); } else { ppItemSecond = &(*ppItemSecond)->nextItem; } } } *ppItemFirst = pItemToAdd; NERO_ISO_ITEM * tem = pItemToAdd->nextItem; return bSuccess; } |
| | |
| | #8 (permalink) |
| Nero Developer Join Date: Oct 2003
Posts: 605
| It would have been better if you posted your code in the [ code ] tags. This way all the whitespace would have been properly preserved. Currently, your code is very hard to read. Other than this, why are you using NeroUserDlgInOut in this function at all? In the following code, bReplace is always true in the end. Code: if (!(*ppItemFirst)->isReference)// 如果没有指向文件;
{
NeroUserDlgInOut result = DLG_RETURN_FALSE ;
if (result == DLG_RETURN_EXIT/*DLG_RETURN_CANCEL*/)
{
bSuccess = FALSE;
break;
}
else
{
bReplace = (result == DLG_RETURN_FALSE);
}
}
else
{
bReplace = TRUE;
} |
| | |
| |
| |
![]() |
| 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 |
| NeroCmd | socram | Nero SDK Discussion Forum | 2 | 12-09-2005 17:27 |
| [nerocmd] burning multi session dvd problem with NeroCmd | coolhome | Nero SDK Discussion Forum | 0 | 21-07-2005 04:11 |
| chich funcation can give me the left time of burning? | daixiaofei | Nero SDK Discussion Forum | 1 | 21-12-2004 16:11 |
| Nerocmd | matthewjames | Nero & InCD | 0 | 26-03-2004 11:13 |
| NeroCmd | maociao | Nero SDK Discussion Forum | 3 | 23-03-2004 13:59 |