Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

774 lines
31 KiB

  1. // jgplay.h -- Public Header for ART 3.5 Player
  2. // --------------------------------------------------------------------
  3. // Copyright (c) 1995 Johnson-Grace Company, all rights reserved
  4. //
  5. // Change History
  6. // --------------
  7. // 950820 DLB Original File
  8. // 960426 Eric Rodriguez-Diaz
  9. // - For Mac only, added import pragmas.
  10. // 960429 Eric Rodriguez-Diaz
  11. // - Improved import pragmas for Mac.
  12. // 960605 Eric Rodriguez-Diaz
  13. // - Now taking into account the fact that for the Mac symbol
  14. // GENERATINGCFM is always defined in the universal headers.
  15. // 960606 SED Added UI hook functions.
  16. // 960613 SED Added Art file attributes; removed HasAudio, HasImage,
  17. // HasMIDI. Added memory calls for UI DLL. Added Lossless
  18. // Decompression calls for ARTDoc. Added memory hooks for
  19. // MAC. Also added memory function struct arg to
  20. // JgPlayStartUp for MAC. Added ShowIsOver, TitleReady,
  21. // JGPLAY_ERR_FULL and JGPLAY_MAX_INPUT for Slide Shows.
  22. // Added JgPlayFreeImage.
  23. // 960617 SED Added JGPLAY_PALETTE and modifed JgPlayGetPalette to
  24. // use it.
  25. // 960618 SED Added the UI Report hook and modified the UI Input hook.
  26. // 960619 SED Removed JgPlayFreeImage. Modified JgPlayGetImage to
  27. // use JGPLAY_IMAGE_REF and JgPlayGetPalette to use
  28. // JGPLAY_PALETTE_REF. Added the JgPlayStopPlay element
  29. // argument and the element constants. Added a Size member
  30. // to the JGPLAY_MEMORY structure. Changed the JGPLAY_SETUP
  31. // DefaultPalette member to a JGPLAY_PALETTE_REF.
  32. // 960621 SED Added Number of colors parameter to JgPlayGetPalette.
  33. // 960621 SED Changed JGPLAY_ERR_OLDERROR to JGPLAY_ERR_PREVIOUS.
  34. // Removed JGPLAY_ERR_IMGDECODER.
  35. // 960625 SED Added JgPlayPausePlay, JgPlayResumePlay, JgPlaySetPosition
  36. // and JgPlayGetPosition. Removed element-to-stop arg from
  37. // JgPlayStopPlay. Removed StopTime from JgPlayStartPlay and
  38. // StopTime from JgPlayStopPlay. Added UI hooks defines for
  39. // JgPlayPausePlay and JgPlayResumePlay.
  40. // 960626 SED Added JGHandle to JGPLAY_SETUP structure to support reuse
  41. // of the JGDW context.
  42. // 960628 SED Added PaletteMode and IndexOverride and associated constants
  43. // to JGPLAY_SETUP structure.
  44. // 960708 SED Changed JGPLAY_XXX to JGP_XXX and JgPlayXXX to JgpXXXX.
  45. // 960709 SED Changed JGPTR to JGFAR * and JGHPTR to JGHUGE *. Changed
  46. // BOOLW to UINTW and removed convenience typedefs.
  47. // 960710 Eric Rodriguez-Diaz
  48. // - For the Mac, now have pragmas forcing power structure alignment.
  49. // Not using native alignment because it isn't supported by
  50. // the Symantec compilers. Not using mac68k alignment because 68k
  51. // is a dying breed.
  52. // 960805 SED Added Slide Show support.
  53. // --------------------------------------------------------------------
  54. #ifndef JGPLAY_H
  55. #define JGPLAY_H 1
  56. #ifdef _MAC
  57. #include <Types.h>
  58. #include <Palettes.h>
  59. #include <QuickDraw.h>
  60. #include <QDOffscreen.h>
  61. #else
  62. #pragma warning(disable:4201)
  63. #include <windows.h>
  64. #pragma warning(default:4201)
  65. #endif
  66. #include "jgtypes.h" // Include this for basic JG Types
  67. #ifdef __cplusplus
  68. extern "C" { // Indicate C declarations if C++
  69. #endif
  70. #ifdef _MAC
  71. // make sure GENERATINGCFM is defined
  72. #include <ConditionalMacros.h>
  73. #if GENERATINGCFM
  74. #pragma import on
  75. #endif
  76. // select PowerPC structure alignment
  77. #pragma options align=power
  78. #endif
  79. // --------------------------------------------------------------------
  80. // Error Codes
  81. #define JGP_ERR_BASE 3000 // Get this from the registor. (not yet)
  82. #define JGP_SUCCESS 0 // Always true at JG.
  83. #define JGP_ERR_MEM ((JGP_ERR_BASE + 1) | JG_ERR_MEMORY)
  84. #define JGP_ERR_INIT ((JGP_ERR_BASE + 2) | JG_ERR_CHECK)
  85. #define JGP_ERR_BADDATA ((JGP_ERR_BASE + 3) | JG_ERR_DATA)
  86. #define JGP_ERR_BADARG ((JGP_ERR_BASE + 4) | JG_ERR_ARG)
  87. #define JGP_ERR_CODECHECK ((JGP_ERR_BASE + 5) | JG_ERR_CHECK)
  88. #define JGP_ERR_PREVIOUS ((JGP_ERR_BASE + 6) | JG_ERR_ARG)
  89. #define JGP_ERR_NOTREADY ((JGP_ERR_BASE + 7) | JG_ERR_CHECK)
  90. #define JGP_ERR_RESOURCE ((JGP_ERR_BASE + 8) | JG_ERR_CHECK)
  91. #define JGP_ERR_BADSTRUCTSIZE ((JGP_ERR_BASE + 9) | JG_ERR_CHECK)
  92. #define JGP_ERR_AUDIODECODER ((JGP_ERR_BASE + 10) | JG_ERR_CHECK)
  93. #define JGP_ERR_MIDIDECODER ((JGP_ERR_BASE + 11) | JG_ERR_CHECK)
  94. #define JGP_ERR_VOLUME ((JGP_ERR_BASE + 12) | JG_ERR_CHECK)
  95. #define JGP_ERR_NONOTE ((JGP_ERR_BASE + 13) | JG_ERR_CHECK)
  96. #define JGP_ERR_UNSUPPORTED ((JGP_ERR_BASE + 14) | JG_ERR_DATA)
  97. #define JGP_ERR_NOPALETTE ((JGP_ERR_BASE + 15) | JG_ERR_CHECK)
  98. #define JGP_ERR_FULL ((JGP_ERR_BASE + 16) | JG_ERR_CHECK)
  99. #define JGP_ERR_OPENHANDLE ((JGP_ERR_BASE + 17) | JG_ERR_CHECK)
  100. #define JGP_ERR_NOTAVAILABLE ((JGP_ERR_BASE + 18) | JG_ERR_ARG)
  101. #define JGP_ERR_BADSTATE ((JGP_ERR_BASE + 19) | JG_ERR_ARG)
  102. #define JGP_ERR_UIMODULE ((JGP_ERR_BASE + 20) | JG_ERR_UNKNOWN)
  103. // Error Codes dealing with Library Startup/Shutdown
  104. #define JGP_ERR_IGNORED_MEMORY_HOOKS ((JGP_ERR_BASE + 21) | JG_ERR_UNKNOWN)
  105. #define JGP_ERR_BAD_SHUTDOWN ((JGP_ERR_BASE + 22) | JG_ERR_UNKNOWN)
  106. // Max number of input bytes accepted at once by JgpInputStream,
  107. // one-half a mega byte.
  108. #define JGP_MAX_INPUT 524288
  109. // Max length of ART Note
  110. #define JGP_ARTLENGTH 200
  111. // --------------------------------------------------------------------
  112. // Options for scaling.
  113. #define JGP_SCALE_NONE 0 // No Scaling
  114. #define JGP_SCALE_EXACT 1 // Scale to ScaleWidth and ScaleHeight
  115. #define JGP_SCALE_BESTFIT 2 // Maintain aspect ratio, use best fit
  116. // --------------------------------------------------------------------
  117. // Options for gamma correction.
  118. #define JGP_GAMMA_NONE 0
  119. #define JGP_GAMMA_UP 1
  120. #define JGP_GAMMA_DOWN 2
  121. // --------------------------------------------------------------------
  122. // File Types
  123. #define JGP_UNSUPPORTED 0
  124. #define JGP_ART JG4C_ART
  125. #define JGP_BMP JG4C_BMP
  126. #define JGP_GIF JG4C_GIF
  127. #define JGP_JPG JG4C_JPEG
  128. // --------------------------------------------------------------------
  129. // File Attributes
  130. #define JGP_HASIMAGE 1
  131. #define JGP_HASAUDIO 2
  132. #define JGP_HASMIDI 4
  133. #define JGP_HASARTNOTE 8
  134. #define JGP_HASDYNAMICIMAGES 16
  135. #define JGP_ISTEMPORAL 32
  136. #define JGP_HASPAUSE 64
  137. #define JGP_HASTIMELINE 128
  138. // --------------------------------------------------------------------
  139. // Audio Modes. Choose one of these for playback or zero to choose the
  140. // mode with the lowest processing cost on the CPU (usually 11K, 16bit).
  141. #define JGP_AUDIO_DEFAULT 0x0000
  142. #define JGP_AUDIO_11K_8BIT 0x0001
  143. #define JGP_AUDIO_11K_16BIT 0x0002
  144. #define JGP_AUDIO_22K_8BIT 0x0004
  145. #define JGP_AUDIO_22K_16BIT 0x0008
  146. // --------------------------------------------------------------------
  147. // Common UI hooks.
  148. #define JGP_CLOSEUIHOOK 0 // JgPClose HEAD hook
  149. #define JGP_STARTUIHOOK 1 // JgPStartPlay TAIL hook
  150. #define JGP_STOPUIHOOK 2 // JgPStopPlay TAIL hook
  151. #define JGP_PAUSEUIHOOK 3 // JgPPausePlay TAIL hook
  152. #define JGP_RESUMEUIHOOK 4 // JgPResumePlay TAIL hook
  153. #define JGP_MAXUIHOOKS 5 // INCREASE if more hooks are allowed
  154. // --------------------------------------------------------------------
  155. // PaletteModes.
  156. #define JGP_PALETTE_AUTO 0 // Use first available: file, input, 332
  157. #define JGP_PALETTE_INPUT 1 // Use input palette
  158. #define JGP_PALETTE_332 2 // Use 332
  159. // --------------------------------------------------------------------
  160. // Use this constant to turn off IndexOverride option.
  161. #define JGP_OVERRIDE_NONE 0xFFFF
  162. // --------------------------------------------------------------------
  163. // Typedefs for System dependent Image and Palette data types.
  164. #ifndef _MAC
  165. typedef HGLOBAL JGP_IMAGE_REF;
  166. typedef HGLOBAL JGP_PALETTE_REF;
  167. #else
  168. typedef GWorldPtr JGP_IMAGE_REF;
  169. typedef PaletteHandle JGP_PALETTE_REF;
  170. #endif
  171. // These typedefs must match the jgdw lossless typedefs.
  172. typedef struct {
  173. UINT16 nSize; // Size of structure in bytes
  174. INT16 SearchSize; // (Compression control)
  175. UINT32 CompressedSize; // Total compressed block bytes
  176. UINT32 CompressedSoFar; // Compressed processed so far
  177. UINT32 CompressedLastCall; // Compressed processed last call
  178. UINT32 DecompressedSize; // Total decompressed block bytes
  179. UINT32 DecompressedSoFar; // Decompressed processed so far
  180. UINT32 DecompressedLastCall; // Decompressed processed last call
  181. } JGP_LOSSLESS;
  182. // lossless decompression handle type
  183. typedef void JGFAR * JGP_LOSSLESS_HANDLE;
  184. // --------------------------------------------------------------------
  185. // JGP_IMG -- Defines the exported image format for the ART file Player.
  186. // This format is designed to be system independent, but it can carry
  187. // information that is helpful in the system dependent conversion process.
  188. // It is also designed to be very close to JG_IMG which is used by JGIPROC.
  189. // It can also hold the data in the form of a DIB for windows, or a GWorld
  190. // for a MAC.
  191. typedef struct {
  192. UINTW Rows; // Rows, in pixels
  193. UINTW Cols; // Cols, in pixels
  194. UINTW Colordepth; // Colordepth: 4, 8, 16 or 24
  195. UINT8 JGHUGE *pPixels; // Pointer to top row of pixels in this image
  196. INTW RowDisp; // Offset between rows in this image
  197. UINTW nColors; // Number of colors in the palette.
  198. JG_BGRX JGFAR *pPalette;// Pointer to list of colors for palette.
  199. void JGFAR *pManager; // Reserved. (Internally maintained ptr.)
  200. } JGP_IMG;
  201. // --------------------------------------------------------------------
  202. // JGRECT -- A rectangle structure, defined to be equivalent to the
  203. // Window's RECT. Used here to avoid machine dependance. These rects
  204. // assume that screen coordinates run top (starting at zero) to bottom
  205. // (positive increase) and from left (starting at zero) to right
  206. // (positive increase). We also assume that the bottom-right border
  207. // defined by the structure is not part of the rectanglar area.
  208. typedef struct {
  209. INTW left; // Location of left border
  210. INTW top; // Location of top border
  211. INTW right; // Location of right border, (plus 1)
  212. INTW bottom; // Location of bottom border, (plus 1)
  213. } JGRECT;
  214. // --------------------------------------------------------------------
  215. // JGP_REPORT -- This structure is used to obtain information
  216. // about a specific show which can be idenitified by an instance handle.
  217. typedef struct {
  218. UINTW Size; // Size of this struct in bytes, set by caller
  219. UINTW ImageValid; // True if the image is valid.
  220. UINT32 CurrentTime; // Current Time of play, in ms.
  221. UINT32 AvailPlayTime; // Total Play Time in buffer from start to end.
  222. UINTW DoingAudio; // Non-zero if audio is playing.
  223. UINTW DoingMIDI; // Non-zero if MIDI is playing.
  224. UINTW ShowStalled; // If nothing else to do, ... Waiting for input
  225. UINTW GotEOF; // If this show has received an EOF mark
  226. UINTW IsDone; // The presentation is finished.
  227. UINTW UpdateImage; // Non-zero if the image needs an update.
  228. UINTW TransparentIndex; // Index of transparent color.
  229. JGRECT UpdateRect; // Area in image that has changed.
  230. UINTW ShowIsOver; // The show is finished playing.
  231. UINTW TitleReady; // Title page is ready.
  232. UINTW IsPaused; // The show is paused.
  233. UINTW IsPlaying; // The show is playing
  234. } JGP_REPORT;
  235. // --------------------------------------------------------------------
  236. // JGP_SETUP -- This structure is used to communicate the input parameters
  237. // for the playing of a show.
  238. typedef struct {
  239. UINTW Size; // Size of this struct in bytes, set by caller
  240. UINTW ColorDepth; // Output colordepth (Allowed: 4, 8, 16 or 24)
  241. UINTW InhibitImage; // If true, no image returned.
  242. UINTW InhibitAudio; // If true, no audio played.
  243. UINTW InhibitMIDI; // If true, no MIDI played.
  244. UINTW InhibitDither; // If true, no dithering is done
  245. UINTW InhibitSplash; // If true, no splash with image
  246. UINTW AudioMode; // Desired Audio mode, or zero for default.
  247. UINTW CreateMask; // If true, create mask imacdge
  248. UINTW ScaleImage; // Scaling option
  249. UINTW ScaleWidth; // Scaled width
  250. UINTW ScaleHeight; // Scaled height
  251. UINTW GammaAdjust; // Gamma adjustment value
  252. JG_RGBX BackgroundColor;// Background color under the image.
  253. JGP_PALETTE_REF DefaultPalette; // Default Palette, NULL if none
  254. UINTW PaletteSize; // Number of Colors in Default Palette, or 0
  255. JGHANDLE OldHandle; // Handle for image context reuse
  256. UINTW PaletteMode; // Specifies palette mode
  257. UINTW IndexOverride; // Transparent override/create index
  258. UINTW TempMemory; // TRUE to use temporary memory
  259. UINT32 InputBaud; // Input Baud if known by app. Zero otherwise.
  260. } JGP_SETUP;
  261. // --------------------------------------------------------------------
  262. // JGP_STREAM -- This structure is used to return information
  263. // about the ART Stream
  264. typedef struct {
  265. UINTW Size; // Size of this struct in bytes, set by caller
  266. UINTW MajorVersion; // Major version of the ART tstream.
  267. UINTW MinorVersion; // Subversion of the ART stream.
  268. UINTW CanDecode; // TRUE if this module can decode the stream.
  269. UINT32 Filetype; // JGPL_xxx returned constant
  270. UINT32 Attributes; // File attributes
  271. UINT32 PlayTime; // Playtime if temporal, non-realtime stream.
  272. JGRECT Dimensions; // Native dimensions of stream if has image(s).
  273. UINTW ColorDepth; // Color Depth of Stream (4,8,16,24)
  274. UINT32 UpdateRate; // Minimum ms between heartbeat calls.
  275. UINT32 Baud; // Minimum input baud rate.
  276. UINT32 BytesToTitle; // Number of bytes needed to get title image.
  277. UINTW SubType; // ART subtype ID
  278. } JGP_STREAM;
  279. // --------------------------------------------------------------------
  280. // JGP_TEST -- This structure contains the information about the
  281. // test to see if the CPU and other environment is up to doing the
  282. // show in real-time.
  283. typedef struct {
  284. UINTW Size; // Size of this struct in bytes, set by caller
  285. UINTW CanDoAudio; // Non-zero if audio can be part of the show.
  286. UINTW CanDoMIDI; // Non-zero if MIDI can be part of the show.
  287. UINTW PrefAudioMode; // Preferred audio mode.
  288. } JGP_TEST;
  289. // --------------------------------------------------------------------
  290. // JGP_NOTE -- This structure contains information about the ART note.
  291. typedef struct {
  292. UINTW Size; // Size of this struct in bytes, set by caller
  293. UINTW Display; // If true ART note should always be displayed
  294. UINTW Copyrighted; // If true the note is copyrighted
  295. } JGP_NOTE;
  296. // --------------------------------------------------------------------
  297. // Generic palette pointer for MAC and Windows
  298. typedef void JGFAR * JGP_PALETTE;
  299. // --------------------------------------------------------------------
  300. // Memory function typedefs
  301. typedef void JGFAR * (JGFFUNC * JGMEMALLOC) (
  302. UINT32 RequestedSize // In: Number of bytes to allocate
  303. );
  304. typedef void JGFAR * (JGFFUNC * JGMEMREALLOC) (
  305. void JGFAR *pBuffer, // In: Allocated buffer pointer
  306. UINT32 RequestedSize // In: Number of bytes to allocate
  307. );
  308. typedef void (JGFFUNC * JGMEMFREE) (
  309. void JGFAR *pBuffer // In: Allocated buffer pointer
  310. );
  311. typedef struct {
  312. UINTW Size; // Size of this struct in bytes, set by caller
  313. JGMEMALLOC MemAlloc; // Allocation function pointer
  314. JGMEMREALLOC MemReAlloc; // Re-Allocation function pointer
  315. JGMEMFREE MemFree; // Free function pointer
  316. } JGP_MEMORY;
  317. // --------------------------------------------------------------------
  318. // UI hooks typedef and constants.
  319. typedef JGERR (JGFFUNC * JGP_UIHOOK) (
  320. JGHANDLE Handle, // In: Instance handle
  321. JGERR Err // In: Calling function status
  322. );
  323. typedef JGERR (JGFFUNC * JGP_INPUT_UIHOOK) (
  324. JGHANDLE Handle, // In: Instance handle
  325. UINT8 JGHUGE *pARTStream,// In: Pointer to the ART Stream
  326. UINT32 nBytes, // In: Number of bytes being input
  327. JGERR iErr // In: Calling function status
  328. );
  329. typedef JGERR (JGFFUNC * JGP_REPORT_UIHOOK) (
  330. JGHANDLE Handle, // In: Instance handle
  331. JGP_REPORT JGFAR *pReport,// In: Report structure
  332. JGERR Err // In: Calling function status
  333. );
  334. // --------------------------------------------------------------------
  335. // JgpStartUp{} -- This function can be called when the library is
  336. // started. Under Windows, the LibMain does this.
  337. JGERR JGFFUNC JgpStartUp(
  338. JGP_MEMORY JGFAR *pMemFcns); // In: Memory function struct pointer
  339. // --------------------------------------------------------------------
  340. // JgpShutDown{} -- This function can be called to shut the player
  341. // down. Under Windows, the WEP function does this.
  342. JGERR JGFFUNC JgpShutDown(void);
  343. // --------------------------------------------------------------------
  344. // JgpHeartBeat{} -- This function is used to keep the Show going.
  345. // This function or JgpInputStream must be called every 100 ms.
  346. JGERR JGFFUNC JgpHeartBeat(
  347. JGHANDLE SHandle); // In: Show handle
  348. // --------------------------------------------------------------------
  349. // JgpQueryStream{} -- This is a utility function, which if given the
  350. // first part of an ART Stream will return useful info about it. Usually,
  351. // the data to fill the info structure can be found in the first
  352. // 100 bytes of a Stream, but not necessarily.
  353. JGERR JGFFUNC JgpQueryStream(
  354. UINT8 JGHUGE *pARTStream, // In: ART Stream
  355. UINT32 nARTStreamBytes, // In: Size of ARTStream in Bytes
  356. JGP_STREAM JGFAR *pInfo); // Out: Info structure
  357. // --------------------------------------------------------------------
  358. // JgpDoTest{} -- Perform a test to determine ability of CPU to do
  359. // the show in real-time.
  360. JGERR JGFFUNC JgpDoTest(
  361. JGP_TEST JGFAR *pInfo); // In: Info struct to be filled
  362. // --------------------------------------------------------------------
  363. // JgpOpen{} -- This function is used to obtain a handle for a
  364. // show.
  365. JGERR JGFFUNC JgpOpen(
  366. JGHANDLE JGFAR *pSHandle, // Out: Place to receive handle
  367. JGP_SETUP JGFAR *pSetup); // In: The setup structure
  368. // --------------------------------------------------------------------
  369. // JgpClose{} -- This function frees all the resources associated
  370. // with a show. If the show (and sound) is playing, it is immediately
  371. // stopped.
  372. JGERR JGFFUNC JgpClose(
  373. JGHANDLE SHandle); // In: Show handle
  374. // --------------------------------------------------------------------
  375. // JgpSetEOFMark{} -- Sets and EOF mark for the ART stream.
  376. // This tells the player that no more data is expected for this stream,
  377. // and if, during play, the EOF mark is reached, to shut down play.
  378. // Otherwise, if an out-of-data condition occures, play goes into a
  379. // suppended state which continues to hold onto output resources of the
  380. // computer.
  381. JGERR JGFFUNC JgpSetEOFMark(
  382. JGHANDLE SHandle); // In: Show handle
  383. // --------------------------------------------------------------------
  384. // JgpInputStream{} -- Accepts the Show stream. Call in a loop!
  385. // Must be called every XX ms even if there is no new data.
  386. //
  387. // Note, by calling this routine, the show does not automatically
  388. // start. Call JgpStartShow to do this.
  389. JGERR JGFFUNC JgpInputStream(
  390. JGHANDLE SHandle, // In: Show Handle
  391. UINT8 JGHUGE *pARTStream, // In: Pointer to the ART Stream
  392. UINT32 nBytes); // In: Number of bytes being input
  393. // --------------------------------------------------------------------
  394. // JgpStartPlay{} -- Starts play of a show at an arbitrary point
  395. // in the stream. The arbitrary point in the stream can be specifed
  396. // using the JgpSetPostion. The call can be made anytime after the
  397. // stream is opened, even if there is no data. In a download situation,
  398. // the show is not started until there is enough data to play at the
  399. // given starttime plus 5 seconds.
  400. JGERR JGFFUNC JgpStartPlay(
  401. JGHANDLE SHandle); // In: Show Handle
  402. // --------------------------------------------------------------------
  403. // JgpResumePlay{} -- Starts play of an ART stream at the point
  404. // in the stream at which it was paused.
  405. UINTW JGFFUNC JgpResumePlay(
  406. JGHANDLE SHandle); // In: Show Handle
  407. // --------------------------------------------------------------------
  408. // JgpPausePlay{} -- Causes play of an ART stream to stop. The
  409. // stop time is saved for later resuming.
  410. UINTW JGFFUNC JgpPausePlay(
  411. JGHANDLE SHandle); // In: Show Handle
  412. // --------------------------------------------------------------------
  413. // JgpStopPlay{} -- Stops the play of the show.
  414. JGERR JGFFUNC JgpStopPlay(
  415. JGHANDLE SHandle); // In: Show Handle
  416. // --------------------------------------------------------------------
  417. // JgpReleaseSound{} -- Disconnects the instance from the sound devices.
  418. JGERR JGFFUNC JgpReleaseSound(
  419. JGHANDLE SHandle); // In: Show Handle
  420. // --------------------------------------------------------------------
  421. // JgpResumeSound{} -- Reconnects the instance to the sound devices.
  422. JGERR JGFFUNC JgpResumeSound(
  423. JGHANDLE SHandle); // In: Show Handle
  424. #ifdef _MAC
  425. // --------------------------------------------------------------------
  426. // JgpGetVolume{} -- Gets sound volume for a show instance.
  427. JGERR JGFFUNC JgpGetVolume(
  428. JGHANDLE SHandle,
  429. UINTW JGFAR *pnOutVolume
  430. );
  431. // --------------------------------------------------------------------
  432. // JgpSetVolume{} -- Sets sound volume for a show instance.
  433. JGERR JGFFUNC JgpSetVolume(
  434. JGHANDLE SHandle,
  435. UINTW nInVolume
  436. );
  437. #endif
  438. // --------------------------------------------------------------------
  439. // JgpSetPosition{} -- This function sets the stop/pause position
  440. // time associated with the Show instance.
  441. JGERR JGFFUNC JgpSetPosition(
  442. JGHANDLE SHandle, // In: Show Handle
  443. UINT32 nPosition); // In: Position
  444. // --------------------------------------------------------------------
  445. // JgpGetPosition{} -- This function gets the stop/pause position
  446. // time associated with the Show instance.
  447. JGERR JGFFUNC JgpGetPosition(
  448. JGHANDLE SHandle, // In: Show Handle
  449. UINT32 JGFAR *pPosition); // Out: Position
  450. // --------------------------------------------------------------------
  451. // JgpGetImage{} -- Returns a system independent representation of
  452. // the image.
  453. //
  454. // Depending on the platform phImg is either a GWorldPtr or a huge
  455. // pointer to a DIB. The caller must lock the returned HGLOBAL to use
  456. // the DIB.
  457. JGERR JGFFUNC JgpGetImage(
  458. JGHANDLE SHandle, // In: Show handle
  459. JGP_IMAGE_REF JGFAR *phImg); // Out: Handle to Image memory
  460. // --------------------------------------------------------------------
  461. // JgpGetMask{} -- Returns a system independent representation of
  462. // the mask image.
  463. //
  464. // Depending on the platform phImg is either a BitMapPtr or a huge
  465. // pointer to a DIB. The caller must lock the returned HGLOBAL to use
  466. // the DIB.
  467. JGERR JGFFUNC JgpGetMask(
  468. JGHANDLE SHandle, // In: Show handle
  469. JGP_IMAGE_REF JGFAR *phImg); // Out: Handle to Image memory
  470. // --------------------------------------------------------------------
  471. // JgpGetPalette{} -- Returns a system independent representation
  472. // of the image palette.
  473. //
  474. // The caller is responsible for freeing the memory buffer space.
  475. // Depending on the platform pPal is either a pointer to a PaletteHandle
  476. // or a pointer to PALETTEENTRY structures.
  477. JGERR JGFFUNC JgpGetPalette(
  478. JGHANDLE SHandle, // In: Show Handle
  479. JGP_PALETTE_REF JGFAR *phPal, // Out: Palette data
  480. UINTW JGFAR *pnColors); // Out: Number of colors
  481. // --------------------------------------------------------------------
  482. // JgpGetARTNote{} -- Returns the ART note.
  483. JGERR JGFFUNC JgpGetARTNote(
  484. UINT8 JGHUGE *pARTStream, // In: ART Stream
  485. UINT32 nARTStreamBytes, // In: Size of ARTStream in Bytes
  486. JGP_NOTE JGFAR *pNote, // Out: Info structure
  487. UINT8 JGFAR *pData); // Out: Note text
  488. // --------------------------------------------------------------------
  489. // JgpGetReport{} -- Reports the activity of a show, given it's handle.
  490. // This is usually called after 'bImageUpdate' becomes true.
  491. JGERR JGFFUNC JgpGetReport(
  492. JGHANDLE SHandle, // In: Show Handle
  493. JGP_REPORT JGFAR *pReport); // Out: Structure to receive the report
  494. // --------------------------------------------------------------------
  495. // JgpSetUiHook{} -- This function sets a UI function hook.
  496. JGERR JGFFUNC JgpSetUiHook(
  497. JGP_UIHOOK pHook, // In: Ui Hook function
  498. UINTW UiHook); // In: Hook tag
  499. // --------------------------------------------------------------------
  500. // JgpGetUiHook{} -- This function returns a UI function hook.
  501. JGERR JGFFUNC JgpGetUiHook(
  502. JGP_UIHOOK JGFAR *hHook, // Out: Ui Hook function
  503. UINTW UiHook); // In: Hook tag
  504. // --------------------------------------------------------------------
  505. // JgpSetUiInputHook{} -- This function sets the JgpInputStream
  506. // UI function hook.
  507. JGERR JGFFUNC JgpSetUiInputHook(
  508. JGP_INPUT_UIHOOK pHook); // In: Ui Hook function
  509. // --------------------------------------------------------------------
  510. // JgpGetUiInputHook{} -- This function returns the JgpInputStream
  511. // UI function hook.
  512. JGERR JGFFUNC JgpGetUiInputHook(
  513. JGP_INPUT_UIHOOK JGFAR *hHook); // Out: Ui Hook function
  514. // --------------------------------------------------------------------
  515. // JgpSetUiReportHook{} -- This function sets the JgpGetReport
  516. // UI function hook.
  517. JGERR JGFFUNC JgpSetUiReportHook(
  518. JGP_REPORT_UIHOOK pHook); // In: Ui Hook function
  519. // --------------------------------------------------------------------
  520. // JgpGetUiReportHook{} -- This function returns the JgpGetReport
  521. // UI function hook.
  522. JGERR JGFFUNC JgpGetUiReportHook(
  523. JGP_REPORT_UIHOOK JGFAR *hHook); // Out: Ui Hook function
  524. // --------------------------------------------------------------------
  525. // JgpSetUiLong{} -- This function sets a UI long value associated
  526. // with the Show instance.
  527. JGERR JGFFUNC JgpSetUiLong(
  528. JGHANDLE SHandle, // In: Show Handle
  529. UINT32 LongVal); // In: Long value
  530. // --------------------------------------------------------------------
  531. // JgpGetUiLong{} -- This function returns the UI long value
  532. // associated with the Show instance.
  533. JGERR JGFFUNC JgpGetUiLong(
  534. JGHANDLE SHandle, // In: Show Handle
  535. UINT32 JGFAR *pLongVal); // Out: Long value
  536. // --------------------------------------------------------------------
  537. // JgpAlloc{} -- This function allocates memory. The returned
  538. // JGFAR * can be cast to HUGE.
  539. void JGFAR * JGFFUNC JgpAlloc(
  540. JGHANDLE SHandle, // In: Show Handle
  541. UINT32 nBytes); // In: Bytes to allocate
  542. // --------------------------------------------------------------------
  543. // JgpReAlloc{} -- This function re-allocates memory. The returned
  544. // JGFAR * can be cast to HUGE.
  545. void JGFAR * JGFFUNC JgpReAlloc(
  546. JGHANDLE SHandle, // In: Show Handle
  547. void JGFAR *pMem, // In: Old pointer
  548. UINT32 nBytes); // In: Bytes to allocate
  549. // --------------------------------------------------------------------
  550. // JgpFree{} -- This function frees memory.
  551. void JGFFUNC JgpFree(
  552. JGHANDLE SHandle, // In: Show Handle
  553. void JGFAR *pMem); // In: Pointer to free
  554. // --------------------------------------------------------------------
  555. // JgpLosslessQuery{} -- This function interrogates a lossless stream.
  556. JGERR JGFFUNC JgpLosslessQuery(
  557. UINT8 JGHUGE *pInBuffer, // In: Beginning of compressed stream
  558. UINT32 InBufferSize, // In: Bytes in InBuffer (0-n)
  559. JGP_LOSSLESS JGFAR *pLosslessInfo); // Out: Stream info returned here
  560. // --------------------------------------------------------------------
  561. // JgpLosslessCreate{} -- This function creates a decompression handle.
  562. JGERR JGFFUNC JgpLosslessCreate(
  563. JGP_LOSSLESS_HANDLE JGFAR *pDecHandle); // In: Pointer to new handle
  564. // --------------------------------------------------------------------
  565. // JgpLosslessDestroy{} -- This function destroys a decompression handle.
  566. void JGFFUNC JgpLosslessDestroy(
  567. JGP_LOSSLESS_HANDLE DecHandle); // In: Handle from decompress create
  568. // --------------------------------------------------------------------
  569. // JgpLosslessReset{} -- This function resets an existing handle.
  570. JGERR JGFFUNC JgpLosslessReset(
  571. JGP_LOSSLESS_HANDLE DecHandle); // In: Handle from decompress create
  572. // --------------------------------------------------------------------
  573. // JgpLosslessBlock{} -- This function decompresses a block of data.
  574. JGERR JGFFUNC JgpLosslessBlock(
  575. JGP_LOSSLESS_HANDLE DecHandle, // In: Handle from decompress create
  576. UINT8 JGHUGE *pInBuffer, // In: Input (compressed) data
  577. UINT32 InBufferSize, // In: Bytes at *InBuffer (0-n)
  578. UINT8 JGHUGE *pOutBuffer, // Out: Output (decompressed result) buff
  579. UINT32 OutBufferSize, // In: Free bytes at *OutBuffer
  580. JGP_LOSSLESS JGFAR *pLosslessInfo);// Out: Updated info returned here
  581. // --------------------------------------------------------------------
  582. // JgpLosslessPartitionReset{} -- This function does a new partition reset.
  583. JGERR JGFFUNC JgpLosslessPartitionReset(
  584. JGP_LOSSLESS_HANDLE DecHandle); // In: Handle from decompress create
  585. // ====================================================================
  586. // UNDOCUMENTED/UNSUPPORTED FUNCTIONS (Below) -- (Use at your own risk...)
  587. // ====================================================================
  588. // --------------------------------------------------------------------
  589. // JGP_PERFORMANCE -- This structure returns performance data. It can
  590. // be used to map the CPU and Memory requirements for a Slideshow...
  591. typedef struct {
  592. UINTW Size; // Size of this structure, in bytes, set by caller
  593. UINTW IsSS; // If a slideshow is being played
  594. UINTW IsValidInfo; // If info in this structure contains valid info.
  595. UINTW Mode; // Show Mode: 0=not Init, 1=Preload, 2=Playable
  596. UINT32 CPUTime; // CPU Time (of call)
  597. UINT32 ShowTime; // ShowTime for this measurement
  598. UINTW nAssets; // Number of known assets.
  599. UINT32 nAssetBytes; // Allocated bytes for storing raw assets
  600. UINTW nVisPics; // Number of visible pictures
  601. UINTW nCashedPics; // Number of cashed pictures
  602. UINT32 nPixelBytes; // Number of allocated bytes for pixels
  603. UINT32 tCPUUsed; // Total ms of CPU useage since last call...
  604. } JGP_PERFORMANCE;
  605. // --------------------------------------------------------------------
  606. // JgpGetPerformance{} -- Reports the performance measurement of a show.
  607. JGERR JGFFUNC JgpGetPerformance(
  608. JGHANDLE SHandle, // In: Show Handle
  609. JGP_PERFORMANCE JGFAR *pPerformance); // Out: Structure to receive the report
  610. #ifdef _MAC
  611. // restore structure alignment mode
  612. #pragma options align=reset
  613. #if GENERATINGCFM
  614. #pragma import reset
  615. #endif
  616. #endif
  617. #ifdef __cplusplus
  618. }
  619. #endif
  620. #endif