This is my test code (I'm using starburnX 02202009_v11_Experimental):
I want to burn 3 different files in 3 different sessions.
Code:
StarBurnX m_starBurnX = null;
UDFDataBurner UDFBurn = null;
try
{
m_starBurnX = new StarBurnX();
m_starBurnX.Initialize(string.Empty);
UDFBurn = new UDFDataBurner();
UDFBurn.NextSessionAllowed = true;
UDFBurn.AddFile("d:\\e.mp3"); // then f.mp3, then g.mp3
UDFBurn.Drive = m_starBurnX.Drives[0];
while (UDFBurn.Drive.State != STARBURN_DRIVE_STATE.STARBURN_DRIVE_STATE_READY)
System.Threading.Thread.Sleep(1000);
UDFBurn.Mode = STARBURN_WRITE_MODE.STARBURN_WRITE_MODE_AUTO;
UDFBurn.WriteSpeed = UDFBurn.Drive.DriveInfo.MaxWriteSpeed;
int sessionCount = UDFBurn.Drive.DiscInfo.Sessions.Count;
if (sessionCount > 0)
UDFBurn.ImportTrack(-1);
UDFBurn.Burn(false, "text");
//UDFBurn.Verify();
UDFBurn.Drive.Eject();
System.Threading.Thread.Sleep(100);
UDFBurn.Drive.Load();
}
catch (COMException ex)
{
MessageBox.Show(UDFBurn.LastError + Environment.NewLine +
m_starBurnX.LastError + Environment.NewLine +
ex.ToString());
}
finally
{
m_starBurnX.Uninitialize();
}
the line:
Code:
UDFBurn.ImportTrack(-1);
never works!
This works for 2 sessions only:
Code:
if (sessionCount > 0)
UDFBurn.ImportTrack(sessionCount);
but when I add the third file I get only the first and the last file on the disc. And so on...only the first and the last burned.
Can you tell me what's wrong and suggest some code?
Thanks,
Massimo.