wmmixer-1.7+20120605/0000755000175000017500000000000012173002303012103 5ustar kixkixwmmixer-1.7+20120605/wmmixer.h0000644000175000017500000000340612173002272013754 0ustar kixkix// wmmixer.h - A mixer designed for WindowMaker // // Release 1.5 // Copyright (C) 1998 Sam Hawker // Copyright (C) 2002 Gordon Fraser // Patch added by Rodolfo (kix) Garcia to select the config file // 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. #ifndef __wmmixer_h__ #define __wmmixer_h_ // Input/Output #include #include #include #include #include #include #include // WMMixer #include "mixctl.h" #include "xhandler.h" #include "common.h" #include "exception.h" // For repeating next and prev buttons #define RPTINTERVAL 5 #define CONFIGFILELEN 256 class WMMixer { protected: // Mixer MixCtl *mixctl_; char mixer_device_[256]; char config_file_[CONFIGFILELEN]; unsigned num_channels_; unsigned current_channel_; unsigned current_channel_left_; unsigned current_channel_right_; bool current_recording_; bool current_show_recording_; XHandler *xhandler_; unsigned *channel_list_; int repeat_timer_; // For draggable volume control bool dragging_; // Default scroll amount int wheel_scroll_; // Input/Output void readConfigurationFile(); void displayVersion(void); void displayUsage(const char*); void checkVol(bool); void motionEvent(XMotionEvent *xev); void releaseEvent(XButtonEvent *xev); void pressEvent(XButtonEvent *xev); void parseArgs(int , char **); void initMixer(); void initXHandler(); void updateDisplay(); public: WMMixer(); ~WMMixer(); void init(int, char **); void loop(); }; #endif //__wmmixer_h__ wmmixer-1.7+20120605/README0000644000175000017500000000705412173002272012776 0ustar kixkixwmmixer - A mixer designed for WindowMaker 25 June 2002 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. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. AUTHORS: ======== Original Author: Sam Hawker Current Author: Gordon Fraser CONFIGURATION: ============== Users can configure wmmixer to suit their requirements by means of a ~/.wmmixer file. A commented example is supplied, and would be a good starting point. cp home.wmmixer ~/.wmmixer USAGE: ====== You can access all the channels on your soundcard's mixer with wmmixer. Most common channels are identified with an appropriate icon. Controls include a stereo (mono where appropriate) volume control and a recording source toggle button. Press the "<" and ">" arrow buttons to select a channel. The icon identifies the current channel (a volume symbol with a question mark represents an unrecognised channel). Click and/or drag the volume display to set channel volume. There is a also a button to set recording sources. See the program's manpage ('man wmmixer') for detailed listings of the available options. SHADED VOLUME BARS: =================== As of version 1.5 wmmixer allows shading the volume bar in two colours. If you do not want this and prefer the traditional single-coloured look, you'll have to tell wmmixer to use the same colour for high and low colours: $ wmmixer -l green -L green ...this will give you the traditional look. $ wmmixer -l lightgreen -L blue ...this is an example for the new look. By default, green is used for low volume settings and fade to red for high volumes. AFTERSTEP USERS: ================ (thanks to tygris@erols.com) This release includes in a new command line option. The effect this has is to enable shape support (it implies "-s"), and to reduce the size of the window to 56x56 pixels. The "-position position" option has also been added, so you can push wmcdplay off the edge of the screen while it gets swallowed. To put wmmixer in your Wharf, add the following line in the appropriate part of your .steprc *Wharf wmmixer nil MaxSwallow "wmmixer" wmmixer -a -g -0-0 & It is also possible (by editing and recompiling the afterstep sources), to make Wharf handle the new 56x56 pixel window properly - yes, I add an option to use a 56x56 pixel window, even though the AfterStep Wharf really wants 55x57 pixel ones. I am told (by tygris@erols.com): "Locate Wharf.c (or is it Wharf.cc?) Should be in AfterStep-1.0/modules/Wharf. Locate this: if (Buttons[button].maxsize) { Buttons[button].icons[0].w = 55; Buttons[button].icons[0].h = 57; } and change the 55 and 57 to 56's. Save and compile." wmmixer-1.7+20120605/wmmixer.10000644000175000017500000000574612173002272013676 0ustar kixkix.TH wmmixer 1 "April 02, 2002" Debian "Windowmaker Mixer Application" .SH NAME wmmixer \- A mixer application designed for WindowMaker .SH DESCRIPTION \fBwmmixer\fP is a mixer application designed for WindowMaker, although there is nothing in the program that makes it require WindowMaker, except maybe the NeXTStep look and the fact that it properly docks. It can be used with other window managers without problems. .SH SYNOPSIS .B wmmixer [options] .SH OPTIONS This program follows the usual GNU command line syntax, with long options starting with two dashes ('\-\-'). A summary of options is included below. .TP .B \-d, \-\-display <\fIstring\fP> Attempt to open a window on the named X display. In the absence of this option the display specified by the .B DISPLAY environment variable is used. .TP .B \-g, \-\-geometry <\fIstring\fP> geometry to use, e.g. +100+100 to place it at 100/100 .TP .B \-h, \-\-help show help text and exit. .TP .B \-v, \-\-version show program version and exit. .TP .B \-w, \-\-withdrawn run the application in withdrawn mode. This is for use with WindowMaker or other window managers supporting docks (e.g. KDE) .TP .B \-a, \-\-afterstep use smaller window (for AfterStep Wharf) .TP .B \-s, \-\-shaped shaped window .TP .B \-l, \-\-led\-color <\fIstring\fP> use the specified color for led, e.g. red, green, blue (default: green) .TP .B \-L, \-\-led\-highcolor <\fIstring\fP> use the specified color for led-shading, e.g. red, green, blue (default: red) .TP .B \-b, \-\-back\-color <\fIstring\fP> use the specified color for backgrounds, e.g. red, green, blue .TP .B \-m, \-\-mix\-device <\fIstring\fP> use specified device (rather than /dev/mixer) .TP .B \-r, \-\-scrollwheel <\fInumber\fP> Set the volume increase/decrease when using the mouse wheel (default: 2) .TP For backward compatibility the following obsolete options are still supported: .TP .B \-help show help text and exit. .TP .B \-display attempt to open a window on the named X display .TP .B \-position geometry to use, e.g. +100+100 to place it at 100/100 .SH USAGE All available channels on your soundcard's mixer are accessible with \fIwmmixer\fP. Most common channels are identified with an appropriate icon. Controls include a stereo (mono where appropriate) volume control and a recording source toggle button. Press the "<" and ">" arrow buttons to select a channel. The icon identifies the current channel (a volume symbol with a question mark represents an unrecognised channel). Click and/or drag the volume display to set channel volume. There is a also a button to set recording sources. .SH CONFIGURATION Users can configure wmmixer to suit their requirements by means of a \fI~/.wmmixer\fP file. A commented example can be found in /usr/share/doc/wmmixer on Debian systems, and would be a good starting point .SH AUTHOR wmmixer was originally written by Sam Hawker , and then adopted by Gordon Fraser . This manual page was written by Gordon Fraser . wmmixer-1.7+20120605/xhandler.h0000644000175000017500000000636412173002272014077 0ustar kixkix// wmmixer - A mixer designed for WindowMaker // // 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. #ifndef __xhandler_h__ #define __xhandler_h__ //-------------------------------------------------------------------- // X-Windows includes - standard #include #include #include #include #include #include #include #include #include #include #include "common.h" // Xpm images - standard #include "XPM/wmmixer.xpm" #include "XPM/tile.xpm" // Xpm images - custom #include "XPM/icons.xpm" #include "XPM/norec.xpm" //-------------------------------------------------------------------- #define BTN_LEFT_X 5 #define BTN_LEFT_Y 34 #define BTN_RIGHT_X 17 #define BTN_RIGHT_Y 34 #define BTN_MUTE_X 17 #define BTN_MUTE_Y 47 #define BTN_REC_X 5 #define BTN_REC_Y 47 #define BTN_WIDTH 12 #define BTN_HEIGHT 11 #define BTNNEXT 1 #define BTNPREV 2 #define BTNREC 4 #define BTNMUTE 8 //-------------------------------------------------------------------- class XHandler { protected: int button_state_; int window_size_; bool is_wmaker_; bool is_ushape_; bool is_astep_; unsigned *icon_list_; Display *display_default_; Window window_icon_; Window window_main_; Window window_root_; GC graphics_context_; unsigned long colors_[4]; unsigned long shade_colors_[25]; char display_name_[256]; char position_name_[256]; char ledcolor_name_[256]; char ledcolor_high_name_[256]; char backcolor_name_[256]; char window_class_[256]; Pixel back_pix; Pixel fore_pix; // Pixmaps - standard Pixmap pixmap_main; Pixmap pixmap_tile; Pixmap pixmap_disp; Pixmap pixmap_mask; // Pixmaps - custom Pixmap pixmap_icon; Pixmap pixmap_nrec; // X-Windows basics - standard Atom _XA_GNUSTEP_WM_FUNC; Atom deleteWin; unsigned long getColor(char*); unsigned long mixColor(char*, int, char*, int); void drawButton(int, int, int, int, bool); void initPixmaps(int); void initWindow(int, char**); void initGraphicsContext(); void initMask(); void initColors(); void initIcons(int); int flush_expose(Window); public: XHandler(); virtual ~XHandler(); void init(int, char**, int); void repaint(); void update(unsigned); void drawLeft(unsigned); void drawRight(unsigned); void drawBtns(int, bool); void drawMono(unsigned); bool isLeftButton(int, int); bool isRightButton(int, int); bool isMuteButton(int, int); bool isRecButton(int, int); bool isVolumeBar(int, int); Display* getDisplay() {return display_default_;} int getButtonState(); void setButtonState(int); void setDisplay(char* arg); void setPosition(char* arg); void setLedColor(char* arg); void setLedHighColor(char* arg); void setBackColor(char* arg); void setWindowClass(char* arg); void setUnshaped(); void setWindowMaker(); void setAfterStep(); int getWindowSize(); Atom getDeleteWin(); }; #endif //__xhandler_h__ wmmixer-1.7+20120605/common.h0000644000175000017500000000144612173002272013556 0ustar kixkix// common.h - Common defines and includes for wmmixer // // 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. #ifndef __common_h__ #define __common_h__ // User defines - custom #define MIXERDEV "/dev/mixer" #define BACKCOLOR "#282828" #define LEDCOLOR "green" #define LEDCOLOR_HIGH "red" // User defines - standard #define WINDOWMAKER false #define USESHAPE false #define AFTERSTEP false #define NORMSIZE 64 #define ASTEPSIZE 56 #define NAME "wmmixer" #define CLASS "WMMixer" #endif //__common_h__ wmmixer-1.7+20120605/Makefile0000644000175000017500000000222412173002272013550 0ustar kixkix# $Id: Makefile,v 1.5 2002/06/25 22:13:09 gordon Exp $ prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin mandir = ${prefix}/share/man DESTDIR = CXX = g++ CXXFLAGS = -O -Wall EXTRA_LIBS = -L/usr/X11R6/lib -lX11 -lXpm -lXext LD = g++ LDFLAGS = -o $(EXECUTABLE) $(CXXFLAGS) EXECUTABLE = wmmixer OBJS = xhandler.o mixctl.o wmmixer.o exception.o INSTALL = install INSTALL_FILE = $(INSTALL) -D -p -o root -g root -m 644 INSTALL_PROGRAM = $(INSTALL) -D -p -o root -g root -m 755 .cc.o: $(CXX) $(CXXFLAGS) -c -o $@ $< $(EXECUTABLE): $(OBJS) $(LD) $(LDFLAGS) $(OBJS) $(EXTRA_LIBDIRS) $(EXTRA_LIBS) all: $(EXECUTABLE) clean: rm -f $(OBJS) $(EXECUTABLE) install: install-bin install-doc install-bin: wmmixer $(INSTALL_PROGRAM) $< $(DESTDIR)$(bindir)/wmmixer install-doc: wmmixer.1 $(INSTALL_FILE) $< $(DESTDIR)$(mandir)/man1/wmmixer.1 uninstall: uninstall-bin uninstall-doc uninstall-bin: rm -f $(DESTDIR)$(bindir)/wmmixer uninstall-doc: rm -f $(DESTDIR)$(mandir)/man1/wmmixer.1 .PHONY: all clean dist-clean install install-bin install-doc \ uninstall uninstall-bin uninstall-doc wmmixer-1.7+20120605/mixctl.cc0000644000175000017500000001621012173002272013717 0ustar kixkix// 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 // Copyright (C) 2002 Gordon Fraser // Patch added by Rodolfo (kix) Garcia to select the config file // 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 "wmmixer.h" //-------------------------------------------------------------------- WMMixer::WMMixer() { // Initialize member variables current_channel_ = 0; num_channels_ = 0; current_channel_left_ = 0; current_channel_right_ = 0; repeat_timer_ = 0; wheel_scroll_ = 2; current_recording_ = false; current_show_recording_ = false; dragging_ = false; strcpy(mixer_device_, MIXERDEV); xhandler_ = new XHandler(); } //-------------------------------------------------------------------- WMMixer::~WMMixer() { delete[] channel_list_; delete mixctl_; delete xhandler_; } //-------------------------------------------------------------------- void WMMixer::loop() { XEvent xev; bool done=false; while(!done) { while(XPending(xhandler_->getDisplay())) { XNextEvent(xhandler_->getDisplay(), &xev); switch(xev.type) { case Expose: xhandler_->repaint(); break; case ButtonPress: pressEvent(&xev.xbutton); break; case ButtonRelease: releaseEvent(&xev.xbutton); break; case MotionNotify: motionEvent(&xev.xmotion); break; case ClientMessage: if(xev.xclient.data.l[0] == (int)xhandler_->getDeleteWin()) done=true; break; } } // keep a button pressed causes scrolling throught the channels if(xhandler_->getButtonState() & (BTNPREV | BTNNEXT)) { repeat_timer_++; if(repeat_timer_ >= RPTINTERVAL) { if(xhandler_->getButtonState() & BTNNEXT) { current_channel_++; if(current_channel_ >= num_channels_) current_channel_ = 0; } else { if(current_channel_ < 1) current_channel_ = num_channels_-1; else current_channel_--; } checkVol(true); repeat_timer_ = 0; } } else { checkVol(false); } XFlush(xhandler_->getDisplay()); usleep(100000); } } //-------------------------------------------------------------------- void WMMixer::init(int argc, char **argv) { parseArgs(argc, argv); initMixer(); readConfigurationFile(); xhandler_->init(argc, argv, mixctl_->getNrDevices()); if(num_channels_ == 0) { std::cerr << NAME << " : Sorry, no supported channels found." << std::endl; } else { checkVol(true); } } //-------------------------------------------------------------------- void WMMixer::initMixer() { // Initialize Mixer try { mixctl_ = new MixCtl(mixer_device_); } catch(MixerDeviceException &exc) { std::cerr << NAME << " : " << exc.getErrorMessage() << "'." << std::endl; exit(1); } channel_list_ = new unsigned[mixctl_->getNrDevices()]; for(unsigned count=0; countgetNrDevices(); count++) { if(mixctl_->getSupport(count)){ channel_list_[num_channels_]=count; num_channels_++; } } } //-------------------------------------------------------------------- void WMMixer::checkVol(bool forced = true) { if(!forced && !mixctl_->hasChanged()) return; if(mixctl_->isMuted(channel_list_[current_channel_])) xhandler_->setButtonState(xhandler_->getButtonState() | BTNMUTE); else xhandler_->setButtonState(xhandler_->getButtonState() & ~BTNMUTE); mixctl_->readVol(channel_list_[current_channel_], true); unsigned nl = mixctl_->readLeft(channel_list_[current_channel_]); unsigned nr = mixctl_->readRight(channel_list_[current_channel_]); bool nrec = mixctl_->readRec(channel_list_[current_channel_], true); if(forced) { current_channel_left_ = nl; current_channel_right_ = nr; current_recording_ = nrec; if(nrec) xhandler_->setButtonState(xhandler_->getButtonState() | BTNREC); else xhandler_->setButtonState(xhandler_->getButtonState() & ~BTNREC); current_show_recording_=mixctl_->getRecords(channel_list_[current_channel_]); updateDisplay(); } else { if(nl != current_channel_left_ || nr != current_channel_right_ || nrec != current_recording_) { if(nl!=current_channel_left_) { current_channel_left_=nl; if(mixctl_->getStereo(channel_list_[current_channel_])) xhandler_->drawLeft(current_channel_left_); else xhandler_->drawMono(current_channel_left_); } if(nr!=current_channel_right_) { current_channel_right_=nr; if(mixctl_->getStereo(channel_list_[current_channel_])) xhandler_->drawRight(current_channel_right_); else xhandler_->drawMono(current_channel_left_); } if(nrec!=current_recording_) { current_recording_=nrec; if(nrec) xhandler_->setButtonState(xhandler_->getButtonState() | BTNREC); else xhandler_->setButtonState(xhandler_->getButtonState() & ~BTNREC); xhandler_->drawBtns(BTNREC, current_show_recording_); } updateDisplay(); } } } //-------------------------------------------------------------------- void WMMixer::parseArgs(int argc, char **argv) { static struct option long_opts[] = { {"help", 0, NULL, 'h'}, {"version", 0, NULL, 'v'}, {"display", 1, NULL, 'd'}, {"geometry", 1, NULL, 'g'}, {"withdrawn", 0, NULL, 'w'}, {"afterstep", 0, NULL, 'a'}, {"shaped", 0, NULL, 's'}, {"led-color", 1, NULL, 'l'}, {"led-highcolor", 1, NULL, 'L'}, {"back-color", 1, NULL, 'b'}, {"mix-device", 1, NULL, 'm'}, {"config-file", 1, NULL, 'c'}, {"x-class", 1, NULL, 'x'}, {"scrollwheel",1, NULL, 'r'}, {NULL, 0, NULL, 0 }}; int i, opt_index = 0; // init the config file name snprintf(config_file_, CONFIGFILELEN -1, "%s/.wmmixer", getenv("HOME")); // For backward compatibility for(i=1; isetDisplay(optarg); break; case 'g': xhandler_->setPosition(optarg); break; case 'w': xhandler_->setWindowMaker(); break; case 'a': xhandler_->setAfterStep(); break; case 's': xhandler_->setUnshaped(); break; case 'l': xhandler_->setLedColor(optarg); break; case 'L': xhandler_->setLedHighColor(optarg); break; case 'b': xhandler_->setBackColor(optarg); break; case 'm': sprintf(mixer_device_, "%s", optarg); break; case 'c': snprintf(config_file_, CONFIGFILELEN -1, "%s", optarg); break; case 'x': xhandler_->setWindowClass(optarg); break; case 'r': if(atoi(optarg)>0) wheel_scroll_ = atoi(optarg); break; } } } //-------------------------------------------------------------------- void WMMixer::readConfigurationFile() { FILE *rcfile; char buf[256]; int done; // int current=-1; unsigned current = mixctl_->getNrDevices() + 1; if((rcfile=fopen(config_file_, "r"))!=NULL) { num_channels_=0; do { fgets(buf, 250, rcfile); if((done=feof(rcfile))==0) { buf[strlen(buf)-1]=0; if(strncmp(buf, "addchannel ", strlen("addchannel "))==0) { sscanf(buf, "addchannel %i", ¤t); if(current >= mixctl_->getNrDevices() || mixctl_->getSupport(current) == false) { fprintf(stderr,"%s : Sorry, this channel (%i) is not supported.\n", NAME, current); current = mixctl_->getNrDevices() + 1; } else { channel_list_[num_channels_] = current; num_channels_++; } } if(strncmp(buf, "setchannel ", strlen("setchannel "))==0) { sscanf(buf, "setchannel %i", ¤t); if(current >= mixctl_->getNrDevices() || mixctl_->getSupport(current)==false) { fprintf(stderr,"%s : Sorry, this channel (%i) is not supported.\n", NAME, current); current = mixctl_->getNrDevices() + 1; } } if(strncmp(buf, "setmono ", strlen("setmono "))==0) { if(current== mixctl_->getNrDevices() + 1) fprintf(stderr,"%s : Sorry, no current channel.\n", NAME); else{ int value; sscanf(buf, "setmono %i", &value); mixctl_->setLeft(current, value); mixctl_->setRight(current, value); mixctl_->writeVol(current); } } if(strncmp(buf, "setleft ", strlen("setleft "))==0) { if(current== mixctl_->getNrDevices() + 1) fprintf(stderr, "%s : Sorry, no current channel.\n", NAME); else{ int value; sscanf(buf, "setleft %i", &value); mixctl_->setLeft(current, value); mixctl_->writeVol(current); } } if(strncmp(buf, "setright ", strlen("setright "))==0) { if(current== mixctl_->getNrDevices() + 1) fprintf(stderr, "%s : Sorry, no current channel.\n", NAME); else { int value; sscanf(buf, "setleft %i", &value); mixctl_->setRight(current, value); mixctl_->writeVol(current); } } if(strncmp(buf, "setrecsrc ", strlen("setrecsrc "))==0) { if(current== mixctl_->getNrDevices() + 1) fprintf(stderr, "%s : Sorry, no current channel.\n", NAME); else mixctl_->setRec(current, (strncmp(buf+strlen("setrecsrc "), "true", strlen("true"))==0)); } } } while(done==0); fclose(rcfile); mixctl_->writeRec(); } } //-------------------------------------------------------------------- void WMMixer::displayUsage(const char* name) { std::cout << "Usage: " << name << "[options]" << std::endl; std::cout << " -h, --help display this help screen" << std::endl; std::cout << " -v, --version display program version" << std::endl; std::cout << " -d, --display display to use (see X manual pages)" << std::endl; std::cout << " -g, --geometry +XPOS+YPOS geometry to use (see X manual pages)" << std::endl; std::cout << " -w, --withdrawn run the application in withdrawn mode" << std::endl; std::cout << " (for WindowMaker, etc)" << std::endl; std::cout << " -a, --afterstep use smaller window (for AfterStep Wharf)" << std::endl; std::cout << " -s, --shaped shaped window" << std::endl; std::cout << " -l, --led-color use the specified color for led display" << std::endl; std::cout << " -L, --led-highcolor use the specified color for led shading" << std::endl; std::cout << " -b, --back-color use the specified color for backgrounds" << std::endl; std::cout << " -m, --mix-device use specified device (rather than /dev/mixer)" << std::endl; std::cout << " -c, --config-file use specified config file (rather than $HOME/.wmmixer)" << std::endl; std::cout << " -x, --x-class use specified class (rather than WMMmixer)" << std::endl; std::cout << " -r, --scrollwheel volume increase/decrease with mouse wheel (default: 2)" << std::endl; std::cout << "\nFor backward compatibility the following obsolete options are still supported:" << std::endl; std::cout << " -help display this help screen" << std::endl; std::cout << " -position geometry to use (see X manual pages)" << std::endl; std::cout << " -display display to use (see X manual pages)" << std::endl; exit(0); } //-------------------------------------------------------------------- void WMMixer::displayVersion() { std::cout << "wmmixer version 1.5" << std::endl; exit(0); } //-------------------------------------------------------------------- void WMMixer::pressEvent(XButtonEvent *xev) { bool forced_update = true; int x = xev->x-(xhandler_->getWindowSize()/2-32); int y = xev->y-(xhandler_->getWindowSize()/2-32); if(xhandler_->isLeftButton(x, y)) { if(current_channel_ < 1) current_channel_=num_channels_-1; else current_channel_--; xhandler_->setButtonState(xhandler_->getButtonState() | BTNPREV); repeat_timer_ = 0; xhandler_->drawBtns(BTNPREV, current_show_recording_); } if(xhandler_->isRightButton(x, y)) { current_channel_++; if(current_channel_ >= num_channels_) current_channel_=0; xhandler_->setButtonState(xhandler_->getButtonState() | BTNNEXT); repeat_timer_ = 0; xhandler_->drawBtns(BTNNEXT, current_show_recording_); } // Volume settings if(xhandler_->isVolumeBar(x, y)) { int vl = 0, vr = 0; if(xev->button < 4) { vl = ((60-y)*100)/(2*25); vr = vl; dragging_ = true; } else if(xev->button == 4) { vr = mixctl_->readRight(channel_list_[current_channel_]) + wheel_scroll_; vl = mixctl_->readLeft(channel_list_[current_channel_]) + wheel_scroll_; } else if(xev->button == 5) { vr = mixctl_->readRight(channel_list_[current_channel_]) - wheel_scroll_; vl = mixctl_->readLeft(channel_list_[current_channel_]) - wheel_scroll_; } if(vl <= 0) vl = 0; if(vr <= 0) vr = 0; if(x <= 50) mixctl_->setLeft(channel_list_[current_channel_], vl); if(x >= 45) mixctl_->setRight(channel_list_[current_channel_], vr); mixctl_->writeVol(channel_list_[current_channel_]); forced_update = false; } // Toggle record if(xhandler_->isRecButton(x, y)) { mixctl_->setRec(channel_list_[current_channel_], !mixctl_->readRec(channel_list_[current_channel_], false)); mixctl_->writeRec(); forced_update = false; } // Toggle mute if(xhandler_->isMuteButton(x, y)) { if(mixctl_->isMuted(channel_list_[current_channel_])) { xhandler_->setButtonState(xhandler_->getButtonState() & ~BTNMUTE); mixctl_->unmute(channel_list_[current_channel_]); } else { mixctl_->mute(channel_list_[current_channel_]); xhandler_->setButtonState(xhandler_->getButtonState() | BTNMUTE); } xhandler_->drawBtns(BTNMUTE, current_show_recording_); } // Update volume display checkVol(forced_update); } //-------------------------------------------------------------------- void WMMixer::releaseEvent(XButtonEvent *xev) { dragging_ = false; xhandler_->setButtonState(xhandler_->getButtonState() & ~(BTNPREV | BTNNEXT)); xhandler_->drawBtns(BTNPREV | BTNNEXT, current_show_recording_); xhandler_->repaint(); } //-------------------------------------------------------------------- void WMMixer::motionEvent(XMotionEvent *xev) { int x=xev->x-(xhandler_->getWindowSize()/2-32); int y=xev->y-(xhandler_->getWindowSize()/2-32); // if(x>=37 && x<=56 && y>=8 && dragging_){ if(xhandler_->isVolumeBar(x, y) && dragging_){ int v=((60-y)*100)/(2*25); if(v<0) v=0; if(x<=50) mixctl_->setLeft(channel_list_[current_channel_], v); if(x>=45) mixctl_->setRight(channel_list_[current_channel_], v); mixctl_->writeVol(channel_list_[current_channel_]); checkVol(false); } } //-------------------------------------------------------------------- void WMMixer::updateDisplay() { xhandler_->update(channel_list_[current_channel_]); if(mixctl_->getStereo(channel_list_[current_channel_])) { xhandler_->drawLeft(current_channel_left_); xhandler_->drawRight(current_channel_right_); } else { xhandler_->drawMono(current_channel_right_); } xhandler_->drawBtns(BTNREC | BTNNEXT | BTNPREV | BTNMUTE, current_show_recording_); xhandler_->repaint(); } //==================================================================== int main(int argc, char** argv) { WMMixer mixer = WMMixer(); mixer.init(argc, argv); mixer.loop(); } wmmixer-1.7+20120605/exception.cc0000644000175000017500000000261412173002272014420 0ustar kixkix// wmmixer - A mixer designed for WindowMaker // // 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 "exception.h" //-------------------------------------------------------------------- Exception::Exception() { error_message_ = NULL; } //-------------------------------------------------------------------- Exception::Exception(const Exception& exc) { char* other_message = exc.getErrorMessage(); if(other_message != NULL) { error_message_ = new char[strlen(other_message)+1]; strcpy(error_message_, other_message); } else error_message_ = NULL; } //-------------------------------------------------------------------- Exception::~Exception() { if(error_message_ != NULL) delete[] error_message_; } //-------------------------------------------------------------------- char* Exception::getErrorMessage() const { return error_message_; } //-------------------------------------------------------------------- MixerDeviceException::MixerDeviceException(char* device) { error_message_ = new char[256]; strcpy(error_message_, "Unable to open mixer device "); strcat(error_message_, device); } wmmixer-1.7+20120605/INSTALL0000644000175000017500000000013112173002272013134 0ustar kixkixwmmixer - A mixer designed for WindowMaker INSTALLING: =========== make make install wmmixer-1.7+20120605/COPYING0000644000175000017500000004325412173002272013153 0ustar kixkix GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. wmmixer-1.7+20120605/xhandler.cc0000644000175000017500000004237512173002272014237 0ustar kixkix// wmmixer - A mixer designed for WindowMaker // // 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 "xhandler.h" //-------------------------------------------------------------------- XHandler::XHandler() { is_wmaker_ = WINDOWMAKER; is_ushape_ = USESHAPE; is_astep_ = AFTERSTEP; strcpy(display_name_, ""); strcpy(position_name_, ""); strcpy(ledcolor_name_, LEDCOLOR); strcpy(ledcolor_high_name_, LEDCOLOR_HIGH); strcpy(backcolor_name_, BACKCOLOR); strcpy(window_class_, CLASS); button_state_ = 0; icon_list_ = NULL; } //-------------------------------------------------------------------- XHandler::~XHandler() { XFreeGC(display_default_, graphics_context_); XFreePixmap(display_default_, pixmap_main); XFreePixmap(display_default_, pixmap_tile); XFreePixmap(display_default_, pixmap_disp); XFreePixmap(display_default_, pixmap_mask); XFreePixmap(display_default_, pixmap_icon); XFreePixmap(display_default_, pixmap_nrec); XDestroyWindow(display_default_, window_main_); if(is_wmaker_) XDestroyWindow(display_default_, window_icon_); XCloseDisplay(display_default_); delete[] icon_list_; } //-------------------------------------------------------------------- void XHandler::init(int argc, char** argv, int num_channels) { int display_depth; window_size_=is_astep_ ? ASTEPSIZE : NORMSIZE; if((display_default_ = XOpenDisplay(display_name_))==NULL) { std::cerr << NAME << " : Unable to open X display '" << XDisplayName(display_name_) << "'." << std::endl; exit(1); } initWindow(argc, argv); initColors(); display_depth = DefaultDepth(display_default_, DefaultScreen(display_default_)); initPixmaps(display_depth); initGraphicsContext(); initMask(); initIcons(num_channels); } //-------------------------------------------------------------------- bool XHandler::isLeftButton(int x, int y) { return(x>=BTN_LEFT_X && y>=BTN_LEFT_Y && x<=BTN_LEFT_X + BTN_WIDTH && y<=BTN_LEFT_Y + BTN_HEIGHT); } //-------------------------------------------------------------------- bool XHandler::isRightButton(int x, int y) { return(x>=BTN_RIGHT_X && y>=BTN_RIGHT_Y && x<=BTN_RIGHT_X + BTN_WIDTH && y<=BTN_RIGHT_Y + BTN_HEIGHT); } //-------------------------------------------------------------------- bool XHandler::isMuteButton(int x, int y) { return(x>=BTN_MUTE_X && y>=BTN_MUTE_Y && x<=BTN_MUTE_X + BTN_WIDTH && y<=BTN_MUTE_Y + BTN_HEIGHT); } //-------------------------------------------------------------------- bool XHandler::isRecButton(int x, int y) { return(x>=BTN_REC_X && y>=BTN_REC_Y && x<=BTN_REC_X + BTN_WIDTH && y<=BTN_REC_Y + BTN_HEIGHT); } //-------------------------------------------------------------------- bool XHandler::isVolumeBar(int x, int y) { return(x>=37 && x<=56 && y>=8 && y<=56); } //-------------------------------------------------------------------- unsigned long XHandler::getColor(char *colorname) { XColor color; XWindowAttributes winattr; XGetWindowAttributes(display_default_, window_root_, &winattr); color.pixel=0; XParseColor(display_default_, winattr.colormap, colorname, &color); color.flags=DoRed | DoGreen | DoBlue; XAllocColor(display_default_, winattr.colormap, &color); return color.pixel; } //-------------------------------------------------------------------- unsigned long XHandler::mixColor(char *colorname1, int prop1, char *colorname2, int prop2) { XColor color, color1, color2; XWindowAttributes winattr; XGetWindowAttributes(display_default_, window_root_, &winattr); XParseColor(display_default_, winattr.colormap, colorname1, &color1); XParseColor(display_default_, winattr.colormap, colorname2, &color2); color.pixel = 0; color.red = (color1.red*prop1+color2.red*prop2)/(prop1+prop2); color.green = (color1.green*prop1+color2.green*prop2)/(prop1+prop2); color.blue = (color1.blue*prop1+color2.blue*prop2)/(prop1+prop2); color.flags = DoRed | DoGreen | DoBlue; XAllocColor(display_default_, winattr.colormap, &color); return color.pixel; } //-------------------------------------------------------------------- void XHandler::repaint() { flush_expose(window_icon_); XCopyArea(display_default_, pixmap_disp, window_icon_, graphics_context_, 0, 0, 64, 64, window_size_/2-32, window_size_/2-32); flush_expose(window_main_); XCopyArea(display_default_, pixmap_disp, window_main_, graphics_context_, 0, 0, 64, 64, window_size_/2-32, window_size_/2-32); XEvent xev; while(XCheckTypedEvent(display_default_, Expose, &xev)); } //-------------------------------------------------------------------- void XHandler::update(unsigned channel) { if(is_wmaker_ || is_ushape_ || is_astep_) { XShapeCombineMask(display_default_, window_icon_, ShapeBounding, window_size_/2-32, window_size_/2-32, pixmap_mask, ShapeSet); XShapeCombineMask(display_default_, window_main_, ShapeBounding, window_size_/2-32, window_size_/2-32, pixmap_mask, ShapeSet); } else { XCopyArea(display_default_, pixmap_tile, pixmap_disp, graphics_context_, 0, 0, 64, 64, 0, 0); } XSetClipMask(display_default_, graphics_context_, pixmap_mask); XCopyArea(display_default_, pixmap_main, pixmap_disp, graphics_context_, 0, 0, 64, 64, 0, 0); XSetClipMask(display_default_, graphics_context_, None); XCopyArea(display_default_, pixmap_icon, pixmap_disp, graphics_context_, icon_list_[channel]*22, 0, 22, 22, 6, 5); } //-------------------------------------------------------------------- void XHandler::drawLeft(unsigned curleft) { XSetForeground(display_default_, graphics_context_, shade_colors_[(curleft*25)/100]); for(unsigned i=0;i<25;i++) { if(i >= (curleft*25)/100) { XSetForeground(display_default_, graphics_context_, colors_[3]); } else { XSetForeground(display_default_, graphics_context_, shade_colors_[i]); } XFillRectangle(display_default_, pixmap_disp, graphics_context_, 37, 55-2*i, 9, 1); } } //-------------------------------------------------------------------- void XHandler::drawRight(unsigned curright) { for(unsigned i=0;i<25;i++) { if(i >= (curright*25)/100) { XSetForeground(display_default_, graphics_context_, colors_[3]); } else { XSetForeground(display_default_, graphics_context_, shade_colors_[i]); } XFillRectangle(display_default_, pixmap_disp, graphics_context_, 48, 55-2*i, 9, 1); } } //-------------------------------------------------------------------- // Based on wmsmixer by Damian Kramer void XHandler::drawMono(unsigned curright) { XSetForeground(display_default_, graphics_context_, colors_[1]); for(unsigned i=0;i<25;i++) { if(i >= (curright*25)/100) { XSetForeground(display_default_, graphics_context_, colors_[3]); } else { XSetForeground(display_default_, graphics_context_, shade_colors_[i]); } XFillRectangle(display_default_, pixmap_disp, graphics_context_, 37, 55-2*i, 20, 1); } } //-------------------------------------------------------------------- void XHandler::drawBtns(int buttons, bool curshowrec) { if(buttons & BTNPREV) drawButton(BTN_LEFT_X, BTN_LEFT_Y, BTN_WIDTH, BTN_HEIGHT, (button_state_ & BTNPREV)); if(buttons & BTNNEXT) drawButton(BTN_RIGHT_X, BTN_RIGHT_Y, BTN_WIDTH, BTN_HEIGHT, (button_state_ & BTNNEXT)); if(buttons & BTNMUTE) drawButton(BTN_MUTE_X, BTN_MUTE_Y, BTN_WIDTH, BTN_HEIGHT, (button_state_ & BTNMUTE)); if(buttons & BTNREC){ drawButton(BTN_REC_X, BTN_REC_Y, BTN_WIDTH, BTN_HEIGHT, (button_state_ & BTNREC)); if(!curshowrec) XCopyArea(display_default_, pixmap_nrec, pixmap_disp, graphics_context_, 0, 0, 9, 8, 6, 47); else XCopyArea(display_default_, pixmap_main, pixmap_disp, graphics_context_, 6, 48, 9, 8, 6, 47); } } //-------------------------------------------------------------------- void XHandler::drawButton(int x, int y, int w, int h, bool down) { if(!down) XCopyArea(display_default_, pixmap_main, pixmap_disp, graphics_context_, x, y, w, h, x, y); else { XCopyArea(display_default_, pixmap_main, pixmap_disp, graphics_context_, x, y, 1, h-1, x+w-1, y+1); XCopyArea(display_default_, pixmap_main, pixmap_disp, graphics_context_, x+w-1, y+1, 1, h-1, x, y); XCopyArea(display_default_, pixmap_main, pixmap_disp, graphics_context_, x, y, w-1, 1, x+1, y+h-1); XCopyArea(display_default_, pixmap_main, pixmap_disp, graphics_context_, x+1, y+h-1, w-1, 1, x, y); } } //-------------------------------------------------------------------- int XHandler::flush_expose(Window w) { XEvent dummy; int i=0; while (XCheckTypedWindowEvent(display_default_, w, Expose, &dummy)) i++; return i; } //-------------------------------------------------------------------- int XHandler::getWindowSize() { return window_size_; } //-------------------------------------------------------------------- // --> inline //Display* XHandler::getDisplay() //{ // return display_default_; //} //-------------------------------------------------------------------- int XHandler::getButtonState() { return button_state_; } //-------------------------------------------------------------------- void XHandler::setButtonState(int button_state) { button_state_ = button_state; } //-------------------------------------------------------------------- void XHandler::setDisplay(char* arg) { sprintf(display_name_, "%s", arg); } //-------------------------------------------------------------------- void XHandler::setPosition(char* arg) { sprintf(position_name_, "%s", arg); } //-------------------------------------------------------------------- void XHandler::setLedColor(char* arg) { sprintf(ledcolor_name_, "%s", arg); } //-------------------------------------------------------------------- void XHandler::setLedHighColor(char* arg) { sprintf(ledcolor_high_name_, "%s", arg); } //-------------------------------------------------------------------- void XHandler::setBackColor(char* arg) { sprintf(backcolor_name_, "%s", arg); } //-------------------------------------------------------------------- void XHandler::setWindowClass(char* arg) { snprintf(window_class_, 254, "%s", arg); } //-------------------------------------------------------------------- void XHandler::setUnshaped() { is_ushape_ = 1; } //-------------------------------------------------------------------- void XHandler::setWindowMaker() { is_wmaker_ = 1; } //-------------------------------------------------------------------- void XHandler::setAfterStep() { is_astep_ = 1; } //-------------------------------------------------------------------- Atom XHandler::getDeleteWin() { return deleteWin; } //-------------------------------------------------------------------- void XHandler::initIcons(int num) { if(icon_list_) delete[] icon_list_; icon_list_ = new unsigned[num]; icon_list_[0] = 0; icon_list_[1] = 7; icon_list_[2] = 8; icon_list_[3] = 2; icon_list_[4] = 1; icon_list_[5] = 6; icon_list_[6] = 4; icon_list_[7] = 5; icon_list_[8] = 3; for(int counter=9; counter Added mouse-wheel support Rewrote parts of the X handling to make it work with the KDE Dock Application Bar Added manpage Changed to GNU getopt command line parsing Added simple Makefile, get rid of imake Release 1.2 25 May 2002 Merge Debian patches Cleanup/Splitup MixCtl Preparing for major rewrite... Makefile updated again Release 1.3 26 May 2002 Change the whole thing to actual C++ code. It is not yet pretty code, but it is a lot better. Still, much work to do. Release 1.4 08 Jun 2002 Display only one bar for mono channels (Taken from Damian Kramer's wmsmixer) Split X code up into smaller pieces Fix channel rotating (repeat timer) Add mute button Release 1.5 25 Jun 2002 Several fixes (really open mixer device given with -m, don't segfault when /dev/mixer is not there, don't go to max if using scrollwheel to set volume below 0) Shaded LED-Bar Initial Exception Handling Release 1.6 13 Jul 2011 Support of multiple config files to run multiple instances of wmmixer. Hurd support. Support of XClasses. These patches was created first in Debian 01_restore_pristine_code.patch 02_multiple_config_files.patch 03_hurd_support.patch 04_xclass_support.patch Release 1.7 19 Sep 2011 Fix FTBFS with ld --as-needed Patch sent by Angel Abad wmmixer-1.7+20120605/XPM/0000755000175000017500000000000012173002272012554 5ustar kixkixwmmixer-1.7+20120605/XPM/tile.xpm0000644000175000017500000001265112173002272014244 0ustar kixkix/* XPM */ static char const *tile_xpm[] = { "64 64 54 1", " c #F3CEF3CEF3CE", ". c #000000000000", "X c #514461856185", "o c #A289A289B2CA", "O c #A289A289A289", "+ c #A2899248B2CA", "@ c #9248A289A289", "# c #A2899248A289", "$ c #92489248A289", "% c #924892489248", "& c #92488207A289", "* c #820792489248", "= c #924882079248", "- c #820782079248", "; c #820782078207", ": c #820771C69248", "> c #618551446185", ", c #9248A289B2CA", "< c #92489248B2CA", "1 c #82079248A289", "2 c #82078207A289", "3 c #71C682079248", "4 c #71C682078207", "5 c #514451446185", "6 c #514451445144", "7 c #820771C68207", "8 c #410351445144", "9 c #514441035144", "0 c #71C671C69248", "q c #71C671C68207", "w c #71C671C671C6", "e c #410341035144", "r c #71C661858207", "t c #618571C68207", "y c #410351444103", "u c #410341034103", "i c #618571C671C6", "p c #410330C24103", "a c #30C241034103", "s c #71C6618571C6", "d c #6185618571C6", "f c #618561858207", "g c #30C230C230C2", "h c #618561856185", "j c #30C230C24103", "k c #5144618571C6", "l c #30C2410330C2", "z c #6185514471C6", "x c #208130C230C2", "c c #30C2208130C2", "v c #5144514471C6", "b c #2081208130C2", "n c #208120812081", "m c #410330C25144", " .", " X.", " oOoO+O+O+O+@#$+@#$#$#$$$#$$%&%&%&%&*&*&*=-=*=-=-=--;---;:;:;>.", " oo@o,o@o@o@+@+@<@$@$@$@$@$1$$$*$*$*&*&*2*&*2*-*-*-----3-3-4-X.", " oO+OoO#O+@#@#@#$#@#$#%#$$%$%$%&%&*=%&*=*=*=-=-=--;-;-;:;:;:;5.", " ,ooo@+@+@+@+@<@#@<@$$$$$$$$$*$1$*&*&*&*&*2*---*-----3---4:4:6.", " +O+O+O+@#$#@#$#$#$$%$$$%&%&%&%&*=*&*=-=*=---=--;---;:;:4:;:45.", " @o@o@o@+@+@<@$@$@$$$@$1$1$*$*$*&*&*2*=*2*-*-*-----4-3-4:4-4:6.", " +O#O+@#@#@#$#$#$#%#%$%&%$%&%&*=*&*=*=*=-=-=--;-;-;:;:;:;:4745.", " @+@+@+@+@<@#@$@$$$$$$$$$*$*$*&*&*&*&*2*---*-----3---4:4:4:4:8.", " #O+@#$#@#$#$#$$%$$$%&%&%&%&*=*&*=-=-=---=--;:;-;:;:4:4:474:49.", " @o@<@+@<@$@$@$$$$$1$1$*$*$*&*&*2*=*2*-*-*-----4-4-4:4:4:4:408.", " +@#@#@#$#$#$$%#%$%&%$%&%&*=*&*=*=*=-=-=--;-;-;:;:;:;:474747q9.", " @+@+@<@$$$@$$$$$1$$$*&*$*&*&*&*&*2*---------3-3-4:4:4:4:404q8.", " #$#@#$#$#$$%$$$%&%&%&%&*=-&*=-=-=---=--;:;:;:;:4:4:474:47q7q9.", " @#@<@$@$@$$$$$*$1$*$*$*&*&*2*-*2*-*-*-3---4-4-4:4:4:4:404q4q8.", " #@#$#$#$$%$%$%&%$%&%&*=*=*=-=*=-=;=--;-;-;:;:47;:474747q7q7q9.", " @<@$$$@$$$$$1$$$*&*&*&*&*&*=*2*---------4-3-4:4:4:4:404qq04q8.", " #$#$#$$%$%$%&%&%&%&*=-&*=-=-=------;:;:;:;:4:4:47q747qqq7qqq9.", " @$@$@$$$$$*$1$*$*$*&*&*2*-*-*---*-3-3-4-4-4:4:4:4:404q4q4qqq8.", " #$#$$%$%$%&%&%&%&*=*=*=-=-=-=;=--;:;-;:;:474:474747q7q7qqwqw9.", " $$@$$$$$*$$$*&*&*&*&*2*=*2*---------4-3-4:4:4:4:404qqq4qqqqqe.", " #$$%$%$%&%&*&%&*=-&*=-=-=------;:;:;:;:4:4:47q7q7qqq7qqwrqqw9.", " @$$$$$*$1$*&*$*2*&*2*-*-*-----3-3-4-4-4:4:404:404q4q4qqqqqtqy.", " $%$%$%&%&%=%&*=*=*=-=-=--;=--;:;-;:;:474:474747q7q7qqwqwqwrwe.", " $$$$*$1$*&*&*&*&*2*--2*-----3---4:3-4:4:4:4:404qqqqqqqqqtqtqu.", " &%$%&%&*&*&*=-=*=-=-=--;---;:;:;:;:4:4:47q7q7qqq7qqwrqrwrwrip.", " $$*$*$*&*&*2*&*2*-*-*-----3-3-4-4-4:4:404q404q4q4qtqqqiqtqiru.", " $%&%&*=%&*=*=*=-=-=--;-;-;:;-;:;:474:47q747q7q7qqwqwqwrwrirwu.", " *$1$*&*&*&*&*2*---*-----3---4:4:4:4:4:4:404qqqqqqqqqtqtqirira.", " &%&*=*&*=-=*=-=-=--;---;:;:;:;:4:4:47q7q7qqqqqqwrqrwrwriririp.", " *$*&*&*2*&*2*-*-*-----3-3-4-4-4:4:404q4q4qqq4qtqtqiqiqiriqira.", " &*=*&*=*=*=-=-=--;-;-;:;:;:;:474:47q7q7q7q7qqwrwqwrwrirwrisip.", " *&*&*&*&*2*---*-----3---4:4:4:4:404:404qqqqqqqqqtqtqiriririra.", " =*&*=-=*=---=--;---;:;:4:;:474:47q7q7qqqqqqwrwrwrwriririsdrdp.", " *&*2*=*2*-*-*-----4-3-4:4-4:4:404q4q4qqqqqtqtqiqiqiriqifirifa.", " &*=*=*=-=-=--;-;-;:;:;:;:474747q7q7qqq7qqwrwqwrwrirwrisisisdp.", " *&*&*2*---*-----3-3-4:4:4:4:404qq04qqqqqtqqqirtqiririririfida.", " =-=-=---=--;:;-;:;:4:4:474:47q7q7qqqqqqwrwrwrwriririsdrdsdddp.", " *=*2*-*-*-----4-4-4:4:4:4:404q4q4qqqqqtqtqiqiqiriqifififidida.", " =*=-=-=--;-;-;:;:4:;:474747q7q7qqwqwqwrwqwrwrirwrisdsisdsdsdp.", " *2*---------4-3-4:4:4:4:404qq04qqqqqtqqqiririririririfidddddg.", " =---=--;:;:;:;:4:4:474:47q7q7qqqqqqwrwrwrwriririsdsdsddddddhj.", " *---*-3---4-4-4:4:4:4:404q4q4qqqqqtqtqiqiqiririfififidddidkdl.", " =;=--;:;-;:;:474:474747q7q7qqwqwqwrwrwrwrirwrisdsdsdsdsddhzhj.", " --------4-3-4:4:4:4:404qq04qqqqqtqqqiririririfirifidddddddddx.", " ---;:;:;:;:4:4:47q747qqq7qqwqqqwrwrirwriririsdsdsddddddhzhzhc.", " --3-3-4-4-4:4:4:4:404q4q4qqqqqtqtqiriqiririfififidddddkdkdXdx.", " -;:;-;:;:474:474747q7q7qqwqwqwrwrwrwrisisisdsdsdddsddhzhdhzhg.", " ----4-3-4:4:4:4:404qqq4qqqqqtqtqiriririrififdfidddddkdddkzkdx.", " :;:;:;:4:4:47q7q7qqq7qqwrqqwrwriririririsdsdsddddddhzhzhzhzXc.", " 3-4-4-4:4:404:404q4q4qqqqqtqtqiriqiririfidididddddkdkdXdXdXzx.", " -;:;:474:47q747q7q7qqwqwqwrwrirwrisisisdsdsddddddhzhdhzhzXzhc.", " 4:4-4:4:4:4:404qqqqqqqqqtqtqiriririrififdfidddddkdddkzkdXzXzx.", " :;:4:4:47q7q7qqq7qqwrqrwrwriririsirisdsdsddddddhzhzhzhzXzXzXc.", " 4-4:4:404q404qqq4qtqqqiqtqiriqiririfidididddddkdkdXdXdXzXzXvx.", " :474:47q7q7q7q7qqwrwqwrwrirwrisisisdsdsddddddhzhzhzhzXzhzX>5c.", " 4:4:4:4:404qqqqqqqqqtqtqiririririfiddfidddddkdddXzkdXzXzXvXzx.", " :4:47q7q7qqqqqqwrwrwrwriririsdrisdddsddddddhzhzXzhzXzXzX>5>5c.", " 4:404q4q4qqqqqtqtqiqiqiriqiririfidididddddkdkdXzXdXzXzXvXvXvx.", " :47q7q7q7q7qqwrwqwrwrirwrisisisdsdsddhdddhzhzhzhzXzXzX>5>5>5b.", " 404:404qqqqqqqqqiqtqiririririfidddidddddkdkdXzkzXzXzXvXv5vX5n.", " >65656569698989y9e9u9ueumueupupapaplpgjgjgjgcgcgcgcxcbcncnbnb.", " ..............................................................."}; wmmixer-1.7+20120605/XPM/icons.xpm0000644000175000017500000001174612173002272014426 0ustar kixkix/* XPM */ static char const *icons_xpm[] = { "220 22 4 1", " c #282828 s back_color", ". c #00ffff s led_color_high", "X c #007b7b s led_color_low", "o c #ffffff", " ", " ", " .. ", " .... X.. XXXXXX . . .. ", " . . ...... X......X X..X. .. ........X X. .X . . ", " . . ..XXX..... X............X. ..X.X. .. . ..X X.... X. .X . ", " X. . . ..XXXX...... X....... . . . .X.X.. . . . . ... ..... .. . . . X. ", " X... . . ............... ...XXX....o. .X............X. .X.. . .X. XX . X..X X...X .. .. . X... ", " X..... . . .X.X.X.X X.X.X.X .XX.XXX...o... . X......X ..XX . . X. . . . X...X ...X X.X X..... ", " X....... . . .X.X.X.X X.X.X.X .XXXXX...o.... . .XX . ..X . . . .... ...X ....X . X....... ", " X......... .................... .X.X.X.X X.X.X.X .XXXX. .XXXX. X. .XX . .X. X . . . . X..X ...X .. X.X .. X......... ", " X........... . . .X X X X X X X.X .XXXX. .XXXX. X. .XX . .X. . . . X...X .. ..X .... X........... ", " X............. . . .X X X X X X X.X ....o...XXXXX. . .XX . .. . . . .... X.X . . . X............. ", " X............... . . ...............X ...o...XX..XX. . .XX. . X. . . . .... X. . . . X............... ", " ................. . . XXXXXXXXXXXXXXX .o....XXX... . ... .X. XX . X.... X. . . ................. ", " . . ......XXXX.. .. . . . . . X....X X. X.X. ", " . . .....XXX.. .. X... .X .. . .... X...... ", " .... ...... .. . ...X .. .. .X ", " . ...X ", " ", " ", " "}; wmmixer-1.7+20120605/XPM/wmmixer.xpm0000644000175000017500000001072112173002272014773 0ustar kixkix/* XPM */ static char const *wmmixer_xpm[] = { "64 64 10 1", " c None", ". c #000000", "+ c #AEAAAE", "@ c #282828", "# c #202020", "$ c #F7F3FF", "% c #86828E", "& c #FF0000", "* c #FA0808", "= c #FE0000", " ", " ", " ", " ", " .........................+ ........................+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .#@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " ++++++++++++++++++++++++++ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .......................... .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$$$$$$$$$$$%$$$$$$$$$$$%+ .#@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++++++++++.$++++++++++.+ .#@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++++++.+++.$+++.++++++.+ .#@@@@@@@@@@@@@@@@@@@@@@+ ", " .$+++++..+++.$+++..+++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++++...+++.$+++...++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$+++....+++.$+++....+++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++++...+++.$+++...++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$+++++..+++.$+++..+++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++++++.+++.$+++.++++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++++++++++.$++++++++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .%...........%...........+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " ++++++++++++++++++++++++++ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .......................... .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$$$$$$$$$$$%$$$$$$$$$$$%+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++++++++++.$&++++++++&.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++++++++++.$+&++++..&+.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$+++*&&=+++.$++&++.+.++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++**=*&=++.$++...+&.++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++*===*=++.$++.+&&+.++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++*===&=++.$++...+&.++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$+++*=&=+++.$++&++.+.++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++++++++++.$+&++++..&+.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .$++++++++++.$&++++++++&.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " .%...........%...........+ .@@@@@@@@@@@@@@@@@@@@@@@+ ", " ++++++++++++++++++++++++++ +++++++++++++++++++++++++ ", " ", " ", " ", " ", " "}; wmmixer-1.7+20120605/XPM/norec.xpm0000644000175000017500000000034212173002272014407 0ustar kixkix/* XPM */ static char const *norec_xpm[] = { "10 9 3 1", " c None", ". c #AEAAAE", "+ c #353535", "..........", "..........", "...++++...", "..++++++..", "..++++++..", "..++++++..", "...++++...", "..........", ".........."}; wmmixer-1.7+20120605/mixctl.h0000644000175000017500000000446012173002272013565 0ustar kixkix// 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. #ifndef __mixctl_h__ #define __mixctl_h__ #include #include #include #include #include #include #include #include #ifdef __NetBSD__ #include #endif #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) #include #endif #ifdef __linux__ #include #endif #ifdef __GNU__ // Hurd #include #endif #include "exception.h" //---------------------------------------------------------------------- struct _MixerDevice_{ bool support; bool stereo; bool recsrc; bool records; char *name; char *label; int value; int mask; int muted; }; typedef struct _MixerDevice_ MixerDevice; //---------------------------------------------------------------------- class MixCtl { protected: int mixfd; int mixfdopen; char* device_; int muted_; unsigned num_devices_; // maximum number of devices int devmask; // supported devices int stmask; // stereo devices int recmask; // devices which can be recorded from int caps; // capabilities int recsrc; // devices which are being recorded from int modify_counter; MixerDevice* mixer_devices_; void doStatus(); public: MixCtl(char *dname) throw(MixerDeviceException); virtual ~MixCtl(); int readVol(int, bool); int readLeft(int); int readRight(int); void writeVol(int); void setVol(int, int); void setBoth(int, int, int); void setLeft(int, int); void setRight(int, int); bool readRec(int, bool); void writeRec(); void setRec(int, bool); char *getDevName(); unsigned getNrDevices(); int getCapabilities(); bool getSupport(int); bool getStereo(int); bool getRecords(int); char *getName(int); char *getLabel(int); bool hasChanged(); bool isMuted(int); void mute(int); void unmute(int); }; #endif // __mixctl_h__ wmmixer-1.7+20120605/exception.h0000644000175000017500000000164412173002272014264 0ustar kixkix// wmmixer - A mixer designed for WindowMaker // // 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. #ifndef __exception_h__ #define __exception_h__ #include #include //-------------------------------------------------------------------- class Exception { protected: char* error_message_; public: Exception(); Exception(const Exception&); virtual ~Exception(); char* getErrorMessage() const; }; //-------------------------------------------------------------------- class MixerDeviceException : public Exception { public: MixerDeviceException(char *); // virtual ~MixerDeviceException(); }; #endif //_exception_h__ wmmixer-1.7+20120605/home.wmmixer0000644000175000017500000000414212173002272014453 0ustar kixkix# wmmixer - A mixer designed for WindowMaker # 8 Jun 2002 Release 1.4 # 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 README file for a more complete notice. # User config file # Should be saved as ~/.wmmixer # Comments and blank lines mostly allowed # The format of this file is a series of commands: # addchannel %i # Adds a channel to the sequence. %i specifies a channel. # These are the values from my : # SOUND_MIXER_VOLUME 0 # SOUND_MIXER_BASS 1 # SOUND_MIXER_TREBLE 2 # SOUND_MIXER_SYNTH 3 # SOUND_MIXER_PCM 4 # SOUND_MIXER_SPEAKER 5 # SOUND_MIXER_LINE 6 # SOUND_MIXER_MIC 7 # SOUND_MIXER_CD 8 # There are a few more, but these are the important ones (and are # those identified with appropriate icons). # Ths channel added becomes the current channel for subsequent # setmono, setleft, setright and setrecsrc commands. # setchannel %i # Similar to addchannel, except the channel is not actually added # to the sequence, merely made the current channel for subsequent # setmono, setleft, setright and setrecsrc commands. # setmono %i # Sets both left and right volumes for the current channel. # The channel may be mono or stereo. # The value specified must be an integer in the range 0 to 100. # setleft %i # Sets left volume for the current channel. # Do not use on a mono channel. # The value specified must be an integer in the range 0 to 100. # setright %i # Sets right volume for the current channel. # Do not use on a mono channel. # The value specified must be an integer in the range 0 to 100. # setrecsrc TRUE | FALSE # Enable or disable recording from the current channel. # Ignored if the channel does not support it. # The value is TRUE or FALSE. # At least one channel must be added! addchannel 0 addchannel 3 addchannel 4 addchannel 6 addchannel 7 addchannel 8