Skip to content
Snippets Groups Projects
Commit 7f7c6c64 authored by rswindell's avatar rswindell
Browse files

The xptone() wave shape number (currently 0-6) may be specified on the

command line (-x#).
parent faff4c83
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,9 @@ int octave=4; /* Default octave */
double pitch=523.50/32.0; /* low 'C' */
BOOL use_xp_beep=FALSE;
BOOL use_xptone=FALSE;
enum WAVE_SHAPE wave_shape;
void play(char *freq, char *dur)
{
......@@ -145,8 +147,8 @@ void play(char *freq, char *dur)
else
len=(d*t);
if(f) {
if(use_xp_beep)
xpbeep(f,len);
if(use_xptone)
xptone(f,len,wave_shape);
else
BEEP(f,len);
}
......@@ -185,6 +187,8 @@ void usage(void)
printf(" f display frequency or note value\n");
printf(" n not abortable with key-stroke\n");
printf(" v disable visual text commands\n");
printf(" x# use xptone (wave/dsp output) instead of beep macro\n");
printf(" optionally, specify wave shape number\n");
exit(0);
}
......@@ -193,7 +197,7 @@ int main(int argc, char **argv)
char* p;
char str[128];
char revision[16];
int i,j;
int i;
FILE* stream;
sscanf("$Revision$", "%*s %s", revision);
......@@ -206,26 +210,26 @@ int main(int argc, char **argv)
setvbuf(stdout,NULL,_IONBF,0);
for(i=1;i<argc;i++) {
if(argv[i][0]=='-') {
for(j=1;argv[i][j];j++)
switch(toupper(argv[i][j])) {
case 'D':
mode^=SHOW_DOT;
break;
case 'F':
mode^=SHOW_FREQ;
break;
case 'N':
mode^=NOT_ABORTABLE;
break;
case 'V':
mode^=NO_VISUAL;
break;
case 'X':
use_xp_beep=TRUE;
break;
default:
usage();
break;
switch(toupper(argv[i][1])) {
case 'D':
mode^=SHOW_DOT;
break;
case 'F':
mode^=SHOW_FREQ;
break;
case 'N':
mode^=NOT_ABORTABLE;
break;
case 'V':
mode^=NO_VISUAL;
break;
case 'X':
use_xptone=TRUE;
wave_shape=atoi(argv[i]+2);
break;
default:
usage();
break;
}
continue;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment