NeroUserDialog.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  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: NeroUserDialog.h
  12. |*
  13. |* PURPOSE: Ask how to proceed by offering the user some choices
  14. ******************************************************************************/
  15. #ifndef __NEROUSERDIALOG__
  16. #define __NEROUSERDIALOG__
  17. #if defined(__BORLANDC__)
  18. // NEROAPI expects structs to be 8byte aligned
  19. #pragma pack(push, 8)
  20. // tell Borland C++ Builder to treat enums as int
  21. #pragma option push -b
  22. #endif
  23. // Take care to use 2^n as values for constants:
  24. #define AUP_NO_PROBLEM 0 // No problems found
  25. #define AUP_FIRST_TR_PAUSE 1 // First track must have 2-3 secs pause!
  26. #define AUP_PAUSE_SETTINGS 2 // Problem with audio pause settings (tracks > 1)
  27. #define AUP_INDEX_SETTINGS 4 // Problem with audio index settings
  28. #define AUP_ISRC_SETTINGS 8 // Problem with ISRC settings
  29. #define AUP_COPYPROT_SETTINGS 16 // Problem with copyright settings
  30. #define AUP_NOTRACK_FOUND 32 // Problem because we don´t have any track
  31. #define AUP_MEGA_FATAL 0xFFFFFFFF // Megafatal internal problem that can´t be fixed!
  32. typedef enum NeroUserDlgInOutEnum {
  33. /* return codes for DLG_MESSAGEBOX: */
  34. DLG_RETURN_OK = -8, /* NeroAPI >= 6.0.0.6: ok */
  35. DLG_RETURN_YES = -7, /* NeroAPI >= 6.0.0.6: yes */
  36. DLG_RETURN_RETRY = -6, /* NeroAPI >= 6.0.0.6: retry */
  37. DLG_RETURN_IGNORE = -5, /* NeroAPI >= 6.0.0.6: ignore */
  38. DLG_RETURN_NO = -4, /* NeroAPI >= 6.0.0.6: no */
  39. DLG_RETURN_CANCEL = -3, /* NeroAPI >= 6.0.0.6: cancel */
  40. DLG_RETURN_ABORT = -2, /* NeroAPI >= 6.0.0.6: abort */
  41. /* NeroAPI >= 6.0.0.6:
  42. * return this if an enum is not handled by the callback
  43. */
  44. DLG_RETURN_NOT_HANDLED = -1,
  45. /* return codes for other dialogs */
  46. DLG_RETURN_EXIT = 0, /* Exit application / stop writing */
  47. DLG_RETURN_FALSE = 0, /* false */
  48. DLG_RETURN_TRUE = 1, /* true */
  49. /*
  50. "Disconnect is turned off in the system configuration.
  51. This may cause serious problems while burning: your CD might
  52. be damaged, or the system might hang up."
  53. */
  54. DLG_DISCONNECT = 2,
  55. DLG_RETURN_ON_RESTART = 3, /* turn on disconnect and restart windows */
  56. DLG_RETURN_RESTART = 4, /* Don't change disconnect option and restart windows */
  57. DLG_RETURN_CONTINUE = 5, /* Continue at your own risk */
  58. /* DLG_RETURN_EXIT */
  59. /* same as DLG_DISCONNECT, but restarting has been selected
  60. already and must not be canceled, so valid return codes
  61. are only DLG_RETURN_ON_RESTART and DLG_RETURN_RESTART */
  62. DLG_DISCONNECT_RESTART = 6,
  63. /*
  64. "Auto Insert Notification is turned on in the system configuration.
  65. This may cause serious problems while burning: your CD might be damaged,
  66. or the system might hang up.
  67. Nero is able to burn CDs with Auto Insert Notification turned on if all
  68. necessary drivers are installed."
  69. */
  70. DLG_AUTO_INSERT = 7,
  71. DLG_RETURN_INSTALL_DRIVER = 8, /* Install IO driver which temporarily disables auto insert. */
  72. /* Note: this only works if the additional argument for the callback is not NULL,
  73. otherwise it should not be offered to the user. */
  74. DLG_RETURN_OFF_RESTART = 9, /* Change autoinsert and restart Windows */
  75. /*
  76. as above:
  77. DLG_RETURN_EXIT,
  78. DLG_RETURN_CONTINUE,
  79. */
  80. /*
  81. "Please restart Windows now."
  82. */
  83. DLG_RESTART = 10,
  84. /* return code irrelevant */
  85. /*
  86. "Auto Insert Notification is now OFF. You should restart Windows."
  87. (displayed after rebooting within program failed and user has to do it manually)
  88. */
  89. DLG_AUTO_INSERT_RESTART = 11,
  90. /* return code irrelevant */
  91. /*
  92. "Nero detected some modifications of your PC system configuration
  93. and needs to modify some settings. Please restart your PC to make
  94. the changes become effective."
  95. */
  96. DLG_SETTINGS_RESTART = 12,
  97. /*
  98. DLG_RETURN_RESTART,
  99. DLG_RETURN_CONTINUE,
  100. */
  101. /*
  102. "Sorry, this compilation contains too much data to fit on the CD"
  103. with respect to the normal CD capacity. Do you want to try
  104. overburn writing at your own risk (this might cause read
  105. errors at the end of the CD or might even damage your recorder)?"
  106. "Note: It is also possible, that SCSI/Atapi errors occur at the end
  107. of the simulation or burning. Even in this case there is a certain
  108. chance, that the CD is readable."
  109. NeroAPI >= 6.0.0.27: the data parameter is a pointer to struct DLG_OVERBURN_INFO
  110. defined below.
  111. */
  112. DLG_OVERBURN = 13,
  113. /*
  114. DLG_RETURN_TRUE/FALSE
  115. */
  116. /*
  117. The tracks cannot be written as requested. A detailed
  118. description of the problem is found in the "data" parameter.
  119. It is a DWORD of with bits set according to the AUP constants above
  120. */
  121. DLG_AUDIO_PROBLEMS = 14,
  122. /*
  123. DLG_RETURN_TRUE = fix the problems by adapting the track settings
  124. DLG_RETURN_FALSE = stop writing
  125. */
  126. /*
  127. This dialog type differs slightly from the other ones:
  128. it should pop up a message and return immediately while still showing
  129. the message, so that the API can test for the expected CD in the meantime.
  130. During this time, the NERO_IDLE_CALLBACK will be called to give the
  131. application a chance to update its display and to test for user abort.
  132. The API might call call DLG_WAITCD several times to change the text.
  133. The text depends on the "data" argument that is passed to the
  134. NERO_USER_DIALOG callback. It is the enumeration NERO_WAITCD_TYPE
  135. specified below.
  136. */
  137. DLG_WAITCD = 15,
  138. /*
  139. It is time to remind the user of inserting the CD: play a jingle, flash the screen, etc.
  140. Called only once after a certain amount of time of no CD being inserted.
  141. */
  142. DLG_WAITCD_REMINDER = 16,
  143. /*
  144. Close the message box again, we are done.
  145. */
  146. DLG_WAITCD_DONE = 17,
  147. /*
  148. Tell the user that there will be quality loss during the copy and ask if he wants
  149. to continue anyway
  150. */
  151. DLG_COPY_QUALITY_LOSS = 18,
  152. /*
  153. PROCEED AT YOUR OWN RISK message
  154. */
  155. DLG_COPY_FULLRISK = 19,
  156. /*
  157. Ask the user the path of the file which will be generated by the Image Recorder.
  158. The "data" argument points on a MAX_PATH or PATH_MAX (depending on your OS) bytes buffer that has to be filled with the image path
  159. Returning DLG_RETURN_EXIT will stop the burn process
  160. */
  161. DLG_FILESEL_IMAGE = 20,
  162. /*
  163. Tell that there is not enough space on disk to produce this image
  164. */
  165. DLG_BURNIMAGE_CANCEL = 21,
  166. /*
  167. Tell the user that the CDRW is not empty
  168. Starting from NeroAPI 5.5.3.0, the "data" argument contains the device handle from the recorder
  169. Will be called only if the NBF_DETECT_NON_EMPTY_CDRW flags is given to the NeroBurn function
  170. Returning DLG_RETURN_EXIT will stop the burn process
  171. Returning DLG_RETURN_CONTINUE will continue the burn process
  172. Returning DLG_RETURN_RESTART will ask the user for an other CD
  173. */
  174. DLG_NON_EMPTY_CDRW = 22,
  175. /*
  176. NeroAPI 5.5.3.2: tell the user that the compilation cannot be written on that particular
  177. recorder and that the user shoud modify his compilation settings or burn the CD on
  178. another recorder, that supports the required medium type
  179. */
  180. DLG_COMP_REC_CONFLICT = 23,
  181. /*
  182. NeroAPI 5.5.3.2: another type of medium must be used to burn this compilation
  183. */
  184. DLG_WRONG_MEDIUM = 24,
  185. /* Implementation of the DLG_ROBO_MOVECD dialog types must behave
  186. * like the DLG_WAITCD type, that is, operate in a non-blocking way.
  187. * The data structure passed to this callback is specified as
  188. * ROBOMOVEMESSAGE below */
  189. DLG_ROBO_MOVECD = 25,
  190. /* Destroy a MoveCD dialog. (void*)data cast to an int will contain the
  191. * id of the MoveCD dialog to be removed */
  192. DLG_ROBO_MOVECD_DONE = 26,
  193. /* Show dialog message transmitted by the Robo driver.
  194. * Must return one of the constants below.
  195. * The data structure passed as the data pointer is specified as
  196. * ROBOUSERMESSAGE below.
  197. * Return DLG_RETURN_FALSE or DLG_RETURN_TRUE here */
  198. DLG_ROBO_USERMESSAGE = 27,
  199. /* Provide informations about which media is expected and which media is
  200. * currently present in the recorder.
  201. The data pointer passed is a pointer on the NERO_DLG_WAITCD_MEDIA_INFO structure
  202. declared in NeroAPI.h.
  203. The value returned is ignored*/
  204. DLG_WAITCD_MEDIA_INFO = 28,
  205. /* NeroAPI >= 6.0.0.6:
  206. * Open a custom messagebox dialog. The type and the message of the dialog are described
  207. * with a struct NERODLG_MESSAGEBOX which is given as data pointer.
  208. * See comments for NERODLG_MESSAGE_TYPE which values to return.
  209. */
  210. DLG_MESSAGEBOX = 29,
  211. /* NeroAPI >= 6.3.1.9:
  212. * "There is not enough free space in the temporary directory.
  213. * Please choose another one."
  214. * The data parameter is a pointer to struct DLG_TEMPSPACE_INFO defined below.
  215. */
  216. DLG_TEMPSPACE = 30,
  217. DLG_MAX
  218. } NeroUserDlgInOut;
  219. /* NeroAPI >= 6.0.0.6 */
  220. typedef enum
  221. {
  222. NDIT_INFO = 0, /* an info icon */
  223. NDIT_WARNING = 1, /* a warning icon */
  224. NDIT_ERROR = 2, /* an error icon */
  225. NDIT_QUESTION =3 /* a question icon */
  226. } NERODLG_ICON_TYPE;
  227. /* NeroAPI >= 6.0.0.6 */
  228. typedef enum
  229. {
  230. /* An info dialog with only an OK button. The return value is ignored.
  231. */
  232. NDMT_OK = 0,
  233. /* A dialog with a yes and a no button. Return DLG_RETURN_YES for Yes
  234. * and DLG_RETURN_NO for No.
  235. */
  236. NDMT_YESNO = 1,
  237. /* A dialog with a ok and a cancel button. Return DLG_RETURN_OK for OK
  238. * and DLG_RETURN_CANCEL for Cancel.
  239. */
  240. NDMT_OKCANCEL = 2,
  241. /* A dialog with a retry and a cancel button. Return DLG_RETURN_RETRY
  242. * for Retry and DLG_RETURN_CANCEL for Cancel.
  243. */
  244. NDMT_RETRYCANCEL = 3,
  245. /* A dialog with a abort, a retry and a ignore button.
  246. * Return DLG_RETURN_IGNORE for Ignore, DLG_RETURN_RETRY for Retry
  247. * and DLG_RETURN_ABORT for Abort.
  248. */
  249. NDMT_ABORTRETRYIGNORE = 4,
  250. /* A dialog with a yes, a no and a cancel button.
  251. * Return DLG_RETURN_YES for Yes, DLG_RETURN_NO for No
  252. * and DLG_RETURN_CANCEL for Cancel.
  253. */
  254. NDMT_YESNOCANCEL = 5
  255. } NERODLG_MESSAGE_TYPE;
  256. /* NeroAPI >= 6.0.0.6 */
  257. typedef struct
  258. {
  259. NERODLG_MESSAGE_TYPE type; /* the type of the message, see DLG_MESSAGE_TYPE */
  260. NERODLG_ICON_TYPE icon; /* the icon for the message, see DLG_ICON_TYPE */
  261. NeroUserDlgInOut defaultReturn; /* the default return value */
  262. const char* message; /* the message to display */
  263. } NERODLG_MESSAGEBOX;
  264. typedef enum
  265. {
  266. RUMT_ERROR,
  267. RUMT_WARNING,
  268. RUMT_QUESTION,
  269. RUMT_HINT
  270. } ROBOUSERMESSAGETYPE;
  271. typedef struct
  272. {
  273. ROBOUSERMESSAGETYPE message_type; // The type of message, see constants above */
  274. const char *message;
  275. } ROBOUSERMESSAGE;
  276. typedef enum
  277. {
  278. RMN_INPUT,
  279. RMN_RECORDER,
  280. RMN_OUTPUT,
  281. RMN_PRINTER,
  282. RMN_WASTEBIN
  283. } ROBOMOVENODE;
  284. typedef struct
  285. {
  286. int id; /* In future versions, we may have more than one Robo moving
  287. * at a time. So this ID identifies the movement action
  288. * and will be used to remove it with DLG_ROBO_MOVECD_DONE */
  289. ROBOMOVENODE source;
  290. ROBOMOVENODE destination;
  291. } ROBOMOVEMESSAGE;
  292. /* NeroAPI >= 6.0.0.27: Additional information when DLG_OVERBURN is called */
  293. typedef struct
  294. {
  295. DWORD dwTotalBlocksOnCD; /* total blocks to be written to disc */
  296. DWORD dwTotalCapacity; /* free capacity on disc in blocks */
  297. DWORD reserved[32]; /* reserved for future usage */
  298. } DLG_OVERBURN_INFO;
  299. typedef struct
  300. {
  301. const char* pCurrentDir;
  302. __int64 i64FreeSpace; /* free space on the disc in bytes */
  303. __int64 i64SpaceNeeded; /* space needed in bytes */
  304. char* pNewTempDir; /* a buffer of size iNewTempDirLength where you can
  305. * copy the path to the new temporary directory */
  306. int iNewTempDirLength; /* The size of the pNewTempDirBuffer */
  307. DWORD reserved[32]; /* reserved for future usage */
  308. } DLG_TEMPSPACE_INFO;
  309. /*
  310. // This function gets a requester type and shall return a suitable response to it.
  311. // Depending on the "type", "data" might contain additional information.
  312. //
  313. // Argument passing is in standard C order (on the stack, right to left),
  314. // aka MS Visual++ __cdecl.
  315. */
  316. /* Define __cdecl for non-Microsoft compilers */
  317. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  318. #define __cdecl
  319. #endif
  320. #define NERO_CALLBACK_ATTR __cdecl
  321. typedef NeroUserDlgInOut (NERO_CALLBACK_ATTR *NERO_USER_DIALOG) (void *pUserData, NeroUserDlgInOut type, void *data);
  322. /*
  323. // see below for a description of the enumeration values
  324. */
  325. typedef enum
  326. {
  327. NERO_WAITCD_WRITE,
  328. NERO_WAITCD_SIMULATION,
  329. NERO_WAITCD_AUTOEJECTLOAD,
  330. NERO_WAITCD_REINSERT,
  331. NERO_WAITCD_NEXTCD,
  332. NERO_WAITCD_ORIGINAL,
  333. NERO_WAITCD_WRITEPROTECTED,
  334. NERO_WAITCD_NOTENOUGHSPACE,
  335. NERO_WAITCD_NEWORIGINAL,
  336. NERO_WAITCD_EMPTYCD,
  337. NERO_WAITCD_WRITE_EMPTY,
  338. NERO_WAITCD_SIMULATION_EMPTY,
  339. NERO_WAITCD_WRITEWAVE,
  340. NERO_WAITCD_MULTISESSION,
  341. NERO_WAITCD_MULTISESSION_SIM,
  342. NERO_WAITCD_MULTI_REINSERT,
  343. NERO_WAITCD_DISCINFOS_FAILED,
  344. NERO_WAITCD_MEDIUM_UNSUPPORTED,
  345. NERO_WAITCD_AUTOEJECTLOAD_VER,
  346. NERO_WAITCD_REINSERT_VER,
  347. NERO_WAITCD_NOFORMAT,
  348. NERO_WAITCD_WRONG_MEDIUM, // NeroAPI>=5.5.5.6
  349. NERO_WAITCD_WAITING, // NeroAPI>=5.5.10.26
  350. NERO_WAITCD_EMPTYCDRW, // NeroAPI>=6.0.0.20
  351. NERO_WAITCD_NOTENOUGHSPACERW, // NeroAPI>=6.0.0.20
  352. NERO_WAITCD_NOTENOUGHSPACE_80MIN,
  353. NERO_WAITCD_MAX
  354. } NERO_WAITCD_TYPE;
  355. #endif /* __NEROUSERDIALOG__ */
  356. #ifdef NERO_WAITCD_TEXTS /* define this in exactly one source file before including NeroUserDialog.h there. */
  357. #include <assert.h>
  358. #ifndef NERO_WAITCD_TEXTS_DEFINED
  359. #define NERO_WAITCD_TEXTS_DEFINED
  360. /* If NeroAPI>=5.5.9.10 is present, it is recommanded to use NeroGetLocalizedWaitCDTexts instead since it
  361. returns a localized string */
  362. static const char *NeroGetWaitCDTexts (NERO_WAITCD_TYPE type)
  363. {
  364. static struct
  365. {
  366. NERO_WAITCD_TYPE type;
  367. const char *text;
  368. } mapping[] =
  369. {
  370. { NERO_WAITCD_WRITE, "Please insert the disc to write to..." },
  371. { NERO_WAITCD_SIMULATION, "Please insert a disc to use during simulation...\n\n(Nothing will be written on the disc.)" },
  372. { NERO_WAITCD_AUTOEJECTLOAD,
  373. "Please do not remove the disc!\n\nYour recorder requires this eject between simulation and burning. The disc will be reloaded automatically before continuing with burning..." },
  374. { NERO_WAITCD_REINSERT, "Please do not remove the disc!\n\nYour recorder requires this eject between simulation and burning. Please reinsert the disc..." },
  375. { NERO_WAITCD_NEXTCD, "Please remove the disc and insert the next recordable disc to write to... " },
  376. { NERO_WAITCD_ORIGINAL, "Please insert the original disc." },
  377. { NERO_WAITCD_WRITEPROTECTED,
  378. "This disc is not writable.\n\nPlease insert a writable disc..." },
  379. { NERO_WAITCD_NOTENOUGHSPACE,
  380. "There is not enough space to burn this compilation onto this disc.\n\nPlease insert another disc that provides more space..." },
  381. { NERO_WAITCD_NEWORIGINAL, "The disc is blank, invalid\nor a multisession disc.\n\nPlease insert original disc ..." },
  382. { NERO_WAITCD_EMPTYCD, "The disc is not empty.\n\nPlease insert an empty disc." },
  383. { NERO_WAITCD_WRITE_EMPTY, "Please insert an empty disc to write to..." },
  384. { NERO_WAITCD_SIMULATION_EMPTY,
  385. "Please insert an empty disc to use during simulation...\n\n(Nothing will be written on the disc.)" },
  386. { NERO_WAITCD_WRITEWAVE, "The disc is blank.\n\nPlease insert original disc..." },
  387. { NERO_WAITCD_MULTISESSION, "Nero is checking for the disc, please wait ...\n\nTo burn this multisession compilation you need the disc, that contains the previous backup sessions. Please insert this disc if you haven't done it before." },
  388. { NERO_WAITCD_MULTISESSION_SIM,
  389. "To simulate this multisession compilation you need the disc, that contains the previous backup sessions. Please insert this disc. (Nothing will be written on disc)." },
  390. { NERO_WAITCD_MULTI_REINSERT,
  391. "Please do not remove the disc!\n\nYour recorder requires this eject between simulation and burning. Please reinsert the\n same Multisession disc..." },
  392. { NERO_WAITCD_DISCINFOS_FAILED,
  393. "Disc analysis failed. The error log\ncontains more information about the reason."},
  394. { NERO_WAITCD_MEDIUM_UNSUPPORTED,
  395. "The recorder does not support this type of media!\n\nPlease insert a correct disc to write to..."},
  396. { NERO_WAITCD_AUTOEJECTLOAD_VER, "Please do not remove the disc!\n\nYour recorder requires that the disc be ejected between burning and verification. The disc will be reloaded automatically when burning is to continue..." },
  397. { NERO_WAITCD_REINSERT_VER, "Please do not remove the disc!\n\nYour recorder requires that the disc be ejected between burning and verification. Please reinsert the disc...." },
  398. { NERO_WAITCD_NOFORMAT, "The disc is not formatted. Please insert a formatted disc." },
  399. { NERO_WAITCD_WRONG_MEDIUM, "Sorry, your compilation cannot be written on this kind of disc. Please insert a disc of the correct type or modify the settings of your compilation to make them compatible with the current disc." },
  400. { NERO_WAITCD_WAITING, "--- Accessing disc, please wait ---"},
  401. { NERO_WAITCD_EMPTYCDRW, "The disc is not empty." },
  402. { NERO_WAITCD_NOTENOUGHSPACERW, "There is not enough space to burn the compilation onto this disc."},
  403. { NERO_WAITCD_NOTENOUGHSPACE_80MIN, "There is not enough space to burn the compilation onto this disc.\n\nPlease insert a 80min/700MB media"},
  404. { NERO_WAITCD_MAX, "unknown NERO_WAITCD_TYPE" }
  405. };
  406. int i;
  407. /*
  408. * Please use NeroGetLocalizedWaitCDTexts instead of NeroGetWaitCDTexts.
  409. * NeroGetLocalizedWaitCDTexts gets the strings from the message file and therefore
  410. * always returns the correct string also if a new NERO_WAITCD_TYPE has been added
  411. * to NeroAPI.
  412. */
  413. assert(!"NeroGetWaitCDTexts is deprecated.");
  414. for (i = 0; mapping[i].type != type && mapping[i].type != NERO_WAITCD_MAX; i++)
  415. ;
  416. assert (mapping[i].type != NERO_WAITCD_MAX);
  417. return mapping[i].text;
  418. }
  419. #endif
  420. #if defined(__BORLANDC__)
  421. #pragma pack(pop)
  422. #pragma option pop
  423. #endif
  424. #endif