[Pkg-wmaker-commits] [wmmixer] 02/16: wmmixer patches

Doug Torrance dtorrance-guest at moszumanska.debian.org
Tue Aug 29 09:59:07 UTC 2017


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

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

commit d3043610b3dc088b7ace53cffe008dbaa3be0f57
Author: Rodolfo kix Garcia <kix at kix.es>
Date:   Wed Jul 13 11:22:32 2011 +0200

    wmmixer patches
---
 CHANGES     | 10 +++++++++-
 README      |  4 ++--
 exception.h |  2 +-
 mixctl.cc   |  8 ++++----
 mixctl.h    |  7 +++++--
 wmmixer.cc  | 21 ++++++++++++++++-----
 wmmixer.h   |  4 +++-
 xhandler.cc | 10 +++++++++-
 xhandler.h  |  2 ++
 9 files changed, 51 insertions(+), 17 deletions(-)

diff --git a/CHANGES b/CHANGES
index 0a821ef..cd05006 100644
--- a/CHANGES
+++ b/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/README b/README
index 5109cbb..e77d72b 100644
--- a/README
+++ b/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/exception.h b/exception.h
index 3923006..4c8a138 100644
--- a/exception.h
+++ b/exception.h
@@ -37,4 +37,4 @@ class MixerDeviceException : public Exception
   //  virtual ~MixerDeviceException();
 };
 
-#endif _exception_h__
+#endif //_exception_h__
diff --git a/mixctl.cc b/mixctl.cc
index 7cf3261..10de39d 100644
--- a/mixctl.cc
+++ b/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/mixctl.h b/mixctl.h
index 2750693..1783dc4 100644
--- a/mixctl.h
+++ b/mixctl.h
@@ -23,12 +23,15 @@
 #ifdef __NetBSD__
 #include <soundcard.h>
 #endif
-#ifdef __FreeBSD__
-#include <machine/soundcard.h>
+#if defined (__FreeBSD__) || defined(__FreeBSD_kernel__)
+#include <sys/soundcard.h>
 #endif
 #ifdef __linux__
 #include <linux/soundcard.h>
 #endif
+#ifdef __GNU__  // Hurd
+#include <sys/soundcard.h>
+#endif
 
 #include "exception.h"
 
diff --git a/wmmixer.cc b/wmmixer.cc
index 3cbe4a0..7804aea 100644
--- a/wmmixer.cc
+++ b/wmmixer.cc
@@ -3,6 +3,7 @@
 // Release 1.5
 // Copyright (C) 1998  Sam Hawker <shawkie at geocities.com>
 // Copyright (C) 2002 Gordon Fraser <gordon at debian.org>
+// Patch added by Rodolfo (kix) Garcia <kix at kix.es> 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; i<argc; i++) 
@@ -256,7 +261,7 @@ void WMMixer::parseArgs(int argc, char **argv)
 	}
     }
 
-  while ((i = getopt_long(argc, argv, "hvd:g:wasl:L:b:m:r:", long_opts, &opt_index)) != -1) 
+  while ((i = getopt_long(argc, argv, "hvd:g:wasl:L:b:m:c:x:r:", long_opts, &opt_index)) != -1)
     {
       switch (i) 
 	{
@@ -295,6 +300,12 @@ void WMMixer::parseArgs(int argc, char **argv)
 	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);
@@ -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 <string>  use the specified color for led shading" << std::endl;
   std::cout << "  -b,  --back-color <string>     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 <string>        use specified class (rather than WMMmixer)" << std::endl;
   std::cout << "  -r,  --scrollwheel <number>    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.h b/wmmixer.h
index 2e0968e..ffab02d 100644
--- a/wmmixer.h
+++ b/wmmixer.h
@@ -3,6 +3,7 @@
 // Release 1.5
 // Copyright (C) 1998  Sam Hawker <shawkie at geocities.com>
 // Copyright (C) 2002 Gordon Fraser <gordon at debian.org>
+// Patch added by Rodolfo (kix) Garcia <kix at kix.es> 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/xhandler.cc b/xhandler.cc
index 652335d..2d56813 100644
--- a/xhandler.cc
+++ b/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;
 }
 
 //--------------------------------------------------------------------
@@ -334,6 +336,12 @@ void XHandler::setBackColor(char* arg)
 }
 
 //--------------------------------------------------------------------
+void XHandler::setWindowClass(char* arg)
+{
+  snprintf(window_class_, 254, "%s", arg);
+}
+
+//--------------------------------------------------------------------
 void XHandler::setUnshaped()
 {
   is_ushape_ = 1;
@@ -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/xhandler.h b/xhandler.h
index 68ecbf8..8dcebf8 100644
--- a/xhandler.h
+++ b/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();

-- 
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