It would seem to only take a few extra lines in modules/lua/libs/volume.c in order to enable this.
I've not yet tried building VLC from source as it seems a bit of an undertaking. Having had a dig around the source, one quick hack would be to add something like the following to volume.c (or else add an extra lua module for controlling mute) (I note that the qt gui
(This should be viewed as a sketch of the desired code -- I've not compiled this, let alone tested it.)
Code: Select all
static int get_muted()
{
vlc_playlist_t *playlist = vlclua_get_playlist_internal(L);
vlc_player_t *player = vlc_playlist_GetPlayer(playlist);
return vlc_player_aout_IsMuted(player);
}
static int set_mute(int muted) {
vlc_playlist_t *playlist = vlclua_get_playlist_internal(L);
vlc_player_t *player = vlc_playlist_GetPlayer(playlist);
vlc_player_Lock( player );
vlc_player_aout_Mute( player, muted );
vlc_player_Unlock( player );
}
static int vlclua_get_mute(lua_State *L)
{
long muted = get_muted();
lua_pushnumber(L, muted);
}
static int vlclua_volume_set_mute(lua_State *L)
{
int i_mute = luaL_checkinteger(L, 1);
set_mute(!!i_mute);
}
static int vlclua_toggle_mute(lua_State *L)
{
int muted = !get_muted();
set_mute(muted);
}
/*****************************************************************************
*
*****************************************************************************/
static const luaL_Reg vlclua_volume_reg[] = {
{ "get", vlclua_volume_get },
{ "set", vlclua_volume_set },
{ "up", vlclua_volume_up },
{ "down", vlclua_volume_down },
{ "get_mute", vlclua_get_mute },
{ "set_mute", vlclua_set_mute },
{ "toggle_mute", vlclua_toggle_mute },
{ NULL, NULL }
};