jwaimapi.pas 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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. // $Id: JwaImapi.pas,v 1.7 2005/09/03 13:12:10 marquardt Exp $
  43. unit JwaImapi;
  44. {$WEAKPACKAGEUNIT}
  45. {$I jediapilib.inc}
  46. interface
  47. uses
  48. JwaActiveX, JwaWindows;
  49. {$HPPEMIT ''}
  50. {$HPPEMIT '#include "imapi.h"'}
  51. {$HPPEMIT ''}
  52. //
  53. // interface IDiscRecorder
  54. //
  55. type
  56. MEDIA_TYPES = DWORD;
  57. {$EXTERNALSYM MEDIA_TYPES}
  58. TMediaTypes = MEDIA_TYPES;
  59. const
  60. MEDIA_CDDA_CDROM = 1;
  61. {$EXTERNALSYM MEDIA_CDDA_CDROM}
  62. MEDIA_CD_ROM_XA = MEDIA_CDDA_CDROM + 1;
  63. {$EXTERNALSYM MEDIA_CD_ROM_XA}
  64. MEDIA_CD_I = MEDIA_CD_ROM_XA + 1;
  65. {$EXTERNALSYM MEDIA_CD_I}
  66. MEDIA_CD_EXTRA = MEDIA_CD_I + 1;
  67. {$EXTERNALSYM MEDIA_CD_EXTRA}
  68. MEDIA_CD_OTHER = MEDIA_CD_EXTRA + 1;
  69. {$EXTERNALSYM MEDIA_CD_OTHER}
  70. MEDIA_SPECIAL = MEDIA_CD_OTHER + 1;
  71. {$EXTERNALSYM MEDIA_SPECIAL}
  72. type
  73. MEDIA_FLAGS = DWORD;
  74. {$EXTERNALSYM MEDIA_FLAGS}
  75. TMediaFlags = MEDIA_FLAGS;
  76. const
  77. MEDIA_BLANK = $1;
  78. {$EXTERNALSYM MEDIA_BLANK}
  79. MEDIA_RW = $2;
  80. {$EXTERNALSYM MEDIA_RW}
  81. MEDIA_WRITABLE = $4;
  82. {$EXTERNALSYM MEDIA_WRITABLE}
  83. MEDIA_FORMAT_UNUSABLE_BY_IMAPI = $8;
  84. {$EXTERNALSYM MEDIA_FORMAT_UNUSABLE_BY_IMAPI}
  85. type
  86. RECORDER_TYPES = DWORD;
  87. {$EXTERNALSYM RECORDER_TYPES}
  88. TRecorderTypes = RECORDER_TYPES;
  89. const
  90. RECORDER_CDR = $1;
  91. {$EXTERNALSYM RECORDER_CDR}
  92. RECORDER_CDRW = $2;
  93. {$EXTERNALSYM RECORDER_CDRW}
  94. RECORDER_DOING_NOTHING = 0;
  95. {$EXTERNALSYM RECORDER_DOING_NOTHING}
  96. RECORDER_OPENED = $1;
  97. {$EXTERNALSYM RECORDER_OPENED}
  98. RECORDER_BURNING = $2;
  99. {$EXTERNALSYM RECORDER_BURNING}
  100. IID_IDiscRecorder: TGUID = '{85AC9776-CA88-4cf2-894E-09598C078A41}';
  101. {$EXTERNALSYM IID_IDiscRecorder}
  102. type
  103. IDiscRecorder = interface(IUnknown)
  104. ['{85AC9776-CA88-4cf2-894E-09598C078A41}']
  105. function Init(pbyUniqueID: PByte; nulIDSize, nulDriveNumber: ULONG): HRESULT; stdcall;
  106. function GetRecorderGUID(pbyUniqueID: PByte; ulBufferSize: ULONG; out pulReturnSizeRequired: ULONG): HRESULT; stdcall;
  107. function GetRecorderType(out fTypeCode: Longint): HRESULT; stdcall;
  108. function GetDisplayNames(var pbstrVendorID, pbstrProductID, pbstrRevision: PWideChar): HRESULT; stdcall;
  109. function GetBasePnPID(out pbstrBasePnPID: PWideChar): HRESULT; stdcall;
  110. function GetPath(out pbstrPath: PWideChar): HRESULT; stdcall;
  111. function GetRecorderProperties(out ppPropStg: IPropertyStorage): HRESULT; stdcall;
  112. function SetRecorderProperties(pPropStg: IPropertyStorage): HRESULT; stdcall;
  113. function GetRecorderState(out pulDevStateFlags: ULONG): HRESULT; stdcall;
  114. function OpenExclusive: HRESULT; stdcall;
  115. function QueryMediaType(out fMediaType, fMediaFlags: Longint): HRESULT; stdcall;
  116. function QueryMediaInfo(out pbSessions, pbLastTrack: Byte; out ulStartAddress, ulNextWritable, ulFreeBlocks: ULONG): HRESULT; stdcall;
  117. function Eject: HRESULT; stdcall;
  118. function Erase(bFullErase: BOOL): HRESULT; stdcall;
  119. function Close: HRESULT; stdcall;
  120. end;
  121. {$EXTERNALSYM IDiscRecorder}
  122. //
  123. // interface IEnumDiscRecorders
  124. //
  125. const
  126. IID_IEnumDiscRecorders: TGUID = '{9B1921E1-54AC-11d3-9144-00104BA11C5E}';
  127. {$EXTERNALSYM IID_IEnumDiscRecorders}
  128. type
  129. IEnumDiscRecorders = interface(IUnknown)
  130. ['{9B1921E1-54AC-11d3-9144-00104BA11C5E}']
  131. function Next(cRecorders: ULONG; out ppRecorder: IDiscRecorder; out pcFetched: ULONG): HRESULT; stdcall;
  132. function Skip(cRecorders: ULONG): HRESULT; stdcall;
  133. function Reset: HRESULT; stdcall;
  134. function Clone(out ppEnum: IEnumDiscRecorders): HRESULT; stdcall;
  135. end;
  136. {$EXTERNALSYM IEnumDiscRecorders}
  137. //
  138. // interface IEnumDiscMasterFormats
  139. //
  140. const
  141. IID_IEnumDiscMasterFormats: TGUID = '{DDF445E1-54BA-11d3-9144-00104BA11C5E}';
  142. {$EXTERNALSYM IID_IEnumDiscMasterFormats}
  143. type
  144. IEnumDiscMasterFormats = interface(IUnknown)
  145. ['{DDF445E1-54BA-11d3-9144-00104BA11C5E}']
  146. function Next(cFormats: ULONG; out lpiidFormatID: TGUID; out pcFetched: ULONG): HRESULT; stdcall;
  147. function Skip(cFormats: ULONG): HRESULT; stdcall;
  148. function Reset: HRESULT; stdcall;
  149. function Clone(out ppEnum: IEnumDiscMasterFormats): HRESULT; stdcall;
  150. end;
  151. {$EXTERNALSYM IEnumDiscMasterFormats}
  152. //
  153. // interface IRedbookDiscMaster
  154. //
  155. const
  156. IID_IRedbookDiscMaster: TGUID = '{E3BC42CD-4E5C-11D3-9144-00104BA11C5E}';
  157. {$EXTERNALSYM IID_IRedbookDiscMaster}
  158. type
  159. IRedbookDiscMaster = interface(IUnknown)
  160. ['{E3BC42CD-4E5C-11D3-9144-00104BA11C5E}']
  161. function GetTotalAudioTracks(out pnTracks: Longint): HRESULT; stdcall;
  162. function GetTotalAudioBlocks(out pnBlocks: Longint): HRESULT; stdcall;
  163. function GetUsedAudioBlocks(out pnBlocks: Longint): HRESULT; stdcall;
  164. function GetAvailableAudioTrackBlocks(out pnBlocks: Longint): HRESULT; stdcall;
  165. function GetAudioBlockSize(out pnBlockBytes: Longint): HRESULT; stdcall;
  166. function CreateAudioTrack(nBlocks: Longint): HRESULT; stdcall;
  167. function AddAudioTrackBlocks(pby: PByte; cb: Longint): HRESULT; stdcall;
  168. function CloseAudioTrack: HRESULT; stdcall;
  169. end;
  170. {$EXTERNALSYM IRedbookDiscMaster}
  171. //
  172. // interface IJolietDiscMaster
  173. //
  174. const
  175. IID_IJolietDiscMaster: TGUID = '{E3BC42CE-4E5C-11D3-9144-00104BA11C5E}';
  176. {$EXTERNALSYM IID_IJolietDiscMaster}
  177. type
  178. IJolietDiscMaster = interface(IUnknown)
  179. ['{E3BC42CE-4E5C-11D3-9144-00104BA11C5E}']
  180. function GetTotalDataBlocks(out pnBlocks: Longint): HRESULT; stdcall;
  181. function GetUsedDataBlocks(out pnBlocks: Longint): HRESULT; stdcall;
  182. function GetDataBlockSize(out pnBlockBytes: Longint): HRESULT; stdcall;
  183. function AddData(pStorage: IStorage; lFileOverwrite: Longint): HRESULT; stdcall;
  184. function GetJolietProperties(out ppPropStg: IPropertyStorage): HRESULT; stdcall;
  185. function SetJolietProperties(pPropStg: IPropertyStorage): HRESULT; stdcall;
  186. end;
  187. {$EXTERNALSYM IJolietDiscMaster}
  188. //
  189. // interface IDiscMasterProgressEvents
  190. //
  191. const
  192. IID_IDiscMasterProgressEvents: TGUID = '{EC9E51C1-4E5D-11D3-9144-00104BA11C5E}';
  193. {$EXTERNALSYM IID_IDiscMasterProgressEvents}
  194. type
  195. IDiscMasterProgressEvents = interface(IUnknown)
  196. ['{EC9E51C1-4E5D-11D3-9144-00104BA11C5E}']
  197. function QueryCancel(out pbCancel: BOOL): HRESULT; stdcall;
  198. function NotifyPnPActivity: HRESULT; stdcall;
  199. function NotifyAddProgress(nCompletedSteps, nTotalSteps: Longint): HRESULT; stdcall;
  200. function NotifyBlockProgress(nCompleted, nTotal: Longint): HRESULT; stdcall;
  201. function NotifyTrackProgress(nCurrentTrack, nTotalTracks: Longint): HRESULT; stdcall;
  202. function NotifyPreparingBurn(nEstimatedSeconds: Longint): HRESULT; stdcall;
  203. function NotifyClosingDisc(nEstimatedSeconds: Longint): HRESULT; stdcall;
  204. function NotifyBurnComplete(status: HRESULT): HRESULT; stdcall;
  205. function NotifyEraseComplete(status: HRESULT): HRESULT; stdcall;
  206. end;
  207. {$EXTERNALSYM IDiscMasterProgressEvents}
  208. //
  209. // interface IDiscMaster
  210. //
  211. const
  212. IID_IDiscMaster: TGUID = '{520CCA62-51A5-11D3-9144-00104BA11C5E}';
  213. {$EXTERNALSYM IID_IDiscMaster}
  214. type
  215. IDiscMaster = interface(IUnknown)
  216. ['{520CCA62-51A5-11D3-9144-00104BA11C5E}']
  217. function Open: HRESULT; stdcall;
  218. function EnumDiscMasterFormats(out ppEnum: IEnumDiscMasterFormats): HRESULT; stdcall;
  219. function GetActiveDiscMasterFormat(out lpiid: TGUID): HRESULT; stdcall;
  220. function SetActiveDiscMasterFormat(const riid: TGUID; out ppUnk: IUnknown): HRESULT; stdcall;
  221. function EnumDiscRecorders(out ppEnum: IEnumDiscRecorders): HRESULT; stdcall;
  222. function GetActiveDiscRecorder(out ppRecorder: IDiscRecorder): HRESULT; stdcall;
  223. function SetActiveDiscRecorder(pRecorder: IDiscRecorder): HRESULT; stdcall;
  224. function ClearFormatContent: HRESULT; stdcall;
  225. function ProgressAdvise(pEvents: IDiscMasterProgressEvents; out pvCookie: UINT): HRESULT; stdcall;
  226. function ProgressUnadvise(vCookie: UINT): HRESULT; stdcall;
  227. function RecordDisc(bSimulate, bEjectAfterBurn: BOOL): HRESULT; stdcall;
  228. function Close: HRESULT; stdcall;
  229. end;
  230. {$EXTERNALSYM IDiscMaster}
  231. //
  232. // library IMAPILib
  233. //
  234. const
  235. //EXTERN_C const IID LIBID_IMAPILib;
  236. CLSID_MSDiscRecorderObj: TGUID = '{520CCA61-51A5-11D3-9144-00104BA11C5E}';
  237. {$EXTERNALSYM CLSID_MSDiscRecorderObj}
  238. MSDiscRecorderObj: TGUID = '{520CCA61-51A5-11D3-9144-00104BA11C5E}';
  239. {$EXTERNALSYM MSDiscRecorderObj}
  240. CLSID_MSDiscMasterObj: TGUID = '{520CCA63-51A5-11D3-9144-00104BA11C5E}';
  241. {$EXTERNALSYM CLSID_MSDiscMasterObj}
  242. MSDiscMasterObj: TGUID = '{520CCA63-51A5-11D3-9144-00104BA11C5E}';
  243. {$EXTERNALSYM MSDiscMasterObj}
  244. CLSID_MSEnumDiscRecordersObj: TGUID = '{8A03567A-63CB-4BA8-BAF6-52119816D1EF}';
  245. {$EXTERNALSYM CLSID_MSEnumDiscRecordersObj}
  246. MSEnumDiscRecordersObj: TGUID = '{8A03567A-63CB-4BA8-BAF6-52119816D1EF}';
  247. {$EXTERNALSYM MSEnumDiscRecordersObj}
  248. implementation
  249. end.