[Rhythmbox-devel] mouse scroll button volume control patch



Hi,

	This is a patch that let control the volume by scrolling with the
scroll-button of a mouse over the volume button.

	It add too a #ifdef HAVE_AUDIO arounf #include <rb-audio-cd.h>
	in rb-shell.c


	Jean.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/rhythmbox/ChangeLog,v
retrieving revision 1.460
diff -r1.460 ChangeLog
0a1,4
> 2003-06-12 Jean Schurger <yshark@schurger.org>
> 	* shell/rb-shell-player.c: handle scroll-up/down over the volume button
> 	* shell/rb-shell.c: check HAVE_CD before #include rb-audio-cd.h
> 
Index: shell/rb-shell-player.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell-player.c,v
retrieving revision 1.45
diff -r1.45 rb-shell-player.c
404a405,409
> 	g_signal_connect ((gpointer) player->priv->volume_button, "scroll_event",
>                     G_CALLBACK (rb_shell_volume_scroll),
>                     player);
> 
> 	
1534a1540,1561
> }
> 
> gboolean rb_shell_volume_scroll (GtkWidget *widget, GdkEvent *event, gpointer data) {
> 	RBShellPlayer *player = RB_SHELL_PLAYER (data);
> 	float cur_volume;
> 
> 	cur_volume = monkey_media_player_get_volume(player->priv->mmplayer);
> 	switch(event->scroll.direction) {
> 	    case GDK_SCROLL_UP:
> 		cur_volume += 0.1;
> 	      break;
> 	    case GDK_SCROLL_DOWN:
> 		cur_volume -= 0.1;
> 	      break;
> 	    case GDK_SCROLL_LEFT:
> 	    case GDK_SCROLL_RIGHT:
> 		break;
> 	}
> 	cur_volume = cur_volume > 1 ? 1 : cur_volume;
> 	cur_volume = cur_volume < 0 ? 0 : cur_volume;
> 	monkey_media_player_set_volume(player->priv->mmplayer, cur_volume);                                                                              
>   return FALSE;
Index: shell/rb-shell-player.h
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell-player.h,v
retrieving revision 1.9
diff -r1.9 rb-shell-player.h
77a78,79
> gboolean		rb_shell_volume_scroll 		(GtkWidget *widget, GdkEvent *event, gpointer data);
> 
Index: shell/rb-shell.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell.c,v
retrieving revision 1.116
diff -r1.116 rb-shell.c
67c67,69
< #include "rb-audiocd-source.h"
---
> #ifdef HAVE_AUDIOCD
> 	#include "rb-audiocd-source.h"
> #endif


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