Example #1
0
        public void SeekPercentage(int progress)
        {
            if (_parent.MpcLoaded)
            {
                _parent.MpcHcRemote.SeekPercentage(progress);
            }
            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);
            }
        }
Example #2
0
 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);
     }
 }
Example #3
0
 public void Quit()
 {
     _parent.AsyncJsonCommand("Application.Quit", null);
 }