home *** CD-ROM | disk | FTP | other *** search
/ Millennium Time Capsule / AC2000.BIN / disks / hbasic_1 / moderful / pjcomod.bas < prev    next >
BASIC Source File  |  1997-08-05  |  839b  |  61 lines

  1.  
  2. REM $option q10
  3.  
  4. LIBRARY "MODPLAY","GEMDOS"
  5.  
  6. PRINT "HiSoft BASIC DSP MODPLAY Library Demo"
  7. PRINT "Written by Paul Jones"
  8.  
  9. f$=COMMAND$
  10.  
  11. ' Get the command line.
  12.  
  13. IF NOT FEXISTS(f$) THEN
  14.     PRINT "File";f$;" does not exist...."
  15.     STOP
  16. END IF
  17.  
  18. ' if the file doesn't exist, report an error.
  19.  
  20. OPEN f$ FOR INPUT AS 2
  21. a&=LOF(2)
  22. CLOSE 2
  23.  
  24. b&=malloc& (a&)
  25.  
  26. ' find the file's file and allocates memory.
  27.  
  28. IF B&=0 THEN
  29.     PRINT "Not enough memory!"
  30.     STOP
  31. END IF
  32.  
  33. BLOAD f$,b&
  34.  
  35. ' If not enough memory, then print error. Bloads it in.
  36.  
  37. InitMod a%()
  38.  
  39. ' Initialise the player.
  40.  
  41. GetModName b&,b$
  42.  
  43. ' Get it's name.
  44.  
  45. PRINT "Modfile Title:";b$
  46. PRINT
  47. PRINT "Any key to exit....."
  48.  
  49. PlayMod b&
  50.  
  51. ' play it!
  52.  
  53. DO WHILE INKEY$=""
  54. LOOP
  55.  
  56. ' want until a button is pressed.
  57.  
  58. StopMod a%()
  59.  
  60. ' stop the mod file.
  61. STOP -1