NeroUserDialog.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. /******************************************************************************
  2. |* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  3. |* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  4. |* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  5. |* PARTICULAR PURPOSE.
  6. |*
  7. |* Copyright 1995-2002 Ahead Software AG. All Rights Reserved.
  8. |*-----------------------------------------------------------------------------
  9. |* NeroSDK / NeroAPI
  10. |*
  11. |* PROGRAM: NeroUserDialog.h
  12. |*
  13. |* PURPOSE: Ask how to proceed by offering the user some choices
  14. ******************************************************************************/
  15. #ifndef __NEROUSERDIALOG__
  16. #define __NEROUSERDIALOG__
  17. // Take care to use 2^n as values for constants:
  18. #define AUP_NO_PROBLEM 0 // No problems found
  19. #define AUP_FIRST_TR_PAUSE 1 // First track must have 2-3 secs pause!
  20. #define AUP_PAUSE_SETTINGS 2 // Problem with audio pause settings (tracks > 1)
  21. #define AUP_INDEX_SETTINGS 4 // Problem with audio index settings
  22. #define AUP_ISRC_SETTINGS 8 // Problem with ISRC settings
  23. #define AUP_COPYPROT_SETTINGS 16 // Problem with copyright settings
  24. #define AUP_NOTRACK_FOUND 32 // Problem because we don´t have any track
  25. #define AUP_MEGA_FATAL 0xFFFFFFFF // Megafatal internal problem that can´t be fixed!
  26. typedef enum NeroUserDlgInOutEnum {
  27. /* default return codes: */
  28. DLG_RETURN_EXIT = 0, /* Exit application / stop writing */
  29. DLG_RETURN_FALSE = 0, /* false/no */
  30. DLG_RETURN_TRUE = 1, /* true/yes */
  31. /*
  32. "Disconnect is turned off in the system configuration.
  33. This may cause serious problems while burning: your CD might
  34. be damaged, or the system might hang up."
  35. */
  36. DLG_DISCONNECT,
  37. DLG_RETURN_ON_RESTART, /* turn on disconnect and restart windows */
  38. DLG_RETURN_RESTART, /* Don't change disconnect option and restart windows */
  39. DLG_RETURN_CONTINUE, /* Continue at your own risk */
  40. /* DLG_RETURN_EXIT */
  41. /* same as DLG_DISCONNECT, but restarting has been selected
  42. already and must not be canceled, so valid return codes
  43. are only DLG_RETURN_ON_RESTART and DLG_RETURN_RESTART */
  44. DLG_DISCONNECT_RESTART,
  45. /*
  46. "Auto Insert Notification is turned on in the system configuration.
  47. This may cause serious problems while burning: your CD might be damaged,
  48. or the system might hang up.
  49. Nero is able to burn CDs with Auto Insert Notification turned on if all
  50. necessary drivers are installed."
  51. */
  52. DLG_AUTO_INSERT,
  53. DLG_RETURN_INSTALL_DRIVER, /* Install IO driver which temporarily disables auto insert. */
  54. /* Note: this only works if the additional argument for the callback is not NULL,
  55. otherwise it should not be offered to the user. */
  56. DLG_RETURN_OFF_RESTART, /* Change autoinsert and restart Windows */
  57. /*
  58. as above:
  59. DLG_RETURN_EXIT,
  60. DLG_RETURN_CONTINUE,
  61. */
  62. /*
  63. "Please restart Windows now."
  64. */
  65. DLG_RESTART,
  66. /* return code irrelevant */
  67. /*
  68. "Auto Insert Notification is now OFF. You should restart Windows."
  69. (displayed after rebooting within program failed and user has to do it manually)
  70. */
  71. DLG_AUTO_INSERT_RESTART,
  72. /* return code irrelevant */
  73. /*
  74. "Nero detected some modifications of your PC system configuration
  75. and needs to modify some settings. Please restart your PC to make
  76. the changes become effective."
  77. */
  78. DLG_SETTINGS_RESTART,
  79. /*
  80. DLG_RETURN_RESTART,
  81. DLG_RETURN_CONTINUE,
  82. */
  83. /*
  84. "Sorry, this compilation contains too much data to fit on the CD"
  85. with respect to the normal CD capacity. Do you want to try
  86. overburn writing at your own risk (this might cause read
  87. errors at the end of the CD or might even damage your recorder)?"
  88. "Note: It is also possible, that SCSI/Atapi errors occur at the end
  89. of the simulation or burning. Even in this case there is a certain
  90. chance, that the CD is readable."
  91. */
  92. DLG_OVERBURN,
  93. /*
  94. DLG_RETURN_TRUE/FALSE
  95. */
  96. /*
  97. The tracks cannot be written as requested. A detailed
  98. description of the problem is found in the "data" parameter.
  99. It is a DWORD of with bits set according to the AUP constants above
  100. */
  101. DLG_AUDIO_PROBLEMS,
  102. /*
  103. DLG_RETURN_TRUE = fix the problems by adapting the track settings
  104. DLG_RETURN_FALSE = stop writing
  105. */
  106. /*
  107. This dialog type differs slightly from the other ones:
  108. it should pop up a message and return immediately while still showing
  109. the message, so that the API can test for the expected CD in the meantime.
  110. During this time, the NERO_IDLE_CALLBACK will be called to give the
  111. application a chance to update its display and to test for user abort.
  112. The API might call call DLG_WAITCD several times to change the text.
  113. The text depends on the "data" argument that is passed to the
  114. NERO_USER_DIALOG callback. It is the enumeration NERO_WAITCD_TYPE
  115. specified below.
  116. */
  117. DLG_WAITCD,
  118. /*
  119. It is time to remind the user of inserting the CD: play a jingle, flash the screen, etc.
  120. Called only once after a certain amount of time of no CD being inserted.
  121. */
  122. DLG_WAITCD_REMINDER,
  123. /*
  124. Close the message box again, we are done.
  125. */
  126. DLG_WAITCD_DONE,
  127. /*
  128. Tell the user that there will be quality loss during the copy and ask if he wants
  129. to continue anyway
  130. */
  131. DLG_COPY_QUALITY_LOSS,
  132. /*
  133. PROCEED AT YOUR OWN RISK message
  134. */
  135. DLG_COPY_FULLRISK,
  136. /*
  137. Ask the user the path of the file which will be generated by the Image Recorder.
  138. The "data" argument points on a 256 bytes buffer that has to be filled with the image path
  139. Returning DLG_RETURN_EXIT will stop the burn process
  140. */
  141. DLG_FILESEL_IMAGE,
  142. /*
  143. Tell that there is not enough space on disk to produce this image
  144. */
  145. DLG_BURNIMAGE_CANCEL,
  146. /*
  147. Tell the user that the CDRW is not empty
  148. Starting from NeroAPI 5.5.3.0, the "data" argument contains the device handle from the recorder
  149. Will be called only if the NBF_DETECT_EMPTY_CDRW flags is given to the NeroBurn function
  150. Returning DLG_RETURN_EXIT will stop the burn process
  151. Returning DLG_RETURN_CONTINUE will continue the burn process
  152. Returning DLG_RETURN_RESTART will ask the user for an other CD
  153. */
  154. DLG_NON_EMPTY_CDRW,
  155. /*
  156. NeroAPI 5.5.3.2: tell the user that the compilation cannot be written on that particular
  157. recorder and that the user shoud modify his compilation settings or burn the CD on
  158. another recorder, that supports the required medium type
  159. */
  160. DLG_COMP_REC_CONFLICT,
  161. /*
  162. NeroAPI 5.5.3.2: another type of medium must be used to burn this compilation
  163. */
  164. DLG_WRONG_MEDIUM,
  165. /* Implementation of the DLG_ROBO_MOVECD dialog types must behave
  166. * like the DLG_WAITCD type, that is, operate in a non-blocking way.
  167. * The data structure passed to this callback is specified as
  168. * ROBOMOVEMESSAGE below */
  169. DLG_ROBO_MOVECD,
  170. /* Destroy a MoveCD dialog. (void*)data cast to an int will contain the
  171. * id of the MoveCD dialog to be removed */
  172. DLG_ROBO_MOVECD_DONE,
  173. /* Show dialog message transmitted by the Robo driver.
  174. * Must return one of the constants below.
  175. * The data structure passed as the data pointer is specified as
  176. * ROBOUSERMESSAGE below.
  177. * Return DLG_RETURN_FALSE or DLG_RETURN_TRUE here */
  178. DLG_ROBO_USERMESSAGE,
  179. DLG_MAX
  180. } NeroUserDlgInOut;
  181. typedef enum
  182. {
  183. RUMT_ERROR,
  184. RUMT_WARNING,
  185. RUMT_QUESTION,
  186. RUMT_HINT
  187. } ROBOUSERMESSAGETYPE;
  188. typedef struct
  189. {
  190. ROBOUSERMESSAGETYPE message_type; // The type of message, see constants above */
  191. const char *message;
  192. } ROBOUSERMESSAGE;
  193. typedef enum
  194. {
  195. RMN_INPUT,
  196. RMN_RECORDER,
  197. RMN_OUTPUT,
  198. RMN_PRINTER,
  199. RMN_WASTEBIN
  200. } ROBOMOVENODE;
  201. typedef struct
  202. {
  203. int id; /* In future versions, we may have more than one Robo moving
  204. * at a time. So this ID identifies the movement action
  205. * and will be used to remove it with DLG_ROBO_MOVECD_DONE */
  206. ROBOMOVENODE source;
  207. ROBOMOVENODE destination;
  208. } ROBOMOVEMESSAGE;
  209. /*
  210. // This function gets a requester type and shall return a suitable response to it.
  211. // Depending on the "type", "data" might contain additional information.
  212. //
  213. // Argument passing is in standard C order (on the stack, right to left),
  214. // aka MS Visual++ __cdecl.
  215. */
  216. /* Define __cdecl for non-Microsoft compilers */
  217. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  218. #define __cdecl
  219. #endif
  220. #define NERO_CALLBACK_ATTR __cdecl
  221. typedef NeroUserDlgInOut (NERO_CALLBACK_ATTR *NERO_USER_DIALOG) (void *pUserData, NeroUserDlgInOut type, void *data);
  222. /*
  223. // see below for a description of the enumeration values
  224. */
  225. typedef enum
  226. {
  227. NERO_WAITCD_WRITE,
  228. NERO_WAITCD_SIMULATION,
  229. NERO_WAITCD_AUTOEJECTLOAD,
  230. NERO_WAITCD_REINSERT,
  231. NERO_WAITCD_NEXTCD,
  232. NERO_WAITCD_ORIGINAL,
  233. NERO_WAITCD_WRITEPROTECTED,
  234. NERO_WAITCD_NOTENOUGHSPACE,
  235. NERO_WAITCD_NEWORIGINAL,
  236. NERO_WAITCD_EMPTYCD,
  237. NERO_WAITCD_WRITE_EMPTY,
  238. NERO_WAITCD_SIMULATION_EMPTY,
  239. NERO_WAITCD_WRITEWAVE,
  240. NERO_WAITCD_MULTISESSION,
  241. NERO_WAITCD_MULTISESSION_SIM,
  242. NERO_WAITCD_MULTI_REINSERT,
  243. NERO_WAITCD_DISCINFOS_FAILED,
  244. NERO_WAITCD_MEDIUM_UNSUPPORTED,
  245. NERO_WAITCD_AUTOEJECTLOAD_VER,
  246. NERO_WAITCD_REINSERT_VER,
  247. NERO_WAITCD_NOFORMAT,
  248. NERO_WAITCD_WRONG_MEDIUM, // NeroAPI>=5.5.5.6
  249. NERO_WAITCD_MAX
  250. } NERO_WAITCD_TYPE;
  251. #endif /* __NEROUSERDIALOG__ */
  252. #ifdef NERO_WAITCD_TEXTS /* define this in exactly one source file before including NeroUserDialog.h there. */
  253. #include <assert.h>
  254. #ifndef NERO_WAITCD_TEXTS_DEFINED
  255. #define NERO_WAITCD_TEXTS_DEFINED
  256. static const char *NeroGetWaitCDTexts (NERO_WAITCD_TYPE type)
  257. {
  258. static struct
  259. {
  260. NERO_WAITCD_TYPE type;
  261. const char *text;
  262. } mapping[] =
  263. {
  264. { NERO_WAITCD_WRITE, "Please insert the CD to write to..." },
  265. { NERO_WAITCD_SIMULATION, "Please insert a CD to use during simulation...\n\n(Nothing will be written on the CD.)" },
  266. { NERO_WAITCD_AUTOEJECTLOAD,
  267. "Please do not remove the CD!\n\nYour recorder requires this eject between simulation and burning. The CD will be reloaded automatically before continuing with burning..." },
  268. { NERO_WAITCD_REINSERT, "Please do not remove the CD!\n\nYour recorder requires this eject between simulation and burning. Please reinsert the CD..." },
  269. { NERO_WAITCD_NEXTCD, "Please remove the CD and insert the next CD-Recordable to write to... " },
  270. { NERO_WAITCD_ORIGINAL, "Please insert the original CD." },
  271. { NERO_WAITCD_WRITEPROTECTED,
  272. "This CD is not writable.\n\nPlease insert a writable CD..." },
  273. { NERO_WAITCD_NOTENOUGHSPACE,
  274. "There is not enough space to burn this compilation onto this CD.\n\nPlease insert another CD that provides more space..." },
  275. { NERO_WAITCD_NEWORIGINAL, "The CD is blank, invalid\nor a multisession CD.\n\nPlease insert original CD ..." },
  276. { NERO_WAITCD_EMPTYCD, "The CD is not empty.\n\nPlease insert an empty CD." },
  277. { NERO_WAITCD_WRITE_EMPTY, "Please insert an empty CD to write to..." },
  278. { NERO_WAITCD_SIMULATION_EMPTY,
  279. "Please insert an empty CD to use during simulation...\n\n(Nothing will be written on the CD.)" },
  280. { NERO_WAITCD_WRITEWAVE, "The CD is blank.\n\nPlease insert original CD..." },
  281. { NERO_WAITCD_MULTISESSION, "Nero is checking for the CD, please wait ...\n\nTo burn this multisession compilation you need the CD, that contains the previous backup sessions. Please insert this CD if you haven't done it before." },
  282. { NERO_WAITCD_MULTISESSION_SIM,
  283. "To simulate this multisession compilation you need the CD, that contains the previous backup sessions. Please insert this CD. (Nothing will be written on CD)." },
  284. { NERO_WAITCD_MULTI_REINSERT,
  285. "Please do not remove the CD!\n\nYour recorder requires this eject between simulation and burning. Please reinsert the\n same Multisession CD..." },
  286. { NERO_WAITCD_DISCINFOS_FAILED,
  287. "Disc analysis failed. The error log\ncontains more information about the reason."},
  288. { NERO_WAITCD_MEDIUM_UNSUPPORTED,
  289. "The recorder does not support this type of media!\n\nPlease insert a correct CD to write to..."},
  290. { NERO_WAITCD_AUTOEJECTLOAD_VER, "Please do not remove the CD!\n\nYour recorder requires that the CD be ejected between burning and verification. The CD will be reloaded automatically when burning is to continue..." },
  291. { NERO_WAITCD_REINSERT_VER, "Please do not remove the CD!\n\nYour recorder requires that the CD be ejected between burning and verification. Please reinsert the CD...." },
  292. { NERO_WAITCD_NOFORMAT, "Medium is not formatted. Please insert a formatted medium." },
  293. { NERO_WAITCD_WRONG_MEDIUM, "Sorry, your compilation cannot be written on this kind of medium. Please insert a medium of the correct type or modify the settings of your compilation to make them compatible with the current medium." },
  294. { NERO_WAITCD_MAX, "unknown NERO_WAITCD_TYPE" }
  295. };
  296. int i;
  297. for (i = 0; mapping[i].type != type && mapping[i].type != NERO_WAITCD_MAX; i++)
  298. ;
  299. assert (mapping[i].type != NERO_WAITCD_MAX);
  300. return mapping[i].text;
  301. }
  302. #endif
  303. #endif