summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2008-10-08 16:20:02 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2008-10-08 16:20:02 +0000
commitea7104a545095e5af9e737142765c5dfcf874c3e (patch)
treec40a7653c63acc58ab618f18c457ffd0f707f471 /legacy
parent0ebceb16a14eb31d7ddec19cde078e9ccf1d087c (diff)
emotion: set volume when files are opened.
SVN revision: 36531
Diffstat (limited to 'legacy')
-rw-r--r--legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c2
-rw-r--r--legacy/emotion/src/modules/xine/emotion_xine.c22
-rw-r--r--legacy/emotion/src/modules/xine/emotion_xine.h1
3 files changed, 13 insertions, 12 deletions
diff --git a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
index 97d2491d99..8258ab5f90 100644
--- a/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
+++ b/legacy/emotion/src/modules/gstreamer/emotion_gstreamer.c
@@ -453,6 +453,8 @@ em_file_open(const char *file,
453 _free_metadata(ev->metadata); 453 _free_metadata(ev->metadata);
454 ev->metadata = calloc(1, sizeof(Emotion_Gstreamer_Metadata)); 454 ev->metadata = calloc(1, sizeof(Emotion_Gstreamer_Metadata));
455 455
456 em_audio_channel_volume_set(ev, ev->volume);
457
456 _eos_timer_fct(ev); 458 _eos_timer_fct(ev);
457 459
458 return 1; 460 return 1;
diff --git a/legacy/emotion/src/modules/xine/emotion_xine.c b/legacy/emotion/src/modules/xine/emotion_xine.c
index e1e457689f..c76bf1d2e2 100644
--- a/legacy/emotion/src/modules/xine/emotion_xine.c
+++ b/legacy/emotion/src/modules/xine/emotion_xine.c
@@ -215,6 +215,7 @@ _em_slave(void *par)
215 ev->ratio = (double)v / 10000.0; 215 ev->ratio = (double)v / 10000.0;
216 ev->just_loaded = 1; 216 ev->just_loaded = 1;
217 ev->get_poslen = 0; 217 ev->get_poslen = 0;
218 xine_set_param(ev->stream, XINE_PARAM_AUDIO_VOLUME, ev->volume * 100);
218 } 219 }
219 _em_module_event(ev, 2); /* event - open done */ 220 _em_module_event(ev, 2); /* event - open done */
220 } 221 }
@@ -312,12 +313,7 @@ _em_slave(void *par)
312 break; 313 break;
313 case 10: /* vol */ 314 case 10: /* vol */
314 { 315 {
315 double vol; 316 xine_set_param(ev->stream, XINE_PARAM_AUDIO_VOLUME, ev->volume * 100);
316
317 vol = *((double *)eev->xine_event);
318 if (vol < 0.0) vol = 0.0;
319 if (vol > 1.0) vol = 1.0;
320 xine_set_param(ev->stream, XINE_PARAM_AUDIO_VOLUME, vol * 100);
321 _em_module_event(ev, 10); 317 _em_module_event(ev, 10);
322 } 318 }
323 break; 319 break;
@@ -979,12 +975,13 @@ static void
979em_audio_channel_volume_set(void *ef, double vol) 975em_audio_channel_volume_set(void *ef, double vol)
980{ 976{
981 Emotion_Xine_Video *ev; 977 Emotion_Xine_Video *ev;
982 double *ppos;
983 978
979 if (vol < 0.0) vol = 0.0;
980 else if (vol > 1.0) vol = 1.0;
981
984 ev = (Emotion_Xine_Video *)ef; 982 ev = (Emotion_Xine_Video *)ef;
985 ppos = malloc(sizeof(double)); 983 ev->volume = vol;
986 *ppos = vol; 984 _em_slave_event(ev, 10, NULL);
987 _em_slave_event(ev, 10, ppos);
988} 985}
989 986
990static double 987static double
@@ -993,8 +990,9 @@ em_audio_channel_volume_get(void *ef)
993 Emotion_Xine_Video *ev; 990 Emotion_Xine_Video *ev;
994 991
995 ev = (Emotion_Xine_Video *)ef; 992 ev = (Emotion_Xine_Video *)ef;
996 if (ev->opening || (!ev->play_ok)) return 0; 993 if (ev->opening || (!ev->play_ok)) return ev->volume;
997 return (double)xine_get_param(ev->stream, XINE_PARAM_AUDIO_VOLUME) / 100.0; 994 ev->volume = xine_get_param(ev->stream, XINE_PARAM_AUDIO_VOLUME) / 100.0;
995 return ev->volume;
998} 996}
999 997
1000static int 998static int
diff --git a/legacy/emotion/src/modules/xine/emotion_xine.h b/legacy/emotion/src/modules/xine/emotion_xine.h
index d7985aa20d..3a4b464a20 100644
--- a/legacy/emotion/src/modules/xine/emotion_xine.h
+++ b/legacy/emotion/src/modules/xine/emotion_xine.h
@@ -20,6 +20,7 @@ struct _Emotion_Xine_Video
20 xine_event_queue_t *queue; 20 xine_event_queue_t *queue;
21 volatile double len; 21 volatile double len;
22 volatile double pos; 22 volatile double pos;
23 volatile double volume;
23 double fps; 24 double fps;
24 double ratio; 25 double ratio;
25 int w, h; 26 int w, h;