summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-21 20:44:29 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-08-21 20:44:29 +0000
commit0f4a3c14c3774acb3cca332f530a96385617278a (patch)
treed3aa1485079e4bbb59abe64d5106f7aed6f43b2e
parent665b40cbd553bc620d9ecf3b2c7efdffbafd87fb (diff)
downloadmpv-0f4a3c14c3774acb3cca332f530a96385617278a.tar.bz2
mpv-0f4a3c14c3774acb3cca332f530a96385617278a.tar.xz
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> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7056 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--input/input.c2
-rw-r--r--mplayer.c10
2 files changed, 11 insertions, 1 deletions
diff --git a/input/input.c b/input/input.c
index 6265ae3eac..9c23ee9b2a 100644
--- a/input/input.c
+++ b/input/input.c
@@ -51,7 +51,7 @@ static mp_cmd_t mp_cmds[] = {
{ 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}} } },
diff --git a/mplayer.c b/mplayer.c
index 359a927776..70812eb91c 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -2380,10 +2380,20 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
} 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