]>
Commit | Line | Data |
---|---|---|
5d3c520e SZ |
1 | diff -Naur wavplay-1.4/main.c wavplay-1.4-p/main.c |
2 | --- wavplay-1.4/main.c Sat Dec 4 01:06:42 1999 | |
3 | +++ wavplay-1.4-p/main.c Mon May 12 19:56:20 2003 | |
4 | @@ -101,6 +101,7 @@ | |
5 | printf("\t-%c\tLock for record.\n",OPF_RECD_LOCK); | |
6 | printf("\t-%c\tUnlock for record.\n",OPF_RECD_UNLOCK); | |
7 | printf("\t-%c dev\tOverride default of %s\n",OPF_DEVICE,AUDIODEV); | |
8 | + printf("\t-%c\tOpen device in non-blocking mode.\n",OPF_NONBLOCK); | |
9 | ||
10 | if ( opr_mode != OprRecord ) | |
11 | printf("\t-%c\tDisplay info about wav file(s) only\n",OPF_INFO); | |
12 | @@ -212,7 +213,7 @@ | |
13 | OPF_INFO, OPF_HELP, OPF_QUIET, OPF_SAMPRATE,':', OPF_STEREO, OPF_MONO, | |
14 | OPF_TIME,':', OPF_DATABITS,':', OPF_IPCKEY,':', OPF_RESET, | |
15 | OPF_PLAY_LOCK, OPF_PLAY_UNLOCK, OPF_RECD_LOCK, OPF_RECD_UNLOCK, | |
16 | - OPF_DEBUG, OPF_VERSION, OPF_DEVICE,':', 0 }; | |
17 | + OPF_DEBUG, OPF_VERSION, OPF_DEVICE,':', OPF_NONBLOCK, 0 }; | |
18 | #ifndef USE_GETOPT_STD | |
19 | int optx; /* Option index */ | |
20 | char *cp; | |
21 | @@ -261,6 +262,10 @@ | |
22 | case OPF_DEVICE : /* -d device_path */ | |
23 | env_AUDIODEV = optarg; /* Override environment variable */ | |
24 | break; | |
25 | + | |
26 | + case OPF_NONBLOCK : /* -n ; non-blocking */ | |
27 | + wavopts.NonBlock.optChar = (char) optch; | |
28 | + break; | |
29 | ||
30 | case OPF_PLAY_LOCK : /* -l ; lock play lock request */ | |
31 | case OPF_PLAY_UNLOCK : /* -u ; unlock play lock request */ | |
32 | diff -Naur wavplay-1.4/recplay.c wavplay-1.4-p/recplay.c | |
33 | --- wavplay-1.4/recplay.c Sat Dec 4 01:06:42 1999 | |
34 | +++ wavplay-1.4-p/recplay.c Mon May 12 19:58:29 2003 | |
35 | @@ -121,7 +121,10 @@ | |
36 | /* | |
37 | * If not -i mode, play the file: | |
38 | */ | |
39 | - if ( (dfile = OpenDSP(wfile,O_WRONLY,v_erf)) == NULL ) | |
40 | + if ( (dfile = OpenDSP(wfile,O_WRONLY | | |
41 | + (wavopts->NonBlock.optChar == OPF_NONBLOCK | |
42 | + ? O_NDELAY | |
43 | + : 0) ,v_erf)) == NULL ) | |
44 | goto errxit; | |
45 | ||
46 | if ( PlayDSP(dfile,wfile,svr_work_proc,v_erf) ) | |
47 | diff -Naur wavplay-1.4/wavplay.1 wavplay-1.4-p/wavplay.1 | |
48 | --- wavplay-1.4/wavplay.1 Sat Dec 4 01:06:42 1999 | |
49 | +++ wavplay-1.4-p/wavplay.1 Mon May 12 19:59:44 2003 | |
50 | @@ -20,6 +20,7 @@ | |
51 | .RB [ -L ] | |
52 | .RB [ -U ] | |
53 | .RB [ -V, --version ] | |
54 | +.RB [ -n ] | |
55 | .RI [ input-files ] | |
56 | .PP | |
57 | .B wavrec | |
58 | @@ -41,6 +42,7 @@ | |
59 | .RB [ -L ] | |
60 | .RB [ -U ] | |
61 | .RB [ -V, --version ] | |
62 | +.RB [ -n ] | |
63 | .RI [ output-file ] | |
64 | .PP | |
65 | .SH DESCRIPTION | |
66 | @@ -113,6 +115,9 @@ | |
67 | .TP | |
68 | .BI \--version | |
69 | same as -V. | |
70 | +.TP | |
71 | +.BI \-n | |
72 | +use non-blocking open() call on device. | |
73 | ||
74 | .SH BUGS | |
75 | .B wavplay | |
76 | diff -Naur wavplay-1.4/wavplay.h wavplay-1.4-p/wavplay.h | |
77 | --- wavplay-1.4/wavplay.h Mon May 12 19:42:44 2003 | |
78 | +++ wavplay-1.4-p/wavplay.h Mon May 12 19:54:59 2003 | |
79 | @@ -147,6 +147,7 @@ | |
80 | #define OPF_RECD_UNLOCK 'U' /* -U ; unlock record option */ | |
81 | #define OPF_DEBUG 'x' /* -x ; debug option */ | |
82 | #define OPF_VERSION 'V' /* -V ; version and copyright */ | |
83 | +#define OPF_NONBLOCK 'n' /* -n ; open in non-blocking mode */ | |
84 | ||
85 | /* | |
86 | * Types internal to wavplay, in an attempt to isolate ourselves from | |
87 | @@ -231,6 +232,7 @@ | |
88 | UInt32 Seconds; /* Time limited to this many seconds, else zero */ | |
89 | UInt32 StartSample; /* Sample to start playback with */ | |
90 | int ipc; /* Semaphore IPC ID */ | |
91 | + FlgOpt NonBlock; /* -n option flag */ | |
92 | } WavPlayOpts; | |
93 | ||
94 | /* |