// mixctl.h - MixCtl class provides control of audio mixer functions // // Release 1.5 // Copyright (C) 1998 Sam Hawker // Copyright (C) 2002 Gordon Fraser // This software comes with ABSOLUTELY NO WARRANTY // This software is free software, and you are welcome to redistribute it // under certain conditions // See the COPYING file for details. #include "mixctl.h" //---------------------------------------------------------------------- MixCtl::MixCtl(char *device_name) throw(MixerDeviceException) { device_ = new char[strlen(device_name)+1]; strcpy(device_, device_name); modify_counter = -1; if((mixfd = open(device_,O_RDONLY | O_NONBLOCK)) != -1) { num_devices_ = SOUND_MIXER_NRDEVICES; const char *devnames[] = SOUND_DEVICE_NAMES; const char *devlabels[] = SOUND_DEVICE_LABELS; ioctl(mixfd, SOUND_MIXER_READ_DEVMASK, &devmask); ioctl(mixfd, SOUND_MIXER_READ_STEREODEVS, &stmask); ioctl(mixfd, SOUND_MIXER_READ_RECMASK, &recmask); ioctl(mixfd, SOUND_MIXER_READ_CAPS, &caps); mixer_devices_ = new MixerDevice[num_devices_]; int mixmask = 1; for(unsigned count=0; count