summaryrefslogtreecommitdiff
path: root/legacy/emotion/src/modules/xine/emotion_xine.c
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/emotion/src/modules/xine/emotion_xine.c
parent0ebceb16a14eb31d7ddec19cde078e9ccf1d087c (diff)
emotion: set volume when files are opened.
SVN revision: 36531
Diffstat (limited to 'legacy/emotion/src/modules/xine/emotion_xine.c')
-rw-r--r--legacy/emotion/src/modules/xine/emotion_xine.c22
1 files changed, 10 insertions, 12 deletions
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