home *** CD-ROM | disk | FTP | other *** search
/ The Complete Idiot's Guide to CD-ROM / thecompleteidiotsguidetocd-rom.iso / pc / mac / apps / ezplayer / easyplay.0_a
Text File  |  1993-02-11  |  20KB  |  527 lines

  1.  
  2. EasyPlay¬ 2.0 Apple Events
  3. ~~~~~~~~~~~~~~~~~~~~~~
  4. Easyplay is copyrighted software. It is not free. Check the important message at the end of the text in the application's "About EasyPlay" command.
  5.  
  6. EasyPlay can be fully controlled from another application by having that application send high level events. This document describes the events which EasyPlay 2.0 supports.
  7.  
  8. EasyPlay has an internal ╘aete╒ resource inside it which describes the supported events. Scripting systems are able to read this resource to determine the events that EasyPlay supports, and the terminology to use for each event.
  9.  
  10. The paragraphs below describe the supported events. At the right side of the first line, the four letter class and ID codes for the event appears, along with the type of the direct parameter and result, if any. At the left side, the UserLand ╥Frontier╙ scripting verb appears. Navigator also supports Frontier╒s shared menu system. If you have Frontier, double-click the ╥EasyPlay.Frontier╙ document to install the EasyPlay verbs. On the second line, the scripting terminology for the event is shown.
  11.  
  12. In the descriptions, keywords describe the data type for arguments and results: ╥bool╙ means a true/false value. ╥item╙ means an integer value. ╥string╙ means a string of no more than 255 characters. ╥path╙ means a text string of no more than 255 characters which specifies a file and its location. ╥rect╙ means a rectangle. "pict" means a standard picture in ╘PICT╒ format. ╥appID╙ means a four-letter application creator code, which for EasyPlay is always ╘EZpa╒. ╥files╙ means an object which is a list of file specifications. ╥fixed╙ means a fixed-point decimal value, which need not be an integer.
  13.  
  14. ==========
  15. Required Events - Events that every application should support:
  16.  
  17. ----------
  18. required.openApplication (appID,path)        aevt.oapp()
  19. Run
  20.  
  21. Sent by the Finder when an application is opened by direct double clicking, it has no effect. AppID is the four letter ID for EasyPlay, ╘EZpa╒.
  22.  
  23.  
  24. ----------
  25. required.openDocument (appID,path)        aevt.odoc(files)
  26. Open file <path>
  27.  
  28. Opens the specified file(s). AppID is the four letter ID for EasyPlay, ╘EZpa╒. The <path> is a pathname specifying the file to open. The event direct parameter is a list of files to open. If a specified file is not a movie or catalog file, it is ignored. If a movie is opened, it may begin playing, and may automatically close when finished, depending on the preferences. Since only one movie file and one catalog file may be open at a time, opening a movie closes any previously open movie, and opening a catalog closes any previously open catalog.
  29.  
  30.  
  31. ----------
  32. required.printDocument (appID,path)            aevt.pdoc(files)
  33. Print file <path>
  34.  
  35. Asks to print the specified file(s). Since EasyPlay does no support printing, this event is ignored. AppID is the four letter ID for EasyPlay, ╘EZpa╒.
  36.  
  37.  
  38. ----------
  39. required.quitApplication (appID)            aevt.quit()
  40. Quit
  41.  
  42. Quits EasyPlay. AppID is the four letter ID for EasyPlay, ╘EZpa╒.
  43.  
  44. ==========
  45. Applet events - Defined by UserLand Inc.
  46. Dialogs & Errors
  47.  
  48. ----------
  49. app.alertDialog (string)                    app1.alrt (string)
  50. Alert "string"
  51.  
  52. Displays the string in a modal dialog box, waiting for the user to click on OK before returning true. This verb allows script writers to deliver a message to the user without forcing the scripting system to the front.
  53.  
  54. Note: if the application isn╒t the frontmost application it brings itself to the front before displaying the dialog.
  55.  
  56.  
  57. ----------
  58. bool app.confirmDialog (string)            bool app1.cnfm (string)
  59. Confirm "string"
  60.  
  61. Displays the string in a modal dialog box, waiting for the user to click on OK or Cancel. Returns true if the user clicked on OK, false if Cancel. This verb allows script writers to confirm an action with the user without forcing the scripting system to the front.
  62.  
  63. Note: if the application isn╒t the frontmost application it brings itself to the front before displaying the dialog.
  64.  
  65.  
  66. ----------
  67. bool app.enableDialogs (bool)                bool app1.enbd (bool)
  68. Enable dialogs <bool>
  69.  
  70. Dialogs are normally enabled, call this verb to disable them, or re-enable them after disabling. The verb takes a boolean parameter, if true, dialogs will appear when an error happens when opening or saving a file, for example. 
  71.  
  72. If the parameter is false, subsequent dialogs will be disabled, verbs will return with no interaction required by the user.
  73.  
  74. In either case, the script writer can call the getErrorString verb to get a string describing any error condition.
  75.  
  76. Returns a boolean, the value of the enable-dialogs flag before it was set. You can use this value to restore the value of the flag after setting it.
  77.  
  78.  
  79. ----------
  80. string app.getErrorString ()                string app1.gers ()
  81. Get error string
  82.  
  83. Returns the error string, the result of the last error-prone operation. It╒s empty if the operation was successful. This verb is useful if you╒ve turned alerts off using the enableDialogs verb. Call this verb if a save or open returns false, for example; the string can be displayed in a call to the Frontier dialog.alert verb.
  84.  
  85.  
  86. ==========
  87. Target Windows
  88.  
  89.  
  90. ----------
  91. string app.getTargetWindow ()                app1.gtrg (string)
  92. Get target window
  93.  
  94. Returns a string containing the title of the target window. 
  95.  
  96. Returns the title of the frontmost window if the target window hasn╒t been set. 
  97.  
  98. Returns the empty string if no windows are open.
  99.  
  100.  
  101. ----------
  102. string app.setTargetWindow (string)            string app1.strg (string)
  103. Set target window "string"
  104.  
  105. Takes one parameter, a string indicating the title of the target window.
  106.  
  107. All subsequent verbs apply to the target window. 
  108.  
  109. Special case: if the title is empty, the target is set to the name of the frontmost window.
  110.  
  111. Returns the title of the target window. If it failed, the empty string is returned.
  112.  
  113.  
  114. ==========
  115. Basic Window Operations
  116.  
  117.  
  118. ----------
  119. string app.newWindow (string)                string app1.nwin (string)
  120. New window "string"
  121.  
  122. Creates a new catalog window with the indicated title, and an empty catalog file on disk. If a catalog file is already open, it is automatically closed.
  123.  
  124. Takes one parameter, a string indicating the title of the new window. If the string is empty, an untitled window is created. 
  125.  
  126. Returns the actual title of the new window. 
  127.  
  128. Note: If a window with the title is already open, the application comes to the front and displays an alert dialog box; and the empty string is returned. This alert dialog can be enabled or disabled using the enableDialogs verb.
  129.  
  130.  
  131. ----------
  132. bool app.openWindow (path)                bool app1.owin (path)
  133. Open window "string"
  134.  
  135. Opens the file indicated by the path. Returns true if it worked, and sets the target window to the newly opened window. The file must be a movie or catalog file for the open to succeed. If a movie is opened, it may begin playing, and automatically close when finished, depending on the preference settings. Since only one movie file and one catalog file may be open at a time, opening a movie closes any previously open movie, and opening a catalog closes any previously open catalog.
  136.  
  137. If the path matches the name of a window title, the verb just brings the window to the front and returns true.
  138.  
  139. The title of the window may be the name of the file, or for a movie opened by opening a catalog entry, the ╥title╙ field in the catalog entry for the movie.
  140.  
  141. Returns false if there wasn╒t enough memory to create a new window or if there was an error loading the file.
  142.  
  143.  
  144. ----------
  145. bool app.closeWindow ()                bool app1.cwin ()
  146. Close window
  147.  
  148. Close the target window. Returns True, unless there is no target window.
  149.  
  150.  
  151. ----------
  152. bool app.moveWindow (rect)                bool app1.mwin (rect) 
  153. Move window <rect>
  154.  
  155. Moves and resizes the target window so it covers the rectangle, in global coordinates.
  156.  
  157. Returns false if there is no target window.
  158.  
  159. You can determine a window╒s position by calling getWindowPosition.
  160.  
  161.  
  162. ----------
  163. bool app.selectWindow (string)            bool app1.xwin (string)
  164. Select window "string"
  165.  
  166. Brings the window with the indicated title to the front, and sets the target window to that window. Returns true if it worked, false otherwise.
  167.  
  168.  
  169. ==========
  170. Getting Info about a Window
  171.  
  172.  
  173. ----------
  174. string app.getFilePath ()                    string app1.gpth () 
  175. Get path
  176.  
  177. Returns the file name the file being displayed in the target window. Note the usual function of this verb is to return the full path, but in EasyPlay only the file name is returned.
  178. Returns the empty string if the target window is a new window that wasn╒t loaded from a file and hasn╒t been saved.
  179.  
  180.  
  181. ----------
  182. rect app.getWindowPosition ()                rect app1.gwps ()
  183. Get window position
  184.  
  185. Returns a rectangle describing the position of the target window on the desktop. 
  186.  
  187.  
  188. ----------
  189. bool app.madeChanges ()                bool app1.chgs ()
  190. Window changed
  191.  
  192. Returns true if the target window has been changed since the last save, false otherwise. 
  193.  
  194. Since EasyPlay automatically saves changes to a catalog as they are made, this verb always returns False.
  195.  
  196.  
  197. ==========
  198. Moving Text & Graphics
  199.  
  200.  
  201. ----------
  202. pict app.getPicture ()                    pict app1.gpic ()
  203. Get picture
  204.  
  205. Returns the selected items in the target window as a picture. The type of the returned value is ╘PICT╒. If the target is a movie, it returns a picture of the currently displayed frame. If the target is a catalog window, it returns the thumbnail picture for the currently selected entry.
  206.  
  207.  
  208. ----------
  209. bool app.selectAll ()                    bool app1.sela ()
  210. Select all
  211.  
  212. Selects all the items in the target window. Has the same effect as the ╥Select All╙ command in the ╥Edit╙ menu. For example if a movie window is selected, the entire movie is selected.
  213.  
  214. Returns true if something is selected, false otherwise.
  215.  
  216.  
  217. ----------
  218. bool app.somethingSelected ()                bool app1.hsel ()
  219. Something selected
  220.  
  221. Returns true if something is selected in the target window. For a movie or catalog window, something is always selected so it returns True.
  222.  
  223.  
  224. ==========
  225. Controlling the Environment
  226.  
  227.  
  228. ----------
  229. item app.countWindows ()                item app1.twin ()
  230. Count windows
  231.  
  232. Returns the number of open windows.
  233.  
  234.  
  235. ----------
  236. string app.nthWindow (item)                string app1.nthw (item) 
  237. Select Nth window <item>
  238.  
  239. Returns a string, the title of the nth window. Windows are ordered from front to back, so the first window is the frontmost one. If n is greater than the number of windows, the empty string is returned.
  240.  
  241.  
  242. ----------
  243. bool app.quit ()                        bool app1.quit ()
  244. Quit application
  245.  
  246. The application quits to the operating system if no changed windows are open. Since changes are automatically saved as they are made, changed windows are never open, so the Quit succeeds.
  247.  
  248. Returns true if it quit, false if it didn╒t.
  249.  
  250.  
  251. ==========
  252. Testing
  253.  
  254.  
  255. ----------
  256. rect app.performanceTest (rect,rect)            rect app1.perf (rect,rect)
  257. Performance test <rect> <rect>
  258.  
  259. This verb allows any application to participate in a performance benchmark of interapplication communication. It performs rectangle subtraction on two rectangle params, r1 and r2. It returns a rectangle that╒s the difference between each of the four fields (top, left, bottom, right) of the two rectangles.
  260.  
  261. It does no screen updating or disk operations, so if you call it repeatedly you╒ll get a pretty good measure of IAC performance.
  262.  
  263.  
  264. ==========
  265. EasyPlay events - Events unique to EasyPlay
  266. Control events
  267.  
  268.  
  269. ----------
  270. EasyPlay.doMenu (item,item)                EZpa.menu (item)
  271. Do menu code <item>
  272.  
  273. This verb can perform any menu command in EasyPlay. The first item is a number indicating the menu, and item is a number indicating the item in the menu, the first item being item 1. The possible values for the ID are:
  274.  
  275.     128    Apple menu
  276.     129    File menu
  277.     130    Edit menu
  278.     131    Movie menu
  279.     132    Window menu
  280.     133    Catalog menu
  281.  
  282. In an event or script, the direct parameter is a longword with the ID in the high word and the item in the low word. So to make a code for the "Copy" command (the 4th item in the "File" menu), you would multiply 65536 times 129 giving 8454144, and then add 4 to that, resulting in a code of 8454148.
  283.  
  284.  
  285. ==========
  286. Movie Events
  287.  
  288.  
  289. EasyPlay only allows one movie to be open at a time. These events operate on the movie window that is currently open. It need not be frontmost.
  290.  
  291.  
  292. ----------
  293. fixed EasyPlay.getMovieDuration ()            fixed EZpa.mgdu ()
  294. Get movie duration
  295.  
  296. Returns the duration of the currently open movie in seconds, as a fixed point decimal value. 
  297.  
  298.  
  299. ----------
  300. fixed EasyPlay.getMoviePosition ()            fixed EZpa.mgtm ()
  301. Get movie position
  302.  
  303. Returns the position of the currently open movie. The position is expressed as a fixed point value in seconds, with 0 being the start of the movie.
  304.  
  305.  
  306. ----------
  307. EasyPlay.setMoviePosition (fixed)            EZpa.mstm (fixed)
  308. Set movie position <fixed>
  309.  
  310. Sets the position of the currently open movie. Pos is expressed as a fixed point value in seconds, with 0 being the start of the movie. If the position is out of range, it is set to the start or end of the movie as appropriate.
  311.  
  312.  
  313. ----------
  314. EasyPlay.playMovie (bool)                EZpa.mply (bool)
  315. Play movie <bool>
  316.  
  317. Play or stop the currently open movie. go is a boolean value. If it is true, the movie begins (or continues) playing forward at normal speed from its current position. If it is false, the movie stops playing.
  318.  
  319.  
  320. ----------
  321. EasyPlay.isPlaying ()                    EZpa.mgip ()
  322. Movie is playing
  323.  
  324. Returns the playing status of the currently open movie. If the movie is stopped, the result is false. If the movie is playing at any speed, forward or backward, the result is true. If there is no movie open at all, the result is false.
  325.  
  326.  
  327. ----------
  328. EasyPlay.stepMovie (item)                EZpa.mstp (item)
  329. Step movie <fixed>
  330.  
  331. Steps the movie forward or back the specified number of frames. If frames is positive, it moves forward the specified number of frames and then stops. If negative, it moves backward. If zero, it moves forward one frame. The direct parameter is a fixed point value specifying the number of frames to move.
  332.  
  333.  
  334. ----------
  335. pict EasyPlay.getMoviePoster ()            pict EZpa.mgmp ()
  336. Get movie poster
  337.  
  338. Returns a picture containing the poster frame for the currently open movie. The returned type is ╘PICT. To get a picture of a particular movie frame, use the app1.getPicture event.
  339.  
  340.  
  341. ==========
  342. Catalog Events
  343.  
  344.  
  345. Catalog files are kept up to date as changes are made - EasyPlay has no ╥Save╙ command. If you change a catalog entry, the change is immediately saved to the disk, if the catalog file can be written to. If not, the appropriate error is returned.
  346.  
  347. Most of these events work on the currently selected catalog entry in the currently open catalog file.
  348.  
  349.  
  350. ----------
  351. EasyPlay.selectEntry (item)                EZpa.cstg (item)
  352. Select entry <item>
  353.  
  354. Sets the selection in the catalog. The catalog window is redrawn to reflect the new selected entry. The item is an integer specifying the entry to be selected, 0 being the first.
  355.  
  356.  
  357. ----------
  358. item EasyPlay.selectedEntry ()                item EZpa.cgtg ()
  359. Get entry index
  360.  
  361. Returns an integer describing the selected catalog entry, 0 being the first.
  362.  
  363.  
  364. ----------
  365. item EasyPlay.entryCount ()                item EZpa.cgec ()
  366. Get entry count
  367.  
  368. Returns an integer with the number of entries in the currently open catalog.
  369.  
  370.  
  371. ----------
  372. bool EasyPlay.getEntryLooping ()            bool EZpa.eglp ()
  373. Get entry looping
  374.  
  375. Returns a boolean value containing the looping property of the currently selected entry.
  376.  
  377.  
  378. ----------
  379. EasyPlay.setEntryLooping (bool)            EZpa.eslp (bool)
  380. Set entry looping <bool>
  381.  
  382. Sets the looping property of the currently selected catalog entry. If true, the movie will initially loop if opened through this catalog entry.
  383.  
  384.  
  385. ----------
  386. item EasyPlay.getEntryDepth ()            item EZpa.egmd ()
  387. Get entry depth
  388.  
  389. Returns an integer containing the monitor depth property of the currently selected entry.
  390.  
  391.  
  392. ----------
  393. EasyPlay.setEntryDepth (item)                EZpa.esmd (item)
  394. Set entry depth <item>
  395.  
  396. Sets the monitor depth property of the currently selected catalog entry. The parameter is an integer specifying the depth property. This controls the color depth the screen is set to when the movie is played through this catalog entry. Since the user should always be in control of the depth through the ╥Monitors╙ control panel, the setting should be ╥No Change╙ unless the movie requires a specific depth. Valid values are:
  397.  
  398.     1    No change - the suggested setting.
  399.     3    Black/White
  400.     4    4 grays
  401.     5    16 grays
  402.     6    256 grays
  403.     8    4 colors
  404.     9    16 colors
  405.     10    256 colors
  406.     11    Thousands
  407.     12    Millions
  408.  
  409.  
  410. ==========
  411. Preference Events
  412.  
  413. EasyPlay preferences are saved in a file in the System Folder. If you change a preference, the new setting is saved until it is changed again, by the user or another event.
  414.  
  415.  
  416. ----------
  417. bool EasyPlay.getMenubarPref ()            bool EZpa.pgmb ()
  418. Get menubarScreen preference
  419.  
  420. Returns a boolean value containing the current ╥Always use screen with menu bar╙ preference. 
  421.  
  422.  
  423. ----------
  424. EasyPlay.setMenubarPref (bool)            EZpa.psmb (bool)
  425. Set menubarScreen preference <bool>
  426.  
  427. Sets the ╥Always use screen with menu bar╙ preference. If true, movies are always opened on the screen with the menu bar, even if it is not the one set to the most colors.
  428.  
  429.  
  430. ----------
  431. bool EasyPlay.getNoAutoplayPref ()            bool EZpa.pgap ()
  432. Get noAutoPlay preference
  433.  
  434. Returns a boolean value containing the current ╥Don╒t automatically play movies when opened╙ preference. 
  435.  
  436.  
  437. ----------
  438. EasyPlay.setNoAutoplayPref (bool)            EZpa.psap (bool)
  439. Set noAutoPlay preference <bool>
  440.  
  441. Sets the ╥Don╒t automatically play movies when opened╙ preference. If true, movies do not automatically start playing when they are opened.
  442.  
  443.  
  444. ----------
  445. bool EasyPlay.getHideCtlrPref ()            bool EZpa.pghc ()
  446. Get hideController preference
  447.  
  448. Returns a boolean value containing the current ╥Hide controller for movies when opened╙ preference. 
  449.  
  450.  
  451. ----------
  452. EasyPlay.setHideCtlrPref (bool)            EZpa.pshc (bool)
  453. Set hideController preference <bool>
  454.  
  455. Sets the ╥Hide controller for movies when opened╙ preference. If true, a movie controller does not initially appear at the bottom of movie windows when they are opened.
  456.  
  457.  
  458. ----------
  459. bool EasyPlay.getNoAutoclosePref ()            bool EZpa.pgcf ()
  460. Get noAutoclose preference
  461.  
  462. Returns a boolean value containing the current ╥Don╒t close movies when finished╙ preference. 
  463.  
  464.  
  465. ----------
  466. EasyPlay.setNoAutoclosePref (bool)            EZpa.pscf (bool)
  467. Set noAutoclose preference <bool>
  468.  
  469. Sets the ╥Don╒t close movies when finished╙ preference. If true, movie windows are not automatically closed when the movie finishes playing.
  470.  
  471.  
  472. ----------
  473. bool EasyPlay.getCatalogPref ()            bol EZpa.pgcm ()
  474. Get catalogMenu preference
  475.  
  476. Returns a boolean value containing the current ╥Show catalog menu╙ preference. 
  477.  
  478.  
  479. ----------
  480. EasyPlay.setCatalogPref (bool)            EZpa.pscm (bool)
  481. Set catalogMenu preference <bool>
  482.  
  483. Sets the ╥Show Catalog menu╙ preference. If true, the ╥Catalog╙ menu appears on the menu bar.
  484.  
  485.  
  486. ----------
  487. item EasyPlay.getBackgroundPref ()            item EZpa.pgbg ()
  488. Get background preference
  489.  
  490. Returns an integer describing the current window background preference. 
  491.  
  492.  
  493. ----------
  494. EasyPlay.setBackgroundPref (item)            EZpa.psbg (item)
  495. Set background preference <item>
  496.  
  497. Sets the window background preference. The item is an integer with the preference setting. This controls the presence and color of the background around a movie in movie windows. The valid values are:
  498.  
  499.     1    None. Open a window the same size as the movie image.
  500.     3    Black background.
  501.     4    Gray background.
  502.     5    White background.
  503.  
  504.  
  505. ----------
  506. item EasyPlay.getSizePref ()                item EZpa.pgds ()
  507. Get size preference
  508.  
  509. Returns an integer describing the current default movie size preference. 
  510.  
  511.  
  512. ----------
  513. EasyPlay.setSizePref (item)                EZpa.psds (item)
  514. Set size preference <item>
  515.  
  516. Sets the movie default size preference. The item is an integer with the preference setting. This controls the default size of movie images when movies are opened. Note that if a movie is opened by opening a catalog entry, the catalog entry may override the default. The valid values are:
  517.  
  518.     1    Half normal
  519.     2    Normal
  520.     3    Double normal
  521.     4    Largest that maintains movie aspect ratio
  522.     5    Full screen
  523.  
  524. ----------
  525. Have fun controlling EasyPlay! -Mike O'Connor
  526.  
  527.