#ifndef __MIXERCTL_H__ #define __MIXERCTL_H__ #include #include class mixerctl { public: enum channeltype { ctVolume = 0, ctBass, ctTreble, ctSynth, ctPCM, ctSpeaker, ctLine, ctMic, ctCD, ctMix, ctPCM2, ctRecord, ctInput, ctOutput, ctLine1, ctLine2, ctLine3, ctDigital1, ctDigital2, ctDigital3, ctPhoneIn, ctPhoneOut, ctVideo, ctRadio, ctMonitor, channeltype_end }; protected: int fd; std::string devname; std::set channels; public: mixerctl(): fd(-1) { } mixerctl(const std::string &adevname) { devname = adevname; open(); } ~mixerctl() { close(); } void open(); void close(); bool is_open() const { return fd > 0; } std::set getchannels() const { return channels; } int readlevel(channeltype ct); void writelevel(channeltype ct, int val); }; #endif