1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 21:06:00 +00:00

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
This commit is contained in:
arpi 2002-08-21 20:44:29 +00:00
parent 665b40cbd5
commit 0f4a3c14c3
2 changed files with 11 additions and 1 deletions

View File

@ -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}} } },

View File

@ -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