[totem] main: Allow finer-grained control on volume



commit 5be9be414e03bca8741e556474ec9179e084c5f0
Author: Frank Dana <ferdnyc gmail com>
Date:   Sun Feb 6 23:47:00 2011 +0000

    main: Allow finer-grained control on volume
    
    When adjusting volume using the keyboard, I often find that raising or
    lowering the volume level by 8% is too drastic a change, and I can't
    seem to hit a "comfortable" volume unless I reach for the mouse.
    
    We now bind the Shift-UpArrow and Shift-DownArrow keys to a
    volume adjustment of +2% and -2% (respectively), in the spirit of the
    fine-grained seek controls (Shift-LeftArrow and Shift-RightArrow).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=641672

 src/totem-object.c  |    4 ++++
 src/totem-private.h |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/totem-object.c b/src/totem-object.c
index 0d4acc8..2a8108c 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -3720,12 +3720,16 @@ totem_action_handle_key_press (TotemObject *totem, GdkEventKey *event)
 	case GDK_KEY_Up:
 		if (bacon_video_widget_has_menus (totem->bvw) != FALSE)
 			bacon_video_widget_dvd_event (totem->bvw, BVW_DVD_ROOT_MENU_UP);
+		else if (event->state & GDK_SHIFT_MASK)
+			totem_action_volume_relative (totem, VOLUME_UP_SHORT_OFFSET);
 		else
 			totem_action_volume_relative (totem, VOLUME_UP_OFFSET);
 		break;
 	case GDK_KEY_Down:
 		if (bacon_video_widget_has_menus (totem->bvw) != FALSE)
 			bacon_video_widget_dvd_event (totem->bvw, BVW_DVD_ROOT_MENU_DOWN);
+		else if (event->state & GDK_SHIFT_MASK)
+			totem_action_volume_relative (totem, VOLUME_DOWN_SHORT_OFFSET);
 		else
 			totem_action_volume_relative (totem, VOLUME_DOWN_OFFSET);
 		break;
diff --git a/src/totem-private.h b/src/totem-private.h
index 8abed90..deca5ab 100644
--- a/src/totem-private.h
+++ b/src/totem-private.h
@@ -173,6 +173,9 @@ GtkWidget *totem_volume_create (void);
 #define VOLUME_DOWN_OFFSET (-0.08)
 #define VOLUME_UP_OFFSET (0.08)
 
+#define VOLUME_DOWN_SHORT_OFFSET (-0.02)
+#define VOLUME_UP_SHORT_OFFSET (0.02)
+
 #define ZOOM_IN_OFFSET 0.01
 #define ZOOM_OUT_OFFSET -0.01
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]