Hi all!
       This is my first independant code contribution to any FOSS project. :-)
       The mixer module currently
increases or decreases the volume if mouse wheel goes up or down on
the module's panel icon. The patch provided (used svn diff) makes it
adjust the balance too when Horizontal scroll wheel is used.

       Though a mouse with a horizontal scroll wheel/ scroll ball is
uncommon, there are laptops with synaptic touchpad which has
horizontal scrolling capability. It can also be emulated on
trackpoints with appropriate X configuration.

-- 
Laxminarayan Kamath Ammembal
http://lankerisms.blogspot.com
(+91) 9945036093
Index: e/src/modules/mixer/e_mod_main.c
===================================================================
--- e/src/modules/mixer/e_mod_main.c	(revision 36088)
+++ e/src/modules/mixer/e_mod_main.c	(working copy)
@@ -188,6 +188,61 @@
 }
 
 static void
+_mixer_balance_left(E_Mixer_Instance *inst)
+{
+   E_Mixer_Channel_State *state;
+
+   state = &inst->mixer_state;
+   e_mixer_system_get_volume(inst->sys, inst->channel,
+			     &state->left, &state->right);
+   if (state->left >= 0)
+     {
+	if (state->left > 5)
+	  state->left -= 5;
+	else
+	  state->left = 0;
+     }
+   if (state->right >= 0)
+     {
+	if (state->right < 95)
+	  state->right += 5;
+	else
+	  state->right = 100;
+     }
+
+   e_mixer_system_set_volume(inst->sys, inst->channel,
+			     state->left, state->right);
+   _mixer_gadget_update(inst);
+}
+
+static void
+_mixer_balance_right(E_Mixer_Instance *inst)
+{
+   E_Mixer_Channel_State *state;
+
+   state = &inst->mixer_state;
+   e_mixer_system_get_volume(inst->sys, inst->channel,
+			     &state->left, &state->right);
+   if (state->left >= 0)
+     {
+	if (state->left < 95)
+	  state->left += 5;
+	else
+	  state->left = 100;
+     }
+   if (state->right >= 0)
+     {
+	if (state->right > 5)
+	  state->right -= 5;
+	else
+	  state->right = 0;
+     }
+   e_mixer_system_set_volume(inst->sys, inst->channel,
+			     state->left, state->right);
+   _mixer_gadget_update(inst);
+}
+
+static void
 _mixer_volume_increase(E_Mixer_Instance *inst)
 {
    E_Mixer_Channel_State *state;
@@ -663,6 +718,13 @@
 	else if (ev->z < 0)
 	  _mixer_volume_increase(inst);
      }
+   else if (ev->direction == 1)
+     {
+	if (ev->z > 0)
+	  _mixer_balance_left(inst);
+	else if (ev->z < 0)
+	  _mixer_balance_right(inst);
+     }
 }
 
 static int
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to