Enlightenment CVS committal
Author : doursse
Project : e17
Module : libs/emotion
Dir : e17/libs/emotion/src/modules
Modified Files:
emotion_gstreamer.c emotion_gstreamer.h
Log Message:
fix audio mute
===================================================================
RCS file: /cvs/e/e17/libs/emotion/src/modules/emotion_gstreamer.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- emotion_gstreamer.c 21 May 2006 10:26:09 -0000 1.14
+++ emotion_gstreamer.c 21 May 2006 11:13:05 -0000 1.15
@@ -1014,11 +1014,23 @@
int mute)
{
Emotion_Gstreamer_Video *ev;
+ GstElement *volume;
ev = (Emotion_Gstreamer_Video *)video;
+ if (ev->audio_mute == mute)
+ return;
+
ev->audio_mute = mute;
- /* FIXME: a faire ... */
+ volume = gst_bin_get_by_name (GST_BIN (ev->pipeline), "volume");
+ if (!volume) return;
+
+ if (mute)
+ g_object_set (G_OBJECT (volume), "volume", 0.0, NULL);
+ else
+ g_object_set (G_OBJECT (volume), "volume", ev->volume / 10.0, NULL);
+
+ gst_object_unref (volume);
}
static int
@@ -1044,6 +1056,7 @@
vol = 0.0;
if (vol > 100.0)
vol = 100.0;
+ ev->volume = vol;
volume = gst_bin_get_by_name (GST_BIN (ev->pipeline), "volume");
if (!volume) return;
g_object_set (G_OBJECT (volume), "volume",
@@ -1055,17 +1068,11 @@
em_audio_channel_volume_get(void *video)
{
Emotion_Gstreamer_Video *ev;
- GstElement *volume;
double vol;
ev = (Emotion_Gstreamer_Video *)video;
- volume = gst_bin_get_by_name (GST_BIN (ev->pipeline), "volume");
- if (!volume) return 0.0;
- g_object_get (G_OBJECT (volume), "volume", &vol, NULL);
- gst_object_unref (volume);
-
- return vol*10.0;
+ return ev->volume;
}
/* spu stuff */
@@ -1543,6 +1550,7 @@
GstElement *volume;
GstElement *sink;
GstPad *audiopad;
+ double vol;
audiobin = gst_bin_new (NULL);
@@ -1550,6 +1558,9 @@
conv = gst_element_factory_make ("audioconvert", NULL);
resample = gst_element_factory_make ("audioresample", NULL);
volume = gst_element_factory_make ("volume", "volume");
+ g_object_get (G_OBJECT (volume), "volume", &vol, NULL);
+ ev->volume = vol * 10.0;
+
if (index == 1)
sink = gst_element_factory_make ("autoaudiosink", NULL);
else
===================================================================
RCS file: /cvs/e/e17/libs/emotion/src/modules/emotion_gstreamer.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- emotion_gstreamer.h 22 Apr 2006 10:12:03 -0000 1.6
+++ emotion_gstreamer.h 21 May 2006 11:13:05 -0000 1.7
@@ -55,6 +55,7 @@
/* Characteristics of stream */
double position;
double ratio;
+ double volume;
volatile int seek_to;
volatile int get_poslen;
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs