DeckLinkAPIDeckControl.idl 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /* -LICENSE-START-
  2. ** Copyright (c) 2021 Blackmagic Design
  3. **
  4. ** Permission is hereby granted, free of charge, to any person or organization
  5. ** obtaining a copy of the software and accompanying documentation covered by
  6. ** this license (the "Software") to use, reproduce, display, distribute,
  7. ** execute, and transmit the Software, and to prepare derivative works of the
  8. ** Software, and to permit third-parties to whom the Software is furnished to
  9. ** do so, all subject to the following:
  10. **
  11. ** The copyright notices in the Software and this entire statement, including
  12. ** the above license grant, this restriction and the following disclaimer,
  13. ** must be included in all copies of the Software, in whole or in part, and
  14. ** all derivative works of the Software, unless such copies or derivative
  15. ** works are solely in the form of machine-executable object code generated by
  16. ** a source language processor.
  17. **
  18. ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. ** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
  21. ** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
  22. ** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
  23. ** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  24. ** DEALINGS IN THE SOFTWARE.
  25. ** -LICENSE-END-
  26. */
  27. #ifndef BMD_CONST
  28. #if defined(_MSC_VER)
  29. #define BMD_CONST __declspec(selectany) static const
  30. #else
  31. #define BMD_CONST static const
  32. #endif
  33. #endif
  34. // Type Declarations
  35. // Enumeration Mapping
  36. cpp_quote("typedef unsigned int BMDDeckControlStatusFlags;")
  37. cpp_quote("typedef unsigned int BMDDeckControlExportModeOpsFlags;")
  38. cpp_quote("#if 0")
  39. typedef enum _BMDDeckControlStatusFlags BMDDeckControlStatusFlags;
  40. typedef enum _BMDDeckControlExportModeOpsFlags BMDDeckControlExportModeOpsFlags;
  41. cpp_quote("#endif")
  42. /* Enum BMDDeckControlMode - DeckControl mode */
  43. typedef [v1_enum] enum _BMDDeckControlMode {
  44. bmdDeckControlNotOpened = /* 'ntop' */ 0x6E746F70,
  45. bmdDeckControlVTRControlMode = /* 'vtrc' */ 0x76747263,
  46. bmdDeckControlExportMode = /* 'expm' */ 0x6578706D,
  47. bmdDeckControlCaptureMode = /* 'capm' */ 0x6361706D
  48. } BMDDeckControlMode;
  49. /* Enum BMDDeckControlEvent - DeckControl event */
  50. typedef [v1_enum] enum _BMDDeckControlEvent {
  51. bmdDeckControlAbortedEvent = /* 'abte' */ 0x61627465, // This event is triggered when a capture or edit-to-tape operation is aborted.
  52. /* Export-To-Tape events */
  53. bmdDeckControlPrepareForExportEvent = /* 'pfee' */ 0x70666565, // This event is triggered a few frames before reaching the in-point. IDeckLinkInput::StartScheduledPlayback should be called at this point.
  54. bmdDeckControlExportCompleteEvent = /* 'exce' */ 0x65786365, // This event is triggered a few frames after reaching the out-point. At this point, it is safe to stop playback. Upon reception of this event the deck's control mode is set back to bmdDeckControlVTRControlMode.
  55. /* Capture events */
  56. bmdDeckControlPrepareForCaptureEvent = /* 'pfce' */ 0x70666365, // This event is triggered a few frames before reaching the in-point. The serial timecode attached to IDeckLinkVideoInputFrames is now valid.
  57. bmdDeckControlCaptureCompleteEvent = /* 'ccev' */ 0x63636576 // This event is triggered a few frames after reaching the out-point. Upon reception of this event the deck's control mode is set back to bmdDeckControlVTRControlMode.
  58. } BMDDeckControlEvent;
  59. /* Enum BMDDeckControlVTRControlState - VTR Control state */
  60. typedef [v1_enum] enum _BMDDeckControlVTRControlState {
  61. bmdDeckControlNotInVTRControlMode = /* 'nvcm' */ 0x6E76636D,
  62. bmdDeckControlVTRControlPlaying = /* 'vtrp' */ 0x76747270,
  63. bmdDeckControlVTRControlRecording = /* 'vtrr' */ 0x76747272,
  64. bmdDeckControlVTRControlStill = /* 'vtra' */ 0x76747261,
  65. bmdDeckControlVTRControlShuttleForward = /* 'vtsf' */ 0x76747366,
  66. bmdDeckControlVTRControlShuttleReverse = /* 'vtsr' */ 0x76747372,
  67. bmdDeckControlVTRControlJogForward = /* 'vtjf' */ 0x76746A66,
  68. bmdDeckControlVTRControlJogReverse = /* 'vtjr' */ 0x76746A72,
  69. bmdDeckControlVTRControlStopped = /* 'vtro' */ 0x7674726F
  70. } BMDDeckControlVTRControlState;
  71. /* Enum BMDDeckControlStatusFlags - Deck Control status flags */
  72. [v1_enum] enum _BMDDeckControlStatusFlags {
  73. bmdDeckControlStatusDeckConnected = 1 << 0,
  74. bmdDeckControlStatusRemoteMode = 1 << 1,
  75. bmdDeckControlStatusRecordInhibited = 1 << 2,
  76. bmdDeckControlStatusCassetteOut = 1 << 3
  77. };
  78. /* Enum BMDDeckControlExportModeOpsFlags - Export mode flags */
  79. [v1_enum] enum _BMDDeckControlExportModeOpsFlags {
  80. bmdDeckControlExportModeInsertVideo = 1 << 0,
  81. bmdDeckControlExportModeInsertAudio1 = 1 << 1,
  82. bmdDeckControlExportModeInsertAudio2 = 1 << 2,
  83. bmdDeckControlExportModeInsertAudio3 = 1 << 3,
  84. bmdDeckControlExportModeInsertAudio4 = 1 << 4,
  85. bmdDeckControlExportModeInsertAudio5 = 1 << 5,
  86. bmdDeckControlExportModeInsertAudio6 = 1 << 6,
  87. bmdDeckControlExportModeInsertAudio7 = 1 << 7,
  88. bmdDeckControlExportModeInsertAudio8 = 1 << 8,
  89. bmdDeckControlExportModeInsertAudio9 = 1 << 9,
  90. bmdDeckControlExportModeInsertAudio10 = 1 << 10,
  91. bmdDeckControlExportModeInsertAudio11 = 1 << 11,
  92. bmdDeckControlExportModeInsertAudio12 = 1 << 12,
  93. bmdDeckControlExportModeInsertTimeCode = 1 << 13,
  94. bmdDeckControlExportModeInsertAssemble = 1 << 14,
  95. bmdDeckControlExportModeInsertPreview = 1 << 15,
  96. bmdDeckControlUseManualExport = 1 << 16
  97. };
  98. /* Enum BMDDeckControlError - Deck Control error */
  99. typedef [v1_enum] enum _BMDDeckControlError {
  100. bmdDeckControlNoError = /* 'noer' */ 0x6E6F6572,
  101. bmdDeckControlModeError = /* 'moer' */ 0x6D6F6572,
  102. bmdDeckControlMissedInPointError = /* 'mier' */ 0x6D696572,
  103. bmdDeckControlDeckTimeoutError = /* 'dter' */ 0x64746572,
  104. bmdDeckControlCommandFailedError = /* 'cfer' */ 0x63666572,
  105. bmdDeckControlDeviceAlreadyOpenedError = /* 'dalo' */ 0x64616C6F,
  106. bmdDeckControlFailedToOpenDeviceError = /* 'fder' */ 0x66646572,
  107. bmdDeckControlInLocalModeError = /* 'lmer' */ 0x6C6D6572,
  108. bmdDeckControlEndOfTapeError = /* 'eter' */ 0x65746572,
  109. bmdDeckControlUserAbortError = /* 'uaer' */ 0x75616572,
  110. bmdDeckControlNoTapeInDeckError = /* 'nter' */ 0x6E746572,
  111. bmdDeckControlNoVideoFromCardError = /* 'nvfc' */ 0x6E766663,
  112. bmdDeckControlNoCommunicationError = /* 'ncom' */ 0x6E636F6D,
  113. bmdDeckControlBufferTooSmallError = /* 'btsm' */ 0x6274736D,
  114. bmdDeckControlBadChecksumError = /* 'chks' */ 0x63686B73,
  115. bmdDeckControlUnknownError = /* 'uner' */ 0x756E6572
  116. } BMDDeckControlError;
  117. // Forward Declarations
  118. interface IDeckLinkDeckControlStatusCallback;
  119. interface IDeckLinkDeckControl;
  120. /* Interface IDeckLinkDeckControlStatusCallback - Deck control state change callback. */
  121. [
  122. object,
  123. uuid(53436FFB-B434-4906-BADC-AE3060FFE8EF),
  124. helpstring("Deck control state change callback.")
  125. ] interface IDeckLinkDeckControlStatusCallback : IUnknown
  126. {
  127. HRESULT TimecodeUpdate ([in] BMDTimecodeBCD currentTimecode);
  128. HRESULT VTRControlStateChanged ([in] BMDDeckControlVTRControlState newState, [in] BMDDeckControlError error);
  129. HRESULT DeckControlEventReceived ([in] BMDDeckControlEvent event, [in] BMDDeckControlError error);
  130. HRESULT DeckControlStatusChanged ([in] BMDDeckControlStatusFlags flags, [in] unsigned int mask);
  131. };
  132. /* Interface IDeckLinkDeckControl - Deck Control main interface */
  133. [
  134. object,
  135. uuid(8E1C3ACE-19C7-4E00-8B92-D80431D958BE),
  136. helpstring("Deck Control main interface")
  137. ] interface IDeckLinkDeckControl : IUnknown
  138. {
  139. HRESULT Open ([in] BMDTimeScale timeScale, [in] BMDTimeValue timeValue, [in] BOOL timecodeIsDropFrame, [out] BMDDeckControlError* error);
  140. HRESULT Close ([in] BOOL standbyOn);
  141. HRESULT GetCurrentState ([out] BMDDeckControlMode* mode, [out] BMDDeckControlVTRControlState* vtrControlState, [out] BMDDeckControlStatusFlags* flags);
  142. HRESULT SetStandby ([in] BOOL standbyOn);
  143. HRESULT SendCommand ([in] unsigned char* inBuffer, [in] unsigned int inBufferSize, [out] unsigned char* outBuffer, [out] unsigned int* outDataSize, [in] unsigned int outBufferSize, [out] BMDDeckControlError* error);
  144. HRESULT Play ([out] BMDDeckControlError* error);
  145. HRESULT Stop ([out] BMDDeckControlError* error);
  146. HRESULT TogglePlayStop ([out] BMDDeckControlError* error);
  147. HRESULT Eject ([out] BMDDeckControlError* error);
  148. HRESULT GoToTimecode ([in] BMDTimecodeBCD timecode, [out] BMDDeckControlError* error);
  149. HRESULT FastForward ([in] BOOL viewTape, [out] BMDDeckControlError* error);
  150. HRESULT Rewind ([in] BOOL viewTape, [out] BMDDeckControlError* error);
  151. HRESULT StepForward ([out] BMDDeckControlError* error);
  152. HRESULT StepBack ([out] BMDDeckControlError* error);
  153. HRESULT Jog ([in] double rate, [out] BMDDeckControlError* error);
  154. HRESULT Shuttle ([in] double rate, [out] BMDDeckControlError* error);
  155. HRESULT GetTimecodeString ([out] BSTR* currentTimeCode, [out] BMDDeckControlError* error);
  156. HRESULT GetTimecode ([out] IDeckLinkTimecode** currentTimecode, [out] BMDDeckControlError* error);
  157. HRESULT GetTimecodeBCD ([out] BMDTimecodeBCD* currentTimecode, [out] BMDDeckControlError* error);
  158. HRESULT SetPreroll ([in] unsigned int prerollSeconds);
  159. HRESULT GetPreroll ([out] unsigned int* prerollSeconds);
  160. HRESULT SetExportOffset ([in] int exportOffsetFields);
  161. HRESULT GetExportOffset ([out] int* exportOffsetFields);
  162. HRESULT GetManualExportOffset ([out] int* deckManualExportOffsetFields);
  163. HRESULT SetCaptureOffset ([in] int captureOffsetFields);
  164. HRESULT GetCaptureOffset ([out] int* captureOffsetFields);
  165. HRESULT StartExport ([in] BMDTimecodeBCD inTimecode, [in] BMDTimecodeBCD outTimecode, [in] BMDDeckControlExportModeOpsFlags exportModeOps, [out] BMDDeckControlError* error);
  166. HRESULT StartCapture ([in] BOOL useVITC, [in] BMDTimecodeBCD inTimecode, [in] BMDTimecodeBCD outTimecode, [out] BMDDeckControlError* error);
  167. HRESULT GetDeviceID ([out] unsigned short* deviceId, [out] BMDDeckControlError* error);
  168. HRESULT Abort (void);
  169. HRESULT CrashRecordStart ([out] BMDDeckControlError* error);
  170. HRESULT CrashRecordStop ([out] BMDDeckControlError* error);
  171. HRESULT SetCallback ([in] IDeckLinkDeckControlStatusCallback* callback);
  172. };
  173. /* Coclasses */
  174. importlib("stdole2.tlb");