home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 63 / CDACTUAL63.iso / Aplicaciones / DarkBasic / DemoDarkBasic.exe / help / examples / music / exam03.dba < prev    next >
Encoding:
Text File  |  2000-04-09  |  1.6 KB  |  57 lines

  1. Rem * Title  : Pausing Music
  2. Rem * Author : DBS-MB
  3. Rem * Date   : 1st August 99
  4. rem =======================================================
  5. rem DARK BASIC EXAMPLE PROGRAM 3
  6. rem =======================================================
  7. rem This program will pause and resume playing a music file
  8. rem -------------------------------------------------------
  9.  
  10. rem Set the ink to white and paper color to black 
  11. ink rgb(244,214,210),1
  12.  
  13. rem This command will load a midi music file into number one
  14. load music "music1.mid",1
  15. print "music file music1.mid loaded"
  16.  
  17. rem Play the music that was loaded into number one
  18. play music 1
  19.  
  20. print "please press the left mouse button to pause this music"
  21. rem wait till you press left mouse button
  22. repeat:until mouseclick()=1
  23. rem wait till you release the left mouse button
  24. repeat:until mouseclick()=0
  25.  
  26. rem This command will pause the music number one
  27. pause music 1
  28.  
  29. if music paused(1)=1:print "The music has been pause":endif
  30.  
  31. print "please press the left mouse button to resume the music"
  32. rem wait till you press left mouse button
  33. repeat:until mouseclick()=1
  34. rem wait till you release the left mouse button
  35. repeat:until mouseclick()=0
  36.  
  37. rem This command will resume playing the music
  38. resume music 1
  39.  
  40. if music paused(1)=1
  41.     print "The music has been paused"
  42. else
  43.     print "The music has resumed playing"
  44. endif
  45.  
  46. rem Will wait for you to press any key
  47. suspend for key
  48.  
  49. rem Stop the music from playing
  50. stop music 1
  51.  
  52. rem Delete music from memory and free the music number used
  53. delete music 1
  54.  
  55. rem End the program
  56. end
  57.