NeroAPI.h 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827
  1. /******************************************************************************
  2. |* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. |* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. |* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. |* PARTICULAR PURPOSE.
  6. |*
  7. |* Copyright 1995-2002 Ahead Software AG. All Rights Reserved.
  8. |*-----------------------------------------------------------------------------
  9. |* NeroSDK / NeroAPI
  10. |*
  11. |* PROGRAM: NeroAPI.h
  12. |*
  13. |* PURPOSE: Main interface for Nero API DLL
  14. ******************************************************************************/
  15. #ifndef _NEROAPI_
  16. #define _NEROAPI_
  17. #ifdef __cplusplus
  18. extern "C"
  19. {
  20. #endif
  21. #ifdef NEROAPI_PORTABLE
  22. #include "datatypes.h"
  23. #endif
  24. /*
  25. // If included within the glue code, then don't add special
  26. // attributes to the functions.
  27. */
  28. #define NADLL_ATTR __cdecl
  29. #ifdef __NEROAPIGLUE__
  30. #define NEROAPI_API
  31. #else
  32. /* NEROAPI must not be defined when using the DLL */
  33. #ifdef NEROAPI
  34. #ifndef NEROAPI_PORTABLE
  35. #define NEROAPI_API __declspec(dllexport)
  36. #else
  37. // The portable version of NeroAPI uses standard C calls throughout
  38. #define NEROAPI_API
  39. #endif
  40. #else
  41. #define NEROAPI_API __declspec(dllimport)
  42. #endif /* NEROAPI */
  43. #endif /* __NEROAPIGLUE__ */
  44. #ifdef __cplusplus
  45. class CRecorderInfo;
  46. typedef CRecorderInfo *NERO_DEVICEHANDLE;
  47. #else
  48. typedef void *NERO_DEVICEHANDLE;
  49. #endif
  50. #ifndef NEROAPI_PORTABLE
  51. #include <windows.h> // the data types used below are those of windows
  52. #endif
  53. #include <time.h>
  54. #include "NeroUserDialog.h"
  55. /*
  56. // The NeroAPI never uses static memory. Instead, memory is allocated
  57. // dynamically on behalf of the application, e.g. for strings. This
  58. // memory has to be freed with this function.
  59. //
  60. // Passing a NULL is allowed.
  61. */
  62. NEROAPI_API void NADLL_ATTR NeroFreeMem (void *pMem);
  63. /*
  64. // All functions returning an DWORD will return 0 for success and a
  65. // error number otherwise. This error numbers are opaque and neither
  66. // can nor should be interpreted by the application. Instead, localized
  67. // strings are provided for errors and informative displays.
  68. //
  69. // The NeroAPI keeps a log of such informative messages or errors.
  70. // In case of an error, NeroGetLastError() will return more information
  71. // about the last error and NeroGetErrorLog() will show all recorded
  72. // events.
  73. //
  74. // Both functions return NULL if no error is available.
  75. //
  76. // Memory is allocated for the string, which has to be freed with NeroFreeMem().
  77. //
  78. // Note: NeroCloseDrive() has to throw away all errors, because they
  79. // might be bound to the driver. Handle errors before calling it!
  80. */
  81. NEROAPI_API char * NADLL_ATTR NeroGetLastError ();
  82. NEROAPI_API char * NADLL_ATTR NeroGetErrorLog ();
  83. /*
  84. // Clear errors and log (done automatically for every read or write function,
  85. // but can be used to avoid false memory leak warnings).
  86. */
  87. NEROAPI_API void NADLL_ATTR NeroClearErrors ();
  88. /*
  89. // Version management for this API:
  90. */
  91. #define NEROAPI_VERSION 5582 // This file is the interface for this version of NeroAPI
  92. NEROAPI_API DWORD NADLL_ATTR NeroGetAPIVersion(void); /* Returns 1000 for 1.0.0.0 */
  93. /* Using this function, an application can tell NeroAPI for which version of NeroAPI it was
  94. designed to work. NeroAPI will then tries to behave as this version as much as possible. This
  95. ensures the binary compatibility with future versions of NeroAPI. If this function is not called,
  96. NeroAPI will behaves as NeroAPI 5.0.3.9. If your application uses NeroAPIGlue.c, this function
  97. will be automatically called. */
  98. NEROAPI_API void NADLL_ATTR NeroSetExpectedAPIVersion(DWORD);
  99. /*
  100. // During writing or in several long running functions control
  101. // is transfered to the DLL. The application has to provide services
  102. // and dialog with the user via callback functions.
  103. //
  104. // NERO_CALLBACK_ATTR is defined in "NeroUserDialog.h" and ensures that
  105. // the same conventions are used for passing of parameters.
  106. */
  107. typedef struct tag_NERO_CALLBACK
  108. {
  109. void *ncCallbackFunction; /* actually, this is a pointer to one of several different callback functions defined below */
  110. void *ncUserData; /* this will be passed to the function as first parameter */
  111. } NERO_CALLBACK;
  112. typedef BOOL (NERO_CALLBACK_ATTR *NERO_IDLE_CALLBACK) (void *pUserData); /* called regularly during long running activities; return TRUE if this activity shall be aborted */
  113. /*
  114. // The NeroAPI needs some information:
  115. */
  116. typedef struct tag_NERO_SETTINGS
  117. {
  118. const char *nstNeroFilesPath; /* directory name with trailing '\' of where to find the additional Nero DLL and text files
  119. * No trailing '\' or '/' is necessary on for NeroAPI Portable */
  120. const char *nstVendor,
  121. *nstSoftware; /* path for registry settings (use "ahead", "Nero - Burning Rom" for Nero application's settings) */
  122. const char *nstLanguageFile; /* name of the Nero language file; relativ to nstNeroFilesPath (e.g. "Nero.txt") */
  123. NERO_CALLBACK nstIdle; /* NERO_IDLE_CALLBACK, may be NULL */
  124. NERO_CALLBACK nstUserDialog; /* NERO_USER_DIALOG, must not be NULL, see "NeroUserDialog.h" for details */
  125. /*
  126. // overburn settings:
  127. // overburning (writing more than the nominal capacity of a disc) is allowed if:
  128. // - nstEnableOverburn == TRUE
  129. // - nstOverburnSize >= amount of required blocks for compilation
  130. // and if
  131. // - the drive supports it
  132. // - DAO is used.
  133. // Even then, overburning has to be acknowledged via callback (see DLG_OVERBURN in "NeroUserDialog.h").
  134. */
  135. BOOL nstEnableOverburn;
  136. DWORD nstOverburnSize; /* in blocks */
  137. } NERO_SETTINGS;
  138. /*
  139. // Initialize the DLL. Must be successful before any of the remaining
  140. // functions can be called. Settings structure and strings it points
  141. // to are _not_ copied and function callbacks must be available all
  142. // the time.
  143. */
  144. typedef enum
  145. {
  146. NEROAPI_INIT_OK=0,
  147. NEROAPI_INIT_INVALID_ARGS,
  148. NEROAPI_INIT_UNSPECIFIED_ERROR, // Unspecified error
  149. NEROAPI_INIT_INVALID_SERIAL_NUM,
  150. NEROAPI_INIT_DEMOVERSION_EXPIRED,
  151. NEROAPI_INIT_ALREADY_INITIALISED,
  152. NEROAPI_INIT_CANNOT_LOCK
  153. } NEROAPI_INIT_ERROR;
  154. // Make sure to keep *all* the data including the strings valid as long as you're using NeroAPI,
  155. // since Nero will only store a pointer to this structure, not make a copy.
  156. NEROAPI_API NEROAPI_INIT_ERROR NADLL_ATTR NeroInit (const NERO_SETTINGS *pNeroSettings,const char *reserved);
  157. /*
  158. // Call this function before closing the DLL. This is necessary because
  159. // some clean-up actions like stopping threads cannot be done in the
  160. // close function of the DLL.
  161. */
  162. NEROAPI_API void NADLL_ATTR NeroDone ();
  163. /*
  164. Call this function to change a global option of NeroAPI
  165. */
  166. typedef enum
  167. {
  168. NEROAPI_OPTION_MSG_FILE_NAME, // Set the language file. The value points to a string containing the file name. This adress will be kept.
  169. NEROAPI_OPTION_WRITE_BUFFER_SIZE // Set write buffer size. Value points onto an integer containing the size in byte
  170. } NEROAPI_OPTION;
  171. NEROAPI_API int NADLL_ATTR NeroSetOption(NEROAPI_OPTION option,void *value);
  172. /*
  173. // Code to scan the SCSI/IDE bus and get information about
  174. // the available WORM/CDROM drives:
  175. */
  176. typedef enum
  177. {
  178. NEA_SCSI_DEVTYPE_UNKNOWN,
  179. NEA_SCSI_DEVTYPE_WORM, /* can write */
  180. NEA_SCSI_DEVTYPE_CDROM, /* can only read */
  181. NEA_SCSI_DEVTYPE_UNSUPPORTED_WORM /* can write but is not supported by NeroAPI */
  182. } NEROAPI_SCSI_DEVTYPE;
  183. typedef struct tag_NERO_SPEED_INFOS
  184. {
  185. DWORD nsiNumSupportedSpeeds; /* 1 if the speed cannot be changed */
  186. DWORD nsiBaseSpeedKBs; /* Speed corresponding to 1X for the selected media in KB/s */
  187. DWORD nsiSupportedSpeedsKBs[64]; /* List of possible speeds in KB/s */
  188. DWORD nsiSupportedSpeeds[64]; /* List of possible speeds in multiple of 150KB/s (1X for CD) (present for compatibility) */
  189. DWORD nsiReserved[32];
  190. } NERO_SPEED_INFOS;
  191. typedef enum tag_NERO_MEDIA_TYPE
  192. {
  193. MEDIA_CD = (1<<0), // CD-R/RW
  194. MEDIA_DDCD = (1<<1), // DDCD-R/RW
  195. MEDIA_DVD_M = (1<<2), // DVD-R/RW
  196. MEDIA_DVD_P = (1<<3), // DVD+RW
  197. MEDIA_DVD_ANY = MEDIA_DVD_M|MEDIA_DVD_P,// Any DVD-Recorder
  198. MEDIA_DVD_RAM = (1<<4), // DVD-RAM
  199. MEDIA_ML = (1<<5), // ML (Multi Level disc)
  200. MEDIA_MRW = (1<<6) // Mt. Rainier
  201. } NERO_MEDIA_TYPE;
  202. typedef DWORD NERO_MEDIA_SET;
  203. typedef struct tag_NERO_SCSI_DEVICE_INFO
  204. {
  205. char nsdiDeviceName[64];
  206. char nsdiHostAdapterName[8];
  207. DWORD nsdiHostAdapterNo;
  208. DWORD nsdiDeviceID;
  209. NEROAPI_SCSI_DEVTYPE nsdiDevType;
  210. char nsdiDriveLetter; /* Windows drive letter or 0 if not available */
  211. DWORD nsdiCapabilities; /* drive capabilities: */
  212. #define NSDI_ALLOWED (1<<0) /* the drive can only be used if this bit is set */
  213. #define NSDI_DAO (1<<1) /* can write in DAO. */
  214. #define NSDI_READ_CD_TEXT (1<<2) /* can read CD text */
  215. #define NSDI_VARIABLE_PAUSES_IN_TAO (1<<3) /* see natPauseInBlksBeforeThisTrack below */
  216. #define NSDI_DAO_WRITE_CD_TEXT (1<<4) /* writes CD text in DAO (see natArtist/Title); never supported in TAO */
  217. #define NSDI_IMAGE_RECORDER (1<<6) /* drive is the image recorder */
  218. #define NSDI_UNDETECTED (1<<7)
  219. #define NSDI_IDE_BUS (1<<8)
  220. #define NSDI_SCSI_BUS (1<<9)
  221. #define NSDI_BUF_UNDERRUN_PROT (1<<10) /* drive has a buffer underrun protection feature (not necessary Burn Proof) */
  222. #define NSDI_RESERVED (1<<11) /* Must not be used */
  223. NERO_SPEED_INFOS nsdiReadSpeeds;
  224. NERO_SPEED_INFOS nsdiWriteSpeeds;
  225. void *nsdiDriver; /* opaque identifier of the internal driver, required by NeroOpenDevice() */
  226. char nsdiBufUnderrunProtName[64]; /* Buffer underrun protection technology name */
  227. /* The string will be empty if the technology has no name */
  228. DWORD nsdiMandatoryBUPSpeed; /* it is highly recommanded to enable buffer
  229. underrun protection protection when burning at this speed or
  230. faster. Contains 0 if there is no recommandation */
  231. NERO_MEDIA_SET nsdiMediaSupport; /* NeroAPI >=5.5.4.1: Bit field of supported media (constructed with the NERO_MEDIA_TYPE enum)*/
  232. DWORD nsdiReserved[64]; /* Should be zero */
  233. } NERO_SCSI_DEVICE_INFO;
  234. typedef struct tag_NERO_SCSI_DEVICE_INFOS
  235. {
  236. DWORD nsdisNumDevInfos; /* number of the following entries */
  237. NERO_SCSI_DEVICE_INFO nsdisDevInfos[1];
  238. } NERO_SCSI_DEVICE_INFOS;
  239. /* Gets a list of available WORM and CDROM devices, free with NeroFreeMem(). */
  240. /* Returns NULL for error */
  241. NEROAPI_API NERO_SCSI_DEVICE_INFOS * NADLL_ATTR NeroGetAvailableDrivesEx(
  242. NERO_MEDIA_TYPE mediaType, // Provide speeds values for this kind of media
  243. void *reserved); // Must be NULL
  244. /* Get a string describing the given bit field of supported media
  245. The given separator will be used beetween several medias. Free with NeroFreeMem();
  246. */
  247. NEROAPI_API char *NADLL_ATTR NeroGetTypeNameOfMedia(DWORD media,const char *separator);
  248. /*
  249. // Open and close a device:
  250. */
  251. NEROAPI_API NERO_DEVICEHANDLE NADLL_ATTR NeroOpenDevice(const NERO_SCSI_DEVICE_INFO* pDevInfo); /* NULL for errors */
  252. NEROAPI_API void NADLL_ATTR NeroCloseDevice(NERO_DEVICEHANDLE aDeviceHandle);
  253. /*
  254. // CD-Information:
  255. */
  256. typedef enum
  257. {
  258. NTT_UNKNOWN,
  259. NTT_DATA,
  260. NTT_AUDIO
  261. } NERO_TRACK_TYPE;
  262. typedef struct tag_NERO_TRACK_INFO
  263. {
  264. DWORD ntiSessionNumber;
  265. DWORD ntiTrackNumber;
  266. NERO_TRACK_TYPE ntiTrackType;
  267. DWORD ntiTrackStartBlk;
  268. DWORD ntiTrackLengthInBlks;
  269. char ntiArtist[65];
  270. char ntiTitle[65];
  271. DWORD ntiReserved[32]; /* Should be zero */
  272. } NERO_TRACK_INFO;
  273. typedef enum
  274. {
  275. NMT_UNKNOWN,
  276. NMT_CD_ROM,
  277. NMT_CD_RECORDABLE,
  278. NMT_CD_REWRITEABLE
  279. } NERO_MEDIUM_TYPE;
  280. typedef struct tag_NERO_CD_INFO
  281. {
  282. DWORD ncdiFreeCapacityInBlocks;
  283. BOOL ncdiIsWriteable; /* A disc can be non-writeable */
  284. NERO_MEDIUM_TYPE ncdiMediumType; /* even if it is a CD-R or CD-RW. */
  285. char ncdiArtist[65];
  286. char ncdiTitle[65];
  287. DWORD ncdiAvailableEraseModes;/* This bitfield can be decoded using the NCDI_IS_ERASE_MODE_AVAILABLE macro */
  288. DWORD ncdiUnusedBlocks; /* difference beetween Lead-Out position and last possible Lead-Out position */
  289. DWORD ncdiReserved[30]; /* Should be zero */
  290. DWORD ncdiNumTracks;
  291. NERO_TRACK_INFO ncdiTrackInfos[1];
  292. } NERO_CD_INFO;
  293. #define NCDI_IS_ERASE_MODE_AVAILABLE(cdInfo,eraseMode) ((cdInfo).ncdiAvailableEraseModes & (1<<(eraseMode)))
  294. /*
  295. // Get information about a CD. Free result with NeroFreeMem().
  296. //
  297. // aDeviceHandle: result of NeroOpenDevice()
  298. // flags: see below
  299. //
  300. // Returns NULL in case of error.
  301. */
  302. NEROAPI_API NERO_CD_INFO * NADLL_ATTR NeroGetCDInfo(NERO_DEVICEHANDLE aDeviceHandle, DWORD dwFlags);
  303. #define NGCDI_READ_CD_TEXT (1<<0) /* also try to fill in */
  304. /*
  305. // A progress display could look like this:
  306. //
  307. // +------------------------------------------------------+
  308. // | Log of Operation: |
  309. // | +--------------------------------------------------+ |
  310. // | | [icon] text | |
  311. // | | ........... | |
  312. // | | | |
  313. // | +--------------------------------------------------+ |
  314. // | Current Phase: text |
  315. // | Progress: ********............................ |
  316. // | |
  317. // | ABORT |
  318. // +------------------------------------------------------+
  319. //
  320. // The application may provide callback functions to set
  321. // the different parts of this display. All of them may
  322. // be NULL.
  323. */
  324. typedef BOOL (NERO_CALLBACK_ATTR *NERO_PROGRESS_CALLBACK)(void *pUserData, DWORD dwProgressInPercent); /* Will return TRUE if the user wants to abort */
  325. typedef BOOL (NERO_CALLBACK_ATTR *NERO_ABORTED_CALLBACK)(void *pUserData); /* " " " " " " " " " */
  326. typedef enum
  327. {
  328. NERO_TEXT_INFO, /* informative text */
  329. NERO_TEXT_STOP, /* some operation stopped prematurely */
  330. NERO_TEXT_EXCLAMATION, /* important information */
  331. NERO_TEXT_QUESTION, /* a question which requires an answer */
  332. NERO_TEXT_DRIVE, /* a message concerning a CD-ROM drive or recorder */
  333. NERO_TEXT_FILE, /* a message concerning a file */
  334. NERO_TEXT_UNSPECIFIED /* no type specified */
  335. } NERO_TEXT_TYPE;
  336. typedef enum
  337. {
  338. NERO_PHASE_UNSPECIFIED =-1,
  339. NERO_PHASE_START_CACHE =24,
  340. NERO_PHASE_DONE_CACHE =25,
  341. NERO_PHASE_START_TEST =28,
  342. NERO_PHASE_DONE_TEST =29,
  343. NERO_PHASE_START_SIMULATE =32,
  344. NERO_PHASE_DONE_SIMULATE =33,
  345. NERO_PHASE_START_WRITE =36,
  346. NERO_PHASE_DONE_WRITE =37,
  347. NERO_PHASE_START_SIMULATE_NOSPD =61,
  348. NERO_PHASE_DONE_SIMULATE_NOSPD =62,
  349. NERO_PHASE_START_WRITE_NOSPD =65,
  350. NERO_PHASE_DONE_WRITE_NOSPD =66,
  351. NERO_PHASE_ENCODE_VIDEO =82,
  352. NERO_PHASE_SEAMLESSLINK_ACTIVATED = 87,
  353. NERO_PHASE_BUP_ACTIVATED =90,
  354. NERO_PHASE_CONTINUE_FORMATTING =99,
  355. NERO_PHASE_FORMATTING_SUCCESSFUL =100,
  356. NERO_PHASE_DVDVIDEO_DETECTED =111,
  357. NERO_PHASE_DVDVIDEO_REALLOC_STARTED =112,
  358. NERO_PHASE_DVDVIDEO_REALLOC_COMPLETED =113,
  359. } NERO_MAJOR_PHASE;
  360. /* a one-line text to be displayed; text pointer becomes invalid after returning from this function */
  361. typedef void (NERO_CALLBACK_ATTR *NERO_ADD_LOG_LINE_CALLBACK)(void *pUserData, NERO_TEXT_TYPE type, const char *text);
  362. /* set the phase line; text pointer becomes invalid after returning from this function */
  363. typedef void (NERO_CALLBACK_ATTR *NERO_SET_PHASE_CALLBACK)(void *pUserData, const char *text);
  364. /* Tell the main program whether the burn process can be interrupted or not */
  365. typedef void (NERO_CALLBACK_ATTR *NERO_DISABLE_ABORT_CALLBACK)(void *pUserData,BOOL abortEnabled);
  366. /* Let the application knows in which part of the burn process NeroAPI is */
  367. typedef void (NERO_CALLBACK_ATTR *NERO_SET_MAJOR_PHASE_CALLBACK)(void *pUserData,NERO_MAJOR_PHASE phase,void *reserved);
  368. typedef struct tag_NERO_PROGRESS
  369. {
  370. NERO_PROGRESS_CALLBACK npProgressCallback;
  371. NERO_ABORTED_CALLBACK npAbortedCallback;
  372. NERO_ADD_LOG_LINE_CALLBACK npAddLogLineCallback;
  373. NERO_SET_PHASE_CALLBACK npSetPhaseCallback;
  374. void *npUserData;
  375. NERO_DISABLE_ABORT_CALLBACK npDisableAbortCallback; /* Will be called only if the NBF_DISABLE_ABORT flags is given to the NeroBurn function */
  376. NERO_SET_MAJOR_PHASE_CALLBACK npSetMajorPhaseCallback;
  377. NERO_PROGRESS_CALLBACK npSubTaskProgressCallback; /* provide the write buffer fill level */
  378. } NERO_PROGRESS;
  379. /*
  380. // Data exchange between application and NeroAPI is done with
  381. // a function that gets a pointer to its own structure, a buffer
  382. // pointer and the amount in bytes to be read or written. It
  383. // shall return the actual amount of bytes transferred. Other
  384. // functions indicate that the EOF file has been reached when
  385. // reading or a serious error occured.
  386. */
  387. typedef DWORD (NERO_CALLBACK_ATTR *NERO_IO_CALLBACK)(void *pUserData, BYTE *pBuffer, DWORD dwLen);
  388. typedef BOOL (NERO_CALLBACK_ATTR *NERO_STATUS_CALLBACK)(void *pUserData);
  389. typedef struct tag_NERO_IO
  390. {
  391. void *nioUserData;
  392. NERO_IO_CALLBACK nioIOCallback;
  393. NERO_STATUS_CALLBACK nioEOFCallback; // shall return TRUE if further IO calls will always fail to transfer any data, i.e. EOF reached
  394. NERO_STATUS_CALLBACK nioErrorCallback; // shall return TRUE if an error occured during an IO call
  395. } NERO_IO;
  396. /*
  397. // ISO track generation functions
  398. */
  399. typedef struct tag_NERO_ISO_ITEM
  400. {
  401. char fileName[256]; // File name on the burnt CD
  402. BOOL isDirectory; // Is this item a directory ?
  403. BOOL isReference; // Is this item a reference to a file/directory of a previous session
  404. // when recording RockRidge, you can set the name of a directory to be used for
  405. // retrieving rockridge informations here
  406. char sourceFilePath[256]; // Path to the file, including file name (ignored for a directory)
  407. struct tag_NERO_ISO_ITEM *subDirFirstItem; // Point on the first item of the sub directory if the item is a directory
  408. // Can be NULL if the directory is empty
  409. // (ignored for a file)
  410. struct tag_NERO_ISO_ITEM *nextItem; // Next item in the current directory
  411. void *userData; // Can be used to store additional informations
  412. // Used to reference a file from a previous session
  413. long dataStartSec;
  414. __int64 dataLength;
  415. struct tm entryTime;
  416. int itemSize; // Size of the structure
  417. struct CImportInfo *importinfo; // ImportInfo
  418. } NERO_ISO_ITEM;
  419. // NeroCreateIsoItem: Allocate an instance from the NERO_ISO_ITEM structure
  420. // The itemSize member of the structure will be automatically be filled by this
  421. // function
  422. #define NeroCreateIsoItem() NeroCreateIsoItemOfSize(sizeof(NERO_ISO_ITEM))
  423. NEROAPI_API NERO_ISO_ITEM * NADLL_ATTR NeroCreateIsoItemOfSize(size_t);
  424. // Free an instance from the NERO_ISO_ITEM structure
  425. NEROAPI_API void NADLL_ATTR NeroFreeIsoItem(NERO_ISO_ITEM *);
  426. // Create an ISO track from a NERO_ISO_ITEM tree
  427. NEROAPI_API
  428. struct CNeroIsoTrack * NADLL_ATTR NeroCreateIsoTrackEx(NERO_ISO_ITEM *root, // First item of the root directory
  429. const char *name, // Name of the CD
  430. DWORD flags); // See constants below
  431. #define NCITEF_USE_JOLIET (1<<0)
  432. #define NCITEF_USE_MODE2 (1<<1)
  433. #define NCITEF_USE_ROCKRIDGE (1<<2)
  434. #define NCITEF_CREATE_ISO_FS (1<<3)
  435. #define NCITEF_CREATE_UDF_FS (1<<4)
  436. #define NCITEF_CREATE_HFS_FS (1<<5) // Not yet available
  437. #define NCITEF_DVDVIDEO_REALLOC (1<<6) // NeroAPI>=5.5.7.8: Perform reallocation of files in the VIDEO_TS directory
  438. // Free an ISO track previously allocated with NeroCreateIsoTrackEx
  439. NEROAPI_API void NADLL_ATTR NeroFreeIsoTrack(struct CNeroIsoTrack *track);
  440. // Create a NERO_ISO_ITEM tree from an already existing ISO track in order to create a new session
  441. // with reference to files from older sessions
  442. // *ppCDStamp will be filled with a pointer on a CDStamp object which will have to be freed later
  443. NEROAPI_API NERO_ISO_ITEM *NeroImportIsoTrackEx(NERO_DEVICEHANDLE pRecorder,
  444. DWORD trackNumber,
  445. void **ppCDStamp,
  446. DWORD flags);
  447. #define NIITEF_IMPORT_ROCKRIDGE (1<<0) // Will be ignored, RockRidge is now always imported if present
  448. #define NIITEF_IMPORT_ISO_ONLY (1<<1)
  449. #define NIITEF_PREFER_ROCKRIDGE (1<<2) // Will be ignored
  450. #define NIITEF_IMPORT_UDF (1<<3) // Import UDF Session
  451. // Free a CD stamp allocated by NeroImportIsoTrackEx
  452. NEROAPI_API void NADLL_ATTR NeroFreeCDStamp(void *pCDStamp);
  453. // Create a file system container for the NERO_FILE_SYSTEM_CONTAINER_MEDIA compilation type
  454. #ifdef __cplusplus
  455. namespace FileSystemContent
  456. {
  457. struct IFileSystemDescContainer;
  458. };
  459. #else //__cplusplus
  460. struct IFileSystemDescContainer;
  461. #endif//__cplusplus
  462. NEROAPI_API
  463. #ifdef __cplusplus
  464. FileSystemContent::
  465. #else //__cplusplus
  466. struct
  467. #endif//__cplusplus
  468. IFileSystemDescContainer *NADLL_ATTR NeroCreateFileSystemContainer(void *reserved);
  469. /*
  470. // Recording functions:
  471. */
  472. typedef enum
  473. {
  474. NERO_ET_FILE, /* read/write to/from WAV file. */
  475. NERO_ET_IO_CALLBACK, /* exchange data with application directly */
  476. NERO_ET_FILE_MP3, /* read from MP3 file (not for DAE) */
  477. NERO_ET_FILE_WMA, /* read from MS audio file (not for DAE) */
  478. NERO_ET_FILE_RAW /* for a Freestyle compilation,
  479. * this and NERO_ET_IO_CALLBACK
  480. * are the only types allowed
  481. * at the moment.
  482. * It will expect files
  483. * to be in the format
  484. * as to be written to the disc.
  485. * This exchange type is valid
  486. * for freestyle compilations only */
  487. } NERO_DATA_EXCHANGE_TYPE;
  488. /* use PCM, 44.1kHz, Stereo (left channel first), 16 bits per channel, LSB,
  489. when exchanging data with the NeroAPI */
  490. typedef struct tag_NERO_DATA_EXCHANGE
  491. {
  492. NERO_DATA_EXCHANGE_TYPE ndeType;
  493. union
  494. {
  495. char ndeFileName[256]; // NERO_WAV_FILE
  496. NERO_IO ndeIO; // NERO_IO/EOF/ERROR_CALLBACK
  497. } ndeData;
  498. } NERO_DATA_EXCHANGE;
  499. typedef struct tag_NERO_AUDIO_TRACK
  500. {
  501. DWORD natPauseInBlksBeforeThisTrack;
  502. DWORD natNumIndexPositions;
  503. DWORD natRelativeIndexBlkPositions[98]; /* offsets between one index position and the next one */
  504. const char *natTitle, *natArtist; /* set to NULL if unknown or to be taken from source */
  505. NERO_DATA_EXCHANGE natSourceDataExchg;
  506. DWORD natLengthInBlocks; /* only used for NERO_IO_CALLBACK */
  507. DWORD natReserved[32]; /* Should be zero */
  508. } NERO_AUDIO_TRACK;
  509. typedef enum
  510. {
  511. NERO_TRACKMODE_MODE1, /* 2048 Bytes per sector data track */
  512. NERO_TRACKMODE_MODE2_FORM1, /* 2048 Bytes per sector, used for multisession */
  513. NERO_TRACKMODE_AUDIO /* 2352 Bytes per sector, standard audio track */
  514. } NERO_TRACKMODE_TYPE;
  515. typedef struct tag_NERO_FREESTYLE_TRACK
  516. {
  517. DWORD nftStructureSize; /* size of this structure, to ensure binary compatibility */
  518. DWORD nftPauseInBlksBeforeThisTrack;
  519. DWORD nftNumIndexPositions;
  520. DWORD nftRelativeIndexBlkPositions[98]; /* offsets between one index position and the next one */
  521. const char *nftTitle, *nftArtist; /* set to NULL if unknown or to be taken from source */
  522. NERO_DATA_EXCHANGE nftSourceDataExchg; /* source for raw track data */
  523. DWORD nftLengthInBlocks; /* only used for NERO_IO_CALLBACK */
  524. NERO_TRACKMODE_TYPE nftTracktype; /* specifies track type to be written */
  525. } NERO_FREESTYLE_TRACK;
  526. typedef enum
  527. {
  528. NERO_MPEG_ITEM,
  529. NERO_JPEG_ITEM,
  530. NERO_NONENCODED_VIDEO_ITEM, // The source file name will be an AVI file which will be encoded into MPG by NeroAPI
  531. NERO_DIB_ITEM // NeroAPI>=5.5.7.6: The source is a DIB picture. Informations about it must be given in nviData.nviDIB
  532. } NERO_VIDEO_ITEM_TYPE;
  533. typedef struct tag_NERO_VIDEO_ITEM
  534. {
  535. DWORD nviPauseAfterItem;
  536. char nviSourceFileName[236]; // MPG, JPG or AVI file
  537. union
  538. {
  539. struct // NeroAPI>=5.5.7.6
  540. {
  541. BITMAPINFO *pDIB; // Points to the DIB header followed by data
  542. size_t size; // DIB size
  543. double pixelRatio; // Pixel ratio of the given picture (height/width). 1 means square pixels
  544. } nviDIB;
  545. } nviData;
  546. DWORD reserved;
  547. NERO_VIDEO_ITEM_TYPE nviItemType;
  548. } NERO_VIDEO_ITEM;
  549. typedef enum
  550. {
  551. NERO_ISO_AUDIO_MEDIA =0, // Burn either a CD or a DVD, depending on the nwcdMediaType member
  552. NERO_VIDEO_CD =1,
  553. NERO_BURN_IMAGE_MEDIA =2, // Burn either a CD or a DVD from an image
  554. NERO_FREESTYLE_CD =3,
  555. NERO_FILE_SYSTEM_CONTAINER_MEDIA=4, // Burn an IFileSystemDescContainer (see NeroFileSystemContainer.h)
  556. // For compatibility
  557. NERO_ISO_AUDIO_CD =0,
  558. NERO_BURN_IMAGE_CD =2
  559. } NERO_CD_FORMAT;
  560. typedef struct tag_NERO_WRITE_CD
  561. {
  562. /* both may be NULL: */
  563. const char *nwcdArtist;
  564. const char *nwcdTitle;
  565. struct CNeroIsoTrack *nwcdIsoTrack; /* if not NULL, then the disc will have an ISO track - please refer to "NeroIsoTrack.h" */
  566. BOOL nwcdCDExtra; /* if TRUE and nwcdIsoTrack not NULL, then the resulting CD will have audio in the first session
  567. and the data track in the second, however, currently the NeroAPI does not add any of the
  568. special CD Extra files to the data track */
  569. void *nwcdpCDStamp; // Point on a CDStamp object if a particular CD is requested, otherwise NULL
  570. DWORD nwcdNumTracks;
  571. NERO_MEDIA_TYPE nwcdMediaType; /* Media on which the data should be written */
  572. DWORD nwcdReserved[32]; /* Should be zero */
  573. NERO_AUDIO_TRACK nwcdTracks[1];
  574. } NERO_WRITE_CD;
  575. #ifdef __cplusplus
  576. namespace VCDEngine
  577. {
  578. struct IVCDFSContentGenerator;
  579. struct IVCDMediaDescription;
  580. };
  581. #endif
  582. typedef struct tag_NERO_WRITE_VIDEO_CD
  583. {
  584. BOOL nwvcdSVCD; // If TRUE, write a SVCD
  585. DWORD nwvcdNumItems;
  586. struct CNeroIsoTrack *nwvcdIsoTrack;
  587. char nwvcdTempPath[256]; /* where the encoded files will be temporary stored */
  588. void *nwvcdCustomVCDEngine; /* For internal usage */
  589. DWORD nwvcdReserved[31]; /* Should be zero */
  590. NERO_VIDEO_ITEM nwvcdItems[1];
  591. } NERO_WRITE_VIDEO_CD;
  592. typedef struct tag_NERO_WRITE_IMAGE
  593. {
  594. char nwiImageFileName[256]; /* Name of the NRG file to burn
  595. ISO and CUE files can also be burnt this way */
  596. } NERO_WRITE_IMAGE;
  597. /* This structure will allow you to write any type of
  598. * CD Layout, e.g. containing a raw data track at the beginning of the
  599. * disc instead of a self-made ISO/UDF filesystem.
  600. * This is good for writing .iso images as they can be downloaded everywhere
  601. * on the net */
  602. typedef struct tag_NERO_WRITE_FREESTYLE_CD
  603. {
  604. DWORD nwfcdStructureSize; /* fill this with sizeof(NERO_FREESTYLEWRITE_CD) */
  605. /* both may be NULL: */
  606. const char *nwfcdArtist;
  607. const char *nwfcdTitle;
  608. struct CNeroIsoTrack *nwfcdIsoTrack; /* if not NULL, then the disc will have an ISO track - please refer to "NeroIsoTrack.h" */
  609. BOOL nwfcdCDExtra; /* if TRUE and nwfcdIsoTrack not NULL, then the resulting CD will have audio in the first session
  610. and the data track in the second, however, currently the NeroAPI does not add any of the
  611. special CD Extra files to the data track */
  612. void *nwfcdpCDStamp; // Point on a CDStamp object if a particular CD is requested, otherwise NULL
  613. DWORD nwfcdNumTracks;
  614. NERO_FREESTYLE_TRACK nwfcdTracks[1];
  615. } NERO_WRITE_FREESTYLE_CD;
  616. // To burn an IFileSystemDescContainer object
  617. typedef struct tag_NERO_WRITE_FILE_SYSTEM_CONTAINER
  618. {
  619. DWORD nwfscSize; /* fill this with sizeof(NERO_WRITE_FILE_SYSTEM_CONTENT) */
  620. #ifdef __cplusplus
  621. FileSystemContent::
  622. #else //__cplusplus
  623. struct
  624. #endif//__cplusplus
  625. IFileSystemDescContainer *nwfscFSContainer;
  626. NERO_MEDIA_TYPE nwfscMediaType; /* Media on which the data should be written */
  627. DWORD nwfscBurnOptions; /* Combination of NCITEF flags */
  628. DWORD nwfscReserved[32]; /* Should be zero */
  629. } NERO_WRITE_FILE_SYSTEM_CONTENT;
  630. typedef enum
  631. {
  632. NEROAPI_BURN_OK=0,
  633. NEROAPI_BURN_UNKNOWN_CD_FORMAT,
  634. NEROAPI_BURN_INVALID_DRIVE,
  635. NEROAPI_BURN_FAILED,
  636. NEROAPI_BURN_FUNCTION_NOT_ALLOWED,
  637. NEROAPI_BURN_DRIVE_NOT_ALLOWED,
  638. NEROAPI_BURN_USER_ABORT
  639. } NEROAPI_BURN_ERROR;
  640. NEROAPI_API
  641. NEROAPI_BURN_ERROR NADLL_ATTR NeroBurn(NERO_DEVICEHANDLE aDeviceHandle,
  642. NERO_CD_FORMAT CDFormat,
  643. const void* pWriteCD, // Must point on a NERO_WRITE_CD or a NERO_WRITE_VIDEO_CD structure
  644. DWORD dwFlags,
  645. DWORD dwSpeed, // In KB/s if NBF_SPEED_IN_KBS is present, in multiple of 150 KB/s otherwise
  646. NERO_PROGRESS* pNeroProgress);
  647. /* NeroBurn() flags: */
  648. #define NBF_SPEED_TEST (1<<0) /* test speed of source first */
  649. #define NBF_SIMULATE (1<<1) /* simulate writing before actually writing */
  650. #define NBF_WRITE (1<<2) /* really write at the end */
  651. #define NBF_DAO (1<<3) /* write in DAO */
  652. #define NBF_CLOSE_SESSION (1<<4) /* only close the session and not the whole disc */
  653. #define NBF_CD_TEXT (1<<5) /* write CD text - will be ignore if not supported by drive */
  654. #define NBF_BUF_UNDERRUN_PROT (1<<6) /* enable saver burn mode */
  655. #define NBF_DISABLE_ABORT (1<<7) /* The disable abort callback will be called */
  656. #define NBF_DETECT_NON_EMPTY_CDRW (1<<8) /* The DLG_NON_EMPTY_CDRW user callback will be called when trying to burn onto a non empty CDRW */
  657. #define NBF_DISABLE_EJECT (1<<9) /* CD will not be ejected at the end of the burn process */
  658. #define NBF_VERIFY (1<<10) /* Verify Filesystem after writing. Works for ISO only */
  659. #define NBF_SPEED_IN_KBS (1<<11) /* NeroAPI>=5.5.5.5: Interpret the dwSpeed as KB/s instead of multiple of 150 KB/s */
  660. #define NBF_DVDP_BURN_30MM_AT_LEAST (1<<12) /* NeroAPI>=5.5.8.0: DVD+R/RW high compability mode (at least 1GB will be written) */
  661. #define NBF_RESERVED (1<<31) /* Reserved */
  662. /*
  663. // Digital Audio Extraction functions:
  664. // - aborting will not be reported by NeroGetLastError()
  665. // - incomplete target files are not deleted
  666. // - the function will return 0 for success, else error
  667. */
  668. NEROAPI_API
  669. int NADLL_ATTR NeroDAE(NERO_DEVICEHANDLE aDeviceHandle,
  670. DWORD dwTrackStartBlk,
  671. DWORD dwTrackLengthInBlks,
  672. const NERO_DATA_EXCHANGE *pDestDataExchg,
  673. DWORD iSpeedInX, // speed of extraction, 0 means maximum speed
  674. NERO_CALLBACK* pNeroProgressCallback); /* has to be a NERO_PROGRESS_CALLBACK */
  675. //
  676. // Utility functions:
  677. //
  678. NEROAPI_API int NADLL_ATTR NeroIsDeviceReady(NERO_DEVICEHANDLE aDeviceHandle); // 0 for ready, else error!
  679. NEROAPI_API int NADLL_ATTR NeroEjectLoadCD(NERO_DEVICEHANDLE aDeviceHandle,BOOL eject); // 0 for success, else error!
  680. // CDRW erasing functions
  681. typedef enum
  682. {
  683. NEROAPI_ERASE_ENTIRE =0,
  684. NEROAPI_ERASE_QUICK =1,
  685. } NEROAPI_CDRW_ERASE_MODE;
  686. NEROAPI_API int NADLL_ATTR NeroGetCDRWErasingTime(NERO_DEVICEHANDLE aDeviceHandle,NEROAPI_CDRW_ERASE_MODE mode);
  687. // Returns estimated blanking time for loaded CD-RW in seconds,
  688. // -1 if no CD inserted,
  689. // -2 if recorder doesn't support CDRW
  690. // -3 if the inserted media is not rewritable
  691. NEROAPI_API int NADLL_ATTR NeroEraseCDRW(NERO_DEVICEHANDLE aDeviceHandle,NEROAPI_CDRW_ERASE_MODE mode); // Erase the loaded CD
  692. #ifdef __cplusplus
  693. }
  694. #endif
  695. #endif // _NEROAPI_
  696. //======================================================
  697. // NeroApi.h
  698. //======================================================