RoboDriver.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 / NeroRobo
  10. |*
  11. |* PROGRAM: RoboDriver.h
  12. |*
  13. |* PURPOSE: Interface of robot driver
  14. ******************************************************************************/
  15. /* This file describes the interface each Nero Robo driver has to implement
  16. * to be accessible from Nero */
  17. #ifndef ROBODRIVER_H
  18. #define ROBODRIVER_H
  19. #include "GeneralPluginDLL.h"
  20. /* Compatibility mode interfaces.
  21. * We try to keep backwards compatibility. So this is the layout of the old Version 1
  22. * Robo Interface available since Nero 5.5.4.0 */
  23. class CNeroRoboDriverV1
  24. {
  25. public:
  26. virtual BOOL InitBurn() { return TRUE; };
  27. virtual BOOL PreBurn() { return TRUE; };
  28. virtual BOOL InsertCD() = 0;
  29. virtual BOOL RemoveNonWriteableCD() = 0;
  30. virtual BOOL RemoveUntouchedCD() = 0;
  31. virtual BOOL PostBurnOK() { return TRUE; };
  32. virtual BOOL PostBurnFAILURE() { return TRUE; };
  33. virtual BOOL ExitBurn() { return TRUE; };
  34. virtual ~CNeroRoboDriverV1() {};
  35. };
  36. /* Wait 60 secs. for the drive to get ready in DlgWaitCD.
  37. * If the drive hasn't managed to read the disc during that time,
  38. * ask the user to insert a CD or abort instead */
  39. #define ROBODRIVER_INSERTDISCTIMEOUT 60000
  40. /* Current driver version used for compatibility. Change this version only if the robo driver
  41. * interface has changed. Herefore a proxy has to be adapted to this new version number. */
  42. #define ROBODRIVER_CURRENTVERSION 5
  43. #define ROBODRIVER_PLUGINTYPE "NeroCDRobo"
  44. #define NEROROBODRIVER_API NERO_PLUGIN_API
  45. class IRoboCommNode;
  46. class IUserDialogFactory;
  47. class CNeroRoboFirmwareCheck;
  48. class CSerial;
  49. /* Since Nero 5.5.4.1 */
  50. class CNeroRoboDriverV2
  51. :public CNeroRoboDriverV1 // we just extend the old interface
  52. {
  53. public:
  54. /* The following methods define entry points for the different hook-ups
  55. * within the Nero Burn process. A Nero Robo driver will implement
  56. * whichever methods it may need to perform it's tasks. All other
  57. * methods may remain unimplemented with the exception
  58. * of InsertCD() and RemoveNonWriteableCD()
  59. * --> All those methods shall return a boolean TRUE if
  60. * all desired actions could be performed successfully
  61. * and FALSE otherwise.
  62. * Note that the recording process will stop if FALSE is returned
  63. * and PostBurn()/ExitBurn() will be called unless the error
  64. * occurred in one of those methods
  65. */
  66. /* This method is called just after loading the robo driver DLL.
  67. * Usually, a driver will want to perform it's reset function
  68. * or similar jobs at this point.
  69. * Note that this method is only called once during the whole
  70. * recording job, even if more than one copy is requested */
  71. virtual BOOL InitBurn() { return TRUE; };
  72. /* This method is called for every recording cycle right before it will
  73. * start. This is the place where your driver should call the PrintLabel()
  74. * method in case the label needs to be printed prior to burning */
  75. virtual BOOL PreBurn() { return TRUE; };
  76. /* This method is called if Nero needs a CD to write to.
  77. * The driver should ensure that there's a disc in the tray of the
  78. * recorder when this method returns. Otherwise, it must return FALSE.
  79. * Note that the state of the recorder tray at the time this method is called
  80. * is undefined so prior to actually trying to insert a CD, the driver will have
  81. * to explicitly open the tray with IRoboCommNode::MoveRecorderTray(TRUE).
  82. * The essential point about all this fuzz is that this way the robo driver can decide
  83. * when the tray will be opened which is very useful if some job needs to be done with
  84. * a medium prior to inserting it into the drive (e.g. printing) */
  85. virtual BOOL InsertCD() = 0;
  86. /* This method will be called if Nero encounters a CD it cannot write to.
  87. * It is the responsibility of the Robo driver to remove the inapt medium in this case.
  88. * The tray is open when this method is called */
  89. virtual BOOL RemoveNonWriteableCD() = 0;
  90. /* This method will be called if Nero decides not to use a CD after all but it's already
  91. * been inserted into the drive. This gives the Robo a chance to put the CD back into
  92. * the input tray or wherever it may decide to put it (may as well be the waste bin of course) */
  93. virtual BOOL RemoveUntouchedCD() = 0;
  94. /* Called when Nero is done burning a CD.
  95. * PostBurnOK() will be called if the recording process was successful.
  96. * PostBurnFAILURE() will be called if the recording process failed for some reason.
  97. * The driver should take this into account when deciding where to put the resulting
  98. * disc (e.g. if the recording process wasn't successful, the driver might want to put the cd into
  99. * a trash bin and into some output bin otherwise).
  100. * The recorder's tray is open when this method is called */
  101. virtual BOOL PostBurnOK() { return TRUE; };
  102. virtual BOOL PostBurnFAILURE() { return TRUE; };
  103. /* This method is called to conclude the recording process.
  104. * It is called only once for a recording job, even if this job
  105. * made more than one copies.
  106. * This hook can be used to clean up any structures specific to the
  107. * current recording process. The recorder tray is closed when this method is called */
  108. virtual BOOL ExitBurn() { return TRUE; };
  109. /* Perform any cleanup jobs that may be necessary after the robo has been left in an undefined
  110. * state (remove any remaining media from the printer tray etc.) */
  111. virtual BOOL CleanUp() { return TRUE; };
  112. virtual ~CNeroRoboDriverV2() {};
  113. };
  114. /* Since Nero 5.5.9.4 */
  115. class CNeroRoboDriver
  116. :public CNeroRoboDriverV2
  117. {
  118. public:
  119. /* Explicit tell robo to start printing a label. In this way we are able to print with delay.
  120. * This method will be explicit called after each successfull burning. The driver can ignore
  121. * this call if printing was already done in PostBurnOK method or the label was printed before
  122. * burning. The difference is, if we call this method InsertCD() was already called for new
  123. * copy, so there should be disc in printer and recorder yet. */
  124. virtual BOOL StartPrintLabel() { return TRUE; };
  125. /* A simple robo test. The driver may move the disc through all robot positions (e.g. sequence:
  126. * input bin, recorder, printer, output bin) to test proper configuration. */
  127. virtual BOOL StartRoboTest() { return TRUE; };
  128. virtual ~CNeroRoboDriver() {};
  129. };
  130. typedef const char *(*nerorobodriver_getidentifier_ptr)();
  131. /* Create a Nero Robo Driver object and connect it to the passed IRoboCommNode communication node.
  132. * The node is only borrowed to the Robo Driver and despite it's being reserved for the exclusive use
  133. * through the Robo Driver it is still owned by the caller of this DLL entry point and may not be deleted.
  134. * that methods are obsolete and replaced by methods below, but for compatibility to older Nero versions
  135. * the driver should implement these methods too.*/
  136. typedef CNeroRoboDriver*(*nerorobodriver_createdriver_ptr)(IRoboCommNode*);
  137. NEROROBODRIVER_API CNeroRoboDriver *nerorobodriver_createdriver(IRoboCommNode *pCommNode);
  138. /* Obsolete configure driver interface. Older Nero versions are still using it. */
  139. typedef void (*nerorobodriver_configuredriver_ptr)(IUserDialogFactory *pDialogFactory);
  140. NEROROBODRIVER_API void nerorobodriver_configuredriver(IUserDialogFactory *pDialogFactory);
  141. /* Since Nero 5.5.9.8 */
  142. /* If we have the possibility to assign the recorder location to its unique name, we can tell robot driver which
  143. * recorder it's serving. If there are not multiple recorders on the system with the same name, we pass a valid,
  144. * unique recorder name to this method. Else the recorder name string will be EMPTY. */
  145. typedef CNeroRoboDriver*(*nerorobodriverV2_createdriver_ptr)(IRoboCommNode *pCommNode, const char *cpRecorderName);
  146. NEROROBODRIVER_API CNeroRoboDriver *nerorobodriverV2_createdriver(IRoboCommNode *pCommNode, const char *cpRecorderName);
  147. /* In the same way the driver can configure robot depending on the passed unique recorder name it should serve.
  148. * Recoder name string is valid only for unique recorder names. */
  149. typedef void (*nerorobodriverV2_configuredriver_ptr)(IUserDialogFactory *pDialogFactory, const char *cpRecorderName);
  150. NEROROBODRIVER_API void nerorobodriverV2_configuredriver(IUserDialogFactory *pDialogFactory, const char *cpRecorderName);
  151. /* Check current robo firmware. Is used by Nero for automatic robo recognition. */
  152. typedef CNeroRoboFirmwareCheck*(*nerorobodriver_firmwarecheck_ptr)(CSerial *pInterface);
  153. NEROROBODRIVER_API CNeroRoboFirmwareCheck *nerorobodriver_firmwarecheck(CSerial *pInterface);
  154. #endif // ROBODRIVER_H