home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 19 / CD_ASCQ_19_010295.iso / dos / prg / midas / examples / mplay.pas < prev    next >
Pascal/Delphi Source File  |  1994-08-06  |  2KB  |  65 lines

  1. {*      MPLAY.PAS
  2.  *
  3.  * Minimal module player using MIDAS Sound System
  4.  *
  5.  * Copyright 1994 Petteri Kangaslampi and Jarno Paananen
  6.  *
  7.  * This file is part of the MIDAS Sound System, and may only be
  8.  * used, modified and distributed under the terms of the MIDAS
  9.  * Sound System license, LICENSE.TXT. By continuing to use,
  10.  * modify or distribute this file you indicate that you have
  11.  * read the license and understand and accept it fully.
  12. *}
  13.  
  14.  
  15. uses MIDAS;
  16.  
  17.  
  18.  
  19. procedure Usage;
  20. begin
  21.     WriteLn('Usage:  MPLAY   <filename> [options]');
  22.     WriteLn('');
  23.     WriteLn('Options:');
  24.     WriteLn('        -sx     Force Sound Device x (1 = GUS, 2 = PAS, 3 = WSS, 4 = SB,');
  25.     WriteLn('                5 = No Sound)');
  26.     WriteLn('        -pxxx   Force I/O port xxx (hex) for Sound Device');
  27.     WriteLn('        -ix     Force IRQ x for Sound Device');
  28.     WriteLn('        -mxxxxx Set mixing rate to xxxxx Hz');
  29.     WriteLn('        -e      Disable EMS usage');
  30.     WriteLn('        -t      Disable ProTracker BPM tempos');
  31.     WriteLn('        -u      Enable Surround');
  32.     WriteLn('        -oxxx   Force output mode (8 = 8-bit, 1 = 16-bit, s = stereo, m = mono)');
  33. end;
  34.  
  35.  
  36.  
  37. var
  38.     module : pointer;
  39.  
  40.  
  41. BEGIN
  42.     { ParamStr(1) should be the module file name and the rest are options
  43.       which MIDAS should handle }
  44.  
  45.     { If there are no parameters, show usage and exit: }
  46.     if ParamCount < 1 then
  47.     begin
  48.         Usage;
  49.         exit;
  50.     end;
  51.  
  52.     midasSetDefaults;                   { set MIDAS defaults }
  53.     midasParseEnvironment;              { parse MIDAS environment string }
  54.     midasParseOptions(2, ParamCount-1); { let MIDAS parse all options }
  55.     midasInit;                          { initialize MIDAS Sound System }
  56.     { load module and start playing: }
  57.     module := midasPlayModule(ParamStr(1), 0);
  58.  
  59.     WriteLn('Playing, press Enter to exit');
  60.     ReadLn;
  61.  
  62.     midasStopModule(module);            { stop playing }
  63.     midasClose;                         { uninitialize MIDAS }
  64. END.
  65.