/* sound for Bt848 frame grabber driver Copyright (C) 1996,97 Marcus Metzler (mocm@thp.uni-koeln.de) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * sound.cc */ #include #include #include #include #include #include #include #include #include "sound.h" int mixer_device; int devmask,recmask,recsrc,stereodevs,caps; char *device_labels[] = SOUND_DEVICE_LABELS; char *device_names[] = SOUND_DEVICE_NAMES; int locked_channels, muted_channels; lr_vol volume_list[SOUND_MIXER_NRDEVICES]; lr_vol m; void sound_init () { mixer_device=open("/dev/mixer", O_RDWR, 0); if (mixer_device<0) { cerr << "unable to open mixer !" << endl; } else { /* get mixer information */ if ( ( ioctl(mixer_device, SOUND_MIXER_READ_RECSRC, &recsrc) | ioctl(mixer_device, SOUND_MIXER_READ_RECMASK, &recmask) | ioctl(mixer_device, SOUND_MIXER_READ_STEREODEVS, &stereodevs)| ioctl(mixer_device, SOUND_MIXER_READ_DEVMASK, &devmask) | ioctl(mixer_device, SOUND_MIXER_READ_CAPS, &caps) )<0) { cerr << "Can't initialize sound mixer !" << endl; } else { cerr << "Sound mixer initialized !" << endl; for (int i=0;i