private void btnEnvolventePress(object sender, PointerRoutedEventArgs e) { FrameworkElement boton = (FrameworkElement)e.OriginalSource; switch (boton.Name) { case "swEnv1": { swEnv1.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_on.jpg", UriKind.Absolute) }; swEnv2.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swEnv3.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swEnv4.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; envoActual = sonido.onda.sinusoidal; var transform = perilla1.RenderTransform as CompositeTransform; envolventeFreq = (int)(transform.Rotation * envolventeMax / 180); textbox1.Text += "P1: " + envolventeFreq + "\n"; break; } case "swEnv2": { swEnv1.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swEnv2.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_on.jpg", UriKind.Absolute) }; swEnv3.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swEnv4.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; envoActual = sonido.onda.triangular; var transform = perilla2.RenderTransform as CompositeTransform; envolventeFreq = (int)(transform.Rotation * envolventeMax / 180); textbox1.Text += "P2: " + envolventeFreq + "\n"; break; } case "swEnv3": { swEnv1.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swEnv2.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swEnv3.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_on.jpg", UriKind.Absolute) }; swEnv4.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; envoActual = sonido.onda.cuadrada; var transform = perilla3.RenderTransform as CompositeTransform; envolventeFreq = (int)(transform.Rotation * envolventeMax / 180); textbox1.Text += "P3: " + envolventeFreq + "\n"; break; } case "swEnv4": { swEnv1.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swEnv2.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swEnv3.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swEnv4.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_on.jpg", UriKind.Absolute) }; envoActual = sonido.onda.ninguno; break; } } e.Handled = true; }
private void btnOndaPress(object sender, PointerRoutedEventArgs e) { FrameworkElement boton = (FrameworkElement)e.OriginalSource; switch (boton.Name) { case "swOnda1": { swOnda1.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_on.jpg", UriKind.Absolute) }; swOnda2.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swOnda3.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; syntActual = sonido.onda.sinusoidal; break; } case "swOnda2": { swOnda1.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swOnda2.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_on.jpg", UriKind.Absolute) }; swOnda3.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; syntActual = sonido.onda.triangular; break; } case "swOnda3": { swOnda1.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swOnda2.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_off.jpg", UriKind.Absolute) }; swOnda3.Source = new BitmapImage() { UriSource = new Uri("ms-appx:///Assets/sw_on.jpg", UriKind.Absolute) }; syntActual = sonido.onda.cuadrada; break; } } e.Handled = true; }