[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libmedia/gst/SoundGst.cpp
From: |
Bastiaan Jacques |
Subject: |
[Gnash-commit] gnash ChangeLog libmedia/gst/SoundGst.cpp |
Date: |
Tue, 12 Feb 2008 11:54:42 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Bastiaan Jacques <bjacques> 08/02/12 11:54:42
Modified files:
. : ChangeLog
libmedia/gst : SoundGst.cpp
Log message:
Use the right scale for volume (0-1, not 0-10).
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5619&r2=1.5620
http://cvs.savannah.gnu.org/viewcvs/gnash/libmedia/gst/SoundGst.cpp?cvsroot=gnash&r1=1.6&r2=1.7
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5619
retrieving revision 1.5620
diff -u -b -r1.5619 -r1.5620
--- ChangeLog 12 Feb 2008 10:29:02 -0000 1.5619
+++ ChangeLog 12 Feb 2008 11:54:41 -0000 1.5620
@@ -1,3 +1,8 @@
+2008-02-12 Bastiaan Jacques <address@hidden>
+
+ * libmedia/gst/SoundGst.cpp: Use the right scale for volume (0-1, not
+ 0-10).
+
2008-02-12 Sandro Santilli <address@hidden>
* server/sprite_instance.cpp: drop "invisible mask in MouseEntityFinder"
Index: libmedia/gst/SoundGst.cpp
===================================================================
RCS file: /sources/gnash/gnash/libmedia/gst/SoundGst.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- libmedia/gst/SoundGst.cpp 9 Feb 2008 08:39:04 -0000 1.6
+++ libmedia/gst/SoundGst.cpp 12 Feb 2008 11:54:42 -0000 1.7
@@ -175,15 +175,20 @@
unsigned int
SoundGst::getVolume()
{
- gdouble volume = 10;
+ // Gstreamer's volume element scales like:
+ // 0 - silent
+ // 1 - passthrough
+ // 10 - amplified 10 times
+
+ gdouble volume = 1;
g_object_get(G_OBJECT(_volume), "volume", &volume, NULL);
- return unsigned(volume * 10);
+ return static_cast<unsigned> (volume * 100);
}
void
SoundGst::setVolume(unsigned int new_volume)
{
- gdouble volume = new_volume / 10;
+ gdouble volume = new_volume / 100.0;
g_object_set(G_OBJECT(_volume), "volume", volume, NULL);
}