Initial import of wavplay - utility to record/playback audio.

PR:		16693
Submitted by:	Greg Robinson <greg@rosevale.com.au>
This commit is contained in:
Maxim Sobolev 2000-06-07 16:07:54 +00:00
parent 20b9259c7d
commit dd76a63c00
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=29314
13 changed files with 388 additions and 0 deletions

17
audio/wavplay/Makefile Normal file
View file

@ -0,0 +1,17 @@
# New ports collection makefile for: wavplay
# Date created: 14 January 2000
# Whom: greg
#
# $FreeBSD$
#
PORTNAME= wavplay
PORTVERSION= 1.4
CATEGORIES= audio
MASTER_SITES= http://metalab.unc.edu/pub/Linux/apps/sound/players/
MAINTAINER= greg@rosevale.com.au
MAN1= wavplay.1
.include <bsd.port.mk>

2
audio/wavplay/distinfo Normal file
View file

@ -0,0 +1,2 @@
MD5 (wavplay-1.4.tar.gz) = 726c58f47c0dbc3b58ff6c42300d518e
MD5 (wavplay14.patches.tar.gz) = a6dba343c980aa7126db57375deaa0f6

View file

@ -0,0 +1,157 @@
--- Makefile.orig Sat Dec 4 02:06:42 1999
+++ Makefile Fri May 19 17:52:28 2000
@@ -38,7 +38,7 @@
#----------------------------------------------------------------------
# If you are running a 386 you should comment this line out.
#
-CPU=-m486
+#CPU=-m486
#----------------------------------------------------------------------
# If you are experiencing troubles (like core dumps!), then uncomment
@@ -47,7 +47,7 @@
# adjust the STRIP option to suit compile mode:
#
#DEBUG=-g
-OPT=-O2
+#OPT=-O2
#----------------------------------------------------------------------
# When using 'DEBUG=-g' above, then comment out the 'strip' line:
@@ -59,7 +59,9 @@
# This parameter indicates where the program binaries should be
# placed (wavplay, wavrec, and xltwavplay)
#
-INSTDIR=/usr/local/bin
+PREFIX=/usr/local
+INSTDIR=$(PREFIX)/bin
+MANDIR=$(PREFIX)/man/man1
#----------------------------------------------------------------------
# Uncomment this line if you want to install the xltwavplay.res resource
@@ -81,14 +83,14 @@
# to disable the EDITRES facility. If you're not compiling xltwavplay
# then this setting can be left asis.
#
-#NOEDITRES=-DNO_EDITRES
+NOEDITRES=-DNO_EDITRES
#----------------------------------------------------------------------
# If you COMMENTED OUT the NOEDITRES line, then UNCOMMENT this line.
# If you UNCOMMENTED the NOEDITRES line, then COMMENT out this line.
# (ie. do the opposite of NOEDITRES)
#
-LIBXMU=-lXmu
+#LIBXMU=-lXmu
#----------------------------------------------------------------------
# These are the non X load options (for wavplay/wavrec)
@@ -106,7 +108,13 @@
# only the standard getopt() routine. When commented out, the long options like --help
# are recognized, with the help of the getopt_long() routine.
#
-#STDGETOPTS= -DUSE_GETOPT_STD
+STDGETOPTS= -DUSE_GETOPT_STD
+
+#----------------------------------------------------------------------
+#
+# Uncomment this when compiling on FreeBSD.
+
+EXTRAOPTS=-DFREEBSD -D__GNU_LIBRARY__
#----------------------------------------------------------------------
# The next option specifies the pathname that the xltwavplay X client should exec
@@ -133,7 +141,7 @@
# Environment variable DSPPATH will override this value at runtime, if
# present.
#
-#DSPPATH= -DAUDIODEV=\"/dev/dsp\"
+DSPPATH= -DAUDIODEV=\"/dev/audio\"
#----------------------------------------------------------------------
# Semaphore IPC Key for the Play & Record locks (Default is 0x33333333)
@@ -155,7 +163,7 @@
# Only for unusual sites would you change this: the name of the
# install program. (has no impact if you choose to manually install)
#
-INSTALL=install
+INSTALL=install -c
#----------------------------------------------------------------------
# If you have any custom include directories, like for X or
@@ -163,19 +171,19 @@
# this should be unecessary if the appropriate symlinks are
# installed).
#
-#CUSTINCL= -I/usr/X11R6/include/X11 -I/usr/local/lesstif/include/Xm
+#CUSTINCL= -I/usr/X11R6/include/X11 -I/usr/local/lesstif/include/Xm -I/usr/X11R6/include
#----------------------------------------------------------------------
# Normally, you shouldn't need to change anything beyond this point:
#----------------------------------------------------------------------
.SUFFIXES: .c .cc .h .o
-CUSTMOPTS=$(STDGETOPTS) $(PLAYPATH) $(DSPMIN) $(DSPMAX) $(DSPPATH) $(DSPLOCKS) $(USERES) $(NOEDITRES) $(SCHED_PRIORITY)
+CUSTMOPTS=$(STDGETOPTS) $(EXTRAOPTS) $(PLAYPATH) $(DSPMIN) $(DSPMAX) $(DSPPATH) $(DSPLOCKS) $(USERES) $(NOEDITRES) $(SCHED_PRIORITY)
ELF= # -fPIC
INCL= -I. $(CUSTINCL)
-CCFLAGS= -c $(DEBUG)$(OPT) $(CPU) $(ELF) -fhandle-exceptions $(CUSTMOPTS) -Wall -Wstrict-prototypes
-CFLAGS= -c $(DEBUG)$(OPT) $(CPU) $(ELF) -Wall -Wstrict-prototypes $(CUSTMOPTS)
-CC= gcc
+CCFLAGS+= -c $(DEBUG)$(OPT) $(CPU) $(ELF) -fhandle-exceptions $(CUSTMOPTS) -Wall -Wstrict-prototypes
+CFLAGS+= -c $(DEBUG)$(OPT) $(CPU) $(ELF) -Wall -Wstrict-prototypes $(CUSTMOPTS)
+CC?= gcc
CP= g++
HDRFIL= client.h server.h wavfile.h wavplay.h xltwavplay.h xmsprint.h
@@ -189,9 +197,9 @@
.c.o:
$(CC) $(CFLAGS) $(INCL) $<
-all: wavplay wavrec xltwavplay
+all: wavplay wavrec
-no_x: wavplay wavrec
+with_x: wavplay wavrec xltwavplay
# wavdump: $(WVDMPO)
# $(CP) $(WVDMPO) $(LDOPTS) $(DEBUG) -o wavdump -lRIFF
@@ -209,18 +217,21 @@
$(STRIP) xltwavplay
ls -l xltwavplay
-install: install_wavplay install_xltwavplay
+install: install_wavplay install_man
-install_no_x: install_wavplay
+install_with_x: install_wavplay install_xltwavplay install_man
install_wavplay: wavplay wavrec
- @[ ! -d "$(INSTDIR)" ] && echo "You do not have a directory $(INSTDIR); Check INSTDIR in make file." && exit 13 || :
- $(INSTALL) -o root -g root -m 555 wavplay $(INSTDIR)
+ mkdir -p $(INSTDIR)
+ $(INSTALL) -s -o root -g wheel -m 555 wavplay $(INSTDIR)
rm -f $(INSTDIR)/wavrec
ln $(INSTDIR)/wavplay $(INSTDIR)/wavrec
- @[ ! -z "$(SCHED_PRIORITY)" ] && echo "*** DO 'make setuid_root' IF YOU WANT REAL TIME SCHEDULING ***" || :
@echo
+install_man: wavplay.1
+ mkdir -p $(MANDIR)
+ $(INSTALL) -o root -g wheel -m 444 wavplay.1 $(MANDIR)
+
xltwavplay_test: wavplay xltwavplay
WAVPLAYPATH=./wavplay ./xltwavplay
@@ -234,9 +245,9 @@
@echo
install_xltwavplay: xltwavplay
- $(INSTALL) -o root -g root -m 555 xltwavplay $(INSTDIR)
+ $(INSTALL) -o root -g wheel -m 555 xltwavplay $(INSTDIR)
@[ ! -z "$(USERES)" ] \
- && $(INSTALL) -o root -g root -m 555 xltwavplay.res $(RESDIR)/xltwavplay \
+ && $(INSTALL) -o root -g wheel -m 555 xltwavplay.res $(RESDIR)/xltwavplay \
&& ls -dlL $(RESDIR)/xltwavplay/xltwavplay.res \
|| rm -f $(RESDIR)/xltwavplay

View file

@ -0,0 +1,28 @@
*** client.c.orig Sat Jan 15 13:05:07 2000
--- client.c Sat Jan 15 13:08:42 2000
***************
*** 47,53 ****
--- 47,55 ----
#include <unistd.h>
#include <errno.h>
#include <time.h>
+ #ifndef FREEBSD
#include <malloc.h>
+ #endif
#include <string.h>
#include <memory.h>
#include <signal.h>
***************
*** 57,63 ****
--- 59,69 ----
#include <sys/wait.h>
#include <sys/stat.h>
#include <assert.h>
+ #ifndef FREEBSD
#include <linux/soundcard.h>
+ #else
+ #include <machine/soundcard.h>
+ #endif
#include "wavplay.h"
#include "client.h"

View file

@ -0,0 +1,28 @@
*** file.c.orig Sat Jan 15 12:55:46 2000
--- file.c Sat Jan 15 13:15:38 2000
***************
*** 56,62 ****
--- 56,64 ----
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
+ #ifndef FREEBSD
#include <malloc.h>
+ #endif
#include <string.h>
#include <memory.h>
#include <signal.h>
***************
*** 64,70 ****
--- 66,76 ----
#include <sys/ipc.h>
#include <sys/ioctl.h>
#include <assert.h>
+ #ifndef FREEBSD
#include <linux/soundcard.h>
+ #else
+ #include <machine/soundcard.h>
+ #endif
#include "wavplay.h"
extern int clntIPC; /* Needed for message passing in PlayDSP */

View file

@ -0,0 +1,53 @@
*** main.c.orig Sat Jan 15 12:51:14 2000
--- main.c Sat Jan 15 14:14:54 2000
***************
*** 56,62 ****
--- 56,64 ----
#include <unistd.h>
#include <stdarg.h>
#include <string.h>
+ #ifndef FREEBSD
#include <getopt.h>
+ #endif
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ipc.h>
***************
*** 82,88 ****
--- 84,94 ----
else printf("Usage:\t%s [options] [files...]\n\n",cmd);
puts("Options:");
+ #ifndef FREEBSD
printf("\t-%c\tThis info (or use --help)\n",OPF_HELP);
+ #else
+ printf("\t-%c\tThis info\n",OPF_HELP);
+ #endif
printf("\t-%c\tQuiet mode (no messages)\n",OPF_QUIET);
printf("\t-%c rate\tSampling rate\n",OPF_SAMPRATE);
printf("\t-%c\tDebug mode\n",OPF_DEBUG);
***************
*** 105,111 ****
--- 111,121 ----
if ( opr_mode != OprRecord )
printf("\t-%c\tDisplay info about wav file(s) only\n",OPF_INFO);
+ #ifndef FREEBSD
printf("\n\t-%c\tDisplay version and Copyright info (or use --version)\n\n",OPF_VERSION);
+ #else
+ printf("\n\t-%c\tDisplay version and Copyright info\n\n",OPF_VERSION);
+ #endif
puts("\nWAV parameters are normally taken from the input file(s),\n"
"but command line options can override them if required.");
***************
*** 208,213 ****
--- 218,225 ----
int rc; /* Return code */
int fd; /* Temporary file descriptor */
double d; /* Temporary double value */
+ char *cp; /* Used for env var */
+ uid_t uid;
static char cmdopts[] = {
OPF_INFO, OPF_HELP, OPF_QUIET, OPF_SAMPRATE,':', OPF_STEREO, OPF_MONO,
OPF_TIME,':', OPF_DATABITS,':', OPF_IPCKEY,':', OPF_RESET,

View file

@ -0,0 +1,28 @@
*** msg.c.orig Sat Jan 15 12:58:40 2000
--- msg.c Sat Jan 15 13:16:12 2000
***************
*** 47,53 ****
--- 47,55 ----
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
+ #ifndef FREEBSD
#include <malloc.h>
+ #endif
#include <string.h>
#include <memory.h>
#include <signal.h>
***************
*** 56,62 ****
--- 58,68 ----
#include <sys/msg.h>
#include <sys/ioctl.h>
#include <assert.h>
+ #ifndef FREEBSD
#include <linux/soundcard.h>
+ #else
+ #include <machine/soundcard.h>
+ #endif
#include "wavplay.h"
/*

View file

@ -0,0 +1,23 @@
*** recplay.c.orig Sat Jan 15 12:56:46 2000
--- recplay.c Sat Jan 15 13:16:42 2000
***************
*** 52,63 ****
--- 52,69 ----
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
+ #ifndef FREEBSD
#include <malloc.h>
+ #endif
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
+ #ifndef FREEBSD
#include <linux/soundcard.h>
+ #else
+ #include <machine/soundcard.h>
+ #endif
#include "wavplay.h"
#include "server.h"

View file

@ -0,0 +1,28 @@
*** server.c.orig Sat Jan 15 12:59:19 2000
--- server.c Sat Jan 15 13:17:07 2000
***************
*** 65,71 ****
--- 65,73 ----
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
+ #ifndef FREEBSD
#include <malloc.h>
+ #endif
#include <string.h>
#include <memory.h>
#include <signal.h>
***************
*** 79,85 ****
--- 81,91 ----
#ifdef SCHED_PRIORITY
#include <sched.h>
#endif
+ #ifndef FREEBSD
#include <linux/soundcard.h>
+ #else
+ #include <machine/soundcard.h>
+ #endif
#include "wavplay.h"
#include "server.h"

View file

@ -0,0 +1,14 @@
*** xltwavplay.c.orig Sat Jan 15 13:12:38 2000
--- xltwavplay.c Sat Jan 15 13:13:02 2000
***************
*** 59,65 ****
--- 59,67 ----
#include <time.h>
#include <signal.h>
#include <string.h>
+ #ifndef FREEBSD
#include <getopt.h>
+ #endif
#include <errno.h>
#include <sys/types.h>
#include <sys/ipc.h>

View file

@ -0,0 +1 @@
A wav player and recorder

7
audio/wavplay/pkg-descr Normal file
View file

@ -0,0 +1,7 @@
This is a port of wavplay from Linux. It can record from your sound card and
play recorded sound.
WWW: http://members.home.net/ve3wwg
- greg
greg@rosevale.com.au

2
audio/wavplay/pkg-plist Normal file
View file

@ -0,0 +1,2 @@
bin/wavplay
bin/wavrec