openbsd-ports/mbone/vat/patches/patch-ah
1999-08-05 00:45:50 +00:00

41 lines
782 B
Plaintext

--- audio-voxware.cc.orig Fri Apr 26 14:22:37 1996
+++ audio-voxware.cc Thu Jul 29 23:32:37 1999
@@ -44,6 +44,9 @@
#include <sys/uio.h>
#include <unistd.h>
#include <machine/soundcard.h>
+#elif defined(__OpenBSD__)
+#include <sys/audioio.h>
+#include <soundcard.h>
#else
#include <sys/soundcard.h>
#endif
@@ -217,12 +220,27 @@
iport = p;
}
+static void
+playmode(int fd, int play)
+{
+ struct audio_info set;
+
+ AUDIO_INITINFO(&set);
+ if (ioctl(fd, AUDIO_GETINFO, &set))
+ printf("ioctl %d\n", errno);
+ set.mode = play ? AUMODE_PLAY : AUMODE_RECORD;
+ if (ioctl(fd, AUDIO_SETINFO, &set))
+ printf("ioctl %d\n", errno);
+}
+
void VoxWareAudio::RMute()
{
rmute |= 1;
+ playmode(fd, 1);
}
void VoxWareAudio::RUnmute()
{
rmute &=~ 1;
+ playmode(fd, 0);
}