public MixerPerspectiveSetCommand(int?channel = null, int?layer = null, MixerPerspective perspective = null, Transform transform = null) { Channel = channel; Layer = layer; Perspective = perspective; Transform = transform; }
internal override void ProcessData(AmcpParsedData data) { base.ProcessData(data); var values = Converter.StringToDoubleArray(data.Data[1], " ", NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign, new CultureInfo("en-US")); Perspective = new MixerPerspective(values[0], values[1], values[2], values[3], values[4], values[5], values[6], values[7]); }
private void MixerPerspectiveSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { if (!IsLoaded || !_connection.IsConnected()) { return; } var perspective = new MixerPerspective { TopLeftX = MixerPerspectiveTopLeftXSlider.Value, TopLeftY = MixerPerspectiveTopLeftYSlider.Value, TopRightX = MixerPerspectiveTopRightXSlider.Value, TopRightY = MixerPerspectiveTopRightYSlider.Value, BottomRightX = MixerPerspectiveBottomRightXSlider.Value, BottomRightY = MixerPerspectiveBottomRightYSlider.Value, BottomLeftX = MixerPerspectiveBottomLeftXSlider.Value, BottomLeftY = MixerPerspectiveBottomLeftYSlider.Value }; new MixerPerspectiveSetCommand(_channel, _layer, perspective).ExecuteAsync(_connection).ContinueWith(task => { if (task.Status == TaskStatus.RanToCompletion) { new MixerPerspectiveGetCommand(_channel, _layer).ExecuteAsync(_connection).ContinueWith(task2 => { if (task2.Status == TaskStatus.RanToCompletion) { var perspective2 = task2.Result.Perspective; MixerPerspectiveTopLeftXTextBlock.Text = perspective2.TopLeftX.GetValueOrDefault().ToString("0.00"); MixerPerspectiveTopLeftYTextBlock.Text = perspective2.TopLeftY.GetValueOrDefault().ToString("0.00"); MixerPerspectiveTopRightXTextBlock.Text = perspective2.TopRightX.GetValueOrDefault().ToString("0.00"); MixerPerspectiveTopRightYTextBlock.Text = perspective2.TopRightY.GetValueOrDefault().ToString("0.00"); MixerPerspectiveBottomRightXTextBlock.Text = perspective2.BottomRightX.GetValueOrDefault().ToString("0.00"); MixerPerspectiveBottomRightYTextBlock.Text = perspective2.BottomRightY.GetValueOrDefault().ToString("0.00"); MixerPerspectiveBottomLeftXTextBlock.Text = perspective2.BottomLeftX.GetValueOrDefault().ToString("0.00"); MixerPerspectiveBottomLeftYTextBlock.Text = perspective2.BottomLeftY.GetValueOrDefault().ToString("0.00"); } }); } }, TaskScheduler.FromCurrentSynchronizationContext()); }