Mercurial > mplayer.hg
changeset 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 | 93d385771dc9 |
children | ad9a06fc40f8 |
files | input/input.c mplayer.c |
diffstat | 2 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/input/input.c Wed Aug 21 20:28:44 2002 +0000 +++ b/input/input.c Wed Aug 21 20:44:29 2002 +0000 @@ -51,7 +51,7 @@ { MP_CMD_PLAY_ALT_SRC_STEP, "alt_src_step",1, { { MP_CMD_ARG_INT,{0} }, {-1,{0}} } }, { MP_CMD_SUB_DELAY, "sub_delay",1, { {MP_CMD_ARG_FLOAT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, { MP_CMD_OSD, "osd",0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } }, - { MP_CMD_VOLUME, "volume", 1, { { MP_CMD_ARG_INT,{0} }, {-1,{0}} } }, + { MP_CMD_VOLUME, "volume", 1, { { MP_CMD_ARG_INT,{0} }, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } }, { MP_CMD_MIXER_USEMASTER, "use_master", 0, { {-1,{0}} } }, { MP_CMD_MUTE, "mute", 0, { {-1,{0}} } }, { MP_CMD_CONTRAST, "contrast",1, { {MP_CMD_ARG_INT,{0}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
--- a/mplayer.c Wed Aug 21 20:28:44 2002 +0000 +++ b/mplayer.c Wed Aug 21 20:44:29 2002 +0000 @@ -2380,10 +2380,20 @@ } break; case MP_CMD_VOLUME : { int v = cmd->args[0].v.i; + + // start change for absolute volume value + int abs = (cmd->nargs > 1) ? cmd->args[1].v.i : 0; + + if( abs ) + { + mixer_setvolume( (float)v, (float)v ); + } else { if(v > 0) mixer_incvolume(); else mixer_decvolume(); + } + #ifdef USE_OSD if(osd_level){ osd_visible=sh_video->fps; // 1 sec