home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Updates / DigitalCD / PlayIt164 / !PlayIt / AOF / h / playitap < prev   
Text File  |  1999-10-14  |  2KB  |  65 lines

  1.  
  2. /* C veneer for PlayIt.
  3.  
  4.    by Rick Hudson, 1999
  5. */
  6.  
  7.  
  8. #ifndef _playitap_h
  9. #define _playitap_h
  10.  
  11. #include "playit.h"
  12.  
  13.  
  14. /* Effectively perform the actions described in the programmers' guidelines:
  15.  
  16.    * Load's PlayIt from the resource path 'respath' if not already loaded (auto driver)
  17.    * Checks the version against min_version
  18.    * if the loaded major version differs from that of min_version an error is returned
  19.    * if the version if older than min_version and PlayIt is idle PlayIt is reloaded as aboce
  20.    * An error is returned if the version is still inappropriate
  21.    * Checks if a driver is loaded and auto-chooses one inside 'resdir' if none present
  22.  
  23.    min_version: eg 142 for version 1.42
  24.    resdir: path of resource directory (eg PlayIt: but not <PlayIt$Dir> etc)
  25.    wimp: non-zero if the wimp task should be ensured to be running
  26.    version: the returned version of PlayIt (now) loaded. NULL if not required.
  27. */
  28.  
  29. extern playit_error *xplayit_ensure(int min_version, char *respath, int wimp, int *version);
  30.  
  31.  
  32. /* Alternative to xplayit_version. Instead of returning an error (eg if not
  33.    loaded) a zero version number is returned. If there is no error the
  34.    version is returned.
  35. */
  36.  
  37. extern int playit_read_version(void);
  38.  
  39.  
  40. /* Simply opens the given file with auto-detect and plays it if there was no
  41.    error.
  42. */
  43.  
  44. extern playit_error *xplayit_autoplay(const char *filename);
  45.  
  46. /* Returns a pointer to the (static) name of the file format (Wave, AIFF etc)
  47.    enumerated by the code (as per PLAYIT_FILE_* constants). If any of bits
  48.    16-23 are set then code is assumed to be a 32-bit format word as returned
  49.    by PlayIt_Open etc and the code is extracted from those bits. If
  50.    manipulation
  51. */
  52.  
  53. extern char *playit_file_type_name(int code);
  54.  
  55.  
  56. /* Macro to return a pointer to the (static) name of the file format (as
  57.    above) by specifying the playit_format structure. Pointers to structures
  58.    have to be dereferences first (eg if playit_format *fmt; then
  59.    playit_FILE_TYPE_NAME(*fmt);
  60. */
  61.  
  62. #define playit_FILE_TYPE_NAME(/*playit_format*/ fmt) playit_file_type_name((fmt).s.file_code)
  63.  
  64. #endif
  65.