[gnome-media] base_volume is guint32, not double
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-media] base_volume is guint32, not double
- Date: Thu, 14 May 2009 11:03:53 -0400 (EDT)
commit 6f590a8165b425499458bdcf17b4a051f6c4fb80
Author: Bastien Nocera <hadess hadess net>
Date: Thu May 14 16:03:14 2009 +0100
base_volume is guint32, not double
And avoid overwriting the default base volume straight after having
set it.
---
gnome-volume-control/src/gvc-channel-bar.c | 8 +++++---
gnome-volume-control/src/gvc-channel-bar.h | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/gnome-volume-control/src/gvc-channel-bar.c b/gnome-volume-control/src/gvc-channel-bar.c
index 006ff2f..dfe5027 100644
--- a/gnome-volume-control/src/gvc-channel-bar.c
+++ b/gnome-volume-control/src/gvc-channel-bar.c
@@ -63,7 +63,7 @@ struct GvcChannelBarPrivate
gboolean symmetric;
gboolean click_lock;
gboolean is_amplified;
- double base_volume;
+ guint32 base_volume;
};
enum
@@ -601,12 +601,14 @@ gvc_channel_bar_set_is_amplified (GvcChannelBar *bar, gboolean amplified)
void
gvc_channel_bar_set_base_volume (GvcChannelBar *bar,
- double base_volume)
+ guint32 base_volume)
{
g_return_if_fail (GVC_IS_CHANNEL_BAR (bar));
- if (base_volume == 0)
+ if (base_volume == 0) {
bar->priv->base_volume = ADJUSTMENT_MAX_NORMAL;
+ return;
+ }
/* Note that you need to call _is_amplified() afterwards to update the marks */
bar->priv->base_volume = base_volume;
diff --git a/gnome-volume-control/src/gvc-channel-bar.h b/gnome-volume-control/src/gvc-channel-bar.h
index defb44a..d405038 100644
--- a/gnome-volume-control/src/gvc-channel-bar.h
+++ b/gnome-volume-control/src/gvc-channel-bar.h
@@ -76,7 +76,7 @@ void gvc_channel_bar_set_size_group (GvcChannelBar *bar,
void gvc_channel_bar_set_is_amplified (GvcChannelBar *bar,
gboolean amplified);
void gvc_channel_bar_set_base_volume (GvcChannelBar *bar,
- double base_volume);
+ guint32 base_volume);
gboolean gvc_channel_bar_scroll (GvcChannelBar *bar,
GdkScrollDirection direction);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]