private void InitializeToneInformation() { // NAME toneNameBox.TextChanged += (sender, e) => { var toneName = toneNameBox.Text; tone.Key = toneName.GetValidName(); tone.Name = toneName; }; // VOLUME volumeBox.ValueChanged += (sender, e) => { Tone_Volume_Tip(volumeBox, e); tone.Volume = (float)volumeBox.Value; }; // TONE DESCRIPTOR if (CurrentGameVersion == GameVersion.RS2014) { var tonedesclist = ToneDescriptor.List().ToList(); descriptorCombo.DisplayMember = "Name"; descriptorCombo.ValueMember = "Descriptor"; descriptorCombo.DataSource = tonedesclist; descriptorCombo.SelectedValueChanged += (sender, e) => UpdateToneDescription((ComboBox)sender); } }
public void RefreshControls() { _refreshingCombos = true; toneNameBox.Text = tone.Name ?? ""; volumeBox.Value = Decimal.Round((decimal)tone.Volume, 2); UpdateComboSelection(ampBox, ampKnobButton, "Amp"); UpdateComboSelection(cabinetBox, cabinetKnobButton, "Cabinet"); UpdateComboSelection(prePedal1Box, prePedal1KnobButton, "PrePedal1"); UpdateComboSelection(prePedal2Box, prePedal2KnobButton, "PrePedal2"); UpdateComboSelection(prePedal3Box, prePedal3KnobButton, "PrePedal3"); UpdateComboSelection(prePedal4Box, prePedal4KnobButton, "PrePedal4"); UpdateComboSelection(loopPedalRack1Box, loopPedalRack1KnobButton, LoopOrRackSlot + "1"); UpdateComboSelection(loopPedalRack2Box, loopPedalRack2KnobButton, LoopOrRackSlot + "2"); UpdateComboSelection(loopPedalRack3Box, loopPedalRack3KnobButton, LoopOrRackSlot + "3"); UpdateComboSelection(loopPedalRack4Box, loopPedalRack4KnobButton, LoopOrRackSlot + "4"); UpdateComboSelection(postPedal1Box, postPedal1KnobButton, "PostPedal1"); UpdateComboSelection(postPedal2Box, postPedal2KnobButton, "PostPedal2"); UpdateComboSelection(postPedal3Box, postPedal3KnobButton, "PostPedal3"); UpdateComboSelection(postPedal4Box, postPedal4KnobButton, "PostPedal4"); _refreshingCombos = false; if (CurrentGameVersion == GameVersion.RS2014) { // TODO: multiple ToneDescriptors improved handling and editing if (tone.ToneDescriptors.Count > 0) { if (ToneDescriptor.List().Any <ToneDescriptor>(t => t.Descriptor == tone.ToneDescriptors[0])) { descriptorCombo.SelectedIndex = ToneDescriptor.List().TakeWhile(t => t.Descriptor != tone.ToneDescriptors[0]).Count(); } } else { UpdateToneDescription(descriptorCombo); } } }