public MPCCurrentSong CurrentSong() { string result = Send("currentsong", true); MPCCurrentSong song = FillStruct <MPCCurrentSong>(result); return(song); }
public static void GetSongName(string cmd, string sender, MatrixRoom room) { MPCCurrentSong song = Program.MPCClient.CurrentSong(); Program.MPCClient.Status(); if (song.file != null) { FileInfo file = new FileInfo(song.file); string name = file.Name.Replace(file.Extension, ""); name = new string(System.Text.Encoding.UTF8.GetChars(Convert.FromBase64String(name))); string[] time = Program.MPCClient.lastStatus.time.Split(':'); int elapsed = int.Parse(time[0]); int total = int.Parse(time[1]); name += String.Format(" {0}:{1}/{2}:{3}", elapsed / 60, elapsed % 60, total / 60, total % 60); room.SendNotice(name); } else { room.SendNotice("Nothing is currently playing"); } }