diff --git a/wmmixer/CHANGES b/wmmixer/CHANGES index 0a821ef..cd05006 100644 --- a/wmmixer/CHANGES +++ b/wmmixer/CHANGES @@ -81,4 +81,12 @@ Release 1.5 25 Jun 2002 Several fixes (really open mixer device given there, don't go to max if using scrollwheel to set volume below 0) Shaded LED-Bar - Initial Exception Handling \ No newline at end of file + 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 diff --git a/wmmixer/README b/wmmixer/README index 5109cbb..e77d72b 100644 --- a/wmmixer/README +++ b/wmmixer/README @@ -82,10 +82,10 @@ 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 wmmount in your Wharf, add the following line in the appropriate +To put wmmixer in your Wharf, add the following line in the appropriate part of your .steprc -*Wharf wmmixer nil MaxSwallow "wmmount" wmmixer -a -g -0-0 & +*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 diff --git a/wmmixer/exception.h b/wmmixer/exception.h index 3923006..4c8a138 100644 --- a/wmmixer/exception.h +++ b/wmmixer/exception.h @@ -37,4 +37,4 @@ class MixerDeviceException : public Exception // virtual ~MixerDeviceException(); }; -#endif _exception_h__ +#endif //_exception_h__ diff --git a/wmmixer/mixctl.cc b/wmmixer/mixctl.cc index 7cf3261..10de39d 100644 --- a/wmmixer/mixctl.cc +++ b/wmmixer/mixctl.cc @@ -243,16 +243,16 @@ char* MixCtl::getLabel(int dev) //---------------------------------------------------------------------- bool MixCtl::hasChanged() { - struct mixer_info mixer_info; - ioctl(mixfd, SOUND_MIXER_INFO, &mixer_info); + struct mixer_info mixer_info1; + ioctl(mixfd, SOUND_MIXER_INFO, &mixer_info1); - if (mixer_info.modify_counter == modify_counter) + if (mixer_info1.modify_counter == modify_counter) { return false; } else { - modify_counter = mixer_info.modify_counter; + modify_counter = mixer_info1.modify_counter; return true; } } diff --git a/wmmixer/mixctl.h b/wmmixer/mixctl.h index 2750693..1783dc4 100644 --- a/wmmixer/mixctl.h +++ b/wmmixer/mixctl.h @@ -23,12 +23,15 @@ #ifdef __NetBSD__ #include #endif -#ifdef __FreeBSD__ -#include +#if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) +#include #endif #ifdef __linux__ #include #endif +#ifdef __GNU__ // Hurd +#include +#endif #include "exception.h" diff --git a/wmmixer/wmmixer.cc b/wmmixer/wmmixer.cc index 3cbe4a0..7804aea 100644 --- a/wmmixer/wmmixer.cc +++ b/wmmixer/wmmixer.cc @@ -3,6 +3,7 @@ // 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 @@ -234,10 +235,14 @@ void WMMixer::parseArgs(int argc, char **argv) {"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; isetWindowClass(optarg); + break; case 'r': if(atoi(optarg)>0) wheel_scroll_ = atoi(optarg); @@ -307,14 +318,12 @@ void WMMixer::parseArgs(int argc, char **argv) void WMMixer::readConfigurationFile() { FILE *rcfile; - char rcfilen[256]; char buf[256]; int done; // int current=-1; unsigned current = mixctl_->getNrDevices() + 1; - sprintf(rcfilen, "%s/.wmmixer", getenv("HOME")); - if((rcfile=fopen(rcfilen, "r"))!=NULL) + if((rcfile=fopen(config_file_, "r"))!=NULL) { num_channels_=0; do @@ -412,6 +421,8 @@ void WMMixer::displayUsage(const char* name) 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; diff --git a/wmmixer/wmmixer.h b/wmmixer/wmmixer.h index 2e0968e..ffab02d 100644 --- a/wmmixer/wmmixer.h +++ b/wmmixer/wmmixer.h @@ -3,6 +3,7 @@ // 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 @@ -31,7 +32,7 @@ // For repeating next and prev buttons #define RPTINTERVAL 5 - +#define CONFIGFILELEN 256 class WMMixer { @@ -41,6 +42,7 @@ class WMMixer MixCtl *mixctl_; char mixer_device_[256]; + char config_file_[CONFIGFILELEN]; unsigned num_channels_; unsigned current_channel_; unsigned current_channel_left_; diff --git a/wmmixer/xhandler.cc b/wmmixer/xhandler.cc index 652335d..2d56813 100644 --- a/wmmixer/xhandler.cc +++ b/wmmixer/xhandler.cc @@ -22,8 +22,10 @@ XHandler::XHandler() strcpy(ledcolor_name_, LEDCOLOR); strcpy(ledcolor_high_name_, LEDCOLOR_HIGH); strcpy(backcolor_name_, BACKCOLOR); + strcpy(window_class_, CLASS); button_state_ = 0; + icon_list_ = NULL; } //-------------------------------------------------------------------- @@ -333,6 +335,12 @@ void XHandler::setBackColor(char* arg) sprintf(backcolor_name_, "%s", arg); } +//-------------------------------------------------------------------- +void XHandler::setWindowClass(char* arg) +{ + snprintf(window_class_, 254, "%s", arg); +} + //-------------------------------------------------------------------- void XHandler::setUnshaped() { @@ -488,7 +496,7 @@ void XHandler::initWindow(int argc, char** argv) } classHint.res_name=NAME; - classHint.res_class=CLASS; + classHint.res_class = window_class_; XSetClassHint(display_default_, window_main_, &classHint); XSetClassHint(display_default_, window_icon_, &classHint); diff --git a/wmmixer/xhandler.h b/wmmixer/xhandler.h index 68ecbf8..8dcebf8 100644 --- a/wmmixer/xhandler.h +++ b/wmmixer/xhandler.h @@ -85,6 +85,7 @@ class XHandler char ledcolor_name_[256]; char ledcolor_high_name_[256]; char backcolor_name_[256]; + char window_class_[256]; Pixel back_pix; Pixel fore_pix; @@ -142,6 +143,7 @@ class XHandler void setLedColor(char* arg); void setLedHighColor(char* arg); void setBackColor(char* arg); + void setWindowClass(char* arg); void setUnshaped(); void setWindowMaker(); void setAfterStep();