[banshee: 3/7] [libbanshee] Remove player->current_volume
- From: Christopher James Halse Rogers <chrishr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee: 3/7] [libbanshee] Remove player->current_volume
- Date: Sun, 14 Mar 2010 06:21:43 +0000 (UTC)
commit 811563ccd866ebe04b91fcf0e0117866ba82d70a
Author: Christopher James Halse Rogers <chrishr src gnome org>
Date: Sun Mar 14 16:41:08 2010 +1100
[libbanshee] Remove player->current_volume
Playbin has the canonical value. We don't query the volume very often so
just get the value from the playbin each time.
libbanshee/banshee-player-private.h | 1 -
libbanshee/banshee-player-replaygain.c | 6 ++++--
libbanshee/banshee-player.c | 3 +--
3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/libbanshee/banshee-player-private.h b/libbanshee/banshee-player-private.h
index f3f01b7..68c6bf4 100644
--- a/libbanshee/banshee-player-private.h
+++ b/libbanshee/banshee-player-private.h
@@ -115,7 +115,6 @@ struct BansheePlayer {
gboolean rgvolume_in_pipeline;
gint equalizer_status;
- gdouble current_volume;
// Pipeline/Playback State
GMutex *mutex;
diff --git a/libbanshee/banshee-player-replaygain.c b/libbanshee/banshee-player-replaygain.c
index 238333b..8c870f1 100644
--- a/libbanshee/banshee-player-replaygain.c
+++ b/libbanshee/banshee-player-replaygain.c
@@ -165,12 +165,14 @@ void _bp_rgvolume_print_volume(BansheePlayer *player)
g_return_if_fail (IS_BANSHEE_PLAYER (player));
if (player->replaygain_enabled && (player->rgvolume != NULL)) {
gdouble scale;
+ gdouble volume;
g_object_get (G_OBJECT (player->rgvolume), "result-gain", &scale, NULL);
+ g_object_get (G_OBJECT (player->playbin), "volume", &volume, NULL);
bp_debug ("scaled volume: %.2f (ReplayGain) * %.2f (User) = %.2f",
- bp_replaygain_db_to_linear (scale), player->current_volume,
- bp_replaygain_db_to_linear (scale) * player->current_volume);
+ bp_replaygain_db_to_linear (scale), volume,
+ bp_replaygain_db_to_linear (scale) * volume);
}
}
diff --git a/libbanshee/banshee-player.c b/libbanshee/banshee-player.c
index cd74ed3..28266aa 100644
--- a/libbanshee/banshee-player.c
+++ b/libbanshee/banshee-player.c
@@ -299,8 +299,7 @@ bp_set_volume (BansheePlayer *player, gdouble volume)
g_return_if_fail (IS_BANSHEE_PLAYER (player));
g_return_if_fail (GST_IS_ELEMENT (player->playbin));
- player->current_volume = CLAMP (volume, 0.0, 1.0);
- g_object_set (player->playbin, "volume", player->current_volume, NULL);
+ g_object_set (player->playbin, "volume", CLAMP (volume, 0.0, 1.0), NULL);
_bp_rgvolume_print_volume (player);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]