summaryrefslogtreecommitdiff
path: root/usr.bin/aucat/legacy.c
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-08-14 09:58:56 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-08-14 09:58:56 +0000
commit7061d687e5cfe865da42e09d645e3389fb80b225 (patch)
tree98bda86247e3cabf1e0ae8ae097951c7842db94b /usr.bin/aucat/legacy.c
parentb3e2d4f445ac1ad0e943883a3e456ed5f166d218 (diff)
move all device related stuff from aucat.c to a new dev.c file.
The new dev_xxx() routines expose a "high level" self-contained interface to the device. At initialization, the device is opened and two chains of aproc structures are created: * a playback chain that exposes a (initially) empty mix aproc to which the rest of the code can attach new streams to be played * record chain that exposes a (initially) empty sub aproc to which the rest of the code can attach new stream to to record The rest of the code, has just to use dev_attach() routine to attach streams. While we're at it, add a ``devops'' structure containing pointers to the device-specific routines. This will allow later to add support for other type of device than the Sun API. Also, write the .wav headers in file_del(), so put all header related data in the file strucuture. This allows to close() the file, as soon as wpipe_xxx() aproc terminates. This will be useful for the server, because it will need to close() descripts of closed connections immediately. add mix_pushzero() routine to fill the mixer with silence. It will be used to avoid the mixer to underrun when there are no input streams. Since we always have at least one input stream there's no behaviour change. ok jakemsr
Diffstat (limited to 'usr.bin/aucat/legacy.c')
-rw-r--r--usr.bin/aucat/legacy.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/aucat/legacy.c b/usr.bin/aucat/legacy.c
index 56f4be7e854..fcb705120db 100644
--- a/usr.bin/aucat/legacy.c
+++ b/usr.bin/aucat/legacy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: legacy.c,v 1.1 2008/05/23 07:15:46 ratchov Exp $ */
+/* $OpenBSD: legacy.c,v 1.2 2008/08/14 09:58:55 ratchov Exp $ */
/*
* Copyright (c) 1997 Kenneth Stailey. All rights reserved.
*
@@ -28,7 +28,12 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/audioio.h>
+
#include <fcntl.h>
+#include <string.h>
#include <unistd.h>
#include <err.h>