#include "LSoundPlayer.h" #include #include #include #include "Module.h" #include #include "Player.h" #include #include Player *theplayer=NULL; Module *themodule=NULL; int filehandle=-1; BYTE *memptr=NULL; bool stereo=true; char device[80]="/dev/dsp"; struct termios term; void quit() { delete theplayer; delete themodule; delete[] memptr; if (filehandle!=-1) close(filehandle); term.c_lflag|=ICANON; tcsetattr(0,TCSANOW,&term); } bool ParseCmdLine(int argc, char **argv) { short i=1; if (argc==2) return true; while(iStart(); themodule->Init(); printf("Module name: %s - Output to: %s\n\n",themodule->GetSongName(), device); for (short i=1; i<16; i++) { char *buf; WORD size, repeat,replen, volume; if (themodule->GetSampledInstrument(i,buf,size,repeat,replen,volume)) printf("%02d: %s\n",i,buf); else printf("%02d: Synthetic instrument\n",i); } while(true) { fprintf(stdout,"\rPlaying step %d/%d ",theplayer->GetStep(), themodule->GetNumSteps()); fflush(stdout); theplayer->Run(); theplayer->Mix(); } return 0; }