[Pkg-wmaker-commits] [wmmixer] 07/24: Import Debian changes 1.1-4

Doug Torrance dtorrance-guest at moszumanska.debian.org
Sun Aug 27 13:12:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmmixer.

commit 94d5557f13211e945bab6dc664fda2931a3f87e7
Merge: 91a67f0 6512e4f
Author: Gordon Fraser <gordon at debian.org>
Date:   Sun Apr 14 15:52:40 2002 +0200

    Import Debian changes 1.1-4
    
    wmmixer (1.1-4) unstable; urgency=low
    
      * Fix version string
      * Improve mousewheel behaviour for changing both channels
    
    wmmixer (1.1-3) unstable; urgency=low
    
      * Added ioctl to check for changes before doing updates
        This reduces CPU load a _lot_
      * Really give compiler CXXFLAGS
      * Get rid of compiler warnings
    
    wmmixer (1.1-2) unstable; urgency=low
    
      * Correct Makefile to use C++ compiler instead of C compiler
        (Closes: #141696)
    
    wmmixer (1.1-1) unstable; urgency=low
    
      * New maintainer
      * New upstream release, new upstream author - me
      * Add manpage (Closes: #93477)
      * Add wheelmouse support (Closes: #47984)
      * Move executable to /usr/bin (Closes: #122022)
      * Update menu entry (Closes: #82330)
      * Update X handling, now works with KDE Dock App Bar (Closes: #108529)
      * It builds now (new Makefile, without imake), change Build-Depends
    
    wmmixer (1.0beta1-6.1) unstable; urgency=low
    
      * NMU
      * Add Build-Depends: xutils.  Closes: #105305
    
    wmmixer (1.0beta1-6) unstable; urgency=low
    
      * Can now handle as many channels as your sound card can.
      * cleaned up menu file, added a non-docked entry
      * Closes: #52908

 CHANGES              |  61 ++++
 INSTALL              |   9 +
 Imakefile            |  13 -
 Makefile             |  39 +++
 README               |  95 +-----
 debian/README.debian |   7 -
 debian/changelog     |  56 +++-
 debian/compat        |   1 +
 debian/control       |   7 +-
 debian/copyright     |  10 +-
 debian/dirs          |   3 -
 debian/menu          |  10 +-
 debian/postinst      |  17 -
 debian/postrm        |  30 --
 debian/rules         |  40 +--
 home.wmmixer         |   2 +-
 mixctl.h             |  22 +-
 wmmixer.1            |  89 ++++++
 wmmixer.cc           | 884 +++++++++++++++++++++++++++------------------------
 wmmixer.h            | 159 +++++++++
 20 files changed, 942 insertions(+), 612 deletions(-)

diff --cc Makefile
index 0000000,f2c489d..3504081
mode 000000,100644..100644
--- a/Makefile
+++ b/Makefile
@@@ -1,0 -1,39 +1,39 @@@
+ # $Id: Makefile,v 1.0 2002/04/02 19:38:22 gordon Exp $
+ 
+ prefix      = /usr/local
+ exec_prefix = ${prefix}
+ bindir      = ${exec_prefix}/bin
+ mandir      = ${prefix}/share/man
+ 
+ DESTDIR     =
+ 
 -CFLAGS      = -O2 -Wall -pedantic
++CXXFLAGS    = -O2 -Wall
+ LIBS        = -L/usr/X11R6/lib -lX11 -lXpm -lXext
+ 
+ all: wmmixer
+ 
+ wmmixer: wmmixer.cc
 -	$(CC) $(LIBS) -o $@ $^
++	$(CXX) $(CXXFLAGS) $(LIBS) -o $@ $^
+ 
+ install: install-bin install-doc
+ 
+ install-bin: wmmixer
+ 	install -D -s -m 755 $< $(DESTDIR)$(bindir)/wmmixer
+ 
+ install-doc: wmmixer.1
+ 	install -D -m 644 $< $(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
+ 
+ clean:
+ 	rm -f *.o wmmixer
+ 
+ .PHONY: all clean dist-clean install install-bin install-doc \
+ 	uninstall uninstall-bin uninstall-doc
+ 
diff --cc debian/changelog
index 771d31c,0000000..a460e51
mode 100644,000000..100644
--- a/debian/changelog
+++ b/debian/changelog
@@@ -1,79 -1,0 +1,125 @@@
++wmmixer (1.1-4) unstable; urgency=low
++
++  * Fix version string
++  * Improve mousewheel behaviour for changing both channels
++
++ -- Gordon Fraser <gordon at debian.org>  Sun, 14 Apr 2002 15:52:40 +0200
++
++wmmixer (1.1-3) unstable; urgency=low
++
++  * Added ioctl to check for changes before doing updates
++    This reduces CPU load a _lot_
++  * Really give compiler CXXFLAGS
++  * Get rid of compiler warnings
++
++ -- Gordon Fraser <gordon at debian.org>  Fri, 12 Apr 2002 09:13:37 +0200
++
++wmmixer (1.1-2) unstable; urgency=low
++
++  * Correct Makefile to use C++ compiler instead of C compiler 
++    (Closes: #141696)
++
++ -- Gordon Fraser <gordon at debian.org>  Mon,  8 Apr 2002 09:00:48 +0200
++
++wmmixer (1.1-1) unstable; urgency=low
++
++  * New maintainer
++  * New upstream release, new upstream author - me
++  * Add manpage (Closes: #93477)
++  * Add wheelmouse support (Closes: #47984)
++  * Move executable to /usr/bin (Closes: #122022)
++  * Update menu entry (Closes: #82330)
++  * Update X handling, now works with KDE Dock App Bar (Closes: #108529)
++  * It builds now (new Makefile, without imake), change Build-Depends
++
++ -- Gordon Fraser <gordon at debian.org>  Tue,  2 Apr 2002 19:36:36 +0200
++
++wmmixer (1.0beta1-6.1) unstable; urgency=low
++
++  * NMU
++  * Add Build-Depends: xutils.  Closes: #105305
++
++ -- LaMont Jones <lamont at smallone.fc.hp.com>  Sat, 14 Jul 2001 23:16:14 -0600
++
++wmmixer (1.0beta1-6) unstable; urgency=low
++
++  * Can now handle as many channels as your sound card can.
++  * cleaned up menu file, added a non-docked entry
++  * Closes: #52908
++
++ -- Sean 'Shaleh' Perry <shaleh at debian.org>  Fri,  6 Oct 2000 10:46:24 -0700
++
 +wmmixer (1.0beta1-5) unstable; urgency=low
 +
 +  * New maintainer
 +
 + -- Sean E. Perry <shaleh at debian.org>  Fri,  3 Sep 1999 14:30:29 -0700
 +
 +wmmixer (1.0beta1-4) unstable; urgency=low
 +
 +  * New maintainer
 +
 + -- Neale Pickett <neale at debian.org>  Thu, 25 Feb 1999 14:30:29 -0700
 +
 +wmmixer (1.0beta1-3) frozen unstable; urgency=low
 +
 +  * debian/rules: added dh_installexamples home.wmmixer (closes: bug#25482)
 +  * recompiled with lastest g++
 +  * Added frozen to the target distributions...
 +
 + -- Marcelo E. Magallon <mmagallo at debian.org>  Fri,  4 Dec 1998 13:58:26 -0600
 +
 +wmmixer (1.0beta1-2) unstable; urgency=low
 +
 +  * debian/rules: added dh_installexamples home.wmmixer (closes: bug#25482)
 +  * recompiled with lastest g++
 +
 + -- Marcelo E. Magallon <mmagallo at debian.org>  Fri,  4 Dec 1998 12:36:31 -0600
 +
 +wmmixer (1.0beta1-1) unstable; urgency=low
 +
 +  * New upstream version
 +  * Added CC=c++ to debian/rules (why does it work ok with wmmount but not
 +    with this one?)
 +  * debian/rules: changed cp wmmixer ... to install -s -m 0755 wmmixer ...
 +  * debian/control: upgraded Standards Version to 2.4.1
 +  * debian/control: Suggests: wmaker | afterstep
 +  * debian/rules: nuke -DX_LOCALE after making Makefile
 +  * Added copyright information to debian/rules
 +
 + -- Marcelo E. Magallon <mmagallo at debian.org>  Sun,  4 Oct 1998 20:42:22 -0600
 +
 +wmmixer (0.8-1) frozen unstable; urgency=low
 +
 +  * New upstream version
 +  * WRT version 0.2 this: fixes bug relating to manual window positioning;
 +    reduces CPU load; fixes bug relating to cards with no volume channel;
 +    has better checking of supported channels; is GPLed.
 +
 + -- Marcelo E. Magallon <mmagallo at debian.org>  Sat,  9 May 1998 21:33:48 -0600
 +
 +wmmixer (0.7-1) unstable; urgency=low
 +
 +  * New upstream version. It's GPL'ed now! Moving into main
 +  * Applied patch that handles Expose events
 +
 + -- Marcelo E. Magallon <mmagallo at debian.org>  Sat,  2 May 1998 13:37:54 -0600
 +
 +wmmixer (0.6-1) unstable; urgency=low
 +
 +  * New upstream version
 +
 + -- Marcelo E. Magallon <mmagallo at debian.org>  Wed,  8 Apr 1998 21:20:33 -0600
 +
 +wmmixer (0.2-2) frozen unstable; urgency=low
 +
 +  * Moving to non-free due to copyright
 +
 + -- Marcelo E. Magallon <mmagallo at debian.org>  Sat, 21 Mar 1998 15:29:04 -0600
 +
 +wmmixer (0.2-1) unstable; urgency=low
 +
 +  * Initial release
 +
 + -- Marcelo E. Magallon <mmagallo at debian.org>  Sun,  5 Mar 1998 23:01:10 -0600
 +
- Local variables:
- mode: debian-changelog
- mode: auto-fill
- add-log-mailing-address: "shaleh at debian.org"
- End:
diff --cc debian/compat
index 0000000,0000000..00750ed
new file mode 100644
--- /dev/null
+++ b/debian/compat
@@@ -1,0 -1,0 +1,1 @@@
++3
diff --cc debian/control
index c64d9c7,0000000..58cfccd
mode 100644,000000..100644
--- a/debian/control
+++ b/debian/control
@@@ -1,16 -1,0 +1,15 @@@
 +Source: wmmixer
 +Section: sound
 +Priority: optional
- Maintainer: Sean E. Perry <shaleh at debian.org>
- Standards-Version: 2.4.1.0
++Build-Depends: xlibs-dev, debhelper (>> 3.0.0)
++Maintainer: Gordon Fraser <gordon at debian.org>
++Standards-Version: 3.5.6
 +
 +Package: wmmixer
 +Architecture: any
- Section: sound
- Priority: optional
 +Depends: ${shlibs:Depends}
 +Suggests: wmaker | afterstep
 +Description: A mixer application designed for WindowMaker
 + There's 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
diff --cc debian/copyright
index 21bcdb3,0000000..efff265
mode 100644,000000..100644
--- a/debian/copyright
+++ b/debian/copyright
@@@ -1,13 -1,0 +1,15 @@@
 +This package was first debianized by Marcelo E. Magallon
 +<mmagallo at debian.org> on Sun, 5 Mar 1998 23:00:00 -0600.
- Additional modifications by Neale Pickett <neale at debian.org>.
++Additional modifications by Neale Pickett <neale at debian.org> 
++and Gordon Fraser <gordon at debian.org>
 +
- wmmixer - a mixer control for WindowMaker by Sam Hawker
- shawkie at geocities.com
++wmmixer - a mixer control for WindowMaker, originally by 
++Sam Hawker <shawkie at geocities.com>, now maintained by 
++Gordon Fraser <gordon at freakzone.net>
 +
 +It was downloaded from:
 +
-   http://www.geocities.com/SiliconValley/Vista/2471/linux
++  http://freakzone.net/gordon/wmmixer-1.1.tar.gz
 +
 +This program is distributed under the GPL. You can find a copy on
 +/usr/share/common-licenses/GPL.
diff --cc debian/menu
index 7e81ec2,0000000..92de3ae
mode 100644,000000..100644
--- a/debian/menu
+++ b/debian/menu
@@@ -1,6 -1,0 +1,10 @@@
 +?package(wmmixer):\
 +   needs="x11"\
-    icon="none"\
 +   section="Apps/Sound"\
-    title="WMmixer"\
-    command="/usr/X11R6/bin/wmmixer -s -w"
++   title="WMMixer (Docked)"\
++   command="/usr/bin/wmmixer -w"
++?package(wmmixer):\
++   needs="x11"\
++   section="Apps/Sound"\
++   title="WMMixer"\
++   command="/usr/bin/wmmixer"
diff --cc debian/rules
index e0de470,0000000..eba03a5
mode 100755,000000..100755
--- a/debian/rules
+++ b/debian/rules
@@@ -1,61 -1,0 +1,55 @@@
 +#!/usr/bin/make -f
 +# This is a -*- makefile -*-
 +# Modified from the sample debian/rules that uses debhelper.
 +# GNU copyright 1998 by Marcelo Magallon.
 +# GNU copyright 1997 by Joey Hess.
 +
 +package=wmmixer
 +
- # export DH_VERBOSE = 1
++#export DH_VERBOSE = 1
 +
 +build: stamp-build
 +
- stamp-build: Makefile
++stamp-build:
 +	dh_testdir
- 	make CC=c++ CXXDEBUGFLAGS="-g -O2"
++	$(MAKE)
 +	touch stamp-build
 +
- Makefile: 
- 	xmkmf -a
- 	perl -pi -e 's/-DX_LOCALE//g;' Makefile
- 
 +clean:
 +	dh_testdir
 +	dh_testroot
- 	-make clean
- 	-rm -f stamp-build Makefile
++	-rm -f stamp-build
++	-$(MAKE) clean
 +	dh_clean
 +
- binary-indep: build
- #	dh_testdir -i
- #	dh_testroot
- #	dh_clean -i -k
- 
- binary-arch: build
++install:
 +	dh_testdir
 +	dh_testroot
 +	dh_clean -k
 +	dh_installdirs
- 	install -s -m 0755 wmmixer debian/tmp/usr/X11R6/bin
++	$(MAKE) prefix=/usr DESTDIR=$(CURDIR)/debian/wmmixer install
++
++binary-indep: build install
++
++binary-arch: build install
++	dh_testdir
++	dh_testroot
 +	dh_installdocs README
 +	dh_installexamples home.wmmixer
 +	dh_installmenu
- 	dh_undocumented wmmixer.7x
- 	dh_installchangelogs
++	dh_installman
++	dh_installchangelogs CHANGES
 +	dh_strip
 +	dh_compress
 +	dh_fixperms
 +	dh_installdeb
 +	dh_shlibdeps
 +	dh_gencontrol
 +	dh_md5sums
 +	dh_builddeb
 +
 +binary:	binary-indep binary-arch
 +
- .PHONY: binary binary-arch binary-indep build clean
++.PHONY: binary binary-arch binary-indep build clean install
++
 +
- # Local variables:
- # mode: makefile
- # mode: font-lock
- # End:
diff --cc mixctl.h
index 6530460,6530460..62c6d09
--- a/mixctl.h
+++ b/mixctl.h
@@@ -5,6 -5,6 +5,11 @@@
  // This software is free software, and you are welcome to redistribute it
  // under certain conditions
  // See the COPYING file for details.
++//
++// 12/04/02 Gordon Fraser <gordon at debian.org>
++//   * added bool hasChanged()
++//     This improves performance a lot, as it saves a lot of CPU time if nothing
++//     has changed if we try to update
  
  // Although mixctl.h is an integral part of wmmixer, it may also be distributed seperately.
  
@@@ -31,7 -31,7 +36,8 @@@ 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){
++      modify_counter = -1;
++      if((mixfdopen=(mixfd=open(device,O_RDONLY | O_NONBLOCK)))!=-1){
           nrdevices=SOUND_MIXER_NRDEVICES;
           char *devnames[]=SOUND_DEVICE_NAMES;
           char *devlabels[]=SOUND_DEVICE_LABELS;
@@@ -170,6 -170,6 +176,19 @@@
     char *getLabel(int dev){
        return mixdevs[dev].label;
     }
++   bool hasChanged(){
++     struct mixer_info mixer_info;
++     ioctl(mixfd, SOUND_MIXER_INFO, &mixer_info);
++     
++     if (mixer_info.modify_counter == modify_counter)
++       return false;
++     else {
++       modify_counter = mixer_info.modify_counter;
++       return true;
++     }
++   }
++   
++
  
  private:
     int mixfd;
@@@ -193,5 -193,5 +212,6 @@@
     int recmask;         // devices which can be recorded from
     int caps;            // capabilities
     int recsrc;          // devices which are being recorded from
++   int modify_counter;
     struct MixDev *mixdevs;
  };
diff --cc wmmixer.cc
index d3be080,5675718..179354a
--- a/wmmixer.cc
+++ b/wmmixer.cc
@@@ -6,320 -6,263 +6,270 @@@
  // under certain conditions
  // See the README file for a more complete notice.
  
+ // 02/04/02 Gordon Fraser <gordon at debian.org>
+ //   * GNU getopt
+ //   * Mousewheel support
+ //   * X handling rewrite
++//
++// 12/04/02 Gordon Fraser <gordon at debian.org>
++//   * added mixctl->hasChanged() to checkVol
++//     This improves performance a lot, as it saves a lot of CPU time if nothing
++//     has changed if we try to update
  
- // Defines, includes and global variables
- // --------------------------------------
- 
- // User defines - standard
- #define WINDOWMAKER false
- #define USESHAPE    false
- #define AFTERSTEP   false
- #define NORMSIZE    64
- #define ASTEPSIZE   56
- #define NAME        "wmmixer"
- #define CLASS       "WMMixer"
- 
- // User defines - custom
- #define MIXERDEV    "/dev/mixer"
- #define BACKCOLOR   "#282828"
- #define LEDCOLOR    "green"
- 
- // Includes - standard
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
- 
- // Includes - custom
- #include "mixctl.h"
- 
- // X-Windows includes - standard
- #include <X11/X.h>
- #include <X11/Xlib.h>
- #include <X11/Xutil.h>
- #include <X11/Xproto.h>
- #include <X11/xpm.h>
- #include <X11/extensions/shape.h>
- 
- // Pixmaps - standard
- Pixmap pm_main;
- Pixmap pm_tile;
- Pixmap pm_disp;
- Pixmap pm_mask;
- 
- // Pixmaps - custom
- Pixmap pm_icon;
- Pixmap pm_nrec;
- 
- // Xpm images - standard
- #include "XPM/wmmixer.xpm"
- #include "XPM/tile.xpm"
- 
- // Xpm images - custom
- #include "XPM/icons.xpm"
- #include "XPM/norec.xpm"
- 
- // Variables for command-line arguments - standard
- bool wmaker=WINDOWMAKER;
- bool ushape=USESHAPE;
- bool astep=AFTERSTEP;
- char display[256]="";
- char position[256]="";
- int winsize;
- 
- // Variables for command-line arguments - custom
- char mixdev[256]=MIXERDEV;
- char backcolor[256]=BACKCOLOR;
- char ledcolor[256]=LEDCOLOR;
- 
- // X-Windows basics - standard
- Atom _XA_GNUSTEP_WM_FUNC;
- Atom deleteWin;
- Display *d_display;
- Window w_icon;
- Window w_main;
- Window w_root;
- Window w_activewin;
- 
- // X-Windows basics - custom
- GC gc_gc;
- unsigned long color[4];
- 
- 
- // Misc custom global variables 
- // ----------------------------
- 
- // Current state information
- int curchannel=0;
- bool curshowrec;
- bool currec;
- int curleft;
- int curright;
- 
- // For buttons
- int btnstate=0;
- #define BTNNEXT  1
- #define BTNPREV  2
- #define BTNREC   4
- 
- // For repeating next and prev buttons
- #define RPTINTERVAL   5
- int rpttimer=0;
- 
- // For draggable volume control
- bool dragging=false;
- 
- int channels=0;
- int channel[20];
- int icon[20]={0, 7, 8, 2, 1, 6, 4, 5, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9};
- 
- MixCtl *mixctl;
- 
- 
- // Procedures and functions
- // ------------------------
- 
- // Procedures and functions - standard
- void initXWin(int argc, char **argv);
- void freeXWin();
- void createWin(Window *win, int x, int y);
- unsigned long getColor(char *colorname);
- unsigned long mixColor(char *colorname1, int prop1, char *colorname2, int prop2);
- 
- // Procedures and functions - custom
- void scanArgs(int argc, char **argv);
- void readFile();
- void checkVol(bool forced=true);
- void pressEvent(XButtonEvent *xev);
- void releaseEvent(XButtonEvent *xev);
- void motionEvent(XMotionEvent *xev);
- void repaint();
- void update();
- void drawLeft();
- void drawRight();
- void drawBtns(int btns);
- void drawBtn(int x, int y, int w, int h, bool down);
  
+ #include "wmmixer.h"
  
  // Implementation
  // --------------
  
+ 
  int main(int argc, char **argv)
  {
-    scanArgs(argc, argv);
-    initXWin(argc, argv);
- 
-    XGCValues gcv;
-    unsigned long gcm;
-    gcm=GCGraphicsExposures;
-    gcv.graphics_exposures=false;
-    gc_gc=XCreateGC(d_display, w_root, gcm, &gcv);
- 
-    color[0]=mixColor(ledcolor, 0, backcolor, 100);
-    color[1]=mixColor(ledcolor, 100, backcolor, 0);
-    color[2]=mixColor(ledcolor, 60, backcolor, 40);
-    color[3]=mixColor(ledcolor, 25, backcolor, 75);
- 
-    XpmAttributes xpmattr;
-    XpmColorSymbol xpmcsym[4]={{"back_color",     NULL, color[0]},
-                               {"led_color_high", NULL, color[1]},
-                               {"led_color_med",  NULL, color[2]},
-                               {"led_color_low",  NULL, color[3]}};
-    xpmattr.numsymbols=4;
-    xpmattr.colorsymbols=xpmcsym;
-    xpmattr.exactColors=false;
-    xpmattr.closeness=40000;
-    xpmattr.valuemask=XpmColorSymbols | XpmExactColors | XpmCloseness;
-    XpmCreatePixmapFromData(d_display, w_root, wmmixer_xpm, &pm_main, &pm_mask, &xpmattr);
-    XpmCreatePixmapFromData(d_display, w_root, tile_xpm, &pm_tile, NULL, &xpmattr);
-    XpmCreatePixmapFromData(d_display, w_root, icons_xpm, &pm_icon, NULL, &xpmattr);
-    XpmCreatePixmapFromData(d_display, w_root, norec_xpm, &pm_nrec, NULL, &xpmattr);
-    pm_disp=XCreatePixmap(d_display, w_root, 64, 64, DefaultDepth(d_display, DefaultScreen(d_display)));
- 
-    if(wmaker || ushape || astep)
-       XShapeCombineMask(d_display, w_activewin, ShapeBounding, winsize/2-32, winsize/2-32, pm_mask, ShapeSet);
-    else
-       XCopyArea(d_display, pm_tile, pm_disp, gc_gc, 0, 0, 64, 64, 0, 0);
- 
-    XSetClipMask(d_display, gc_gc, pm_mask);
-    XCopyArea(d_display, pm_main, pm_disp, gc_gc, 0, 0, 64, 64, 0, 0);
-    XSetClipMask(d_display, gc_gc, None);
- 
-    mixctl=new MixCtl(mixdev);
- 
-    if(!mixctl->openOK())
-       fprintf(stderr,"%s : Unable to open mixer device '%s'.\n", NAME, mixdev);
-    else{
-       for(int i=0;i<mixctl->getNrDevices();i++){
- 	 if(i==20){
-             fprintf(stderr,"%s : Sorry, can only use channels 0-19\n", NAME);
-             break;
- 	 }
-          if(mixctl->getSupport(i)){
-             channel[channels]=i;
-             channels++;
-          }
+   scanArgs(argc, argv);
+   initXWin(argc, argv);
+   
+   mixctl=new MixCtl(mixdev);
+   
+   if(!mixctl->openOK())
+     fprintf(stderr,"%s : Unable to open mixer device '%s'.\n", NAME, mixdev);
+   else{
+     icon = new int[mixctl->getNrDevices()];
+     channel = new int[mixctl->getNrDevices()];
+     
+     initialize_icon(mixctl->getNrDevices());
+     
+     for(int i=0;i<mixctl->getNrDevices();i++){
+       if(mixctl->getSupport(i)){
+ 	channel[channels]=i;
+ 	channels++;
+       }
+     }
+   }
+   
+   readFile();
+ 
+   if(channels==0)
+     fprintf(stderr,"%s : Sorry, no supported channels found.\n", NAME);
+   else{
+     checkVol(true);
+     
+     XEvent xev;
+     XSelectInput(d_display, w_main, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
+     XSelectInput(d_display, w_icon, ButtonPressMask | ExposureMask | ButtonReleaseMask | PointerMotionMask | StructureNotifyMask);
+     XMapWindow(d_display, w_main);
+ 
+     bool done=false;
+     while(!done){
 -      while(XPending(d_display)){
++      while(XPending(d_display)) {
+ 	XNextEvent(d_display, &xev);
 -	switch(xev.type){
++	switch(xev.type) {
+ 	case Expose:
+ 	  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]==deleteWin)
++	  if(xev.xclient.data.l[0] == (int)deleteWin)
+ 	    done=true;
+ 	  break;
+ 	}
        }
-    }
- 
-    readFile();
- 
-    if(channels==0)
-       fprintf(stderr,"%s : Sorry, no supported channels found.\n", NAME);
-    else{
-       checkVol(true);
- 
-       XEvent xev;
-       XSelectInput(d_display, w_activewin, ExposureMask | ButtonPressMask | ButtonReleaseMask | ButtonMotionMask);
-       XMapWindow(d_display, w_main);
- 
-       bool done=false;
-       while(!done){
-          while(XPending(d_display)){
-             XNextEvent(d_display, &xev);
-             switch(xev.type){
-              case Expose:
-                 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]==deleteWin)
-                    done=true;
-              break;
-             }
-          }
 -      
 +
-          if(btnstate & (BTNPREV | BTNNEXT)){
-             rpttimer++;
-             if(rpttimer>=RPTINTERVAL){
-                if(btnstate & BTNNEXT)
-                   curchannel++;
-                else
-                   curchannel--;
-                if(curchannel<0)
-                   curchannel=channels-1;
-                if(curchannel>=channels)
-                   curchannel=0;
-                checkVol(true);
-                rpttimer=0;
-             }
-          }
-          else
-             checkVol(false);
-          XFlush(d_display);
-          usleep(50000);
+       if(btnstate & (BTNPREV | BTNNEXT)){
+ 	rpttimer++;
+ 	if(rpttimer>=RPTINTERVAL){
+ 	  if(btnstate & BTNNEXT)
+ 	    curchannel++;
+ 	  else
+ 	    curchannel--;
+ 	  if(curchannel<0)
+ 	    curchannel=channels-1;
+ 	  if(curchannel>=channels)
+ 	    curchannel=0;
+ 	  checkVol(true);
+ 	  rpttimer=0;
+ 	}
        }
-    }
-    XFreeGC(d_display, gc_gc);
-    XFreePixmap(d_display, pm_main);
-    XFreePixmap(d_display, pm_tile);
-    XFreePixmap(d_display, pm_disp);
-    XFreePixmap(d_display, pm_mask);
-    XFreePixmap(d_display, pm_icon);
-    XFreePixmap(d_display, pm_nrec);
-    freeXWin();
-    delete mixctl;
-    return 0;
 -      else
++      else {
+ 	checkVol(false);
++      }
+       XFlush(d_display);
 -      usleep(50000);
++      usleep(100000);
++      //      usleep(50000);
+     }
+   }
+   freeXWin();
+   delete mixctl;
+   return 0;
  }
  
- void initXWin(int argc, char **argv){
-    winsize=astep ? ASTEPSIZE : NORMSIZE;
+ void initialize_icon(int num) {
+ 
+    int i;
+ 
+    icon[0] = 0;
+    icon[1] = 7;
+    icon[2] = 8;
+    icon[3] = 2;
+    icon[4] = 1;
+    icon[5] = 6;
+    icon[6] = 4;
+    icon[7] = 5;
+    icon[8] = 3;
+    for(i=9;i<num;i++)
+        icon[i] = 9;
+ }
  
-    if((d_display=XOpenDisplay(display))==NULL){
-       fprintf(stderr,"%s : Unable to open X display '%s'.\n", NAME, XDisplayName(display));
-       exit(1);
-    }
-    _XA_GNUSTEP_WM_FUNC=XInternAtom(d_display, "_GNUSTEP_WM_FUNCTION", false);
-    deleteWin=XInternAtom(d_display, "WM_DELETE_WINDOW", false);
- 
-    w_root=DefaultRootWindow(d_display);
- 
-    XWMHints wmhints;
-    XSizeHints shints;
-    shints.x=0;
-    shints.y=0;
-    shints.flags=0;
-    bool pos=(XWMGeometry(d_display, DefaultScreen(d_display), position, NULL, 0, &shints, &shints.x, &shints.y,
-       &shints.width, &shints.height, &shints.win_gravity) & (XValue | YValue));
-    shints.min_width=winsize;
-    shints.min_height=winsize;
-    shints.max_width=winsize;
-    shints.max_height=winsize;
-    shints.base_width=winsize;
-    shints.base_height=winsize;
-    shints.flags=PMinSize | PMaxSize | PBaseSize;
- 
-    createWin(&w_main, shints.x, shints.y);
- 
-    if(wmaker || astep || pos)
-       shints.flags |= USPosition;
-    if(wmaker){
-       wmhints.initial_state=WithdrawnState;
-       wmhints.flags=WindowGroupHint | StateHint | IconWindowHint;
-       createWin(&w_icon, shints.x, shints.y);
-       w_activewin=w_icon;
-       wmhints.icon_window=w_icon;
-    }
-    else{
-       wmhints.initial_state=NormalState;
-       wmhints.flags=WindowGroupHint | StateHint;
-       w_activewin=w_main;
+ void initXWin(int argc, char **argv){
+   int d_depth;
+   int screen;
+   int x_fd;
+   int dummy = 0;
+ 
+   XWMHints wmhints;
+   XSizeHints shints;
+   XClassHint classHint;
+   XTextProperty	name;
+   char *wname = argv[0];
+   XGCValues gcv;
+   unsigned long gcm;
+   
+   winsize=astep ? ASTEPSIZE : NORMSIZE;
+   
+   if((d_display=XOpenDisplay(display))==NULL) {
+     fprintf(stderr,"%s : Unable to open X display '%s'.\n", NAME, XDisplayName(display));
+     exit(1);
+   }
+ 
+   screen  = DefaultScreen(d_display);
+   w_root  = RootWindow(d_display, screen);
+   d_depth = DefaultDepth(d_display, screen);
+   x_fd    = XConnectionNumber(d_display);
+   
+   _XA_GNUSTEP_WM_FUNC=XInternAtom(d_display, "_GNUSTEP_WM_FUNCTION", false);
+   deleteWin=XInternAtom(d_display, "WM_DELETE_WINDOW", false);
+ 
+   w_root = RootWindow(d_display, screen);
+ 
+   shints.x = 0;
+   shints.y = 0;
+   //  shints.flags  = USSize;
+   shints.flags  = 0; // Gordon
+   
+   back_pix = getColor("white");
+   fore_pix = getColor("black");
+    
+   bool pos=(XWMGeometry(d_display, DefaultScreen(d_display), position, NULL, 0, &shints, &shints.x, &shints.y,
+ 			&shints.width, &shints.height, &dummy) & (XValue | YValue));
+   shints.min_width   = winsize;
+   shints.min_height  = winsize;
+   shints.max_width   = winsize;
+   shints.max_height  = winsize;
+   shints.base_width  = winsize;
+   shints.base_height = winsize;
+   shints.width       = winsize;
+   shints.height      = winsize;
+   shints.flags=PMinSize | PMaxSize | PBaseSize; // Gordon
+ 
+ 
+   w_main = XCreateSimpleWindow(d_display, w_root, shints.x, shints.y,
+ 			    shints.width, shints.height, 0, fore_pix, back_pix);
+   
+   w_icon = XCreateSimpleWindow(d_display, w_root, shints.x, shints.y,
+ 				shints.width, shints.height, 0, fore_pix, back_pix);
+   
+   XSetWMNormalHints(d_display, w_main, &shints);
+   
+   
+   wmhints.icon_x = shints.x;
+   wmhints.icon_y = shints.y;
+   
+   if(wmaker || astep || pos)
+     shints.flags |= USPosition;
+ 
+   if(wmaker){
+     wmhints.initial_state = WithdrawnState;
+     wmhints.flags = StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
+     wmhints.icon_window = w_icon;
+     
+     wmhints.icon_x = shints.x;
+     wmhints.icon_y = shints.y;
+     wmhints.window_group = w_main;
+   } else {
+     wmhints.initial_state = NormalState;
+     wmhints.flags = WindowGroupHint | StateHint;
+   }
+   
+   classHint.res_name=NAME;
+   classHint.res_class=CLASS;
+   
+   XSetClassHint(d_display, w_main, &classHint);
+   XSetClassHint(d_display, w_icon, &classHint);
+    
+ 
+   if (XStringListToTextProperty(&wname, 1, &name) == 0) {
+     fprintf(stderr, "%s: can't allocate window name\n", wname);
+     exit(1);
     }
-    wmhints.window_group=w_main;
-    XSetWMHints(d_display, w_main, &wmhints);
-    XSetWMNormalHints(d_display, w_main, &shints);
-    XSetCommand(d_display, w_main, argv, argc);
-    XStoreName(d_display, w_main, NAME);
-    XSetIconName(d_display, w_main, NAME);
-    XSetWMProtocols(d_display, w_activewin, &deleteWin, 1);
+   
+   XSetWMName(d_display, w_main, &name);
+   
+   gcm = GCForeground | GCBackground | GCGraphicsExposures;
+   gcv.graphics_exposures = 0;
+   gcv.foreground = fore_pix;
+   gcv.background = back_pix;
+   gc_gc=XCreateGC(d_display, w_root, gcm, &gcv);
+   
+   XSetWMHints(d_display, w_main, &wmhints);
+   
+   XSetCommand(d_display, w_main, argv, argc);
+   
+   XSetWMProtocols(d_display, w_main, &deleteWin, 1); // Close
+   
+   color[0]=mixColor(ledcolor, 0, backcolor, 100);
+   color[1]=mixColor(ledcolor, 100, backcolor, 0);
+   color[2]=mixColor(ledcolor, 60, backcolor, 40);
+   color[3]=mixColor(ledcolor, 25, backcolor, 75);
+   
+   XpmAttributes xpmattr;
+   XpmColorSymbol xpmcsym[4]={{"back_color",     NULL, color[0]},
+ 			     {"led_color_high", NULL, color[1]},
+ 			     {"led_color_med",  NULL, color[2]},
+ 			     {"led_color_low",  NULL, color[3]}};
+   xpmattr.numsymbols = 4;
+   xpmattr.colorsymbols=xpmcsym;
+   xpmattr.exactColors=false;
+   xpmattr.closeness=40000;
+   xpmattr.valuemask=XpmColorSymbols | XpmExactColors | XpmCloseness;
+   
+   
+   XpmCreatePixmapFromData(d_display, w_root, wmmixer_xpm, &pm_main, &pm_mask, &xpmattr);
+   XpmCreatePixmapFromData(d_display, w_root, tile_xpm, &pm_tile, NULL, &xpmattr);
+   XpmCreatePixmapFromData(d_display, w_root, icons_xpm, &pm_icon, NULL, &xpmattr);
+   XpmCreatePixmapFromData(d_display, w_root, norec_xpm, &pm_nrec, NULL, &xpmattr);
+   pm_disp = XCreatePixmap(d_display, w_root, 64, 64, d_depth);
+   
+   if(wmaker || ushape || astep) {
+     XShapeCombineMask(d_display, w_icon, ShapeBounding, winsize/2-32, winsize/2-32, pm_mask, ShapeSet);
+     XShapeCombineMask(d_display, w_main, ShapeBounding, winsize/2-32, winsize/2-32, pm_mask, ShapeSet);
+   } else {
+     XCopyArea(d_display, pm_tile, pm_disp, gc_gc, 0, 0, 64, 64, 0, 0);
+   }
+   
+   
+   XSetClipMask(d_display, gc_gc, pm_mask);
+   XCopyArea(d_display, pm_main, pm_disp, gc_gc, 0, 0, 64, 64, 0, 0);
+   XSetClipMask(d_display, gc_gc, None);
+   
+   XStoreName(d_display, w_main, NAME);
+   XSetIconName(d_display, w_main, NAME); 
  }
  
  void freeXWin(){
@@@ -504,10 -466,10 +473,14 @@@ void readFile()
  }
  
  void checkVol(bool forced=true){
++  if(!forced && !mixctl->hasChanged())
++    return;
++
     mixctl->readVol(channel[curchannel], true);
     int nl=mixctl->readLeft(channel[curchannel]);
     int nr=mixctl->readRight(channel[curchannel]);
     bool nrec=mixctl->readRec(channel[curchannel], true);
++
     if(forced){
        curleft=nl;
        curright=nr;
@@@ -538,8 -500,8 +511,8 @@@
                 btnstate &= ~BTNREC;
              drawBtns(BTNREC);
           }
--         repaint();
--      }
++	 repaint();
++      }      
     }
  }
  
@@@ -566,16 -528,36 +539,37 @@@ void pressEvent(XButtonEvent *xev) 
        checkVol(true);
        return;
     }
-    if(x>=37 && x<=56 && y>=8 && y<=56){
-       int v=((60-y)*100)/(2*25);
-       dragging=true;
-       if(x<=50)
-          mixctl->setLeft(channel[curchannel], v);
-       if(x>=45)
-          mixctl->setRight(channel[curchannel], v);
-       mixctl->writeVol(channel[curchannel]);
-       checkVol(false);
-       return;
+    if(x>=37 && x<=56 && y>=8 && y<=56) {
 -     int v = 0;
++     int vl = 0, vr = 0;
+      if(xev->button < 4) {
 -       v = ((60-y)*100)/(2*25);
++       vl = ((60-y)*100)/(2*25);
++       vr = vl;
+        dragging=true;
+ 
+      } else if(xev->button == 4) {
 -       if(x>50)
 -	 v = mixctl->readRight(channel[curchannel]) + wheel_scroll;
 -       else if(x<45)
 -	 v = mixctl->readLeft(channel[curchannel]) + wheel_scroll;
 -       else
 -	 v = (mixctl->readLeft(channel[curchannel]) + mixctl->readRight(channel[curchannel]))/2 + wheel_scroll;
++       //       if(x>50)
++       vr = mixctl->readRight(channel[curchannel]) + wheel_scroll;
++       //       else if(x<45)
++       vl = mixctl->readLeft(channel[curchannel]) + wheel_scroll;
++       //       else
++       //	 v = (mixctl->readLeft(channel[curchannel]) + mixctl->readRight(channel[curchannel]))/2 + wheel_scroll;
+ 
+      } else if(xev->button == 5) {
 -       if(x>50)
 -	 v = mixctl->readRight(channel[curchannel]) - wheel_scroll;
 -       else if(x<45)
 -	 v = mixctl->readLeft(channel[curchannel]) - wheel_scroll;
 -       else
 -	 v = (mixctl->readLeft(channel[curchannel]) + mixctl->readRight(channel[curchannel]))/2 - wheel_scroll;
++       //       if(x>50)
++	 vr = mixctl->readRight(channel[curchannel]) - wheel_scroll;
++	 //       else if(x<45)
++	 vl = mixctl->readLeft(channel[curchannel]) - wheel_scroll;
++	 //       else
++	 //	 v = (mixctl->readLeft(channel[curchannel]) + mixctl->readRight(channel[curchannel]))/2 - wheel_scroll;
+        
+      }
+      if(x<=50)
 -       mixctl->setLeft(channel[curchannel], v);
++       mixctl->setLeft(channel[curchannel], vl);
+      if(x>=45)
 -       mixctl->setRight(channel[curchannel], v);
++       mixctl->setRight(channel[curchannel], vr);
+      mixctl->writeVol(channel[curchannel]);
+      checkVol(false);
+      return;
     }
     if(x>=5 && y>=47 && x<=28 && y<=57){
        mixctl->setRec(channel[curchannel], !mixctl->readRec(channel[curchannel], false));
@@@ -607,58 -589,110 +601,110 @@@ void motionEvent(XMotionEvent *xev)
     }
  }
  
- void repaint(){
-    XCopyArea(d_display, pm_disp, w_activewin, gc_gc, 0, 0, 64, 64, winsize/2-32, winsize/2-32);
-    XEvent xev;
-    while(XCheckTypedEvent(d_display, Expose, &xev));
+ void repaint() {
+   flush_expose(w_icon);
+   XCopyArea(d_display, pm_disp, w_icon, gc_gc, 0, 0, 64, 64, winsize/2-32, winsize/2-32);
+   flush_expose(w_main);
+   XCopyArea(d_display, pm_disp, w_main, gc_gc, 0, 0, 64, 64, winsize/2-32, winsize/2-32);
+ 
+   XEvent xev;
+   while(XCheckTypedEvent(d_display, Expose, &xev));
  }
  
- void update(){
-    XCopyArea(d_display, pm_icon, pm_disp, gc_gc, icon[channel[curchannel]]*22, 0, 22, 22, 6, 5);
-    drawLeft();
-    drawRight();
-    drawBtns(BTNREC);
+ void update() {
+   if(wmaker || ushape || astep) {
+     XShapeCombineMask(d_display, w_icon, ShapeBounding, winsize/2-32, winsize/2-32, pm_mask, ShapeSet);
+     XShapeCombineMask(d_display, w_main, ShapeBounding, winsize/2-32, winsize/2-32, pm_mask, ShapeSet);
+   } else {
+     XCopyArea(d_display, pm_tile, pm_disp, gc_gc, 0, 0, 64, 64, 0, 0);
+   }
+ 
+   XSetClipMask(d_display, gc_gc, pm_mask);
+   XCopyArea(d_display, pm_main, pm_disp, gc_gc, 0, 0, 64, 64, 0, 0);
+   XSetClipMask(d_display, gc_gc, None);
+   
+   XCopyArea(d_display, pm_icon, pm_disp, gc_gc, icon[channel[curchannel]]*22, 0, 22, 22, 6, 5);
+   drawLeft();
+   drawRight();
+   drawBtns(BTNREC | BTNNEXT | BTNPREV);
  }
  
- void drawLeft(){
-    XSetForeground(d_display, gc_gc, color[1]);
-    for(int i=0;i<25;i++){
-       if(i==(curleft*25)/100)
-          XSetForeground(d_display, gc_gc, color[3]);
-       XFillRectangle(d_display, pm_disp, gc_gc, 37, 55-2*i, 9, 1);
-    }
+ void drawLeft() {
+   XSetForeground(d_display, gc_gc, color[1]);
+   for(int i=0;i<25;i++){
+     if(i==(curleft*25)/100)
+       XSetForeground(d_display, gc_gc, color[3]);
+     XFillRectangle(d_display, pm_disp, gc_gc, 37, 55-2*i, 9, 1);
+   }
  }
  
- void drawRight(){
-    XSetForeground(d_display, gc_gc, color[1]);
-    for(int i=0;i<25;i++){
-       if(i==(curright*25)/100)
-          XSetForeground(d_display, gc_gc, color[3]);
-       XFillRectangle(d_display, pm_disp, gc_gc, 48, 55-2*i, 9, 1);
-    }
+ void drawRight() {
+   XSetForeground(d_display, gc_gc, color[1]);
+   for(int i=0;i<25;i++){
+     if(i==(curright*25)/100)
+       XSetForeground(d_display, gc_gc, color[3]);
+     XFillRectangle(d_display, pm_disp, gc_gc, 48, 55-2*i, 9, 1);
+   }
  }
  
- void drawBtns(int btns){
-    if(btns & BTNPREV)
-       drawBtn(5, 33, 12, 11, (btnstate & BTNPREV));
-    if(btns & BTNNEXT)
-       drawBtn(17, 33, 12, 11, (btnstate & BTNNEXT));
-    if(btns & BTNREC){
-       drawBtn(5, 47, 24, 11, (btnstate & BTNREC));
-       if(!curshowrec)
-          XCopyArea(d_display, pm_nrec, pm_disp, gc_gc, 0, 0, 6, 7, 14, 49);
-       else
-          XCopyArea(d_display, pm_main, pm_disp, gc_gc, 14, 49, 6, 7, 14, 49);
-    }
+ void drawBtns(int btns) {
+   if(btns & BTNPREV)
+     drawBtn(5, 33, 12, 11, (btnstate & BTNPREV));
+   if(btns & BTNNEXT)
+     drawBtn(17, 33, 12, 11, (btnstate & BTNNEXT));
+   if(btns & BTNREC){
+     drawBtn(5, 47, 24, 11, (btnstate & BTNREC));
+     if(!curshowrec)
+       XCopyArea(d_display, pm_nrec, pm_disp, gc_gc, 0, 0, 6, 7, 14, 49);
+     else
+       XCopyArea(d_display, pm_main, pm_disp, gc_gc, 14, 49, 6, 7, 14, 49);
+   }
  }
  
- void drawBtn(int x, int y, int w, int h, bool down){
-    if(!down)
-       XCopyArea(d_display, pm_main, pm_disp, gc_gc, x, y, w, h, x, y);
-    else{
-       XCopyArea(d_display, pm_main, pm_disp, gc_gc, x, y, 1, h-1, x+w-1, y+1);
-       XCopyArea(d_display, pm_main, pm_disp, gc_gc, x+w-1, y+1, 1, h-1, x, y);
-       XCopyArea(d_display, pm_main, pm_disp, gc_gc, x, y, w-1, 1, x+1, y+h-1);
-       XCopyArea(d_display, pm_main, pm_disp, gc_gc, x+1, y+h-1, w-1, 1, x, y);
-    }
+ void drawBtn(int x, int y, int w, int h, bool down) {
+   if(!down)
+     XCopyArea(d_display, pm_main, pm_disp, gc_gc, x, y, w, h, x, y);
+   else {
+     XCopyArea(d_display, pm_main, pm_disp, gc_gc, x, y, 1, h-1, x+w-1, y+1);
+     XCopyArea(d_display, pm_main, pm_disp, gc_gc, x+w-1, y+1, 1, h-1, x, y);
+     XCopyArea(d_display, pm_main, pm_disp, gc_gc, x, y, w-1, 1, x+1, y+h-1);
+     XCopyArea(d_display, pm_main, pm_disp, gc_gc, x+1, y+h-1, w-1, 1, x, y);
+   }
  }
+ 
+ void usage(const char *name) {
+   printf("Usage: %s [options]\n", name);
+   printf("  -h,  --help                    display this help screen\n");
+   printf("  -v,  --version                 display program version\n");
+   printf("  -d,  --display <string>        display to use (see X manual pages)\n");
+   printf("  -g,  --geometry +XPOS+YPOS     geometry to use (see X manual pages)\n");
+   printf("  -w,  --withdrawn               run the application in withdrawn mode\n");
+   printf("                                 (for WindowMaker, etc)\n");
+   printf("  -a,  --afterstep               use smaller window (for AfterStep Wharf)\n");
+   printf("  -s,  --shaped                  shaped window\n");
+   printf("  -l,  --led-color <string>      use the specified color for led display\n");
+   printf("  -b,  --back-color <string>     use the specified color for backgrounds\n");
+   printf("  -m,  --mix-device              use specified device (rather than /dev/mixer)\n");
+   printf("  -r,  --scrollwheel <number>    volume increase/decrease with mouse wheel (default: 2)\n");
+   printf("\nFor backward compatibility the following obsolete options are still supported:\n");
+   printf("  -help                          display this help screen\n");
+   printf("  -position                      geometry to use (see X manual pages)\n");
+   printf("  -display                       display to use (see X manual pages)\n");
+   exit(0);
+ }
+ 
+ void version() {
 -  printf("wmmixer version 1.0\n");
++  printf("wmmixer version 1.1\n");
+   exit(0);
+ }
+ 
+ static int flush_expose(Window w) {  
+   XEvent dummy;
+   int i=0;
+   
+   while (XCheckTypedWindowEvent(d_display, w, Expose, &dummy))
+     i++;
+   
+   return i;
+ }
+ 
diff --cc wmmixer.h
index 0000000,a95a2bb..ed65828
mode 000000,100644..100644
--- a/wmmixer.h
+++ b/wmmixer.h
@@@ -1,0 -1,158 +1,159 @@@
+ // wmmixer - A mixer designed for WindowMaker
+ // 05/09/98  Release 1.0 Beta1
+ // Copyright (C) 1998  Sam Hawker <shawkie at geocities.com>
+ // 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.
+ 
+ // 02/04/02 Gordon Fraser <gordon at debian.org>
+ //   * GNU getopt
+ //   * Mousewheel support
+ //   * X handling rewrite
+ 
+ 
+ // Defines, includes and global variables
+ // --------------------------------------
+ 
+ // User defines - standard
+ #define WINDOWMAKER false
+ #define USESHAPE    false
+ #define AFTERSTEP   false
+ #define NORMSIZE    64
+ #define ASTEPSIZE   56
+ #define NAME        "wmmixer"
+ #define CLASS       "WMMixer"
+ 
+ // User defines - custom
+ #define MIXERDEV    "/dev/mixer"
+ #define BACKCOLOR   "#282828"
+ #define LEDCOLOR    "green"
+ 
+ // Includes - standard
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+ 
+ #include <getopt.h>
+ 
+ // Includes - custom
+ #include "mixctl.h"
+ 
+ // X-Windows includes - standard
+ #include <X11/X.h>
+ #include <X11/Xlib.h>
+ #include <X11/Xutil.h>
+ #include <X11/Xproto.h>
+ #include <X11/xpm.h>
+ #include <X11/extensions/shape.h>
+ 
+ // Pixmaps - standard
+ Pixmap pm_main;
+ Pixmap pm_tile;
+ Pixmap pm_disp;
+ Pixmap pm_mask;
+ 
+ // Pixmaps - custom
+ Pixmap pm_icon;
+ Pixmap pm_nrec;
+ 
+ // Xpm images - standard
+ #include "XPM/wmmixer.xpm"
+ #include "XPM/tile.xpm"
+ 
+ // Xpm images - custom
+ #include "XPM/icons.xpm"
+ #include "XPM/norec.xpm"
+ 
+ // Variables for command-line arguments - standard
+ bool wmaker=WINDOWMAKER;
+ bool ushape=USESHAPE;
+ bool astep=AFTERSTEP;
+ char display[256]="";
+ char position[256]="";
+ int winsize;
+ 
+ // Variables for command-line arguments - custom
+ char mixdev[256]=MIXERDEV;
+ char backcolor[256]=BACKCOLOR;
+ char ledcolor[256]=LEDCOLOR;
+ 
+ // X-Windows basics - standard
+ Atom _XA_GNUSTEP_WM_FUNC;
+ Atom deleteWin;
+ Display *d_display;
+ Window w_icon;
+ Window w_main;
+ Window w_root;
+ 
+ // X-Windows basics - custom
+ GC gc_gc;
+ unsigned long color[4];
+ 
+ 
+ // Misc custom global variables 
+ // ----------------------------
+ 
+ // Current state information
+ int curchannel=0;
+ bool curshowrec;
+ bool currec;
+ int curleft;
+ int curright;
+ 
+ // For buttons
+ int btnstate=0;
+ #define BTNNEXT  1
+ #define BTNPREV  2
+ #define BTNREC   4
+ 
+ // For repeating next and prev buttons
+ #define RPTINTERVAL   5
+ int rpttimer=0;
+ 
+ // For draggable volume control
+ bool dragging=false;
+ 
+ int channels=0;
+ int *channel;
+ int *icon;
+ 
+ MixCtl *mixctl;
+ 
+ Pixel back_pix;
+ Pixel fore_pix;
+ 
+ // Default scroll amount
+ int wheel_scroll = 2;
+ 
+ 
+ // Procedures and functions
+ // ------------------------
+ 
+ // Procedures and functions - standard
+ void initXWin(int argc, char **argv);
+ void freeXWin();
+ void createWin(Window *win, int x, int y);
+ unsigned long getColor(char *colorname);
+ unsigned long mixColor(char *colorname1, int prop1, char *colorname2, int prop2);
+ 
+ // Procedures and functions - custom
+ void scanArgs(int argc, char **argv);
+ void readFile();
 -void checkVol(bool forced=true);
++//void checkVol(bool forced=true);
++void checkVol(bool);
+ void pressEvent(XButtonEvent *xev);
+ void releaseEvent(XButtonEvent *xev);
+ void motionEvent(XMotionEvent *xev);
+ void repaint();
+ void update();
+ void drawLeft();
+ void drawRight();
+ void drawBtns(int btns);
+ void drawBtn(int x, int y, int w, int h, bool down);
+ void initialize_icon(int num);
+ static int flush_expose(Window w);
+ void version(void);
+ void usage(const char *);
+ 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmmixer.git



More information about the Pkg-wmaker-commits mailing list