home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / audio / streplay33.801.lzh / Demos / PlayOnce.c < prev   
C/C++ Source or Header  |  1991-11-24  |  817b  |  50 lines

  1. /* Play.c
  2.  
  3.    Soundtracker-Player using "STReplay.Library"
  4.  
  5.    by Olli, dem Gr÷▀ten
  6.    
  7.    for Lattice C 5.02
  8.  
  9.      Modified by Jonathan Potter, 24.11.91
  10.  
  11. */
  12.  
  13. #include "streplay.h"
  14. #include <proto/exec.h>
  15. #include <workbench/startup.h>
  16. #include <proto/dos.h>
  17.  
  18. extern struct WBStartup *WBenchMsg;
  19. struct Library *STReplayBase;
  20.  
  21. long LoadModule(char *);
  22. void UnloadModule(void);
  23. void PlayOnce(void);
  24.  
  25. _main(line)
  26. char *line;
  27. {
  28.     char    *temp;
  29.  
  30.     if(!(STReplayBase=OpenLibrary("streplay.library",33))) 
  31.     return(20);
  32.  
  33.     if(!WBenchMsg)
  34.     {
  35.         while(*line!=' '&&*line) line++;
  36.         temp=line++;
  37.         while(*temp!=10)    temp++;
  38.         *temp=0;
  39.     }
  40.     else
  41.     {
  42.         CurrentDir(WBenchMsg->sm_ArgList[1].wa_Lock);
  43.         line=WBenchMsg->sm_ArgList[1].wa_Name;
  44.     }
  45.     if(LoadModule(line)) UnloadModule();
  46.     else PlayOnce();
  47.     CloseLibrary(STReplayBase);
  48.     return(0);
  49. }
  50.