jwaimapi.pas 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. {******************************************************************************}
  2. { }
  3. { Image Mastering API interface Unit for Object Pascal }
  4. { }
  5. { Portions created by Microsoft are Copyright (C) 1995-2001 Microsoft }
  6. { Corporation. All Rights Reserved. }
  7. { }
  8. { The original file is: imapi.h, released Aug 2002. The original Pascal }
  9. { code is: Imapi.pas, released November 2002. The initial developer of the }
  10. { Pascal code is Marcel van Brakel (brakelm att chello dott nl). }
  11. { }
  12. { Portions created by Marcel van Brakel are Copyright (C) 1999-2001 }
  13. { Marcel van Brakel. All Rights Reserved. }
  14. { }
  15. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  16. { }
  17. { You may retrieve the latest version of this file at the Project JEDI }
  18. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  19. { }
  20. { The contents of this file are used with permission, subject to the Mozilla }
  21. { Public License Version 1.1 (the "License"); you may not use this file except }
  22. { in compliance with the License. You may obtain a copy of the License at }
  23. { http://www.mozilla.org/MPL/MPL-1.1.html }
  24. { }
  25. { Software distributed under the License is distributed on an "AS IS" basis, }
  26. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  27. { the specific language governing rights and limitations under the License. }
  28. { }
  29. { Alternatively, the contents of this file may be used under the terms of the }
  30. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  31. { provisions of the LGPL License are applicable instead of those above. }
  32. { If you wish to allow use of your version of this file only under the terms }
  33. { of the LGPL License and not to allow others to use your version of this file }
  34. { under the MPL, indicate your decision by deleting the provisions above and }
  35. { replace them with the notice and other provisions required by the LGPL }
  36. { License. If you do not delete the provisions above, a recipient may use }
  37. { your version of this file under either the MPL or the LGPL License. }
  38. { }
  39. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  40. { }
  41. {******************************************************************************}
  42. unit JwaImapi;
  43. {$WEAKPACKAGEUNIT}
  44. {$HPPEMIT ''}
  45. {$HPPEMIT '#include "imapi.h"'}
  46. {$HPPEMIT ''}
  47. {$I jediapilib.inc}
  48. interface
  49. uses
  50. ActiveX {todo},
  51. JwaWinType;
  52. {$IFDEF FPC}
  53. Type
  54. IPropertyStorage = interface end;
  55. {$ENDIF}
  56. //
  57. // interface IDiscRecorder
  58. //
  59. type
  60. MEDIA_TYPES = DWORD;
  61. {$EXTERNALSYM MEDIA_TYPES}
  62. TMediaTypes = MEDIA_TYPES;
  63. const
  64. MEDIA_CDDA_CDROM = 1;
  65. {$EXTERNALSYM MEDIA_CDDA_CDROM}
  66. MEDIA_CD_ROM_XA = MEDIA_CDDA_CDROM + 1;
  67. {$EXTERNALSYM MEDIA_CD_ROM_XA}
  68. MEDIA_CD_I = MEDIA_CD_ROM_XA + 1;
  69. {$EXTERNALSYM MEDIA_CD_I}
  70. MEDIA_CD_EXTRA = MEDIA_CD_I + 1;
  71. {$EXTERNALSYM MEDIA_CD_EXTRA}
  72. MEDIA_CD_OTHER = MEDIA_CD_EXTRA + 1;
  73. {$EXTERNALSYM MEDIA_CD_OTHER}
  74. MEDIA_SPECIAL = MEDIA_CD_OTHER + 1;
  75. {$EXTERNALSYM MEDIA_SPECIAL}
  76. type
  77. MEDIA_FLAGS = DWORD;
  78. {$EXTERNALSYM MEDIA_FLAGS}
  79. TMediaFlags = MEDIA_FLAGS;
  80. const
  81. MEDIA_BLANK = $1;
  82. {$EXTERNALSYM MEDIA_BLANK}
  83. MEDIA_RW = $2;
  84. {$EXTERNALSYM MEDIA_RW}
  85. MEDIA_WRITABLE = $4;
  86. {$EXTERNALSYM MEDIA_WRITABLE}
  87. MEDIA_FORMAT_UNUSABLE_BY_IMAPI = $8;
  88. {$EXTERNALSYM MEDIA_FORMAT_UNUSABLE_BY_IMAPI}
  89. type
  90. RECORDER_TYPES = DWORD;
  91. {$EXTERNALSYM RECORDER_TYPES}
  92. TRecorderTypes = RECORDER_TYPES;
  93. const
  94. RECORDER_CDR = $1;
  95. {$EXTERNALSYM RECORDER_CDR}
  96. RECORDER_CDRW = $2;
  97. {$EXTERNALSYM RECORDER_CDRW}
  98. RECORDER_DOING_NOTHING = 0;
  99. {$EXTERNALSYM RECORDER_DOING_NOTHING}
  100. RECORDER_OPENED = $1;
  101. {$EXTERNALSYM RECORDER_OPENED}
  102. RECORDER_BURNING = $2;
  103. {$EXTERNALSYM RECORDER_BURNING}
  104. IID_IDiscRecorder: TGUID = '{85AC9776-CA88-4cf2-894E-09598C078A41}';
  105. {$EXTERNALSYM IID_IDiscRecorder}
  106. type
  107. IDiscRecorder = interface(IUnknown)
  108. ['{85AC9776-CA88-4cf2-894E-09598C078A41}']
  109. function Init(pbyUniqueID: PByte; nulIDSize, nulDriveNumber: ULONG): HRESULT; stdcall;
  110. function GetRecorderGUID(pbyUniqueID: PByte; ulBufferSize: ULONG; out pulReturnSizeRequired: ULONG): HRESULT; stdcall;
  111. function GetRecorderType(out fTypeCode: Longint): HRESULT; stdcall;
  112. function GetDisplayNames(var pbstrVendorID, pbstrProductID, pbstrRevision: PWideChar): HRESULT; stdcall;
  113. function GetBasePnPID(out pbstrBasePnPID: PWideChar): HRESULT; stdcall;
  114. function GetPath(out pbstrPath: PWideChar): HRESULT; stdcall;
  115. function GetRecorderProperties(out ppPropStg: IPropertyStorage): HRESULT; stdcall;
  116. function SetRecorderProperties(pPropStg: IPropertyStorage): HRESULT; stdcall;
  117. function GetRecorderState(out pulDevStateFlags: ULONG): HRESULT; stdcall;
  118. function OpenExclusive: HRESULT; stdcall;
  119. function QueryMediaType(out fMediaType, fMediaFlags: Longint): HRESULT; stdcall;
  120. function QueryMediaInfo(out pbSessions, pbLastTrack: Byte; out ulStartAddress, ulNextWritable, ulFreeBlocks: ULONG): HRESULT; stdcall;
  121. function Eject: HRESULT; stdcall;
  122. function Erase(bFullErase: BOOL): HRESULT; stdcall;
  123. function Close: HRESULT; stdcall;
  124. end;
  125. {$EXTERNALSYM IDiscRecorder}
  126. //
  127. // interface IEnumDiscRecorders
  128. //
  129. const
  130. IID_IEnumDiscRecorders: TGUID = '{9B1921E1-54AC-11d3-9144-00104BA11C5E}';
  131. {$EXTERNALSYM IID_IEnumDiscRecorders}
  132. type
  133. IEnumDiscRecorders = interface(IUnknown)
  134. ['{9B1921E1-54AC-11d3-9144-00104BA11C5E}']
  135. function Next(cRecorders: ULONG; out ppRecorder: IDiscRecorder; out pcFetched: ULONG): HRESULT; stdcall;
  136. function Skip(cRecorders: ULONG): HRESULT; stdcall;
  137. function Reset: HRESULT; stdcall;
  138. function Clone(out ppEnum: IEnumDiscRecorders): HRESULT; stdcall;
  139. end;
  140. {$EXTERNALSYM IEnumDiscRecorders}
  141. //
  142. // interface IEnumDiscMasterFormats
  143. //
  144. const
  145. IID_IEnumDiscMasterFormats: TGUID = '{DDF445E1-54BA-11d3-9144-00104BA11C5E}';
  146. {$EXTERNALSYM IID_IEnumDiscMasterFormats}
  147. type
  148. IEnumDiscMasterFormats = interface(IUnknown)
  149. ['{DDF445E1-54BA-11d3-9144-00104BA11C5E}']
  150. function Next(cFormats: ULONG; out lpiidFormatID: TGUID; out pcFetched: ULONG): HRESULT; stdcall;
  151. function Skip(cFormats: ULONG): HRESULT; stdcall;
  152. function Reset: HRESULT; stdcall;
  153. function Clone(out ppEnum: IEnumDiscMasterFormats): HRESULT; stdcall;
  154. end;
  155. {$EXTERNALSYM IEnumDiscMasterFormats}
  156. //
  157. // interface IRedbookDiscMaster
  158. //
  159. const
  160. IID_IRedbookDiscMaster: TGUID = '{E3BC42CD-4E5C-11D3-9144-00104BA11C5E}';
  161. {$EXTERNALSYM IID_IRedbookDiscMaster}
  162. type
  163. IRedbookDiscMaster = interface(IUnknown)
  164. ['{E3BC42CD-4E5C-11D3-9144-00104BA11C5E}']
  165. function GetTotalAudioTracks(out pnTracks: Longint): HRESULT; stdcall;
  166. function GetTotalAudioBlocks(out pnBlocks: Longint): HRESULT; stdcall;
  167. function GetUsedAudioBlocks(out pnBlocks: Longint): HRESULT; stdcall;
  168. function GetAvailableAudioTrackBlocks(out pnBlocks: Longint): HRESULT; stdcall;
  169. function GetAudioBlockSize(out pnBlockBytes: Longint): HRESULT; stdcall;
  170. function CreateAudioTrack(nBlocks: Longint): HRESULT; stdcall;
  171. function AddAudioTrackBlocks(pby: PByte; cb: Longint): HRESULT; stdcall;
  172. function CloseAudioTrack: HRESULT; stdcall;
  173. end;
  174. {$EXTERNALSYM IRedbookDiscMaster}
  175. //
  176. // interface IJolietDiscMaster
  177. //
  178. const
  179. IID_IJolietDiscMaster: TGUID = '{E3BC42CE-4E5C-11D3-9144-00104BA11C5E}';
  180. {$EXTERNALSYM IID_IJolietDiscMaster}
  181. type
  182. IJolietDiscMaster = interface(IUnknown)
  183. ['{E3BC42CE-4E5C-11D3-9144-00104BA11C5E}']
  184. function GetTotalDataBlocks(out pnBlocks: Longint): HRESULT; stdcall;
  185. function GetUsedDataBlocks(out pnBlocks: Longint): HRESULT; stdcall;
  186. function GetDataBlockSize(out pnBlockBytes: Longint): HRESULT; stdcall;
  187. function AddData(pStorage: IStorage; lFileOverwrite: Longint): HRESULT; stdcall;
  188. function GetJolietProperties(out ppPropStg: IPropertyStorage): HRESULT; stdcall;
  189. function SetJolietProperties(pPropStg: IPropertyStorage): HRESULT; stdcall;
  190. end;
  191. {$EXTERNALSYM IJolietDiscMaster}
  192. //
  193. // interface IDiscMasterProgressEvents
  194. //
  195. const
  196. IID_IDiscMasterProgressEvents: TGUID = '{EC9E51C1-4E5D-11D3-9144-00104BA11C5E}';
  197. {$EXTERNALSYM IID_IDiscMasterProgressEvents}
  198. type
  199. IDiscMasterProgressEvents = interface(IUnknown)
  200. ['{EC9E51C1-4E5D-11D3-9144-00104BA11C5E}']
  201. function QueryCancel(out pbCancel: BOOL): HRESULT; stdcall;
  202. function NotifyPnPActivity: HRESULT; stdcall;
  203. function NotifyAddProgress(nCompletedSteps, nTotalSteps: Longint): HRESULT; stdcall;
  204. function NotifyBlockProgress(nCompleted, nTotal: Longint): HRESULT; stdcall;
  205. function NotifyTrackProgress(nCurrentTrack, nTotalTracks: Longint): HRESULT; stdcall;
  206. function NotifyPreparingBurn(nEstimatedSeconds: Longint): HRESULT; stdcall;
  207. function NotifyClosingDisc(nEstimatedSeconds: Longint): HRESULT; stdcall;
  208. function NotifyBurnComplete(status: HRESULT): HRESULT; stdcall;
  209. function NotifyEraseComplete(status: HRESULT): HRESULT; stdcall;
  210. end;
  211. {$EXTERNALSYM IDiscMasterProgressEvents}
  212. //
  213. // interface IDiscMaster
  214. //
  215. const
  216. IID_IDiscMaster: TGUID = '{520CCA62-51A5-11D3-9144-00104BA11C5E}';
  217. {$EXTERNALSYM IID_IDiscMaster}
  218. type
  219. IDiscMaster = interface(IUnknown)
  220. ['{520CCA62-51A5-11D3-9144-00104BA11C5E}']
  221. function Open: HRESULT; stdcall;
  222. function EnumDiscMasterFormats(out ppEnum: IEnumDiscMasterFormats): HRESULT; stdcall;
  223. function GetActiveDiscMasterFormat(out lpiid: TGUID): HRESULT; stdcall;
  224. function SetActiveDiscMasterFormat(const riid: TGUID; out ppUnk: IUnknown): HRESULT; stdcall;
  225. function EnumDiscRecorders(out ppEnum: IEnumDiscRecorders): HRESULT; stdcall;
  226. function GetActiveDiscRecorder(out ppRecorder: IDiscRecorder): HRESULT; stdcall;
  227. function SetActiveDiscRecorder(pRecorder: IDiscRecorder): HRESULT; stdcall;
  228. function ClearFormatContent: HRESULT; stdcall;
  229. function ProgressAdvise(pEvents: IDiscMasterProgressEvents; out pvCookie: UINT): HRESULT; stdcall;
  230. function ProgressUnadvise(vCookie: UINT): HRESULT; stdcall;
  231. function RecordDisc(bSimulate, bEjectAfterBurn: BOOL): HRESULT; stdcall;
  232. function Close: HRESULT; stdcall;
  233. end;
  234. {$EXTERNALSYM IDiscMaster}
  235. //
  236. // library IMAPILib
  237. //
  238. const
  239. //EXTERN_C const IID LIBID_IMAPILib;
  240. CLSID_MSDiscRecorderObj: TGUID = '{520CCA61-51A5-11D3-9144-00104BA11C5E}';
  241. {$EXTERNALSYM CLSID_MSDiscRecorderObj}
  242. MSDiscRecorderObj: TGUID = '{520CCA61-51A5-11D3-9144-00104BA11C5E}';
  243. {$EXTERNALSYM MSDiscRecorderObj}
  244. CLSID_MSDiscMasterObj: TGUID = '{520CCA63-51A5-11D3-9144-00104BA11C5E}';
  245. {$EXTERNALSYM CLSID_MSDiscMasterObj}
  246. MSDiscMasterObj: TGUID = '{520CCA63-51A5-11D3-9144-00104BA11C5E}';
  247. {$EXTERNALSYM MSDiscMasterObj}
  248. CLSID_MSEnumDiscRecordersObj: TGUID = '{8A03567A-63CB-4BA8-BAF6-52119816D1EF}';
  249. {$EXTERNALSYM CLSID_MSEnumDiscRecordersObj}
  250. MSEnumDiscRecordersObj: TGUID = '{8A03567A-63CB-4BA8-BAF6-52119816D1EF}';
  251. {$EXTERNALSYM MSEnumDiscRecordersObj}
  252. implementation
  253. end.