private void TurnOff_Click(object sender, RoutedEventArgs e) { string ip = IpTextbox.Text; string psk = PskTextBox.Text; if (string.IsNullOrWhiteSpace(ip) || string.IsNullOrWhiteSpace(psk)) { MessageBox.Show("Must enter an IP and/or PSK"); return; } UpdateOutputText(BraviaCommands.SetPowerStatus(ip, psk, BraviaPowerStatus.Standby) ? "Turned Off" : "Command Failed"); }
private void SetToHDMIThree_Click(object sender, RoutedEventArgs e) { string ip = IpTextbox.Text; string psk = PskTextBox.Text; if (string.IsNullOrWhiteSpace(ip) || string.IsNullOrWhiteSpace(psk)) { MessageBox.Show("Must enter an IP and/or PSK"); return; } UpdateOutputText(BraviaCommands.SetPlayingContent(ip, psk, BraviaPlayContent.HDMI3) ? "Set to HDMI 3" : "Command Failed"); }
private void SetVolumeToTen_Click(object sender, RoutedEventArgs e) { string ip = IpTextbox.Text; string psk = PskTextBox.Text; if (string.IsNullOrWhiteSpace(ip) || string.IsNullOrWhiteSpace(psk)) { MessageBox.Show("Must enter an IP and/or PSK"); return; } UpdateOutputText(BraviaCommands.SetVolume(ip, psk, 10) ? "Volume changed to 10" : "Command Failed"); }
private void SetToTuner_Click(object sender, RoutedEventArgs e) { string ip = IpTextbox.Text; string psk = PskTextBox.Text; if (string.IsNullOrWhiteSpace(ip) || string.IsNullOrWhiteSpace(psk)) { MessageBox.Show("Must enter an IP and/or PSK"); return; } var result = BraviaCommands.GetPlayContentsList(ip, psk); UpdateOutputText(BraviaCommands.SetPlayingContent(ip, psk, BraviaPlayContent.Component1) ? "Set to Tuner" : "Command Failed"); }
private void GetInput_Click(object sender, RoutedEventArgs e) { string ip = IpTextbox.Text; string psk = PskTextBox.Text; if (string.IsNullOrWhiteSpace(ip) || string.IsNullOrWhiteSpace(psk)) { MessageBox.Show("Must enter an IP and/or PSK"); return; } var result = BraviaCommands.GetPlayingContentInformation(ip, psk); if (result != null && result.Result != null) { UpdateOutputText(result.Result[0].Title); } else { UpdateOutputText("Command Failed"); } }
private void GetVolumeInfo_Click(object sender, RoutedEventArgs e) { string ip = IpTextbox.Text; string psk = PskTextBox.Text; if (string.IsNullOrWhiteSpace(ip) || string.IsNullOrWhiteSpace(psk)) { MessageBox.Show("Must enter an IP and/or PSK"); return; } var result = BraviaCommands.GetVolumeInformation(ip, psk); if (result != null && result.Result != null) { UpdateOutputText("Speaker Volume: " + result.Result[0].First(x => x.Target == "speaker").Volume.ToString()); UpdateOutputText("Headphone Volume: " + result.Result[0].First(x => x.Target == "headphone").Volume.ToString()); } else { UpdateOutputText("Command Failed"); } }