NeroAPI.h 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599
  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-2005 Nero 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. /*
  22. // If included within the glue code, then don't add special
  23. // attributes to the functions.
  24. */
  25. #define NADLL_ATTR __cdecl
  26. #ifdef __NEROAPIGLUE__
  27. #define NEROAPI_API
  28. #else
  29. /* NEROAPI must not be defined when using the DLL */
  30. #ifdef NEROAPI
  31. #define NEROAPI_API __declspec(dllexport)
  32. #else
  33. #define NEROAPI_API __declspec(dllimport)
  34. #endif /* NEROAPI */
  35. #endif /* __NEROAPIGLUE__ */
  36. #ifdef __cplusplus
  37. class CSourceDriveInfo;
  38. typedef CSourceDriveInfo *NERO_DEVICEHANDLE;
  39. #else
  40. typedef void *NERO_DEVICEHANDLE;
  41. #endif
  42. #include <windows.h> // the data types used below are those of windows
  43. #include <time.h>
  44. #include "NeroUserDialog.h"
  45. #if defined(__BORLANDC__)
  46. // NEROAPI expects structs to be 8byte aligned
  47. #pragma pack(push, 8)
  48. // tell Borland C++ Builder to treat enums as int
  49. #pragma option push -b
  50. #endif
  51. /*
  52. // The NeroAPI never uses static memory. Instead, memory is allocated
  53. // dynamically on behalf of the application, e.g. for strings. This
  54. // memory has to be freed with this function.
  55. //
  56. // Passing a NULL is allowed.
  57. */
  58. NEROAPI_API void NADLL_ATTR NeroFreeMem (void *pMem);
  59. /*
  60. // All functions returning an DWORD will return 0 for success and a
  61. // error number otherwise. This error numbers are opaque and neither
  62. // can nor should be interpreted by the application. Instead, localized
  63. // strings are provided for errors and informative displays.
  64. //
  65. // The NeroAPI keeps a log of such informative messages or errors.
  66. // In case of an error, NeroGetLastError() will return more information
  67. // about the last error and NeroGetErrorLog() will show all recorded
  68. // events.
  69. //
  70. // Both functions return NULL if no error is available.
  71. //
  72. // Memory is allocated for the string, which has to be freed with NeroFreeMem().
  73. //
  74. // Note: NeroCloseDrive() has to throw away all errors, because they
  75. // might be bound to the driver. Handle errors before calling it!
  76. */
  77. NEROAPI_API char * NADLL_ATTR NeroGetLastError ();
  78. NEROAPI_API char * NADLL_ATTR NeroGetErrorLog ();
  79. /* NeroAPI >= 6.0.0.29: returns the last iNum errors */
  80. NEROAPI_API char * NADLL_ATTR NeroGetLastErrors(int iNum, DWORD dwFlags, void *reserved);
  81. /* include also errors which does not contain a description to be shown in the GUI */
  82. #define NGLE_ALL (1<<0)
  83. /* format the errors as in the NeroAPI error log */
  84. #define NGLE_REPORT (1<<1)
  85. /*
  86. // NeroAPI >= 6.0.0.0:
  87. // Error code describing an error happened during communication with a drive.
  88. // This error code is returned by NeroIsDeviceReady. Other functions set an internal error
  89. // variable to one of these codes if an error occured. This error can be received with
  90. // NeroGetLastDriveError.
  91. */
  92. typedef enum
  93. {
  94. NDE_NO_ERROR = 0, // no error occured/ drive is ready
  95. NDE_GENERIC_ERROR = 1, // generic error, not handled with other enums
  96. NDE_DRIVE_IN_USE = 2, // drive cannot be locked, maybe a other application uses this drive at the moment
  97. NDE_DRIVE_NOT_READY = 3, // drive is not ready
  98. NDE_NO_DRIVE = 4, // The given device is not available . Probably removed by the user (USB/Firewire)
  99. NDE_DISC_NOT_PRESENT = 5, // no medium in drive, status of tray unknown
  100. NDE_DISC_NOT_PRESENT_TRAY_OPEN = 6, // no medium - tray open
  101. NDE_DISC_NOT_PRESENT_TRAY_CLOSED = 7 // no medium - tray closed
  102. } NERO_DRIVE_ERROR;
  103. // Check for all variations of 'disc not present'
  104. #define DISC_NOT_PRESENT(x) (((x == NDE_DISC_NOT_PRESENT) || \
  105. (x == NDE_DISC_NOT_PRESENT_TRAY_CLOSED) || \
  106. (x == NDE_DISC_NOT_PRESENT_TRAY_OPEN)) ? TRUE : FALSE)
  107. /*
  108. // NeroAPI >= 6.0.0.0:
  109. // get the last error occured during communication with a drive
  110. //
  111. // The following methods set this error value:
  112. // - NeroGetCDInfo
  113. // - NeroImportDataTrack
  114. // - NeroEjectLoadCD
  115. // - NeroGetCDRWErasingTime
  116. // - NeroEraseDisc
  117. //
  118. // All these methods first reset the error value and if an error occured the value is set
  119. // accordingly.
  120. */
  121. NEROAPI_API void NADLL_ATTR NeroGetLastDriveError( NERO_DRIVE_ERROR *driveError, void *reserved);
  122. /*
  123. // Clear errors and log (done automatically for every read or write function,
  124. // but can be used to avoid false memory leak warnings).
  125. */
  126. NEROAPI_API void NADLL_ATTR NeroClearErrors ();
  127. /*
  128. // Version management for this API:
  129. */
  130. // This file is the interface for this version of NeroAPI
  131. #define NEROAPI_VERSION_MAJOR_HIGH 6
  132. #define NEROAPI_VERSION_MAJOR_LOW 6
  133. #define NEROAPI_VERSION_MINOR_HIGH 0
  134. #define NEROAPI_VERSION_MINOR_LOW 1
  135. /* Fills the pointed numbers with version number and returns true for
  136. success. Extended in NeroAPI 5.5.9.9 to support multiple digits */
  137. NEROAPI_API BOOL NADLL_ATTR NeroGetAPIVersionEx(WORD *majhi
  138. ,WORD *majlo
  139. ,WORD *minhi
  140. ,WORD *minlo
  141. ,void *reserved); // Must be NULL
  142. /* Using this function, an application can tell NeroAPI for which version of NeroAPI it was
  143. designed to work. NeroAPI will then tries to behave as this version as much as possible. This
  144. ensures the binary compatibility with future versions of NeroAPI. If this function is not called,
  145. NeroAPI will behaves as NeroAPI 5.0.3.9. If your application uses NeroAPIGlue.c, this function
  146. will be automatically called. Extended in NeroAPI 5.5.9.9 to support multiple digits
  147. If pPrevExpectedVersion is not NULL, it must point onto an array of 4 WORDs that will be filled
  148. with the previously expected version number
  149. Returns true for success*/
  150. NEROAPI_API BOOL NADLL_ATTR NeroSetExpectedAPIVersionEx(WORD majhi
  151. ,WORD majlo
  152. ,WORD minhi
  153. ,WORD minlo
  154. ,WORD *pPrevExpectedVersion);
  155. /*
  156. // During writing or in several long running functions control
  157. // is transfered to the DLL. The application has to provide services
  158. // and dialog with the user via callback functions.
  159. //
  160. // NERO_CALLBACK_ATTR is defined in "NeroUserDialog.h" and ensures that
  161. // the same conventions are used for passing of parameters.
  162. */
  163. typedef struct tag_NERO_CALLBACK
  164. {
  165. void *ncCallbackFunction; /* actually, this is a pointer to one of several different callback functions defined below */
  166. void *ncUserData; /* this will be passed to the function as first parameter */
  167. } NERO_CALLBACK;
  168. typedef BOOL (NERO_CALLBACK_ATTR *NERO_IDLE_CALLBACK) (void *pUserData); /* called regularly during long running activities; return TRUE if this activity shall be aborted */
  169. /*
  170. // The NeroAPI needs some information:
  171. */
  172. typedef struct tag_NERO_SETTINGS
  173. {
  174. const char *nstNeroFilesPath; /* directory name with trailing '\' of where to find the additional Nero DLL and text files */
  175. const char *nstVendor,
  176. *nstSoftware; /* path for registry settings (use "ahead", "Nero - Burning Rom" for Nero application's settings) */
  177. const char *nstLanguageFile; /* name of the Nero language file; relativ to nstNeroFilesPath (e.g. "Nero.txt") */
  178. NERO_CALLBACK nstIdle; /* NERO_IDLE_CALLBACK, may be NULL */
  179. NERO_CALLBACK nstUserDialog; /* NERO_USER_DIALOG, must not be NULL, see "NeroUserDialog.h" for details */
  180. /*
  181. // overburn settings:
  182. // overburning (writing more than the nominal capacity of a disc) is allowed if:
  183. // - nstEnableOverburn == TRUE
  184. // - nstOverburnSize >= amount of required blocks for compilation
  185. // and if
  186. // - the drive supports it
  187. // - DAO is used.
  188. // Even then, overburning has to be acknowledged via callback (see DLG_OVERBURN in "NeroUserDialog.h").
  189. */
  190. BOOL nstEnableOverburn;
  191. DWORD nstOverburnSize; /* in blocks */
  192. } NERO_SETTINGS;
  193. /*
  194. // Initialize the DLL. Must be successful before any of the remaining
  195. // functions can be called. Settings structure and strings it points
  196. // to are _not_ copied and function callbacks must be available all
  197. // the time.
  198. */
  199. typedef enum
  200. {
  201. NEROAPI_INIT_OK=0,
  202. NEROAPI_INIT_INVALID_ARGS,
  203. NEROAPI_INIT_UNSPECIFIED_ERROR, // Unspecified error
  204. NEROAPI_INIT_INVALID_SERIAL_NUM,
  205. NEROAPI_INIT_DEMOVERSION_EXPIRED,
  206. NEROAPI_INIT_ALREADY_INITIALISED,
  207. NEROAPI_INIT_CANNOT_LOCK
  208. } NEROAPI_INIT_ERROR;
  209. // Make sure to keep *all* the data including the strings valid as long as you're using NeroAPI,
  210. // since Nero will only store a pointer to this structure, not make a copy.
  211. NEROAPI_API NEROAPI_INIT_ERROR NADLL_ATTR NeroInit (const NERO_SETTINGS *pNeroSettings,const char *reserved);
  212. /*
  213. // Call this function before closing the DLL. This is necessary because
  214. // some clean-up actions like stopping threads cannot be done in the
  215. // close function of the DLL.
  216. //
  217. // NeroDone returns TRUE if some memory blocks were not unallocated using NeroFreeMem. They are dumped in
  218. // the debug output.
  219. // NeroDone returns FALSE if it succeeded
  220. */
  221. NEROAPI_API BOOL NADLL_ATTR NeroDone ();
  222. /*
  223. Call this function to change a global option of NeroAPI
  224. */
  225. typedef enum
  226. {
  227. NEROAPI_OPTION_MSG_FILE_NAME, // Set the language file. The value points to a string containing the file name. This adress will be kept.
  228. NEROAPI_OPTION_WRITE_BUFFER_SIZE, // Set write buffer size. Value points onto an integer containing the size in byte
  229. // NeroAPI>=6.0.0.0 Set the user dialog callback, overwriting nstUserDialog of the settings
  230. // structure passed to NeroInit.
  231. // Pass a pointer to a NERO_CALLBACK structure as value. After returning,
  232. // the struct will contain the previous user callback.
  233. NEROAPI_OPTION_USER_DLG_CALLBACK,
  234. // NeroAPI>=6.0.0.0 Set the idle callback, overwriting nstIdle of the settings
  235. // structure passed to NeroInit.
  236. // Pass a pointer to a NERO_CALLBACK structure as value. After returning,
  237. // the struct will contain the previous idle callback.
  238. NEROAPI_OPTION_IDLE_CALLBACK,
  239. // NeroAPI>=6.0.0.27: Enable/Disable overburning for CDs.
  240. // Value is a pointer to a DWORD containing the overburn size (the total size
  241. // of the CD) in blocks.
  242. // If the value is NULL, disable overburning for CDs.
  243. NEROAPI_OPTION_OVERBURN,
  244. // NeroAPI>=6.3.1.12: Enable/Disable overburning for DVD.
  245. // Value is a pointer to a DWORD containing the overburn size (the total size
  246. // of the DVD) in blocks.
  247. // If the value is NULL, disable overburning for DVDs.
  248. NEROAPI_OPTION_DVDOVERBURN
  249. } NEROAPI_OPTION;
  250. NEROAPI_API int NADLL_ATTR NeroSetOption(NEROAPI_OPTION option,void *value);
  251. /*
  252. // Code to scan the SCSI/IDE bus and get information about
  253. // the available WORM/CDROM drives:
  254. */
  255. typedef enum
  256. {
  257. NEA_SCSI_DEVTYPE_UNKNOWN,
  258. NEA_SCSI_DEVTYPE_WORM, /* can write */
  259. NEA_SCSI_DEVTYPE_CDROM, /* can only read */
  260. NEA_SCSI_DEVTYPE_UNSUPPORTED_WORM /* can write but is not supported by NeroAPI */
  261. } NEROAPI_SCSI_DEVTYPE;
  262. typedef struct tag_NERO_SPEED_INFOS
  263. {
  264. DWORD nsiNumSupportedSpeeds; /* 1 if the speed cannot be changed */
  265. DWORD nsiBaseSpeedKBs; /* Speed corresponding to 1X for the selected media in KB/s */
  266. DWORD nsiSupportedSpeedsKBs[64]; /* List of possible speeds in KB/s */
  267. DWORD nsiSupportedSpeeds[64]; /* List of possible speeds in multiple of 150KB/s (1X for CD) (present for compatibility) */
  268. DWORD nsiReserved[32];
  269. } NERO_SPEED_INFOS;
  270. typedef enum tag_NERO_MEDIA_TYPE
  271. {
  272. MEDIA_NONE = 0, // No media present (NeroAPI>=5.5.9.4)
  273. MEDIA_CD = 0x00001, // CD-R/RW
  274. MEDIA_DDCD = 0x00002, // DDCD-R/RW
  275. MEDIA_DVD_M = 0x00004, // DVD-R/RW
  276. MEDIA_DVD_P = 0x00008, // DVD+RW
  277. MEDIA_DVD_RAM = 0x00010, // DVD-RAM
  278. MEDIA_ML = 0x00020, // ML (Multi Level disc)
  279. MEDIA_MRW = 0x00040, // Mt. Rainier
  280. //NeroAPI>=5.5.9.4:
  281. MEDIA_NO_CDR = 0x00080, // Exclude CD-R
  282. MEDIA_NO_CDRW = 0x00100, // Exclude CD-RW
  283. MEDIA_CDRW = MEDIA_CD|MEDIA_NO_CDR, // CD-RW
  284. MEDIA_CDR = MEDIA_CD|MEDIA_NO_CDRW, // CD-R
  285. MEDIA_DVD_ROM = 0x00200, // DVD-ROM (non writable)
  286. MEDIA_CDROM = 0x00400, // CD-ROM (non writable)
  287. //NeroAPI>=5.5.9.10
  288. MEDIA_NO_DVD_M_RW = 0x00800, // Exclude DVD-RW
  289. MEDIA_NO_DVD_M_R = 0x01000, // Exclude DVD-R
  290. MEDIA_NO_DVD_P_RW = 0x02000, // Exclude DVD+RW
  291. MEDIA_NO_DVD_P_R = 0x04000, // Exclude DVD+R
  292. MEDIA_DVD_M_R = MEDIA_DVD_M|MEDIA_NO_DVD_M_RW, // DVD-R
  293. MEDIA_DVD_M_RW = MEDIA_DVD_M|MEDIA_NO_DVD_M_R, // DVD-RW
  294. MEDIA_DVD_P_R = MEDIA_DVD_P|MEDIA_NO_DVD_P_RW, // DVD+R
  295. MEDIA_DVD_P_RW = MEDIA_DVD_P|MEDIA_NO_DVD_P_R, // DVD+RW
  296. MEDIA_FPACKET = 0x08000, // Fixed Packetwriting
  297. MEDIA_VPACKET = 0x10000, // Variable Packetwriting
  298. MEDIA_PACKETW = MEDIA_MRW|MEDIA_FPACKET // a bit mask for packetwriting
  299. |MEDIA_VPACKET,
  300. //NeroAPI>=5.5.10.4
  301. MEDIA_HDB = 0x20000, // HD-Burn
  302. //Nero API version: 5.5.10.35
  303. //NeroAPI>=6.0.0.29
  304. MEDIA_DVD_P_R9 = 0x40000,
  305. MEDIA_DVD_ANY = MEDIA_DVD_M|MEDIA_DVD_P|MEDIA_DVD_RAM|MEDIA_DVD_P_R9 // Any DVD-Media
  306. } NERO_MEDIA_TYPE;
  307. typedef DWORD NERO_MEDIA_SET; // Represents a set of several medias
  308. typedef struct tag_NERO_SCSI_DEVICE_INFO
  309. {
  310. char nsdiDeviceName[64];
  311. char nsdiHostAdapterName[8];
  312. DWORD nsdiHostAdapterNo;
  313. DWORD nsdiDeviceID;
  314. NEROAPI_SCSI_DEVTYPE nsdiDevType;
  315. char nsdiDriveLetter; /* Windows drive letter or 0 if not available */
  316. DWORD nsdiCapabilities; /* drive capabilities: */
  317. #define NSDI_ALLOWED (1<<0) /* the drive can only be used if this bit is set */
  318. #define NSDI_DAO (1<<1) /* can write in DAO. */
  319. #define NSDI_READ_CD_TEXT (1<<2) /* can read CD text */
  320. #define NSDI_VARIABLE_PAUSES_IN_TAO (1<<3) /* see natPauseInBlksBeforeThisTrack below */
  321. #define NSDI_DAO_WRITE_CD_TEXT (1<<4) /* writes CD text in DAO (see natArtist/Title); never supported in TAO */
  322. #define NSDI_IMAGE_RECORDER (1<<6) /* drive is the image recorder */
  323. #define NSDI_UNDETECTED (1<<7)
  324. #define NSDI_IDE_BUS (1<<8)
  325. #define NSDI_SCSI_BUS (1<<9)
  326. #define NSDI_BUF_UNDERRUN_PROT (1<<10) /* drive has a buffer underrun protection feature (not necessary Burn Proof) */
  327. #define NSDI_RESERVED (1<<11) /* Must not be used */
  328. #define NSDI_RESERVED2 (1<<12) /* Must not be used */
  329. #define NSDI_ALLOW_CHANGE_BOOKTYPE (1<<13) /* NeroAPI >5.5.10.7: DVD recorder can change booktype of burned medium */
  330. #define NSDI_DVDPLUSVR_SUPPORTED (1<<14) /* NeroAPI >= 6.0.0.0: This recorder can write DVD+VR */
  331. NERO_SPEED_INFOS nsdiReadSpeeds;
  332. NERO_SPEED_INFOS nsdiWriteSpeeds;
  333. const void *nsdiDriver; /* opaque identifier of the internal driver, required by NeroOpenDevice() */
  334. char nsdiBufUnderrunProtName[64]; /* Buffer underrun protection technology name */
  335. /* The string will be empty if the technology has no name */
  336. DWORD nsdiMandatoryBUPSpeed; /* it is highly recommanded to enable buffer
  337. underrun protection protection when burning at this speed or
  338. faster. Contains 0 if there is no recommandation */
  339. NERO_MEDIA_SET nsdiMediaSupport; /* NeroAPI>=5.5.4.1: Bit field of supported writable media (constructed with the NERO_MEDIA_TYPE enum)*/
  340. DWORD nsdiDriveBufferSize; /* NeroAPI>=5.5.9.4: Drive buffer size (internal) in KB */
  341. DWORD nsdiDriveError; /* NeroAPI>=6.0.0.0: Contains a NERO_DRIVE_ERROR that occured during generating the information.
  342. If != NDE_NO_ERROR, some information like the drive capabilities or the speeds might be wrong.
  343. You can check with NeroIsDeviceReady if the drive is ready later
  344. and update the device information with NeroUpdateDeviceInfo.
  345. NDE_DISC_NOT_PRESENT* errors can be ignored.
  346. */
  347. NERO_MEDIA_SET nsdiMediaReadSupport; /* NeroAPI>=6.0.0.8: Bit field of supported readable media (constructed with the NERO_MEDIA_TYPE enum)*/
  348. DWORD nsdiReserved[61]; /* Should be zero */
  349. } NERO_SCSI_DEVICE_INFO;
  350. typedef struct tag_NERO_SCSI_DEVICE_INFOS
  351. {
  352. DWORD nsdisNumDevInfos; /* number of the following entries */
  353. NERO_SCSI_DEVICE_INFO nsdisDevInfos[1];
  354. } NERO_SCSI_DEVICE_INFOS;
  355. /* Gets a list of available WORM and CDROM devices, free with NeroFreeMem(). */
  356. /* Returns NULL for error */
  357. NEROAPI_API NERO_SCSI_DEVICE_INFOS * NADLL_ATTR NeroGetAvailableDrivesEx(
  358. NERO_MEDIA_TYPE mediaType, // Provide speeds values for this kind of media
  359. void *reserved); // Must be NULL
  360. /* NeroAPI>=6.0.0.0: Update the information about a drive. */
  361. NEROAPI_API NERO_DRIVE_ERROR NADLL_ATTR NeroUpdateDeviceInfo(NERO_SCSI_DEVICE_INFO *devInfo // the device info to update
  362. , NERO_MEDIA_TYPE mediaType // the media type to update the speed infos with
  363. , void *reserved); // Must be NULL
  364. /* Get a string describing the given bit field of supported media
  365. Free with NeroFreeMem();
  366. */
  367. NEROAPI_API char *NADLL_ATTR NeroGetTypeNameOfMedia(NERO_MEDIA_SET media,void *reserved);
  368. /*
  369. // Open and close a device:
  370. */
  371. NEROAPI_API NERO_DEVICEHANDLE NADLL_ATTR NeroOpenDevice(const NERO_SCSI_DEVICE_INFO* pDevInfo); /* NULL for errors */
  372. NEROAPI_API void NADLL_ATTR NeroCloseDevice(NERO_DEVICEHANDLE aDeviceHandle);
  373. /*
  374. // NeroAPI > 5.5.9.10
  375. // Get available write speeds depending on medium type, free with NeroFreeMem().
  376. // Returns NULL for error
  377. */
  378. typedef enum
  379. {
  380. ACCESSTYPE_WRITE,
  381. ACCESSTYPE_READ
  382. } NERO_ACCESSTYPE;
  383. NEROAPI_API NERO_SPEED_INFOS * NADLL_ATTR NeroGetAvailableSpeeds(NERO_DEVICEHANDLE aDeviceHandle,
  384. NERO_ACCESSTYPE accessType,
  385. NERO_MEDIA_TYPE mediaType,
  386. void *reserved);
  387. /*
  388. * NeroAPI >= 6.3.1.20e
  389. * Booktype settings
  390. */
  391. typedef enum tag_BookTypeSettings
  392. {
  393. BTS_PHYSICAL_DISC_TYPE = 0, // Set booktype to physical disc type. E.g. if a DVD+R is loaded the booktype is set to DVD+R.
  394. BTS_DVD_ROM = 1, // Set booktype to DVD-ROM for all types of DVDs (DVD+R, DVD+RW, DVD+R9 DL, ...).
  395. BTS_UNMODIFIED = 2, // Don't send any booktype change command to the drive. This is useful, if you have changed the settings on the drive and want to use this setting.
  396. BTS_AUTOMATIC = 3 // Let NeroAPI decide, which booktype to use. This may depend from the recorder, medium type and compilation type that is burned.
  397. } NERO_BOOK_TYPE_SETTINGS;
  398. /*
  399. * NeroAPI > 5.5.10.7
  400. * Get and set special low level options of devices
  401. */
  402. typedef enum
  403. {
  404. /*
  405. * Change booktype in recorder driver to the booktype given in <*value> and
  406. * perform changing Booktype on drive so that the booktype of a DVD recordable
  407. * disc is changed for subsequent writes until next power cycle.
  408. * void* is a pointer to NERO_BOOK_TYPE_SETTINGS in Nero(Set|Get)DeviceOption.
  409. *
  410. * For setting the booktype to DVD-ROM, set parameter to BTS_DVD_ROM (before
  411. * and including NeroAPI 6.3.1.20e: TRUE), to set to physical disc type set
  412. * parameter to BTS_PHYSICAL_DISC_TYPE (before and including NeroAPI 6.3.1.20e:
  413. * FALSE) and to not change the booktype settings on the drive set the parameter
  414. * to BTS_UNMODIFIED. To take effect the flag NBF_NO_BOOKTYPE_CHANGE in NeroBurn
  415. * should be set.
  416. * In NeroGetDeviceOption, TRUE is returned if the booktype on the drive is set
  417. * to DVD-ROM, FALSE otherwise.
  418. */
  419. NERO_DEVICEOPTION_BOOKTYPE_DVDROM = 0,
  420. /*
  421. * Set the number of blocks after that to switch from layer 0
  422. * to layer 1 when writing on a double layer medium.
  423. * Notes:
  424. * - the number of blocks must be a multiple of 16
  425. * - the layer 0 must be >= totalDataSize/2, because there can
  426. * never be more data on layer 1 than on layer 0.
  427. *
  428. * In NeroSetDeviceOption value is a pointer to a DWORD variable.
  429. * In NeroGetDeviceOption a pointer to a DWORD is returned.
  430. */
  431. NERO_DEVICEOPTION_LAYERSWITCH = 1,
  432. /*
  433. * NeroAPI >= 6.0.0.24:
  434. * Set the booktype of the next DVD recordable that is written to the value given
  435. * in <*value>. the behaviour is similar as for NERO_DEVICEOPTION_BOOKTYPE_DVDROM
  436. * but the change is only made in the recorder driver and not on the drive.
  437. * This option is useful, if you do packetwriting. To take effect when using NeroBurn
  438. * the flag NBF_NO_BOOKTYPE_CHANGE should be set.
  439. * void* is a pointer to NERO_BOOK_TYPE_SETTINGS in Nero(Set|Get)DeviceOption.
  440. * In NeroGetDeviceOption, TRUE is returned if the booktype in the recorder driver
  441. * is set to DVD-ROM, FALSE otherwise.
  442. */
  443. NERO_DEVICEOPTION_BOOKTYPE_DVDROM_NEXT_WRITE = 2,
  444. /*
  445. * Set the number of blocks after that to switch from layer 0
  446. * to layer 1 when writing on a double layer medium. In difference to
  447. * NERO_DEVICEOPTION_LAYERSWITCH the layer break is written
  448. * immediately to the disc, while otherwise it is set during burning.
  449. * Notes:
  450. * - the number of blocks must be a multiple of 16
  451. * - the layer 0 must be >= totalDataSize/2, because there can
  452. * never be more data on layer 1 than on layer 0.
  453. *
  454. * In NeroSetDeviceOption value is a pointer to a DWORD variable.
  455. * In NeroGetDeviceOption a pointer to a DWORD specifying any physically
  456. * set layer break point on the medium or NULL if no layer break point
  457. * has been set as of yet is returned
  458. */
  459. NERO_DEVICEOPTION_BREAK_LAYER = 3
  460. } NERO_DEVICEOPTION;
  461. /*
  462. // Set a special option for a device
  463. // returns 0 an success
  464. */
  465. NEROAPI_API int NADLL_ATTR NeroSetDeviceOption(NERO_DEVICEHANDLE aDeviceHandle,
  466. NERO_DEVICEOPTION aOption,
  467. void *value);
  468. /*
  469. // Get an option from a device. The returned value must be freed with NeroFreeMem
  470. // by the caller
  471. */
  472. NEROAPI_API void* NADLL_ATTR NeroGetDeviceOption(NERO_DEVICEHANDLE aDeviceHandle,
  473. NERO_DEVICEOPTION aOption, void* reserved);
  474. /*
  475. // CD-Information:
  476. */
  477. typedef enum
  478. {
  479. NTT_UNKNOWN,
  480. NTT_DATA,
  481. NTT_AUDIO
  482. } NERO_TRACK_TYPE;
  483. typedef struct tag_NERO_TRACK_INFO
  484. {
  485. DWORD ntiSessionNumber;
  486. DWORD ntiTrackNumber;
  487. NERO_TRACK_TYPE ntiTrackType;
  488. DWORD ntiTrackStartBlk;
  489. DWORD ntiTrackLengthInBlks;
  490. char ntiArtist[65];
  491. char ntiTitle[65];
  492. char ntiISRC[13]; /* NeroAPI > 5.5.8.3: if NGCDI_READ_ISRC is present: 12 chars ISRC code + terminator */
  493. DWORD ntiBlockSize; /* NeroAPI >= 6.0.0.0: size of one block in bytes */
  494. DWORD ntiReserved[28]; /* Should be zero */
  495. } NERO_TRACK_INFO;
  496. typedef enum
  497. {
  498. NMT_UNKNOWN,
  499. NMT_CD_ROM,
  500. NMT_CD_RECORDABLE,
  501. NMT_CD_REWRITEABLE
  502. } NERO_MEDIUM_TYPE;
  503. typedef struct tag_NERO_CD_INFO
  504. {
  505. DWORD ncdiFreeCapacityInBlocks;
  506. BOOL ncdiIsWriteable; /* A disc can be non-writeable */
  507. NERO_MEDIUM_TYPE ncdiMediumType; /* Old media type description, ncdiMediaType should be used instead */
  508. char ncdiArtist[65];
  509. char ncdiTitle[65];
  510. DWORD ncdiAvailableEraseModes;/* This bitfield can be decoded using the NCDI_IS_ERASE_MODE_AVAILABLE macro */
  511. DWORD ncdiUnusedBlocks; /* difference beetween Lead-Out position and last possible Lead-Out position */
  512. NERO_MEDIA_TYPE ncdiMediaType; /* NeroAPI>=5.5.9.4: type of media */
  513. DWORD ncdiMediumFlags; /* NeroAPI>6.0.0.10: various medium flags (Virtual multisession, ...) */
  514. /* The medium is a virtual multisession medium, use VMS API to retrieve session information.
  515. NOTE: This flag only tells you, that if multisession is written, VMS is used. But not
  516. that this medium contains multisessions.
  517. */
  518. #define NCDIMF_VIRTUALMULTISESSION (1<<0)
  519. #define NCDIMF_HDB_SUPPORTED (1<<1) /* The medium supports HD-BURN */
  520. DWORD ncdiLayer0MaxBlocks; /* NeroAPI>6.0.0.19: If this value is set, the medium is a double layer medium whereby
  521. * layer 0 can not be bigger than the given number of blocks.
  522. */
  523. DWORD ncdiTotalCapacity; /* NeroAPI>=6.3.0.5: The total capacity of this medium */
  524. DWORD ncdiReserved[26]; /* Should be zero */
  525. DWORD ncdiNumTracks;
  526. NERO_TRACK_INFO ncdiTrackInfos[1];
  527. } NERO_CD_INFO;
  528. #define NCDI_IS_ERASE_MODE_AVAILABLE(cdInfo,eraseMode) ((cdInfo).ncdiAvailableEraseModes & (1<<(eraseMode)))
  529. /*
  530. // Get information about a CD. Free result with NeroFreeMem().
  531. //
  532. // aDeviceHandle: result of NeroOpenDevice()
  533. // flags: see below
  534. //
  535. // Returns NULL in case of error.
  536. */
  537. NEROAPI_API NERO_CD_INFO * NADLL_ATTR NeroGetCDInfo(NERO_DEVICEHANDLE aDeviceHandle, DWORD dwFlags);
  538. #define NGCDI_READ_CD_TEXT (1<<0) /* also try to fill in */
  539. #define NGCDI_READ_ISRC (1<<1) /* NeroAPI>=5.5.8.4 */
  540. /* NeroAPI>=6.0.0.25:
  541. * If the recorder and the current medium support HD-BURN, give the capacity and
  542. * the unused blocks for the HD-BURN mode
  543. * Note, that if the medium is already written in HD-BURN mode, this flag is not necessary.
  544. */
  545. #define NGCDI_USE_HDB (1<<2)
  546. typedef struct tag_NERO_VMSSESSION
  547. {
  548. char nvmssSessionName[256]; /* The name of the session (volume name) */
  549. struct tm nvmssCreationTime; /* The creation time of the session */
  550. DWORD nvmssNextWritableAddress; /* The first block that is not occupied by this session */
  551. DWORD nvmssReserved[32]; /* Should be zero */
  552. } NERO_VMSSESSION;
  553. typedef struct tag_NERO_VMS_INFO
  554. {
  555. DWORD nvmsiNextWritableAddress; /* The next writable address of the medium, may be used for free space calculation */
  556. DWORD nvmsiNumSessions; /* Number of sessions stored on the VMS medium */
  557. DWORD nvmsiReserved[32]; /* Should be zero */
  558. NERO_VMSSESSION nvmsiSessionInfo[1]; /* One entry per session */
  559. } NERO_VMS_INFO;
  560. /*
  561. // NeroAPI>6.0.0.10: Retrieve virtual multisession information for media supporting it.
  562. // This function may be called for media having the NCDIMF_VIRTUALMULTISESSION flag
  563. // set in their NERO_CD_INFO structure. Free result with NeroFreeMem()
  564. //
  565. // aDeviceHandle: result of NeroOpenDevice()
  566. // flags: currently unused, reserved for future extensions
  567. //
  568. // Returns NULL in case of error (e.g. non-VMS medium inserted)
  569. //
  570. // Virtual multisession is a technique to allow writing multisession discs on
  571. // medium types that does not support normal multisession, e.g. DVD-+RW.
  572. */
  573. NEROAPI_API NERO_VMS_INFO * NADLL_ATTR NeroGetVMSInfo(NERO_DEVICEHANDLE aDeviceHandle, DWORD dwFlags);
  574. /*
  575. // NeroAPI>=5.5.9.16: Get information about a disc image. Result must be released using NeroFreeMem().
  576. //
  577. // imagePath: path to the image file
  578. // reserved: reserved for future usage
  579. //
  580. // Returns NULL in case of error.
  581. */
  582. NEROAPI_API NERO_CD_INFO * NADLL_ATTR NeroGetDiscImageInfo(const char *imagePath, void *reserved);
  583. /*
  584. // A progress display could look like this:
  585. //
  586. // +------------------------------------------------------+
  587. // | Log of Operation: |
  588. // | +--------------------------------------------------+ |
  589. // | | [icon] text | |
  590. // | | ........... | |
  591. // | | | |
  592. // | +--------------------------------------------------+ |
  593. // | Current Phase: text |
  594. // | Progress: ********............................ |
  595. // | |
  596. // | ABORT |
  597. // +------------------------------------------------------+
  598. //
  599. // The application may provide callback functions to set
  600. // the different parts of this display. All of them may
  601. // be NULL.
  602. */
  603. typedef BOOL (NERO_CALLBACK_ATTR *NERO_PROGRESS_CALLBACK)(void *pUserData, DWORD dwProgressInPercent); /* Will return TRUE if the user wants to abort */
  604. typedef BOOL (NERO_CALLBACK_ATTR *NERO_ABORTED_CALLBACK)(void *pUserData); /* " " " " " " " " " */
  605. typedef enum
  606. {
  607. NERO_TEXT_INFO, /* informative text */
  608. NERO_TEXT_STOP, /* some operation stopped prematurely */
  609. NERO_TEXT_EXCLAMATION, /* important information */
  610. NERO_TEXT_QUESTION, /* a question which requires an answer */
  611. NERO_TEXT_DRIVE, /* a message concerning a CD-ROM drive or recorder */
  612. NERO_TEXT_FILE, /* a message concerning a file */
  613. NERO_TEXT_UNSPECIFIED /* no type specified */
  614. } NERO_TEXT_TYPE;
  615. typedef enum
  616. {
  617. NERO_PHASE_UNSPECIFIED =-1,
  618. NERO_PHASE_START_CACHE =24,
  619. NERO_PHASE_DONE_CACHE =25,
  620. NERO_PHASE_FAIL_CACHE = 26,
  621. NERO_PHASE_ABORT_CACHE = 27,
  622. NERO_PHASE_START_TEST =28,
  623. NERO_PHASE_DONE_TEST =29,
  624. NERO_PHASE_FAIL_TEST = 30,
  625. NERO_PHASE_ABORT_TEST = 31,
  626. NERO_PHASE_START_SIMULATE =32,
  627. NERO_PHASE_DONE_SIMULATE =33,
  628. NERO_PHASE_FAIL_SIMULATE = 34,
  629. NERO_PHASE_ABORT_SIMULATE = 35,
  630. NERO_PHASE_START_WRITE =36,
  631. NERO_PHASE_DONE_WRITE =37,
  632. NERO_PHASE_FAIL_WRITE = 38,
  633. NERO_PHASE_ABORT_WRITE = 39,
  634. NERO_PHASE_START_SIMULATE_NOSPD =61,
  635. NERO_PHASE_DONE_SIMULATE_NOSPD =62,
  636. NERO_PHASE_FAIL_SIMULATE_NOSPD = 63,
  637. NERO_PHASE_ABORT_SIMULATE_NOSPD = 64,
  638. NERO_PHASE_START_WRITE_NOSPD =65,
  639. NERO_PHASE_DONE_WRITE_NOSPD =66,
  640. NERO_PHASE_FAIL_WRITE_NOSPD = 67,
  641. NERO_PHASE_ABORT_WRITE_NOSPD = 68,
  642. NERO_PHASE_PREPARE_ITEMS = 73,
  643. NERO_PHASE_VERIFY_COMPILATION = 78,
  644. NERO_PHASE_VERIFY_ABORTED = 79,
  645. NERO_PHASE_VERIFY_END_OK = 80,
  646. NERO_PHASE_VERIFY_END_FAIL = 81,
  647. NERO_PHASE_ENCODE_VIDEO =82,
  648. NERO_PHASE_SEAMLESSLINK_ACTIVATED = 87, // deprecated, use NERO_PHASE_BUP_ACTIVATED below
  649. NERO_PHASE_BUP_ACTIVATED =90, // Generic: Buffer underun protection activated
  650. NERO_PHASE_START_FORMATTING = 98,
  651. NERO_PHASE_CONTINUE_FORMATTING =99,
  652. NERO_PHASE_FORMATTING_SUCCESSFUL =100,
  653. NERO_PHASE_FORMATTING_FAILED =101,
  654. NERO_PHASE_PREPARE_CD =105,
  655. NERO_PHASE_DONE_PREPARE_CD =106,
  656. NERO_PHASE_FAIL_PREPARE_CD =107,
  657. NERO_PHASE_ABORT_PREPARE_CD =108,
  658. NERO_PHASE_DVDVIDEO_DETECTED =111,
  659. NERO_PHASE_DVDVIDEO_REALLOC_STARTED =112,
  660. NERO_PHASE_DVDVIDEO_REALLOC_COMPLETED =113,
  661. NERO_PHASE_DVDVIDEO_REALLOC_NOTNEEDED =114, // NeroAPI > 5.5.9.3
  662. NERO_PHASE_DVDVIDEO_REALLOC_FAILED =115, // NeroAPI > 5.5.9.3
  663. NERO_PHASE_DRM_CHECK_FAILURE =169, // NeroAPI >= 6.3.0.6
  664. /** Start Burn-at-once phases **/
  665. NERO_PHASE_START_WRITE_DATAFILES =171, // Writing data files started
  666. NERO_PHASE_DONE_WRITE_DATAFILES =172, // Writing data files completed successfully
  667. NERO_PHASE_FAIL_WRITE_DATAFILES =173, // Writing data files failed
  668. NERO_PHASE_WARN_WRITE_DATAFILES =174, // Writing data files completed with warnings
  669. NERO_PHASE_START_BAO_FINALIZE =175, // Finalizing disc started
  670. NERO_PHASE_FAIL_BAO_FINALIZE =176, // Finalizing the disc failed
  671. NERO_PHASE_DONE_BAO_FINALIZE =177, // Disc finalized successfully
  672. NERO_PHASE_FAIL_BAO_PREPARE =178, // Preparing the disc failed
  673. NERO_PHASE_FAIL_BAO_WRITEFILE =179, // Writing file to disc failed
  674. /** End Burn-at-once phases **/
  675. NERO_PHASE_BURN_LAYER_1 =180, // Starting writing on layer 1 of a double layer disc
  676. NERO_PHASE_BURN_LAYER_2 =181, // Starting writing on layer 2 of a double layer disc
  677. } NERO_MAJOR_PHASE;
  678. /* a one-line text to be displayed; text pointer becomes invalid after returning from this function */
  679. typedef void (NERO_CALLBACK_ATTR *NERO_ADD_LOG_LINE_CALLBACK)(void *pUserData, NERO_TEXT_TYPE type, const char *text);
  680. /* set the phase line; text pointer becomes invalid after returning from this function */
  681. typedef void (NERO_CALLBACK_ATTR *NERO_SET_PHASE_CALLBACK)(void *pUserData, const char *text);
  682. /* Tell the main program whether the burn process can be interrupted or not */
  683. typedef void (NERO_CALLBACK_ATTR *NERO_DISABLE_ABORT_CALLBACK)(void *pUserData,BOOL abortEnabled);
  684. /* Let the application knows in which part of the burn process NeroAPI is */
  685. typedef void (NERO_CALLBACK_ATTR *NERO_SET_MAJOR_PHASE_CALLBACK)(void *pUserData,NERO_MAJOR_PHASE phase,void *reserved);
  686. typedef struct tag_NERO_PROGRESS
  687. {
  688. NERO_PROGRESS_CALLBACK npProgressCallback;
  689. NERO_ABORTED_CALLBACK npAbortedCallback;
  690. NERO_ADD_LOG_LINE_CALLBACK npAddLogLineCallback;
  691. NERO_SET_PHASE_CALLBACK npSetPhaseCallback;
  692. void *npUserData;
  693. NERO_DISABLE_ABORT_CALLBACK npDisableAbortCallback; /* Will be called only if the NBF_DISABLE_ABORT flags is given to the NeroBurn function */
  694. NERO_SET_MAJOR_PHASE_CALLBACK npSetMajorPhaseCallback;
  695. NERO_PROGRESS_CALLBACK npSubTaskProgressCallback; /* provide the write buffer fill level */
  696. } NERO_PROGRESS;
  697. /*
  698. // NeroAPI >= 6.0.0.0
  699. // creates a NERO_PROGRESS structure correctly initialised.
  700. // Must be freed with NeroFreeMem when no longer needed.
  701. */
  702. NEROAPI_API NERO_PROGRESS* NADLL_ATTR NeroCreateProgress();
  703. /*
  704. // Data exchange between application and NeroAPI is done with
  705. // a function that gets a pointer to its own structure, a buffer
  706. // pointer and the amount in bytes to be read or written. It
  707. // shall return the actual amount of bytes transferred. Other
  708. // functions indicate that the EOF file has been reached when
  709. // reading or a serious error occured.
  710. */
  711. typedef DWORD (NERO_CALLBACK_ATTR *NERO_IO_CALLBACK)(void *pUserData, BYTE *pBuffer, DWORD dwLen);
  712. typedef BOOL (NERO_CALLBACK_ATTR *NERO_STATUS_CALLBACK)(void *pUserData);
  713. typedef struct tag_NERO_IO
  714. {
  715. void *nioUserData;
  716. NERO_IO_CALLBACK nioIOCallback;
  717. NERO_STATUS_CALLBACK nioEOFCallback; // shall return TRUE if further IO calls will always fail to transfer any data, i.e. EOF reached
  718. NERO_STATUS_CALLBACK nioErrorCallback; // shall return TRUE if an error occured during an IO call
  719. } NERO_IO;
  720. /* A pointer on this structure will be passed with the DLG_WAITCD_MEDIA_INFO user dialog callback
  721. (NeroAPI>=5.5.9.4)
  722. */
  723. typedef struct
  724. {
  725. DWORD ndwmiSize;
  726. NERO_MEDIA_TYPE ndwmiLastDetectedMedia;
  727. NERO_MEDIA_SET ndwmiRequestedMedia;
  728. const char *ndwmiLastDetectedMediaName;
  729. const char *ndwmiRequestedMediaName;
  730. } NERO_DLG_WAITCD_MEDIA_INFO;
  731. /*
  732. // ISO track generation functions
  733. */
  734. typedef struct tag_NERO_ISO_ITEM
  735. {
  736. char fileName[252]; // Deprecated, use longFileName instead
  737. char *longFileName; // File name on the burnt CD
  738. // (will be freed in NeroFreeIsoItem if this item is a reference)
  739. BOOL isDirectory; // Is this item a directory ?
  740. BOOL isReference; // Is this item a reference to a file/directory of a previous session
  741. // when recording RockRidge, you can set the name of a directory to be used for
  742. // retrieving rockridge informations here
  743. char sourceFilePath[252]; // Deprecated, use longSourceFilePath instead
  744. const char *longSourceFilePath; // Path to the file, including file name (ignored for a directory)
  745. struct tag_NERO_ISO_ITEM *subDirFirstItem; // Point on the first item of the sub directory if the item is a directory
  746. // Can be NULL if the directory is empty
  747. // (ignored for a file)
  748. struct tag_NERO_ISO_ITEM *nextItem; // Next item in the current directory
  749. void *userData; // Can be used to store additional informations
  750. // Used to reference a file from a previous session
  751. long dataStartSec;
  752. __int64 dataLength;
  753. struct tm entryTime;
  754. int itemSize; // Size of the structure
  755. struct CImportInfo *importinfo; // ImportInfo
  756. WCHAR *unicodeFileName; // NeroAPI>=6.6.0.0: file name on the burnt CD in unicode format. If unicodeFileName is present, it supersedes fileName and longFileName.
  757. // (will be freed in NeroFreeIsoItem if this item is a reference)
  758. } NERO_ISO_ITEM;
  759. typedef struct tag_NERO_IMPORT_DATA_TRACK_INFO
  760. {
  761. DWORD nidtiSize; // Must contain the size of the structure
  762. char *nidtipVolumeName; // This must be released using NeroFreeMem
  763. } NERO_IMPORT_DATA_TRACK_INFO;
  764. // NeroCreateIsoItem: Allocate an instance from the NERO_ISO_ITEM structure
  765. // The itemSize member of the structure will be automatically be filled by this
  766. // function
  767. #define NeroCreateIsoItem() NeroCreateIsoItemOfSize(sizeof(NERO_ISO_ITEM))
  768. NEROAPI_API NERO_ISO_ITEM * NADLL_ATTR NeroCreateIsoItemOfSize(size_t);
  769. // Free an instance from the NERO_ISO_ITEM structure
  770. // longFilename is only freed if this item is a reference, because only then is longFilename allocated by NeroAPI
  771. NEROAPI_API void NADLL_ATTR NeroFreeIsoItem(NERO_ISO_ITEM *);
  772. /*
  773. // NeroAPI >= 6.0.0.0:
  774. // Free an NERO_ISO_ITEM including all linked items
  775. */
  776. NEROAPI_API void NADLL_ATTR NeroFreeIsoItemTree(NERO_ISO_ITEM*);
  777. // NeroCopyIsoItem: Create a copy of an existing NERO_ISO_ITEM object.
  778. // This is a safe way to obtain an exact copy of NERO_ISO_ITEM objects imported
  779. // from a previous session
  780. // Note that the new NERO_ISO_ITEM's nextItem,userData and subDirFirstItem members are set to NULL
  781. // longFilename is only copied if this item is a reference, because only then is longFilename allocated by NeroAPI
  782. // Available for NeroAPI versions >5.5.9.9
  783. NEROAPI_API NERO_ISO_ITEM * NADLL_ATTR NeroCopyIsoItem(const NERO_ISO_ITEM *iso_item);
  784. // Create an ISO track from a NERO_ISO_ITEM tree
  785. // NeroAPI >= 5.5.9.0:
  786. // For special needs you have to give a pointer to NeroCITEArgs instead of name.
  787. // See declaration of NeroCiteArgs below. Set flags to NCITEF_USE_STRUCT,
  788. // to tell NeroCreateIsoTrackEx that name is a NeroCITEArgs struct and set the flags
  789. // for the burn options with NeroCITEArgs::dwBurnOptions. root should also be NULL
  790. // in this case.
  791. NEROAPI_API
  792. struct CNeroIsoTrack * NADLL_ATTR NeroCreateIsoTrackEx(NERO_ISO_ITEM *root, // First item of the root directory
  793. const char *name, // Name of the CD
  794. DWORD flags); // See constants below
  795. // this struct can be used to give some more parameters to NeroCreateIsoTrackEx:
  796. // - If a CD shall have two different filesystems (e.g. HFS+ CDs), you can give
  797. // the second filesystem with firstRootItem_wrapper.
  798. // - give some information to be written to the volume descriptor
  799. typedef struct tag_NERO_CITE_ARGS {
  800. int size; // ignored. Initialise whole struct with 0. The version of the
  801. // struct will be taken from expected version of NeroAPI
  802. NERO_ISO_ITEM *firstRootItem;
  803. NERO_ISO_ITEM *firstRootItem_wrapper;
  804. const char *name;
  805. DWORD dwBurnOptions;
  806. // NeroAPI >= 5.5.9.26:
  807. const char *systemIdentifier; // system identifier
  808. const char *volumeSet;
  809. const char *publisher; // the publisher of this track
  810. const char *dataPreparer; // the preparer of this track
  811. const char *application; // the application, that created this track
  812. const char *copyright; // copyright file
  813. const char *abstract; // abstract file
  814. const char *bibliographic; // bibliographic file
  815. } NERO_CITE_ARGS;
  816. // definition for compatibility reasons
  817. #define NeroCITEArgs NERO_CITE_ARGS
  818. #define NCITEF_USE_JOLIET (1<<0)
  819. #define NCITEF_USE_MODE2 (1<<1)
  820. #define NCITEF_USE_ROCKRIDGE (1<<2)
  821. #define NCITEF_CREATE_ISO_FS (1<<3)
  822. #define NCITEF_CREATE_UDF_FS (1<<4)
  823. #define NCITEF_CREATE_HFS_FS (1<<5)
  824. #define NCITEF_DVDVIDEO_REALLOC (1<<6) // NeroAPI>=5.5.7.8: Perform reallocation of files in the VIDEO_TS directory; NeroAPI>=6.3.1.4: Also create layerbreak if writing on a double layer medium
  825. #define NCITEF_USE_STRUCT (1<<7) // NeroAPI>=5.5.9.0: 'name' points to an argument struct instead of name. If set, 'root' and other 'flags' are ignored.
  826. #define NCITEF_RESERVED1 (1<<8) // Reserved
  827. #define NCITEF_USE_ALLSPACE (1<<9) // NeroAPI>=5.5.9.17: Use all space available on the medium for the volume to be created. Supported for DVD+-RW only
  828. #define NCITEF_RESERVED2 (1<<10) // Reserved
  829. #define NCITEF_RESERVED3 (1<<11) // Reserved
  830. #define NCITEF_RESERVED4 (1<<12) // Reserved
  831. #define NCITEF_RELAX_JOLIET (1<<13) // NeroAPI>=6.0.0.0:Relax joliet filename length limitations -> allow a maximum of 109 characters per filename
  832. #define NCITEF_DVDVIDEO_CMPT (1<<14) // NeroAPI>6.0.0.13: Create DVD-Video compatible medium, NCITEF_CREATE_ISO_FS and NCITEF_CREATE_UDF_FS must be set,
  833. // NCITEF_DVDVIDEO_REALLOC may be set to reallocate DVD-Video .IFO pointers
  834. // Note that NeroAPI versions prior or equal to 6.0.0.13 will implicitly enable DVD-Video compatibility
  835. // when DVD-Video content is found within your compilation
  836. #define NCITEF_RESERVED5 (1<<15) // Reserved
  837. // Free an ISO track previously allocated with NeroCreateIsoTrackEx
  838. NEROAPI_API void NADLL_ATTR NeroFreeIsoTrack(struct CNeroIsoTrack *track);
  839. typedef enum
  840. {
  841. NIDTR_NO_ERROR=0,
  842. NIDTR_GENERIC_ERROR, // undefined error
  843. NIDTR_DRIVE_ERROR, // get more details with NeroGetLastDriveError
  844. // filesystem errors below, maybe a corrupted filesystem etc.
  845. // If one of these is returned, parts of the filesystem may have
  846. // been imported nevertheless
  847. NIDTR_READ_ERROR, // error while reading from the disc
  848. NIDTR_INVALID_FS, // errors in the filesystem on the disc
  849. NIDTR_INVALID_TRACKNUMBER // the tracknumber given is invalid
  850. } NERO_IMPORT_DATA_TRACK_RESULT;
  851. /*
  852. // Create a NERO_ISO_ITEM tree from an already existing ISO track in order to create a new session
  853. // with reference to files from older sessions
  854. // *ppCDStamp will be filled with a pointer on a CDStamp object which will have to be freed later
  855. // *pInfo will be filled with information about the imported track
  856. // *result will contain a result flag, may be NULL
  857. // (NeroAPI>=6.0.0.0)
  858. */
  859. NEROAPI_API NERO_ISO_ITEM *NADLL_ATTR NeroImportDataTrack( NERO_DEVICEHANDLE pRecorder,
  860. DWORD trackNumber,
  861. void **ppCDStamp,
  862. NERO_IMPORT_DATA_TRACK_INFO *pInfo,
  863. DWORD flags,
  864. NERO_IMPORT_DATA_TRACK_RESULT *result,
  865. void *reserved); // Must be NULL
  866. #define NIITEF_IMPORT_ROCKRIDGE (1<<0) // Will be ignored, RockRidge is now always imported if present
  867. #define NIITEF_IMPORT_ISO_ONLY (1<<1)
  868. #define NIITEF_PREFER_ROCKRIDGE (1<<2) // Will be ignored
  869. #define NIITEF_IMPORT_UDF (1<<3) // Import UDF Session
  870. #define NIITEF_IMPORT_VMS_SESSION (1<<4) // treat trackNumber as the virtual multisession session specifier
  871. // Free a CD stamp allocated by NeroImportIsoTrackEx
  872. NEROAPI_API void NADLL_ATTR NeroFreeCDStamp(void *pCDStamp);
  873. // Create a file system container for the NERO_FILE_SYSTEM_CONTAINER_MEDIA compilation type
  874. #ifdef __cplusplus
  875. namespace FileSystemContent
  876. {
  877. struct IFileSystemDescContainer;
  878. };
  879. #else //__cplusplus
  880. struct IFileSystemDescContainer;
  881. #endif//__cplusplus
  882. NEROAPI_API
  883. #ifdef __cplusplus
  884. FileSystemContent::
  885. #else //__cplusplus
  886. struct
  887. #endif//__cplusplus
  888. IFileSystemDescContainer *NADLL_ATTR NeroCreateFileSystemContainer(void *reserved);
  889. /*
  890. // Recording functions:
  891. */
  892. typedef enum
  893. {
  894. NERO_ET_FILE, /* read/write to/from WAV file. */
  895. NERO_ET_IO_CALLBACK, /* exchange data with application directly */
  896. NERO_ET_FILE_MP3, /* read from MP3 file (not for DAE) */
  897. NERO_ET_FILE_WMA, /* read from MS audio file (not for DAE) */
  898. NERO_ET_FILE_RAW, /* for a Freestyle compilation,
  899. * this and NERO_ET_IO_CALLBACK
  900. * are the only types allowed
  901. * at the moment.
  902. * It will expect files
  903. * to be in the format
  904. * as to be written to the disc.
  905. * This exchange type is valid
  906. * for freestyle compilations only */
  907. NERO_ET_AUDIO_FILE /* NeroAPI > 5.5.9.8: audio file created with the plugin manager*/
  908. } NERO_DATA_EXCHANGE_TYPE;
  909. typedef void * NERO_AUDIO_ITEM_HANDLE;
  910. typedef struct tagNERO_AUDIO_ITEM_INFO
  911. {
  912. NERO_AUDIO_ITEM_HANDLE naiiAudioItem;
  913. const char *naiiFileName;
  914. } NERO_AUDIO_ITEM_INFO;
  915. /* use PCM, 44.1kHz, Stereo (left channel first), 16 bits per channel, LSB,
  916. when exchanging data with the NeroAPI */
  917. typedef struct tag_NERO_DATA_EXCHANGE
  918. {
  919. NERO_DATA_EXCHANGE_TYPE ndeType;
  920. union
  921. {
  922. char ndeFileName[256]; // Deprecated, use ndeLongFileName.ptr instead
  923. struct
  924. {
  925. DWORD reserved; /* must be 0 */
  926. const char *ptr;
  927. } ndeLongFileName;
  928. NERO_IO ndeIO; // NERO_IO/EOF/ERROR_CALLBACK
  929. NERO_AUDIO_ITEM_INFO ndeAudioItemInfo; // NeroAPI > 5.5.9.8
  930. } ndeData;
  931. } NERO_DATA_EXCHANGE;
  932. typedef struct tag_NERO_AUDIO_TRACK
  933. {
  934. DWORD natPauseInBlksBeforeThisTrack;
  935. DWORD natNumIndexPositions;
  936. /* NOTE: values of index positions has to be given in bytes,
  937. * whereby the values have to be a multiple of 2352
  938. */
  939. DWORD natRelativeIndexBlkPositions[98]; /* offsets between one index position and the next one */
  940. const char *natTitle, *natArtist; /* set to NULL if unknown or to be taken from source */
  941. NERO_DATA_EXCHANGE natSourceDataExchg;
  942. DWORD natLengthInBlocks; /* only used for NERO_IO_CALLBACK */
  943. BOOL natIndex0ContainsData; /* NeroAPI 5.5.9.8: TRUE, if audio data shall be written into index
  944. 0. Data for index 0 must be provided. */
  945. DWORD natReserved[31]; /* Should be zero */
  946. } NERO_AUDIO_TRACK;
  947. typedef enum
  948. {
  949. NERO_TRACKMODE_MODE1, /* 2048 Bytes per sector data track */
  950. NERO_TRACKMODE_MODE2_FORM1, /* 2048 Bytes per sector, used for multisession */
  951. NERO_TRACKMODE_AUDIO /* 2352 Bytes per sector, standard audio track */
  952. } NERO_TRACKMODE_TYPE;
  953. typedef struct tag_NERO_FREESTYLE_TRACK
  954. {
  955. DWORD nftStructureSize; /* size of this structure, to ensure binary compatibility */
  956. DWORD nftPauseInBlksBeforeThisTrack;
  957. DWORD nftNumIndexPositions;
  958. DWORD nftRelativeIndexBlkPositions[98]; /* offsets between one index position and the next one */
  959. const char *nftTitle, *nftArtist; /* set to NULL if unknown or to be taken from source */
  960. NERO_DATA_EXCHANGE nftSourceDataExchg; /* source for raw track data */
  961. DWORD nftLengthInBlocks; /* only used for NERO_IO_CALLBACK */
  962. NERO_TRACKMODE_TYPE nftTracktype; /* specifies track type to be written */
  963. } NERO_FREESTYLE_TRACK;
  964. typedef enum
  965. {
  966. NERO_MPEG_ITEM,
  967. NERO_JPEG_ITEM,
  968. NERO_NONENCODED_VIDEO_ITEM, // The source file name will be an AVI file which will be encoded into MPG by NeroAPI
  969. } NERO_VIDEO_ITEM_TYPE;
  970. typedef struct tag_NERO_VIDEO_ITEM
  971. {
  972. DWORD nviPauseAfterItem; // value is number of blocks (75 blocks = 1 second)
  973. char nviSourceFileName[250]; // Deprecated, use nviLongSourceFileName instead
  974. const char *nviLongSourceFileName; // MPG, JPG or AVI file
  975. NERO_VIDEO_ITEM_TYPE nviItemType;
  976. } NERO_VIDEO_ITEM;
  977. typedef enum
  978. {
  979. NERO_ISO_AUDIO_MEDIA =0, // Burn either a CD or a DVD, depending on the nwcdMediaType member
  980. NERO_VIDEO_CD =1,
  981. NERO_BURN_IMAGE_MEDIA =2, // Burn either a CD or a DVD from an image
  982. NERO_FREESTYLE_CD =3,
  983. NERO_FILE_SYSTEM_CONTAINER_MEDIA=4, // Burn an IFileSystemDescContainer (see NeroFileSystemContainer.h)
  984. // For compatibility
  985. NERO_ISO_AUDIO_CD =0,
  986. NERO_BURN_IMAGE_CD =2
  987. } NERO_CD_FORMAT;
  988. typedef struct tag_NERO_WRITE_CD
  989. {
  990. /* both may be NULL: */
  991. const char *nwcdArtist;
  992. const char *nwcdTitle;
  993. struct CNeroIsoTrack *nwcdIsoTrack; /* if not NULL, then the disc will have an ISO track - please refer to "NeroIsoTrack.h" */
  994. BOOL nwcdCDExtra; /* if TRUE and nwcdIsoTrack not NULL, then the resulting CD will have audio in the first session
  995. and the data track in the second, however, currently the NeroAPI does not add any of the
  996. special CD Extra files to the data track */
  997. void *nwcdpCDStamp; // Point on a CDStamp object if a particular CD is requested, otherwise NULL
  998. DWORD nwcdNumTracks;
  999. NERO_MEDIA_TYPE nwcdMediaType; /* Media on which the data should be written */
  1000. DWORD nwcdReserved[32]; /* Should be zero */
  1001. NERO_AUDIO_TRACK nwcdTracks[1];
  1002. } NERO_WRITE_CD;
  1003. #ifdef __cplusplus
  1004. namespace VCDEngine
  1005. {
  1006. struct IVCDFSContentGenerator;
  1007. struct IVCDMediaDescription;
  1008. };
  1009. #endif
  1010. typedef enum
  1011. {
  1012. NERO_VIDEO_RESOLUTION_PAL = 0,
  1013. NERO_VIDEO_RESOLUTION_NTSC = 1
  1014. } NERO_VIDEO_RESOLUTION;
  1015. typedef struct tag_NERO_WRITE_VIDEO_CD
  1016. {
  1017. BOOL nwvcdSVCD; // If TRUE, write a SVCD
  1018. DWORD nwvcdNumItems;
  1019. struct CNeroIsoTrack *nwvcdIsoTrack;
  1020. char nwvcdTempPath[252]; /* Deprecated, use nwvcdLongTempPath instead */
  1021. const char *nwvcdLongTempPath; /* NeroAPI>=5.5.5.3: where the encoded files will be temporary stored */
  1022. #ifdef __cplusplus /* NeroAPI>=5.5.7.6 */
  1023. VCDEngine::IVCDFSContentGenerator *(*nwvcdCustomVCDEngine)(VCDEngine::IVCDMediaDescription *desc,FileSystemContent::IFileSystemDescContainer *pFSDC);
  1024. #else
  1025. void *nwvcdCustomVCDEngine;
  1026. #endif
  1027. NERO_VIDEO_RESOLUTION nwvcdEncodingResolution; /* NeroAPI >= 6.0.0.17: select the encoding resolution for the video.
  1028. * This option only has effects for video items of type NERO_NONENCODED_VIDEO_ITEM. */
  1029. DWORD nwvcdReserved[31]; /* Should be zero */
  1030. NERO_VIDEO_ITEM nwvcdItems[1];
  1031. } NERO_WRITE_VIDEO_CD;
  1032. typedef struct tag_NERO_WRITE_IMAGE
  1033. {
  1034. char nwiImageFileName[252]; /* Deprecated, use nwiLongImageFileName instead */
  1035. const char *nwiLongImageFileName; /* Name of the NRG file to burn
  1036. ISO and CUE files can also be burnt this way */
  1037. NERO_MEDIA_TYPE nwiMediaType; /* NeroAPI >= 6.3.0.6: Media on which the image should be written. If set to MEDIA_NONE the default media type of the image will be used. */
  1038. DWORD nwiReserved[32];
  1039. } NERO_WRITE_IMAGE;
  1040. /* This structure will allow you to write any type of
  1041. * CD Layout, e.g. containing a raw data track at the beginning of the
  1042. * disc instead of a self-made ISO/UDF filesystem.
  1043. * This is good for writing .iso images as they can be downloaded everywhere
  1044. * on the net */
  1045. typedef struct tag_NERO_WRITE_FREESTYLE_CD
  1046. {
  1047. DWORD nwfcdStructureSize; /* fill this with sizeof(NERO_FREESTYLEWRITE_CD) */
  1048. /* both may be NULL: */
  1049. const char *nwfcdArtist;
  1050. const char *nwfcdTitle;
  1051. struct CNeroIsoTrack *nwfcdIsoTrack; /* if not NULL, then the disc will have an ISO track - please refer to "NeroIsoTrack.h" */
  1052. BOOL nwfcdCDExtra; /* if TRUE and nwfcdIsoTrack not NULL, then the resulting CD will have audio in the first session
  1053. and the data track in the second, however, currently the NeroAPI does not add any of the
  1054. special CD Extra files to the data track */
  1055. void *nwfcdpCDStamp; /* Point on a CDStamp object if a particular CD is requested, otherwise NULL */
  1056. DWORD nwfcdNumTracks;
  1057. DWORD nwfcdBurnOptions; /* NeroAPI>=5.5.9.1: Combination of NCITEF flags (ignored if nwfcdFSContainer is NULL) */
  1058. #ifdef __cplusplus
  1059. FileSystemContent::
  1060. #else //__cplusplus
  1061. struct
  1062. #endif//__cplusplus
  1063. IFileSystemDescContainer *nwfcdFSContainer; /* NeroAPI>=5.5.9.1: if not NULL, then the disc will have an ISO track described by
  1064. this container. nwfcdIsoTrack must be NULL, otherwise the container will be ignored */
  1065. NERO_MEDIA_TYPE nwfcdMediaType; /* NeroAPI >=5.5.9.1: Media on which the data should be written */
  1066. DWORD nwfcdReserved[32]; /* Should be zero */
  1067. NERO_FREESTYLE_TRACK nwfcdTracks[1];
  1068. } NERO_WRITE_FREESTYLE_CD;
  1069. // To burn an IFileSystemDescContainer object
  1070. typedef struct tag_NERO_WRITE_FILE_SYSTEM_CONTAINER
  1071. {
  1072. DWORD nwfscSize; /* fill this with sizeof(NERO_WRITE_FILE_SYSTEM_CONTENT) */
  1073. #ifdef __cplusplus
  1074. FileSystemContent::
  1075. #else //__cplusplus
  1076. struct
  1077. #endif//__cplusplus
  1078. IFileSystemDescContainer *nwfscFSContainer;
  1079. NERO_MEDIA_TYPE nwfscMediaType; /* Media on which the data should be written */
  1080. DWORD nwfscBurnOptions; /* Combination of NCITEF flags */
  1081. DWORD nwfscReserved[32]; /* Should be zero */
  1082. } NERO_WRITE_FILE_SYSTEM_CONTENT;
  1083. typedef enum
  1084. {
  1085. NEROAPI_BURN_OK=0,
  1086. NEROAPI_BURN_UNKNOWN_CD_FORMAT,
  1087. NEROAPI_BURN_INVALID_DRIVE,
  1088. NEROAPI_BURN_FAILED,
  1089. NEROAPI_BURN_FUNCTION_NOT_ALLOWED,
  1090. NEROAPI_BURN_DRIVE_NOT_ALLOWED,
  1091. NEROAPI_BURN_USER_ABORT,
  1092. NEROAPI_BURN_BAD_MESSAGE_FILE // message file invalid or missing
  1093. } NEROAPI_BURN_ERROR;
  1094. NEROAPI_API
  1095. NEROAPI_BURN_ERROR NADLL_ATTR NeroBurn(NERO_DEVICEHANDLE aDeviceHandle,
  1096. NERO_CD_FORMAT CDFormat,
  1097. const void* pWriteCD, // Must point on a NERO_WRITE_CD or a NERO_WRITE_VIDEO_CD structure
  1098. DWORD dwFlags,
  1099. DWORD dwSpeed, // In KB/s if NBF_SPEED_IN_KBS is present, in multiple of 150 KB/s otherwise
  1100. NERO_PROGRESS* pNeroProgress);
  1101. /* NeroBurn() flags: */
  1102. #define NBF_SPEED_TEST (1<<0) /* test speed of source first */
  1103. #define NBF_SIMULATE (1<<1) /* simulate writing before actually writing */
  1104. #define NBF_WRITE (1<<2) /* really write at the end */
  1105. #define NBF_DAO (1<<3) /* write in DAO */
  1106. #define NBF_CLOSE_SESSION (1<<4) /* only close the session and not the whole disc */
  1107. #define NBF_CD_TEXT (1<<5) /* write CD text - will be ignore if not supported by drive */
  1108. #define NBF_BUF_UNDERRUN_PROT (1<<6) /* enable saver burn mode */
  1109. #define NBF_DISABLE_ABORT (1<<7) /* The disable abort callback will be called */
  1110. #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 */
  1111. #define NBF_DISABLE_EJECT (1<<9) /* CD will not be ejected at the end of the burn process */
  1112. #define NBF_VERIFY (1<<10) /* Verify Filesystem after writing. Works for ISO only */
  1113. #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 */
  1114. #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) */
  1115. #define NBF_CD_TEXT_IS_JAPANESE (1<<13) /* NeroApi>=5.5.9.17: If NBF_CD_TEXT and NBF_CD_TEXT_IS_JAPANESE are set, then the CD Text is treated as japanese CD Text */
  1116. #define NBF_BOOKTYPE_DVDROM (1<<14) /* NeroAPI>5.5.10.7: If NBF_BOOKTYPE_DVDROM the booktype of a burned DVD will be set to DVD-ROM */
  1117. #define NBF_NO_BOOKTYPE_CHANGE (1<<15) /* NeroAPI>=6.0.0.24: Don't change the booktype of DVD, even if the default setting of NeroAPI is to change the booktype to DVD-ROM*/
  1118. #define NBF_RESERVED2 (1<<30) /* Reserved */
  1119. #define NBF_RESERVED (1<<31) /* Reserved */
  1120. typedef struct tag_NERO_FILESYSTEMTRACK_OPTIONS
  1121. {
  1122. DWORD netsStructureSize; /* fill this with sizeof(NERO_FILESYSTEMTRACK_OPTIONS) */
  1123. /*
  1124. * The following three entries need to be filled out whenever the file system size is to be calculated
  1125. * accurately.
  1126. */
  1127. void * netspCDStamp; /* Point on a CDStamp object when appending to an existing medium, otherwise NULL */
  1128. NERO_MEDIA_TYPE netsMediaType; /* The media type the file system is to be written to */
  1129. NERO_DEVICEHANDLE netsDeviceHandle; /* device handle representing the drive the file system is to be written to */
  1130. DWORD netsFlags; /* NBF_XXXX that will be used for the recording process */
  1131. #ifdef __cplusplus
  1132. FileSystemContent::
  1133. #else //__cplusplus
  1134. struct
  1135. #endif//__cplusplus
  1136. IFileSystemDescContainer *netsFSContainer; /* if not NULL, the file system will be created from this
  1137. * object instead of the passed CNeroIsoTrack object. pIsoTrack must be NULL in this case */
  1138. DWORD netsFSContainerFlags; /* NCITEF_XXXX flags to be used for filesystem creation. Used only when netsFSContainer
  1139. * is used to create the file system */
  1140. DWORD netsReserved[32]; /* Should be zero */
  1141. } NERO_FILESYSTEMTRACK_OPTIONS;
  1142. /* NeroAPI >= 6.0.0.14: Estimate the total size of a track including data and overhead
  1143. * for the filesystem. The method returns the size in blocks.
  1144. * Use the flags below to specify what exactly has to be taken into account for the
  1145. * calculation.
  1146. *
  1147. * Warning: Depending on the parameters passed, the returned size might only be an estimation!
  1148. */
  1149. NEROAPI_API unsigned int NADLL_ATTR NeroEstimateTrackSize(struct CNeroIsoTrack *pIsoTrack // the iso track for which to calculate the size
  1150. , DWORD dwFlags // combination of the flags below
  1151. , NERO_FILESYSTEMTRACK_OPTIONS *pOptions);
  1152. #define NETS_FILESYSTEM_OVERHEAD (1<<0) /* calculate filesystem overhead */
  1153. #define NETS_DATA (1<<1) /* calculate size of the data */
  1154. #define NETS_EXACT_SIZE (1<<2) /* Nero >= 6.0.0.21 calculate exactly.
  1155. * If this option is specified, filesystem overhead as well as file data is taken into account
  1156. * the optional fields of the NERO_ESTIMATETRACKSIZE_OPTIONS structure need to be filled out */
  1157. /*
  1158. // Digital Audio Extraction functions:
  1159. // - aborting will not be reported by NeroGetLastError()
  1160. // - incomplete target files are not deleted
  1161. // - the function will return 0 for success, else error
  1162. */
  1163. NEROAPI_API
  1164. int NADLL_ATTR NeroDAE(NERO_DEVICEHANDLE aDeviceHandle,
  1165. DWORD dwTrackStartBlk,
  1166. DWORD dwTrackLengthInBlks,
  1167. const NERO_DATA_EXCHANGE *pDestDataExchg,
  1168. DWORD iSpeedInX, // speed of extraction, 0 means maximum speed
  1169. NERO_CALLBACK* pNeroProgressCallback); /* has to be a NERO_PROGRESS_CALLBACK */
  1170. //
  1171. // Utility functions:
  1172. //
  1173. NEROAPI_API int NADLL_ATTR NeroIsDeviceReady(NERO_DEVICEHANDLE aDeviceHandle); // returns a value of NERO_DRIVE_ERROR
  1174. NEROAPI_API int NADLL_ATTR NeroEjectLoadCD(NERO_DEVICEHANDLE aDeviceHandle,BOOL eject); // returns a value of NERO_DRIVE_ERROR
  1175. // NeroAPI >= 6.0.0.25:
  1176. // Set the image file for the image recorder. This can be used to initialize
  1177. // the image recorder for packet writing.
  1178. // If imageFilePath is NULL, the last opened file is closed.
  1179. NEROAPI_API int NADLL_ATTR NeroInitImageRecorder(NERO_DEVICEHANDLE aDeviceHandle, const char *imageFilePath, DWORD dwFlags, NERO_MEDIA_TYPE mediaType, void *reserved);
  1180. // NeroAPI>=5.5.9.10: Get localized WAIT_CD text
  1181. // Returned string must be released using NeroFreeMem()
  1182. // Function may return NULL if type is out of range
  1183. NEROAPI_API char * NADLL_ATTR NeroGetLocalizedWaitCDTexts (NERO_WAITCD_TYPE type);
  1184. // NeroAPI >= 6.0.0.25: Use the nstUserDialog callback functions to request a CD
  1185. // Returns FALSE if the burn process should be aborted
  1186. NEROAPI_API BOOL NADLL_ATTR NeroWaitForDisc(NERO_DEVICEHANDLE aDeviceHandle
  1187. ,NERO_MEDIA_SET nmt // media types requested
  1188. ,DWORD dwBurnFlags // Set of NBF_ flags
  1189. ,void *pCDStamp // Optional stamp of requested media
  1190. ,DWORD dwFlags // Set of NWFD_ flags
  1191. ,void *reserved); // must be NULL
  1192. #define NWFD_REQUIRE_EMPTY_DISC (1<<0)
  1193. // CDRW erasing functions
  1194. typedef enum
  1195. {
  1196. NEROAPI_ERASE_ENTIRE =0,
  1197. NEROAPI_ERASE_QUICK =1,
  1198. } NEROAPI_CDRW_ERASE_MODE;
  1199. NEROAPI_API int NADLL_ATTR NeroGetCDRWErasingTime(NERO_DEVICEHANDLE aDeviceHandle,NEROAPI_CDRW_ERASE_MODE mode);
  1200. // Returns estimated blanking time for loaded CD-RW in seconds,
  1201. // -1 if no CD inserted,
  1202. // -2 if recorder doesn't support CDRW
  1203. // -3 if the inserted media is not rewritable
  1204. // Erase the disc inserted in the given recorder
  1205. NEROAPI_API int NADLL_ATTR NeroEraseDisc(NERO_DEVICEHANDLE aDeviceHandle,NEROAPI_CDRW_ERASE_MODE mode
  1206. ,DWORD dwFlags,void *reserved);
  1207. #define NEDF_DISABLE_EJECT (1<<0) /* NeroAPI>=6.0.0.0: CD will not be ejected at the end of the
  1208. erasing, even if this is recommanded for the selected recorder*/
  1209. #define NEDF_EJECT_AFTER_ERASE (1<<1) /* NeroAPI > 6.0.0.0: eject disc after erasing, no matter if this is
  1210. recommended for the recorder or not */
  1211. typedef enum
  1212. {
  1213. NDR_DRIVE_IN_USE=0,
  1214. NDR_DRIVE_NOT_IN_USE,
  1215. NDR_DISC_REMOVED,
  1216. NDR_DISC_INSERTED,
  1217. NDR_DRIVE_REMOVED,
  1218. NDR_DRIVE_ADDED
  1219. } NERO_DRIVESTATUS_RESULT;
  1220. /*
  1221. // callback that is called to tell the application about a status change of a drive
  1222. // hostID corresponds to the nsdiHostAdapterNo and targetID corresponds
  1223. // to the nsdiDeviceID of NERO_SCSI_DEVICE_INFO
  1224. // Note: The callback need to be thread safe, since it might be called from a different thread
  1225. */
  1226. typedef void (NERO_CALLBACK_ATTR *NERO_DRIVESTATUS_CALLBACK)(int hostID, int targetID, NERO_DRIVESTATUS_RESULT result, void *pUserData);
  1227. typedef enum
  1228. {
  1229. // the disc in the drive has been changed
  1230. // Warning: This change notification is based on Windows notifying about
  1231. // medium changes. If an application has disabled this notification, the
  1232. // callback will not be called. If you want to be sure to recognize all
  1233. // medium changes, you should use timer events and use NeroIsDeviceReady
  1234. // to ask for the drive status.
  1235. NDT_DISC_CHANGE,
  1236. NDT_IN_USE_CHANGE // the in-use status of the drive has been changed
  1237. } NERO_DRIVESTATUS_TYPE;
  1238. /* NeroAPI >= 6.0.0.0:
  1239. // Register a callback which is called whenever the specified status
  1240. // of a drive is changed.
  1241. //
  1242. // Please see documentation of NERO_DRIVE_STATUS_TYPE for restrictions of the
  1243. // notifications.
  1244. //
  1245. //
  1246. // Parameters:
  1247. // status: the status the application is interested in
  1248. // pDeviceInfo: the drive for which the status change should be notified.
  1249. // The pointer can be freed afterwards.
  1250. // callback: the callback to be called if the status changed.
  1251. // Note: The callback need to be thread safe, since it might be called from a different thread
  1252. // pUserData: data passed to the callback
  1253. //
  1254. // returns 0 on success
  1255. */
  1256. NEROAPI_API int NADLL_ATTR NeroRegisterDriveStatusCallback(NERO_DRIVESTATUS_TYPE status
  1257. , const NERO_SCSI_DEVICE_INFO *pDeviceInfo
  1258. , NERO_DRIVESTATUS_CALLBACK callback
  1259. , void *pUserData);
  1260. /* NeroAPI >= 6.0.0.0:
  1261. // Unregister a callback
  1262. //
  1263. // Parameters:
  1264. // status: the status for which the callback has been registered
  1265. // pDeviceInfo: the drive for which the status was notified
  1266. // The pointer does not need to be the same as in
  1267. // NeroRegisterDrivestatusCallback, but has to represent
  1268. // the same drive.
  1269. // callback: the callback to be called if the status changed.
  1270. // pUserData: data passed to the callback
  1271. //
  1272. // returns 0 on success
  1273. */
  1274. NEROAPI_API int NADLL_ATTR NeroUnregisterDriveStatusCallback(NERO_DRIVESTATUS_TYPE status // the status the application is interested in
  1275. , const NERO_SCSI_DEVICE_INFO *pDeviceInfo // the drive for which the status should be acknowledged
  1276. , NERO_DRIVESTATUS_CALLBACK callback // the callback to be called if the status changed
  1277. , void *pUserData); // data passed to the callback
  1278. /*
  1279. // NeroAPI >= 6.0.0.0:
  1280. // Register a callback which is called whenever a drive was removed or added in the system
  1281. // Use NeroGetAvailableDrivesEx to get the current list of drives in the system.
  1282. //
  1283. // NOTE: In some rare cases NeroAPI does not get this information from the OS and will therefore
  1284. // never notify the callback if a drive has been added/removed.
  1285. //
  1286. // Parameters:
  1287. // callback: the callback to be called when a drive is removed or added
  1288. // Note: The callback need to be thread safe, since it might be called from a different thread
  1289. // pUserData: data passed to the callback
  1290. //
  1291. // returns 0 on success
  1292. */
  1293. NEROAPI_API int NADLL_ATTR NeroRegisterDriveChangeCallback( NERO_DRIVESTATUS_CALLBACK callback
  1294. , void *pUserData);
  1295. /*
  1296. // NeroAPI >= 6.0.0.0:
  1297. // Unregister a callback which was registered with NeroRegisterDriveChangeCallback
  1298. //
  1299. // Parameters:
  1300. // callback: the callback to be called when a drive is removed or added
  1301. // pUserData: data passed to the callback
  1302. //
  1303. // returns 0 on success
  1304. */
  1305. NEROAPI_API int NADLL_ATTR NeroUnregisterDriveChangeCallback(NERO_DRIVESTATUS_CALLBACK callback
  1306. , void *pUserData);
  1307. // NeroAPI > 5.5.9.8: AUDIO SUPPORT
  1308. // NERO_CONFIG_RESULT
  1309. typedef enum
  1310. {
  1311. NCR_CANNOT_CONFIGURE,
  1312. NCR_CHANGED,
  1313. NCR_NOT_CHANGED
  1314. } NERO_CONFIG_RESULT;
  1315. ////////////////////////////////////////////////////// NERO_AUDIO_FORMAT_INFO //
  1316. typedef struct tagNERO_AUDIO_FORMAT_INFO
  1317. {
  1318. // Data
  1319. // smth. like "RIFF PCM WAV format"
  1320. char nafiDescription[256],
  1321. // smth. like "wav,wave,riff"
  1322. nafiExtList[256];
  1323. BOOL nafiTgt, // Contains TRUE if this is a target plugin
  1324. nafiConfigurable; // ConfigureItem will fail on items of
  1325. // this type if this member == false
  1326. }
  1327. NERO_AUDIO_FORMAT_INFO;
  1328. //////////////////////////////////////////////////////////// Helper functions //
  1329. NEROAPI_API NERO_AUDIO_ITEM_HANDLE NeroAudioCreateTargetItem(int iFormatNumber);
  1330. NEROAPI_API BOOL NeroAudioCloseItem(NERO_AUDIO_ITEM_HANDLE hItem);
  1331. // Insead of hItem a value of NULL can be passed to configure the
  1332. // whole plugin manager.
  1333. NEROAPI_API NERO_CONFIG_RESULT NeroAudioGUIConfigureItem \
  1334. (NERO_AUDIO_ITEM_HANDLE *phItem, int iNum);
  1335. // As soon as it returns false, it means that there are no more formats.
  1336. NEROAPI_API BOOL NeroAudioGetFormatInfo \
  1337. (int iNum, NERO_AUDIO_FORMAT_INFO *pFI);
  1338. //
  1339. // Deprecated functions. Present for compatibility with previous versions
  1340. //
  1341. NEROAPI_API DWORD NADLL_ATTR NeroGetAPIVersion(void); /* Returns 1000 for 1.0.0.0 */
  1342. NEROAPI_API BOOL NADLL_ATTR NeroSetExpectedAPIVersion(DWORD);
  1343. NEROAPI_API NERO_ISO_ITEM *NeroImportIsoTrackEx(NERO_DEVICEHANDLE pRecorder,
  1344. DWORD trackNumber,
  1345. void **ppCDStamp,
  1346. DWORD flags);
  1347. NEROAPI_API int NADLL_ATTR NeroEraseCDRW(NERO_DEVICEHANDLE aDeviceHandle,NEROAPI_CDRW_ERASE_MODE mode); // Erase the loaded CD
  1348. // NeroAPI>=5.5.9.4: Use the nstUserDialog callback functions to request a CD
  1349. // Returns FALSE if the burn process should be aborted
  1350. NEROAPI_API BOOL NADLL_ATTR NeroWaitForMedia(NERO_DEVICEHANDLE aDeviceHandle
  1351. ,NERO_MEDIA_SET nms // media types requested
  1352. ,DWORD dwFlags // Set of NBF_ flags
  1353. ,void *pCDStamp); // Optional stamp of requested media
  1354. #ifdef __cplusplus
  1355. }
  1356. #endif
  1357. #if defined(__BORLANDC__)
  1358. #pragma pack(pop)
  1359. #pragma option pop
  1360. #endif
  1361. #endif // _NEROAPI_
  1362. //======================================================
  1363. // NeroApi.h
  1364. //======================================================