42 lines
917 B
Plaintext
42 lines
917 B
Plaintext
|
$OpenBSD: patch-audio-voxware_cc,v 1.1 2001/07/30 15:33:22 espie Exp $
|
||
|
--- audio-voxware.cc.orig Fri Apr 26 14:22:37 1996
|
||
|
+++ audio-voxware.cc Mon Jul 30 17:25:38 2001
|
||
|
@@ -44,6 +44,9 @@ static const char rcsid[] =
|
||
|
#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 @@ void VoxWareAudio::InputPort(int p)
|
||
|
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);
|
||
|
}
|