burncontext.cpp
来自「把doc文档转成pdf后刻录成CD,用VC++开发,用了Nero的SDK和CXI」· C++ 代码 · 共 2,103 行 · 第 1/3 页
CPP
2,103 行
return CLE_NO_ERROR;
}
const BURNTYPE PARAMETERS::GetBurnType() const
{
return m_BurnType;
}
const COMMAND PARAMETERS::GetCommand() const
{
return m_Command;
}
COMMAND_LINE_ERRORS PARAMETERS::SetCommand (COMMAND Command)
{
if (GetCommand() == COMMAND_UNKNOWN)
{
m_Command = Command;
}
else
{
return CLE_MULTIPLE_COMMANDS_SPECIFIED;
}
return CLE_NO_ERROR;
}
const LPCSTR PARAMETERS::GetDriveName() const
{
return m_psDriveName;
}
COMMAND_LINE_ERRORS PARAMETERS::SetDriveName (int& argc, char**& argv)
{
argc--;
argv++;
if (argc <= 0)
{
return CLE_MISSING_DRIVE_NAME_PARAMETER;
}
m_psDriveName = *argv;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetUseReal() const
{
return m_bReal;
}
COMMAND_LINE_ERRORS PARAMETERS::SetUseReal ()
{
m_bReal = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetUseTAO() const
{
return m_bTAO;
}
COMMAND_LINE_ERRORS PARAMETERS::SetUseTAO ()
{
m_bTAO = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetUseUnderRunProt() const
{
return m_bUnderRunProt;
}
COMMAND_LINE_ERRORS PARAMETERS::SetUseUnderRunProt ()
{
m_bUnderRunProt = true;
return CLE_NO_ERROR;
}
const LPCSTR PARAMETERS::GetArtist() const
{
return m_psArtist;
}
COMMAND_LINE_ERRORS PARAMETERS::SetArtist (int& argc, char**& argv)
{
argc--;
argv++;
if (argc <= 0)
{
return CLE_MISSING_ARTIST_PARAMETER;
}
m_psArtist = *argv;
return CLE_NO_ERROR;
}
const LPCSTR PARAMETERS::GetTitle() const
{
return m_psTitle;
}
COMMAND_LINE_ERRORS PARAMETERS::SetTitle (int& argc, char**& argv)
{
argc--;
argv++;
if (argc <= 0)
{
return CLE_MISSING_TITLE_PARAMETER;
}
m_psTitle = *argv;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetAudioSelected() const
{
return m_bAudioSelected;
}
COMMAND_LINE_ERRORS PARAMETERS::SetAudioSelected ()
{
// Audio can only be used in combination with ISO
if (BURNTYPE_UNKNOWN != GetBurnType())
{
if (!GetISOSelected())
{
return CLE_BURN_TYPE_ALREADY_SPECIFIED;
}
}
m_bAudioSelected = true;
m_BurnType = BURNTYPE_ISOAUDIO;
return CLE_NO_ERROR;
}
const int PARAMETERS::GetReadSpeed() const
{
return m_iReadSpeed;
}
COMMAND_LINE_ERRORS PARAMETERS::SetReadSpeed (int& argc, char**& argv)
{
argc--;
argv++;
if (argc <= 0)
{
return CLE_MISSING_SPEED_PARAMETER;
}
// check if conversion went right
if (!ATOI (*argv, m_iReadSpeed))
{
return CLE_INVALID_SPEED_PARAMETER;
}
return CLE_NO_ERROR;
}
const int PARAMETERS::GetSpeed() const
{
return m_iSpeed;
}
COMMAND_LINE_ERRORS PARAMETERS::SetSpeed (int& argc, char**& argv)
{
argc--;
argv++;
if (argc <= 0)
{
return CLE_MISSING_SPEED_PARAMETER;
}
if (GetSpeedInKbps () >= 0)
{
// If the speed in kbps is already specified, it is an error to
// set the speed in X.
//
return CLE_INVALID_SPEED_PARAMETER;
}
// check if conversion went right
if (!ATOI (*argv, m_iSpeed))
{
return CLE_INVALID_SPEED_PARAMETER;
}
return CLE_NO_ERROR;
}
const int PARAMETERS::GetSpeedInKbps() const
{
return m_iSpeedInKbps;
}
COMMAND_LINE_ERRORS PARAMETERS::SetSpeedInKbps (int& argc, char**& argv)
{
argc--;
argv++;
if (argc <= 0)
{
return CLE_MISSING_SPEED_PARAMETER;
}
if (GetSpeed () >= 0)
{
// If the speed in X is already specified, it is an error to
// set the speed in kb/s.
//
return CLE_INVALID_SPEED_PARAMETER;
}
// check if conversion went right
if (!ATOI (*argv, m_iSpeedInKbps))
{
return CLE_INVALID_SPEED_PARAMETER;
}
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetUseCDExtra() const
{
return m_bCDExtra;
}
COMMAND_LINE_ERRORS PARAMETERS::SetCDExtra ()
{
m_bCDExtra = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetEnableAbort() const
{
return m_bEnableAbort;
}
COMMAND_LINE_ERRORS PARAMETERS::SetEnableAbort ()
{
m_bEnableAbort = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetUseSpeedTest() const
{
return m_bSpeedTest;
}
COMMAND_LINE_ERRORS PARAMETERS::SetSpeedTest ()
{
m_bSpeedTest = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetCloseSession() const
{
return m_bCloseSession;
}
COMMAND_LINE_ERRORS PARAMETERS::SetCloseSession ()
{
m_bCloseSession = true;
return CLE_NO_ERROR;
}
const int PARAMETERS::GetSessionToImport() const
{
return m_iSessionToImport;
}
COMMAND_LINE_ERRORS PARAMETERS::SetSessionToImport (int& argc, char**& argv)
{
argc--;
argv++;
// By default, session is not imported unless --import is spotted in
// the command line.
//
m_bImportSession = true;
if (argc <= 0)
{
// If there are no more command line arguments, this switch was
// supplied without a session number.
//
m_iSessionToImport = -1;
}
else
{
// Check whether the argument is a number. If it is, take it as
// a part of this switch. If not, backtrack a single position
// in an argument list and let the parser reuse this argument
// while semantically considering that the last session will be
// imported.
//
if (!ATOI (*argv, m_iSessionToImport))
{
argc++;
argv--;
//this switch was supplied without a session number.
m_iSessionToImport = -1;
}
}
return CLE_NO_ERROR;
}
const int PARAMETERS::GetDoImportSession() const
{
// Return a flag that signifies if a session should be imported at all
// or not.
//
return m_bImportSession;
}
const bool PARAMETERS::GetDetectNonEmptyCDRW() const
{
return m_bDetectNonEmptyCDRW;
}
COMMAND_LINE_ERRORS PARAMETERS::SetDetectNonEmptyCDRW ()
{
m_bDetectNonEmptyCDRW = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetUseCDText() const
{
return m_bCDText;
}
COMMAND_LINE_ERRORS PARAMETERS::SetUseCDText ()
{
m_bCDText = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetUseRockridge() const
{
return m_bUseRockridge;
}
COMMAND_LINE_ERRORS PARAMETERS::SetUseRockridge ()
{
m_bUseRockridge = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetCreateIsoFs() const
{
return m_bCreateIsoFS;
}
COMMAND_LINE_ERRORS PARAMETERS::SetCreateIsoFs ()
{
m_bCreateIsoFS = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetCreateUdfFS() const
{
return m_bCreateUdfFS;
}
COMMAND_LINE_ERRORS PARAMETERS::SetCreateUdfFs ()
{
m_bCreateUdfFS = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetDVDVideoRealloc() const
{
return m_bDVDVideoRealloc;
}
COMMAND_LINE_ERRORS PARAMETERS::SetDVDVideoRealloc ()
{
m_bDVDVideoRealloc = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetDVDVideoCmpt() const
{
return m_bDVDVideoCmpt;
}
COMMAND_LINE_ERRORS PARAMETERS::SetDVDVideoCmpt ()
{
m_bDVDVideoCmpt = true;
return CLE_NO_ERROR;
}
// NIITEF_IMPORT_ROCKRIDGE flag is obsolete so we commented the
// code below.
//
/*const bool PARAMETERS::GetImportRockridge() const
{
return m_bImportRockridge;
}
COMMAND_LINE_ERRORS PARAMETERS::SetImportRockridge ()
{
m_bImportRockridge = true;
return CLE_NO_ERROR;
}*/
const bool PARAMETERS::GetImportUDF() const
{
return m_bImportUDF;
}
COMMAND_LINE_ERRORS PARAMETERS::SetImportUDF ()
{
m_bImportUDF = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetImportVMSSession() const
{
return m_bImportVMSSession;
}
COMMAND_LINE_ERRORS PARAMETERS::SetImportVMSSession ()
{
m_bImportVMSSession = true;
return CLE_NO_ERROR;
}
/*
const bool PARAMETERS::GetImportIsoOnly() const
{
return m_bImportIsoOnly;
}
COMMAND_LINE_ERRORS PARAMETERS::SetImportIsoOnly ()
{
m_bImportIsoOnly = true;
return CLE_NO_ERROR;
}
*/
/*
const bool PARAMETERS::GetPreferRockRidge() const
{
return m_bPreferRockridge;
}
COMMAND_LINE_ERRORS PARAMETERS::SetPreferRockridge ()
{
m_bPreferRockridge = true;
return CLE_NO_ERROR;
}
*/
const bool PARAMETERS::GetDisableEject() const
{
return m_bDisableEject;
}
COMMAND_LINE_ERRORS PARAMETERS::SetDisableEject ()
{
m_bDisableEject = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetVerify() const
{
return m_bVerify;
}
COMMAND_LINE_ERRORS PARAMETERS::SetVerify ()
{
m_bVerify = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetISOSelected() const
{
return m_bISOSelected;
}
COMMAND_LINE_ERRORS PARAMETERS::SetISOSelected (int& argc, char**& argv)
{
// ISO can be used in combination with
// any other burn type except BURNTYPE_IMAGE.
if (BURNTYPE_UNKNOWN != GetBurnType())
{
// If ISO has been set already return an error
if (GetISOSelected())
{
return CLE_BURN_TYPE_ALREADY_SPECIFIED;
}
else
{
// The other illegal type in this case
// is BURNTYPE_IMAGE.
if (BURNTYPE_IMAGE == GetBurnType())
{
return CLE_BURN_TYPE_ALREADY_SPECIFIED;
}
}
}
else
{
// No burn type set before
m_BurnType = BURNTYPE_ISOAUDIO;
}
if (argc <= 1)
{
return CLE_MISSING_ISO_PARAMETER;
}
argc--;
argv++;
COMMAND_LINE_ERRORS ecl = SetVolumeName(*argv);
if (CLE_NO_ERROR != ecl)
{
return ecl;
}
ecl = SetVolumeNameSupplied();
if (CLE_NO_ERROR != ecl)
{
return ecl;
}
m_bISOSelected = true;
return CLE_NO_ERROR;
}
const LPCSTR PARAMETERS::GetVolumeName() const
{
return m_psVolumeName;
}
COMMAND_LINE_ERRORS PARAMETERS::SetVolumeName (char* psName)
{
m_psVolumeName = psName;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetDontUseJoliet() const
{
return m_bDontUseJoliet;
}
COMMAND_LINE_ERRORS PARAMETERS::SetDontUseJoliet ()
{
m_bDontUseJoliet = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetUseMode2() const
{
return m_bMode2;
}
COMMAND_LINE_ERRORS PARAMETERS::SetUseMode2 ()
{
m_bMode2 = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetVolumeNameSupplied() const
{
return m_bVolumeNameSupplied;
}
COMMAND_LINE_ERRORS PARAMETERS::SetVolumeNameSupplied ()
{
m_bVolumeNameSupplied = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetUseDVD() const
{
return m_bDVD;
}
COMMAND_LINE_ERRORS PARAMETERS::SetUseDVD ()
{
m_bDVD = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetUseDVDHighCompatibility() const
{
return m_bDVDHighCompatibility;
}
COMMAND_LINE_ERRORS PARAMETERS::SetUseDVDHighCompatibility ()
{
m_bDVDHighCompatibility = true;
return CLE_NO_ERROR;
}
const bool PARAMETERS::GetRecursive() const
{
return m_bRecursiveSearch;
}
COMMAND_LINE_ERRORS PARAMETERS::SetRecursive()
{
m_bRecursiveSearch = true;
return CLE_NO_ERROR;
}
COMMAND_LINE_ERRORS PARAMETERS::SetImageBurnType(int &argc, char **&argv)
{
COMMAND_LINE_ERRORS ecl = SetBurnType(BURNTYPE_IMAGE);
if (CLE_NO_ERROR != ecl)
{
return ecl;
}
if (argc <= 0)
{
return CLE_MISSING_IMAGE_PARAMETER;
}
argc--;
argv++;
return SetImageFileName(*argv);
}
COMMAND_LINE_ERRORS PARAMETERS::SetFreestyleBurnType(int &argc, char **&argv)
{
// make sure that the burn type has not been
// specified already
if (GetBurnType() != BURNTYPE_UNKNOWN && GetBurnType() != BURNTYPE_FREESTYLE)
{
return CLE_BURN_TYPE_ALREADY_SPECIFIED;
}
// set the track mode
COMMAND_LINE_ERRORS ecl;
if (!stricmp (*argv, "--freestyle_mode1"))
{
ecl = SetTrackMode(GetNumberOfTracks(), NERO_TRACKMODE_MODE1);
}
else if (!stricmp (*argv, "--freestyle_mode2"))
{
ecl = SetTrackMode(GetNumberOfTracks(), NERO_TRACKMODE_MODE2_FORM1);
}
else if (!stricmp (*argv, "--freestyle_audio"))
{
ecl = SetTrackMode(GetNumberOfTracks(), NERO_TRACKMODE_AUDIO);
}
if (CLE_NO_ERROR != ecl)
{
return ecl;
}
// the file name must be specified after the track mode
if (argc <= 0)
{
return CLE_MISSING_IMAGE_PARAMETER;
}
// make sure that we can add another track
if (!StillTrackSpaceLeft())
{
return CLE_MAXIMUM_NUMBER_OF_TRACKS_REACHED;
}
// Get the track filename
argc--;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?