// mixctl.h - MixCtl class provides control of audio mixer functions // 05/09/98 Release 1.0 Beta1 // Copyright (C) 1998 Sam Hawker // 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. // Although mixctl.h is an integral part of wmmixer, it may also be distributed seperately. #include #include #include #include #include #include #include #ifdef __NetBSD__ #include #endif #ifdef __FreeBSD__ #include #endif #ifdef __linux__ #include #endif class MixCtl { public: MixCtl(char *dname){ device=(char *)malloc(sizeof(char)*(strlen(dname)+1)); strcpy(device,dname); if(mixfdopen=(mixfd=open(device,O_RDONLY | O_NONBLOCK))!=-1){ nrdevices=SOUND_MIXER_NRDEVICES; char *devnames[]=SOUND_DEVICE_NAMES; 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); mixdevs=(struct MixDev *)malloc(sizeof(struct MixDev)*nrdevices); int mixmask=1; for(int i=0;i