HIMovieView.pas 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. {
  2. File: QuickTime/HIMovieView.h
  3. Contains: HIView-based movie playback
  4. Version: QuickTime 7.7.1
  5. Copyright: © 2004-2012 by Apple Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { Pascal Translation: Gale R Paeper, <[email protected]>, 2006 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  12. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  13. {
  14. Modified for use with Free Pascal
  15. Version 308
  16. Please report any bugs to <[email protected]>
  17. }
  18. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  19. {$mode macpas}
  20. {$modeswitch cblocks}
  21. {$packenum 1}
  22. {$macro on}
  23. {$inline on}
  24. {$calling mwpascal}
  25. unit HIMovieView;
  26. interface
  27. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  28. {$setc GAP_INTERFACES_VERSION := $0308}
  29. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  30. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  31. {$endc}
  32. {$ifc defined CPUPOWERPC and defined CPUI386}
  33. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  34. {$endc}
  35. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  36. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  37. {$endc}
  38. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  39. {$setc __ppc__ := 1}
  40. {$elsec}
  41. {$setc __ppc__ := 0}
  42. {$endc}
  43. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  44. {$setc __ppc64__ := 1}
  45. {$elsec}
  46. {$setc __ppc64__ := 0}
  47. {$endc}
  48. {$ifc not defined __i386__ and defined CPUI386}
  49. {$setc __i386__ := 1}
  50. {$elsec}
  51. {$setc __i386__ := 0}
  52. {$endc}
  53. {$ifc not defined __x86_64__ and defined CPUX86_64}
  54. {$setc __x86_64__ := 1}
  55. {$elsec}
  56. {$setc __x86_64__ := 0}
  57. {$endc}
  58. {$ifc not defined __arm__ and defined CPUARM}
  59. {$setc __arm__ := 1}
  60. {$elsec}
  61. {$setc __arm__ := 0}
  62. {$endc}
  63. {$ifc not defined __arm64__ and defined CPUAARCH64}
  64. {$setc __arm64__ := 1}
  65. {$elsec}
  66. {$setc __arm64__ := 0}
  67. {$endc}
  68. {$ifc defined cpu64}
  69. {$setc __LP64__ := 1}
  70. {$elsec}
  71. {$setc __LP64__ := 0}
  72. {$endc}
  73. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  74. {$error Conflicting definitions for __ppc__ and __i386__}
  75. {$endc}
  76. {$ifc defined __ppc__ and __ppc__}
  77. {$setc TARGET_CPU_PPC := TRUE}
  78. {$setc TARGET_CPU_PPC64 := FALSE}
  79. {$setc TARGET_CPU_X86 := FALSE}
  80. {$setc TARGET_CPU_X86_64 := FALSE}
  81. {$setc TARGET_CPU_ARM := FALSE}
  82. {$setc TARGET_CPU_ARM64 := FALSE}
  83. {$setc TARGET_OS_MAC := TRUE}
  84. {$setc TARGET_OS_IPHONE := FALSE}
  85. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  86. {$setc TARGET_OS_EMBEDDED := FALSE}
  87. {$elifc defined __ppc64__ and __ppc64__}
  88. {$setc TARGET_CPU_PPC := FALSE}
  89. {$setc TARGET_CPU_PPC64 := TRUE}
  90. {$setc TARGET_CPU_X86 := FALSE}
  91. {$setc TARGET_CPU_X86_64 := FALSE}
  92. {$setc TARGET_CPU_ARM := FALSE}
  93. {$setc TARGET_CPU_ARM64 := FALSE}
  94. {$setc TARGET_OS_MAC := TRUE}
  95. {$setc TARGET_OS_IPHONE := FALSE}
  96. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  97. {$setc TARGET_OS_EMBEDDED := FALSE}
  98. {$elifc defined __i386__ and __i386__}
  99. {$setc TARGET_CPU_PPC := FALSE}
  100. {$setc TARGET_CPU_PPC64 := FALSE}
  101. {$setc TARGET_CPU_X86 := TRUE}
  102. {$setc TARGET_CPU_X86_64 := FALSE}
  103. {$setc TARGET_CPU_ARM := FALSE}
  104. {$setc TARGET_CPU_ARM64 := FALSE}
  105. {$ifc defined(iphonesim)}
  106. {$setc TARGET_OS_MAC := FALSE}
  107. {$setc TARGET_OS_IPHONE := TRUE}
  108. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  109. {$elsec}
  110. {$setc TARGET_OS_MAC := TRUE}
  111. {$setc TARGET_OS_IPHONE := FALSE}
  112. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  113. {$endc}
  114. {$setc TARGET_OS_EMBEDDED := FALSE}
  115. {$elifc defined __x86_64__ and __x86_64__}
  116. {$setc TARGET_CPU_PPC := FALSE}
  117. {$setc TARGET_CPU_PPC64 := FALSE}
  118. {$setc TARGET_CPU_X86 := FALSE}
  119. {$setc TARGET_CPU_X86_64 := TRUE}
  120. {$setc TARGET_CPU_ARM := FALSE}
  121. {$setc TARGET_CPU_ARM64 := FALSE}
  122. {$ifc defined(iphonesim)}
  123. {$setc TARGET_OS_MAC := FALSE}
  124. {$setc TARGET_OS_IPHONE := TRUE}
  125. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  126. {$elsec}
  127. {$setc TARGET_OS_MAC := TRUE}
  128. {$setc TARGET_OS_IPHONE := FALSE}
  129. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  130. {$endc}
  131. {$setc TARGET_OS_EMBEDDED := FALSE}
  132. {$elifc defined __arm__ and __arm__}
  133. {$setc TARGET_CPU_PPC := FALSE}
  134. {$setc TARGET_CPU_PPC64 := FALSE}
  135. {$setc TARGET_CPU_X86 := FALSE}
  136. {$setc TARGET_CPU_X86_64 := FALSE}
  137. {$setc TARGET_CPU_ARM := TRUE}
  138. {$setc TARGET_CPU_ARM64 := FALSE}
  139. { will require compiler define when/if other Apple devices with ARM cpus ship }
  140. {$setc TARGET_OS_MAC := FALSE}
  141. {$setc TARGET_OS_IPHONE := TRUE}
  142. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  143. {$setc TARGET_OS_EMBEDDED := TRUE}
  144. {$elifc defined __arm64__ and __arm64__}
  145. {$setc TARGET_CPU_PPC := FALSE}
  146. {$setc TARGET_CPU_PPC64 := FALSE}
  147. {$setc TARGET_CPU_X86 := FALSE}
  148. {$setc TARGET_CPU_X86_64 := FALSE}
  149. {$setc TARGET_CPU_ARM := FALSE}
  150. {$setc TARGET_CPU_ARM64 := TRUE}
  151. { will require compiler define when/if other Apple devices with ARM cpus ship }
  152. {$setc TARGET_OS_MAC := FALSE}
  153. {$setc TARGET_OS_IPHONE := TRUE}
  154. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  155. {$setc TARGET_OS_EMBEDDED := TRUE}
  156. {$elsec}
  157. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  158. {$endc}
  159. {$ifc defined __LP64__ and __LP64__ }
  160. {$setc TARGET_CPU_64 := TRUE}
  161. {$elsec}
  162. {$setc TARGET_CPU_64 := FALSE}
  163. {$endc}
  164. {$ifc defined FPC_BIG_ENDIAN}
  165. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  166. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  167. {$elifc defined FPC_LITTLE_ENDIAN}
  168. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  169. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  170. {$elsec}
  171. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  172. {$endc}
  173. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  174. {$setc CALL_NOT_IN_CARBON := FALSE}
  175. {$setc OLDROUTINENAMES := FALSE}
  176. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  177. {$setc OPAQUE_UPP_TYPES := TRUE}
  178. {$setc OTCARBONAPPLICATION := TRUE}
  179. {$setc OTKERNEL := FALSE}
  180. {$setc PM_USE_SESSION_APIS := TRUE}
  181. {$setc TARGET_API_MAC_CARBON := TRUE}
  182. {$setc TARGET_API_MAC_OS8 := FALSE}
  183. {$setc TARGET_API_MAC_OSX := TRUE}
  184. {$setc TARGET_CARBON := TRUE}
  185. {$setc TARGET_CPU_68K := FALSE}
  186. {$setc TARGET_CPU_MIPS := FALSE}
  187. {$setc TARGET_CPU_SPARC := FALSE}
  188. {$setc TARGET_OS_UNIX := FALSE}
  189. {$setc TARGET_OS_WIN32 := FALSE}
  190. {$setc TARGET_RT_MAC_68881 := FALSE}
  191. {$setc TARGET_RT_MAC_CFM := FALSE}
  192. {$setc TARGET_RT_MAC_MACHO := TRUE}
  193. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  194. {$setc TYPE_BOOL := FALSE}
  195. {$setc TYPE_EXTENDED := FALSE}
  196. {$setc TYPE_LONGLONG := TRUE}
  197. uses MacTypes,HIGeometry,HIObject,HIView,Movies;
  198. {$endc} {not MACOSALLINCLUDE}
  199. {$ifc TARGET_OS_MAC}
  200. {$ALIGN POWER}
  201. { QuickTime is not available to 64-bit clients }
  202. {$ifc not TARGET_CPU_64}
  203. {
  204. * kHIMovieViewClassID
  205. *
  206. * Summary:
  207. * Class ID for HIMovieView
  208. }
  209. {$ifc USE_CFSTR_CONSTANT_MACROS}
  210. {$definec kHIMovieViewClassID CFSTRP('com.apple.quicktime.HIMovieView')}
  211. {$endc}
  212. {
  213. * Summary:
  214. * HIMovieView Event class
  215. }
  216. const
  217. {
  218. * Events related to movie views.
  219. }
  220. kEventClassMovieView = FourCharCode('moov');
  221. {
  222. * kEventClassMovieView / kEventMovieViewOptimalBoundsChanged
  223. *
  224. * Summary:
  225. * Sent when the movie size changes.
  226. *
  227. * Parameters:
  228. *
  229. * --> kEventParamDirectObject (in, typeControlRef)
  230. * The movie view whose size is changing.
  231. *
  232. * --> kEventParamControlOptimalBounds (in, typeHIRect)
  233. * The new optimal bounds.
  234. *
  235. * Availability:
  236. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later in QuickTime.framework
  237. * CarbonLib: not available
  238. }
  239. const
  240. kEventMovieViewOptimalBoundsChanged = 1;
  241. {
  242. * Summary:
  243. * HIMovieView attributes
  244. }
  245. const
  246. {
  247. * No attributes
  248. }
  249. kHIMovieViewNoAttributes = 0;
  250. {
  251. * Movie controller bar is visible below visual content
  252. }
  253. kHIMovieViewControllerVisibleAttribute = 1 shl 0;
  254. {
  255. * Automatically call MCIdle() at appropriate times
  256. }
  257. kHIMovieViewAutoIdlingAttribute = 1 shl 1;
  258. {
  259. * Accepts keyboard focus
  260. }
  261. kHIMovieViewAcceptsFocusAttribute = 1 shl 2;
  262. {
  263. * Movie editing enabled
  264. }
  265. kHIMovieViewEditableAttribute = 1 shl 3;
  266. {
  267. * Handles editing HI commands such as cut, copy and paste
  268. }
  269. kHIMovieViewHandleEditingHIAttribute = 1 shl 4;
  270. {
  271. * Combination of kHIMovieViewControllerVisibleAttribute,
  272. * kHIMovieViewAutoIdlingAttribute, and
  273. * kHIMovieViewAcceptsFocusAttribute
  274. }
  275. kHIMovieViewStandardAttributes = kHIMovieViewControllerVisibleAttribute or kHIMovieViewAutoIdlingAttribute or kHIMovieViewAcceptsFocusAttribute;
  276. {
  277. * HIMovieViewCreate()
  278. *
  279. * Summary:
  280. * Creates an HIMovieView object
  281. *
  282. * Discussion:
  283. * If successful, the created view will have a single retain count.
  284. *
  285. * Parameters:
  286. *
  287. * inMovie:
  288. * [in] Initial movie to view, may be NULL
  289. *
  290. * inAttributes:
  291. * [in] Initial HIMovieView attributes
  292. *
  293. * outMovieView:
  294. * [out] Points to variable to receive new HIMovieView
  295. *
  296. * Availability:
  297. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later in QuickTime.framework
  298. * CarbonLib: not available
  299. * Non-Carbon CFM: not available
  300. }
  301. function HIMovieViewCreate( inMovie: Movie; inAttributes: OptionBits; var outMovieView: HIViewRef ): OSStatus; external name '_HIMovieViewCreate';
  302. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  303. {
  304. * HIMovieViewGetMovie()
  305. *
  306. * Summary:
  307. * Returns the view's current movie.
  308. *
  309. * Parameters:
  310. *
  311. * inView:
  312. * [in] The HIMovieView
  313. *
  314. * Availability:
  315. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later in QuickTime.framework
  316. * CarbonLib: not available
  317. * Non-Carbon CFM: not available
  318. }
  319. function HIMovieViewGetMovie( inView: HIViewRef ): Movie; external name '_HIMovieViewGetMovie';
  320. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  321. {
  322. * HIMovieViewSetMovie()
  323. *
  324. * Summary:
  325. * Sets the view's current movie.
  326. *
  327. * Parameters:
  328. *
  329. * inView:
  330. * [in] The HIMovieView
  331. *
  332. * inMovie:
  333. * [in] The new movie to display
  334. *
  335. * Availability:
  336. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later in QuickTime.framework
  337. * CarbonLib: not available
  338. * Non-Carbon CFM: not available
  339. }
  340. function HIMovieViewSetMovie( inView: HIViewRef; inMovie: Movie ): OSStatus; external name '_HIMovieViewSetMovie';
  341. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  342. {
  343. * HIMovieViewGetAttributes()
  344. *
  345. * Summary:
  346. * Returns the view's current attributes.
  347. *
  348. * Parameters:
  349. *
  350. * inView:
  351. * [in] The HIMovieView
  352. *
  353. * Availability:
  354. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later in QuickTime.framework
  355. * CarbonLib: not available
  356. * Non-Carbon CFM: not available
  357. }
  358. function HIMovieViewGetAttributes( inView: HIViewRef ): OptionBits; external name '_HIMovieViewGetAttributes';
  359. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  360. {
  361. * HIMovieViewChangeAttributes()
  362. *
  363. * Summary:
  364. * Changes the views attributes.
  365. *
  366. * Discussion:
  367. * Setting an attribute takes precedence over clearing the attribute.
  368. *
  369. * Parameters:
  370. *
  371. * inView:
  372. * [in] The HIMovieView
  373. *
  374. * inAttributesToSet:
  375. * [in] Attributes to set
  376. *
  377. * inAttributesToClear:
  378. * [in] Attributes to clear
  379. *
  380. * Availability:
  381. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later in QuickTime.framework
  382. * CarbonLib: not available
  383. * Non-Carbon CFM: not available
  384. }
  385. function HIMovieViewChangeAttributes( inView: HIViewRef; inAttributesToSet: OptionBits; inAttributesToClear: OptionBits ): OSStatus; external name '_HIMovieViewChangeAttributes';
  386. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  387. {
  388. * HIMovieViewGetMovieController()
  389. *
  390. * Summary:
  391. * Returns the view's current movie controller.
  392. *
  393. * Parameters:
  394. *
  395. * inView:
  396. * [in] The HIMovieView
  397. *
  398. * Availability:
  399. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later in QuickTime.framework
  400. * CarbonLib: not available
  401. * Non-Carbon CFM: not available
  402. }
  403. function HIMovieViewGetMovieController( inView: HIViewRef ): MovieController; external name '_HIMovieViewGetMovieController';
  404. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  405. {
  406. * HIMovieViewGetControllerBarSize()
  407. *
  408. * Summary:
  409. * Returns the size of the visible movie controller bar.
  410. *
  411. * Parameters:
  412. *
  413. * inView:
  414. * [in] The HIMovieView
  415. *
  416. * Availability:
  417. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later in QuickTime.framework
  418. * CarbonLib: not available
  419. * Non-Carbon CFM: not available
  420. }
  421. function HIMovieViewGetControllerBarSize( inView: HIViewRef ): HISize; external name '_HIMovieViewGetControllerBarSize';
  422. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  423. {
  424. * HIMovieViewPlay()
  425. *
  426. * Summary:
  427. * Convenience routine to play the view's current movie.
  428. *
  429. * Discussion:
  430. * If the movie is already playing, this function does nothing.
  431. *
  432. * Parameters:
  433. *
  434. * movieView:
  435. * [in] The movie view.
  436. *
  437. * Availability:
  438. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later in QuickTime.framework
  439. * CarbonLib: not available
  440. * Non-Carbon CFM: not available
  441. }
  442. function HIMovieViewPlay( movieView: HIViewRef ): OSStatus; external name '_HIMovieViewPlay';
  443. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  444. {
  445. * HIMovieViewPause()
  446. *
  447. * Summary:
  448. * Convenience routine to pause the view's current movie.
  449. *
  450. * Discussion:
  451. * If the movie is already paused, this function does nothing.
  452. *
  453. * Parameters:
  454. *
  455. * movieView:
  456. * [in] The movie view.
  457. *
  458. * Availability:
  459. * Mac OS X: in version 10.4 (or QuickTime 7.0) and later in QuickTime.framework
  460. * CarbonLib: not available
  461. * Non-Carbon CFM: not available
  462. }
  463. function HIMovieViewPause( movieView: HIViewRef ): OSStatus; external name '_HIMovieViewPause';
  464. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  465. {$endc} {TARGET_CPU_64}
  466. {$endc} {TARGET_OS_MAC}
  467. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  468. end.
  469. {$endc} {not MACOSALLINCLUDE}