smallplay.pas 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. program smallplay;
  2. {****************************************
  3. PT-Player 2.0 © 1994 BetaSoft
  4. uses PTReplay.library also by BetaSoft
  5. and Andreas [Pucko] Pålsson
  6. ****************************************}
  7. uses exec, amigados, ptreplay;
  8. const
  9. vstr : pchar = '$VER: SmallPlay 2.0 (23.12.93)';
  10. var
  11. module : pModule;
  12. SigBit : shortint;
  13. SigMask : longint;
  14. procedure CleanUp(why : string, err : integer);
  15. begin
  16. if why <> '' then writeln(why);
  17. halt(err);
  18. end;
  19. begin
  20. module := nil;
  21. if ParamCount > 1 then
  22. CleanUp('Specify one module only',20);
  23. if ParamCount < 0 then
  24. CleanUp('Play what module?',20);
  25. module := PTLoadModule(ParamStr[1]);
  26. if not assigned(module) then
  27. CleanUp('Couldn''t open/load module',20);
  28. SigBit := AllocSignal(-1);
  29. if SigBit = -1 then
  30. CleanUp('Couldn''t allocate signal',10);
  31. PTInstallBits(module,SigBit,-1,-1,-1);
  32. PTPlay(module);
  33. SigMask := Wait(SIGBREAKF_CTRL_C or (1 shl SigBit));
  34. if (SigMask and SIGBREAKF_CTRL_C) then
  35. PTFade(module,1)
  36. else
  37. PTStop(module);
  38. FreeSignal(SigBit);
  39. PTUnloadModule(module);
  40. end.