home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / cdrom / jukebox_2.1 / preview.jb < prev    next >
Text File  |  1981-07-07  |  862b  |  48 lines

  1. /* play first <n> seconds of any track */
  2. /* (c) copyright 1992,93 by F.J. Reichert */
  3.  
  4. parse arg seconds;
  5.  
  6. if seconds = '' | seconds = '?' | seconds <= 0 then do;
  7.     say 'usage: preview <seconds-to-play>';
  8.     exit(0);
  9. end;
  10.  
  11. options results;
  12. options failat 11;
  13. toc stem names.;
  14.  
  15. if rc = 0 then do;
  16.     j = names.0 - 1;
  17.     say j 'tracks found'
  18.     say 'playing first' seconds 'seconds of each track';
  19.     say 'press [ESC] to abort';
  20.     do trk=1 to j;
  21.         current break;
  22.         if result ~= 0 then do;
  23.             say 'user abort';
  24.             leave;
  25.         end;    
  26.         pause;
  27.         if rc ~= 0 then do;
  28.             say 'can''t access disc';
  29.             exit(5);
  30.         end;    
  31.         set track trk;
  32.         toc trk;
  33.         res = 'track #'||overlay(trk,' ',1,2) result;
  34.         say res;
  35.         current time;
  36.         start = result;
  37.         play;
  38.         addtime start '00:'||seconds;
  39.         stop = result;
  40.         wait time stop;
  41.     end;
  42.     exit(0);
  43. end;
  44. else do;
  45.     say 'no disc inserted';
  46.     exit(5);
  47. end;    
  48.