public void SeekPercentage(int progress) { if (_parent.MpcLoaded) { _parent.MpcHcRemote.SeekPercentage(progress, _nowPlaying.Duration.TotalMilliseconds); } else if (_parent.IsConnected()) { var players = (JsonArray)_parent.JsonCommand("Player.GetActivePlayers", null); if (players.Count > 0) { foreach (JsonObject player in players) { if (player["type"].ToString() == "picture") { continue; } var current = Int32.Parse(player["playerid"].ToString()); var par = new JsonObject(); par["playerid"] = current; par["value"] = progress; _parent.AsyncJsonCommand("Player.Seek", par); } } _parent.JsonCommand( _nowPlaying.MediaType == "Audio" ? "AudioPlayer.SeekPercentage" : "VideoPlayer.SeekPercentage", progress); } }
public void ToggleMute() { if (_parent.MpcLoaded) { _parent.MpcHcRemote.ToggleMute(); } else if (_parent.IsConnected()) { var mute = new JsonObject(); mute["mute"] = "toggle"; _parent.AsyncJsonCommand("Application.SetMute", mute); } }
public void Quit() { _parent.AsyncJsonCommand("Application.Quit", null); }