Mercurial > mplayer.hg
comparison mplayer.c @ 7055:5a6616a088f2
new slave volume command done :
"volume <x> <abs 0|1>"
where :
abs optionnal,
0 : relative, x > 0 increase else decrease
1 : static, x = volume, 0 to 100
for sofware plugin, remember to / 2.55 before commiting
patch by "j.a.l" <j.a.l@free.fr>
author | arpi |
---|---|
date | Wed, 21 Aug 2002 20:44:29 +0000 |
parents | e37a67d5e117 |
children | 2e5c07262861 |
comparison
equal
deleted
inserted
replaced
7054:93d385771dc9 | 7055:5a6616a088f2 |
---|---|
2378 else | 2378 else |
2379 osd_level= v > 2 ? 2 : v; | 2379 osd_level= v > 2 ? 2 : v; |
2380 } break; | 2380 } break; |
2381 case MP_CMD_VOLUME : { | 2381 case MP_CMD_VOLUME : { |
2382 int v = cmd->args[0].v.i; | 2382 int v = cmd->args[0].v.i; |
2383 | |
2384 // start change for absolute volume value | |
2385 int abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0; | |
2386 | |
2387 if( abs ) | |
2388 { | |
2389 mixer_setvolume( (float)v, (float)v ); | |
2390 } else { | |
2383 if(v > 0) | 2391 if(v > 0) |
2384 mixer_incvolume(); | 2392 mixer_incvolume(); |
2385 else | 2393 else |
2386 mixer_decvolume(); | 2394 mixer_decvolume(); |
2395 } | |
2396 | |
2387 #ifdef USE_OSD | 2397 #ifdef USE_OSD |
2388 if(osd_level){ | 2398 if(osd_level){ |
2389 osd_visible=sh_video->fps; // 1 sec | 2399 osd_visible=sh_video->fps; // 1 sec |
2390 vo_osd_progbar_type=OSD_VOLUME; | 2400 vo_osd_progbar_type=OSD_VOLUME; |
2391 vo_osd_progbar_value=(mixer_getbothvolume()*256.0)/100.0; | 2401 vo_osd_progbar_value=(mixer_getbothvolume()*256.0)/100.0; |