⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 neroapi.h

📁 本源码是通过调用NeroAPI实现刻录功能
💻 H
📖 第 1 页 / 共 5 页
字号:
{
	DWORD nsiNumSupportedSpeeds;     /* 1 if the speed cannot be changed */
	DWORD nsiBaseSpeedKBs;			 /* Speed corresponding to 1X for the selected media in KB/s */
	DWORD nsiSupportedSpeedsKBs[64]; /* List of possible speeds in KB/s */
	DWORD nsiSupportedSpeeds[64];    /* List of possible speeds in multiple of 150KB/s (1X for CD) (present for compatibility) */
	DWORD nsiReserved[32];
} NERO_SPEED_INFOS;

typedef enum tag_NERO_MEDIA_TYPE
{
	MEDIA_NONE				=	0,								// No media present (NeroAPI>=5.5.9.4)
	MEDIA_CD				=	0x00001,						// CD-R/RW
	MEDIA_DDCD				=	0x00002,						// DDCD-R/RW
	MEDIA_DVD_M				=	0x00004,						// DVD-R/RW
	MEDIA_DVD_P				=	0x00008,						// DVD+RW
	MEDIA_DVD_RAM			=	0x00010,						// DVD-RAM
	MEDIA_ML				=	0x00020,						// ML (Multi Level disc)
	MEDIA_MRW				=	0x00040,						// Mt. Rainier

	//NeroAPI>=5.5.9.4:
	MEDIA_NO_CDR			=	0x00080,						// Exclude CD-R
	MEDIA_NO_CDRW			=	0x00100,						// Exclude CD-RW
	MEDIA_CDRW				=   MEDIA_CD|MEDIA_NO_CDR,			// CD-RW		
	MEDIA_CDR				=   MEDIA_CD|MEDIA_NO_CDRW,			// CD-R
	MEDIA_DVD_ROM			=	0x00200,						// DVD-ROM (non writable)
	MEDIA_CDROM				=	0x00400,						// CD-ROM (non writable)

	//NeroAPI>=5.5.9.10
	MEDIA_NO_DVD_M_RW		=	0x00800,						// Exclude DVD-RW
	MEDIA_NO_DVD_M_R		=	0x01000,						// Exclude DVD-R
	MEDIA_NO_DVD_P_RW		=	0x02000,						// Exclude DVD+RW
	MEDIA_NO_DVD_P_R		=	0x04000,						// Exclude DVD+R
	MEDIA_DVD_M_R			=	MEDIA_DVD_M|MEDIA_NO_DVD_M_RW,	// DVD-R
	MEDIA_DVD_M_RW			=	MEDIA_DVD_M|MEDIA_NO_DVD_M_R,	// DVD-RW
	MEDIA_DVD_P_R			=	MEDIA_DVD_P|MEDIA_NO_DVD_P_RW,	// DVD+R
	MEDIA_DVD_P_RW			=	MEDIA_DVD_P|MEDIA_NO_DVD_P_R,	// DVD+RW
	MEDIA_FPACKET			=   0x08000,						// Fixed Packetwriting
	MEDIA_VPACKET			=	0x10000,						// Variable Packetwriting
	MEDIA_PACKETW			=	MEDIA_MRW|MEDIA_FPACKET			// a bit mask for packetwriting
									|MEDIA_VPACKET,
	//NeroAPI>=5.5.10.4
	MEDIA_HDB				=	0x20000,						// HD-Burn

	//NeroAPI>=6.0.0.29
	MEDIA_DVD_P_R9			=	0x40000,
	MEDIA_DVD_ANY			=	MEDIA_DVD_M|MEDIA_DVD_P|MEDIA_DVD_RAM|MEDIA_DVD_P_R9 // Any DVD-Media	
} NERO_MEDIA_TYPE;

typedef DWORD NERO_MEDIA_SET;	// Represents a set of several medias

typedef struct tag_NERO_SCSI_DEVICE_INFO
{
	char                nsdiDeviceName[64];
	char                nsdiHostAdapterName[8];
	DWORD               nsdiHostAdapterNo; 
	DWORD               nsdiDeviceID;
	NEROAPI_SCSI_DEVTYPE nsdiDevType;
	char                nsdiDriveLetter;        /* Windows drive letter or 0 if not available */

	DWORD				nsdiCapabilities;       /* drive capabilities: */
#define NSDI_ALLOWED				(1<<0)      /* the drive can only be used if this bit is set */
#define NSDI_DAO                    (1<<1)      /* can write in DAO. */
#define NSDI_READ_CD_TEXT           (1<<2)      /* can read CD text */
#define NSDI_VARIABLE_PAUSES_IN_TAO (1<<3)      /* see natPauseInBlksBeforeThisTrack below */
#define NSDI_DAO_WRITE_CD_TEXT      (1<<4)      /* writes CD text in DAO (see natArtist/Title); never supported in TAO */
#define NSDI_IMAGE_RECORDER			(1<<6)		/* drive is the image recorder */
#define NSDI_UNDETECTED				(1<<7)
#define NSDI_IDE_BUS				(1<<8)
#define NSDI_SCSI_BUS				(1<<9)
#define NSDI_BUF_UNDERRUN_PROT		(1<<10)		/* drive has a buffer underrun protection feature (not necessary Burn Proof) */
#define NSDI_RESERVED				(1<<11)		/* Must not be used */
#define NSDI_RESERVED2				(1<<12)		/* Must not be used */
#define NSDI_ALLOW_CHANGE_BOOKTYPE	(1<<13)		/* NeroAPI >5.5.10.7: DVD recorder can change booktype of burned medium */
#define NSDI_DVDPLUSVR_SUPPORTED    (1<<14)     /* NeroAPI >= 6.0.0.0: This recorder can write DVD+VR */

	NERO_SPEED_INFOS    nsdiReadSpeeds;
	NERO_SPEED_INFOS    nsdiWriteSpeeds;
	const void         *nsdiDriver;             /* opaque identifier of the internal driver, required by NeroOpenDevice() */
	char		nsdiBufUnderrunProtName[64];	/* Buffer underrun protection technology name */
												/* The string will be empty if the technology has no name */
	DWORD				nsdiMandatoryBUPSpeed;	/* it is highly recommanded to enable buffer
												   underrun protection protection when burning at this speed or
												   faster. Contains 0 if there is no recommandation */
	NERO_MEDIA_SET		nsdiMediaSupport;		/* NeroAPI>=5.5.4.1: Bit field of supported writable media (constructed with the NERO_MEDIA_TYPE enum)*/

	DWORD				nsdiDriveBufferSize;	/* NeroAPI>=5.5.9.4: Drive buffer size (internal) in KB */
	
	DWORD				nsdiDriveError;			/* NeroAPI>=6.0.0.0: Contains a NERO_DRIVE_ERROR that occured during generating the information.
												   If != NDE_NO_ERROR, some information like the drive capabilities or the speeds might be wrong.
												   You can check with NeroIsDeviceReady if the drive is ready later
												   and update the device information with NeroUpdateDeviceInfo.
												   NDE_DISC_NOT_PRESENT* errors can be ignored.
												*/
	NERO_MEDIA_SET		nsdiMediaReadSupport;	/* NeroAPI>=6.0.0.8: Bit field of supported readable media (constructed with the NERO_MEDIA_TYPE enum)*/

	DWORD               nsdiReserved[61];       /* Should be zero */
} NERO_SCSI_DEVICE_INFO;

typedef struct tag_NERO_SCSI_DEVICE_INFOS
{
	DWORD nsdisNumDevInfos; /* number of the following entries */
	NERO_SCSI_DEVICE_INFO nsdisDevInfos[1];
} NERO_SCSI_DEVICE_INFOS;

/* Gets a list of available WORM and CDROM devices, free with NeroFreeMem(). */
/* Returns NULL for error */
NEROAPI_API NERO_SCSI_DEVICE_INFOS * NADLL_ATTR NeroGetAvailableDrivesEx(
													NERO_MEDIA_TYPE	mediaType,	// Provide speeds values for this kind of media
													void *reserved);			// Must be NULL

/* NeroAPI>=6.0.0.0: Update the information about a drive. */
NEROAPI_API NERO_DRIVE_ERROR NADLL_ATTR NeroUpdateDeviceInfo(NERO_SCSI_DEVICE_INFO *devInfo // the device info to update
												, NERO_MEDIA_TYPE mediaType // the media type to update the speed infos with
												, void *reserved); // Must be NULL

/* Get a string describing the given bit field of supported media
   Free with NeroFreeMem();
*/
NEROAPI_API char *NADLL_ATTR NeroGetTypeNameOfMedia(NERO_MEDIA_SET media,void *reserved);

/*
// Open and close a device:
*/
NEROAPI_API NERO_DEVICEHANDLE NADLL_ATTR NeroOpenDevice(const NERO_SCSI_DEVICE_INFO* pDevInfo);  /* NULL for errors */
NEROAPI_API void NADLL_ATTR NeroCloseDevice(NERO_DEVICEHANDLE aDeviceHandle);

/*
// NeroAPI > 5.5.9.10
// Get available write speeds depending on medium type, free with NeroFreeMem().
// Returns NULL for error
*/
  
typedef enum
{
   ACCESSTYPE_WRITE,
   ACCESSTYPE_READ
} NERO_ACCESSTYPE;

NEROAPI_API NERO_SPEED_INFOS * NADLL_ATTR NeroGetAvailableSpeeds(NERO_DEVICEHANDLE aDeviceHandle,
							       NERO_ACCESSTYPE accessType,
							       NERO_MEDIA_TYPE mediaType,
							       void *reserved);

/*
 * NeroAPI > 5.5.10.7
 * Get and set special low level options of devices
 */
typedef enum
{
	/*
	 * change booktype of a DVD+R and DVD+RW for subsequent writes until 
	 * next power cycle to DVD-ROM. 
	 * void* is a pointer to BOOL in Nero(Set|Get)DeviceOption.
	 * For setting the booktype to DVD-ROM, set parameter to TRUE, to reset
	 * changing the booktype set to FALSE.
	 * In NeroGetDeviceOption, TRUE is returned if the changing the booktype 
	 * to DVD-ROM is enabled for both DVD+R and DVD+RW, FALSE otherwise.
	 */
	NERO_DEVICEOPTION_BOOKTYPE_DVDROM = 0,

	/*
	 * Set the number of blocks after that to switch from layer 0
	 * to layer 1 when writing on a double layer medium. 
	 * Notes:
	 * - the number of blocks must be a multiple of 16
	 * - the layer 0 must be >= totalDataSize/2, because there can
	 *   never be more data on layer 1 than on layer 0.
	 *
	 * In NeroSetDeviceOption value is a pointer to a DWORD variable.
	 * In NeroGetDeviceOption a pointer to a DWORD is returned.
	 */
	NERO_DEVICEOPTION_LAYERSWITCH = 1,

	/*
	 * NeroAPI >= 6.0.0.24: 
	 * Set the booktype of the next DVD+R and DVD+RW that is written
	 * to DVD-ROM. This option is useful, if you do packetwriting. If you
	 * call NeroBurn you have to use the NBF_BOOKTYPE_DVDROM flag or 
	 * NBF_NO_BOOKTYPE_CHANGE flag.	 
	 * void* is a pointer to BOOL in Nero(Set|Get)DeviceOption.
	 */
	NERO_DEVICEOPTION_BOOKTYPE_DVDROM_NEXT_WRITE = 2,

	/*
	 * Set the number of blocks after that to switch from layer 0
	 * to layer 1 when writing on a double layer medium. In difference to
	 * NERO_DEVICEOPTION_LAYERSWITCH the layer break is written
	 * immediately to the disc, while otherwise it is set during burning.
	 * Notes:
	 * - the number of blocks must be a multiple of 16
	 * - the layer 0 must be >= totalDataSize/2, because there can
	 *   never be more data on layer 1 than on layer 0.
	 *
	 * In NeroSetDeviceOption value is a pointer to a DWORD variable.
	 * In NeroGetDeviceOption a pointer to a DWORD is returned.
	 */
	NERO_DEVICEOPTION_BREAK_LAYER = 3

} NERO_DEVICEOPTION;

/*
// Set a special option for a device
// returns 0 an success
*/
NEROAPI_API int NADLL_ATTR NeroSetDeviceOption(NERO_DEVICEHANDLE aDeviceHandle,
									NERO_DEVICEOPTION aOption,
									void *value);

/*
// Get an option from a device. The returned value must be freed with NeroFreeMem
// by the caller
*/
NEROAPI_API void* NADLL_ATTR NeroGetDeviceOption(NERO_DEVICEHANDLE aDeviceHandle,
									NERO_DEVICEOPTION aOption, void* reserved);


/*
// CD-Information:
*/

typedef enum
{
	NTT_UNKNOWN,
	NTT_DATA,
	NTT_AUDIO
} NERO_TRACK_TYPE;

typedef struct tag_NERO_TRACK_INFO
{
	DWORD           ntiSessionNumber;
	DWORD           ntiTrackNumber;
	NERO_TRACK_TYPE ntiTrackType;
	DWORD           ntiTrackStartBlk;
	DWORD           ntiTrackLengthInBlks;
	char            ntiArtist[65];
	char            ntiTitle[65];
	char			ntiISRC[13];			/* NeroAPI > 5.5.8.3: if NGCDI_READ_ISRC is present: 12 chars ISRC code + terminator */
	DWORD           ntiBlockSize;           /* NeroAPI >= 6.0.0.0: size of one block in bytes */
	DWORD           ntiReserved[28];        /* Should be zero */
} NERO_TRACK_INFO;

typedef enum
{
	NMT_UNKNOWN,
	NMT_CD_ROM,
	NMT_CD_RECORDABLE,
	NMT_CD_REWRITEABLE
} NERO_MEDIUM_TYPE;

typedef struct tag_NERO_CD_INFO
{
	DWORD            ncdiFreeCapacityInBlocks;
	BOOL             ncdiIsWriteable;       /* A disc can be non-writeable */
	NERO_MEDIUM_TYPE ncdiMediumType;        /* Old media type description, ncdiMediaType should be used instead */
	char             ncdiArtist[65];
	char             ncdiTitle[65];
	DWORD			 ncdiAvailableEraseModes;/* This bitfield can be decoded using the NCDI_IS_ERASE_MODE_AVAILABLE macro */
	DWORD			 ncdiUnusedBlocks;		/* difference beetween Lead-Out position and last possible Lead-Out position */
	NERO_MEDIA_TYPE	 ncdiMediaType;			/* NeroAPI>=5.5.9.4: type of media */
	DWORD			 ncdiMediumFlags;		/* NeroAPI>6.0.0.10: various medium flags (Virtual multisession, ...)  */
/* The medium is a virtual multisession medium, use VMS API to retrieve session information.
   NOTE: This flag only tells you, that if multisession is written, VMS is used. But not
         that this medium contains multisessions.
*/
#define NCDIMF_VIRTUALMULTISESSION	(1<<0)
#define NCDIMF_HDB_SUPPORTED		(1<<1)  /* The medium supports HD-BURN */

	DWORD            ncdiLayer0MaxBlocks;   /* NeroAPI>6.0.0.19: If this value is set, the medium is a double layer medium whereby 
	                                         * layer 0 can not be bigger than the given number of blocks.
                                             */
	DWORD            ncdiTotalCapacity;		/* NeroAPI>=6.3.0.5: The total capacity of this medium */
	DWORD            ncdiReserved[26];      /* Should be zero */
	DWORD            ncdiNumTracks;
	NERO_TRACK_INFO  ncdiTrackInfos[1];
} NERO_CD_INFO;

#define NCDI_IS_ERASE_MODE_AVAILABLE(cdInfo,eraseMode)	((cdInfo).ncdiAvailableEraseModes & (1<<(eraseMode)))

/*
// Get information about a CD. Free result with NeroFreeMem().
//
// aDeviceHandle: result of NeroOpenDevice()
//         flags: see below
//
// Returns NULL in case of error.
*/
NEROAPI_API NERO_CD_INFO * NADLL_ATTR NeroGetCDInfo(NERO_DEVICEHANDLE aDeviceHandle, DWORD dwFlags);
#define NGCDI_READ_CD_TEXT      (1<<0)		/* also try to fill in */
#define NGCDI_READ_ISRC			(1<<1)		/* NeroAPI>=5.5.8.4 */
/* NeroAPI>=6.0.0.25: 
 * If the recorder and the current medium support HD-BURN, give the capacity and 
 * the unused blocks for the HD-BURN mode 
 * Note, that if the medium is already written in HD-BURN mode, this flag is not necessary.
 */
#define NGCDI_USE_HDB			(1<<2)		

typedef struct tag_NERO_VMSSESSION
{
	char		nvmssSessionName[256];		/* The name of the session (volume name) */
	struct tm	nvmssCreationTime;			/* The creation time of the session */
	DWORD		nvmssNextWritableAddress;	/* The first block that is not occupied by this session */
	DWORD		nvmssReserved[32];			/* Should be zero */
} NERO_VMSSESSION;

typedef struct tag_NERO_VMS_INFO
{
	DWORD			nvmsiNextWritableAddress;	/* The next writable address of the medium, may be used for free space calculation */
	DWORD			nvmsiNumSessions;			/* Number of sessions stored on the VMS medium */
	DWORD			nvmsiReserved[32];			/* Should be zero */
	NERO_VMSSESSION	nvmsiSessionInfo[1];		/* One entry per session */
} NERO_VMS_INFO;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -