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


Commercial message



Nero SDK Discussion Forum Discuss, about the MergeIsoTrack funcation in the nerocmd? at International Chat: Software related forum; 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


Reply
 
Thread Tools
Old 01-12-2004   #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;
}
daixiaofei is offline   Reply With Quote
Old 01-12-2004   #2 (permalink)
Nero Developer
 
Join Date: Oct 2003
Posts: 605
Quote:
1, the diffrent between Multsession and no Multsession is :
in the burn function we using the NBF_CLOSE_SESSION;
is It true or flase;
Multisession disc has (as the word itself implies) multiple sessions. If a disc contains only one session, you could write another if the disc was not closed previously. In order to only close the session and not the whole disc, you need to use NBF_CLOSE_SESSION on each subsequent write. If you omit the flag, the disc will be closed and further writing will not be possible.

Quote:
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;
Could you please clarify the above two questions? It is not clear what you are asking.
alexp is offline   Reply With Quote
Old 02-12-2004   #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 ;
daixiaofei is offline   Reply With Quote
Old 02-12-2004   #4 (permalink)
Nero Developer
 
Join Date: Oct 2003
Posts: 605
Quote:
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
You really shouldn't ever be mixing unrelated flags. Here only NBF_ flags should be combined. NCITEF_ flags are used in a different place altogether.

Quote:
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??
If a disc contains only one session, Nero will not show it is a multisession disc. Since you used NBF_CLOSE_SESSION, you should be able to write additional sessions to the disc. If you want the files from the previous session to be seen, you must import this session first.

Quote:
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?
Correct.

Quote:
can you tell me finally ,,,, the Item added to disk is the ppItemFirst or the
pItemToAdd??
It is ppItemFirst.
alexp is offline   Reply With Quote
Old 02-12-2004   #5 (permalink)
Nero Developer
 
Join Date: Oct 2003
Posts: 605
Quote:
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 ;
The idea is to remove any duplicate/unwanted items from the pItemToAdd tree and then attach what is rest of it to the main tree.
alexp is offline   Reply With Quote
Old 03-12-2004   #6 (permalink)
CD Freaks Rookie
 
Join Date: Aug 2004
Posts: 30
Re: about the MergeIsoTrack funcation in the nerocmd?

Quote:
Originally Posted by alexp
The idea is to remove any duplicate/unwanted items from the pItemToAdd tree and then attach what is rest of it to the main tree.

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;
daixiaofei is offline   Reply With Quote
Old 03-12-2004   #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;
}
daixiaofei is offline   Reply With Quote
Old 03-12-2004   #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; 
}
alexp 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
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


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


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