void Init() { A.Value = osc.A; D.Value = osc.D; S.Value = osc.S; R.Value = osc.R; randomPhase.IsChecked = osc.randomPhase; Volume.Value = osc.Volume; switch (osc.Type) { case OscillatorType.sine: TypeOscSin.IsChecked = true; break; case OscillatorType.triangle: TypeOscTri.IsChecked = true; break; case OscillatorType.square: TypeOscSq.IsChecked = true; break; case OscillatorType.saw: TypeOscSaw.IsChecked = true; break; case OscillatorType.whiteNoise: TypeOscWhite.IsChecked = true; break; case OscillatorType.pinkNoise: TypeOscPink.IsChecked = true; break; } checkSquareRatio(); Pitchs.Children.Clear(); int i = 0; foreach (var x in osc.Pitchs) { var pitchui = new PitchUI { Value = x }; pitchui.Tag = i++; pitchui.ValueChanged += Pitchui_ValueChanged; Pitchs.Children.Add(pitchui); } var but = new ButtonPretty { Text = "Dodaj" }; but.Click += But_Click; Pitchs.Children.Add(but); }
void ShowInput() { EffectsList.Children.Clear(); int index = 0; foreach (var effect in selectedLine.Line.effects) { Line_effectAdded(index, effect); index++; } var button = new ButtonPretty() { Text = "Dodaj" }; button.Click += AddEffect_Click; EffectsList.Children.Add(button); }