home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff258.lzh / STReplay / DEMOS / play.c < prev    next >
C/C++ Source or Header  |  1989-10-18  |  778b  |  48 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. */
  10.  
  11. #include "streplay.h"
  12. #include <proto/exec.h>
  13. #include <workbench/startup.h>
  14. #include <proto/dos.h>
  15.  
  16. extern struct WBStartup *WBenchMsg;
  17. struct Library *STReplayBase;
  18.  
  19. long LoadModule(char *);
  20. void StartSong(void);
  21. void UnloadModule(void);
  22.  
  23. _main(line)
  24. char *line;
  25. {
  26.     char    *temp;
  27.  
  28.     if(!(STReplayBase=OpenLibrary("streplay.library",33))) 
  29.     return(20);
  30.  
  31.     if(!WBenchMsg)
  32.     {
  33.         while(*line!=' '&&*line) line++;
  34.         temp=line++;
  35.         while(*temp!=10)    temp++;
  36.         *temp=0;
  37.     }
  38.     else
  39.     {
  40.         CurrentDir(WBenchMsg->sm_ArgList[1].wa_Lock);
  41.         line=WBenchMsg->sm_ArgList[1].wa_Name;
  42.     }
  43.     if(LoadModule(line)) UnloadModule();
  44.     else StartSong();
  45.     CloseLibrary(STReplayBase);
  46.     return(0);
  47. }
  48.