public PaletteChordForm(PaletteForm paletteForm, BasicChordControl bcc, int midiChordIndex, FormStateFunctions fsf) { InitializeComponent(); Text = paletteForm.PaletteName + " : midi chord " + (midiChordIndex + 1).ToString(); _paletteForm = paletteForm; _bcc = bcc; _midiChordIndex = midiChordIndex; _fsf = fsf; if(_paletteForm.IsPercussionPalette) { MidiInstrumentsHelpButton.Text = "Percussion Instr."; } else { MidiInstrumentsHelpButton.Text = "MIDI Instruments"; } FindEmptyDefaultControls(); InitializeTextBoxes(paletteForm, bcc, midiChordIndex); ChordDensityTextBox_Leave(ChordDensityTextBox, null); InitializeMidiEventButton(midiChordIndex); AddAudioSampleButtons(_paletteForm.Domain); SetDialogStateIsSaved(); }
private void ConnectBasicChordControl() { _bcc = new BasicChordControl(SetDialogState); _bcc.Location = new Point(22, 14); Controls.Add(_bcc); _bcc.TabIndex = 5; }
public PaletteChordForm(PaletteForm paletteForm, BasicChordControl bcc, int midiChordIndex, FormStateFunctions fsf) { InitializeComponent(); Text = paletteForm.SavedName + " : midi chord " + (midiChordIndex + 1).ToString(); _paletteForm = paletteForm; _bcc = bcc; _midiChordIndex = midiChordIndex; _fsf = fsf; if (_paletteForm.IsPercussionPalette) { MidiInstrumentsHelpButton.Text = "Percussion Instr."; } else { MidiInstrumentsHelpButton.Text = "MIDI Instruments"; } FindEmptyDefaultControls(); InitializeTextBoxes(paletteForm, bcc, midiChordIndex); ChordDensityTextBox_Leave(ChordDensityTextBox, null); InitializeMidiEventButton(midiChordIndex); AddAudioSampleButtons(_paletteForm.Domain); SetDialogStateIsSaved(); }
private void ConnectBasicChordControl() { _bcc = new BasicChordControl(SetDialogState); _bcc.Location = new Point(0, 25); _bcc.BorderStyle = BorderStyle.None; this.TopPanel.Controls.Add(_bcc); TopPanel.TabIndex = 0; _bcc.TabIndex = 1; int rightMargin = _bcc.DurationsLabel.Location.X + _bcc.DurationsLabel.Size.Width; ReplaceLabel(_bcc.DurationsLabel, "relative durations", rightMargin); ReplaceLabel(_bcc.VelocitiesLabel, "velocity increments", rightMargin); ReplaceLabel(_bcc.MidiPitchesLabel, "transpositions", rightMargin); ReplaceLabel(_bcc.ChordDensitiesLabel, "note density factors", rightMargin); }
private void InitializeTextBoxes(PaletteForm paletteForm, BasicChordControl bcc, int midiChordIndex) { durationSBs = GetSubStrings(bcc.DurationsTextBox.Text, midiChordIndex); this.DurationTextBox.Text = durationSBs[1].ToString(); _savedDurationTextBoxText = DurationTextBox.Text; _allTextBoxes.Add(DurationTextBox); velocitySBs = GetSubStrings(bcc.VelocitiesTextBox.Text, midiChordIndex); this.VelocityTextBox.Text = velocitySBs[1].ToString(); _savedVelocityTextBoxText = VelocityTextBox.Text; _allTextBoxes.Add(VelocityTextBox); baseMidiPitchSBs = GetSubStrings(bcc.MidiPitchesTextBox.Text, midiChordIndex); this.BaseMidiPitchTextBox.Text = baseMidiPitchSBs[1].ToString(); _savedBaseMidiPitchTextBoxText = BaseMidiPitchTextBox.Text; _allTextBoxes.Add(BaseMidiPitchTextBox); chordOffSBs = GetSubStrings(bcc.ChordOffsTextBox.Text, midiChordIndex); this.ChordOffTextBox.Text = chordOffSBs[1].ToString(); _savedChordOffTextBoxText = ChordOffTextBox.Text; _allTextBoxes.Add(ChordOffTextBox); chordDensitySBs = GetSubStrings(bcc.ChordDensitiesTextBox.Text, midiChordIndex); this.ChordDensityTextBox.Text = chordDensitySBs[1].ToString(); _savedChordDensityTextBoxText = ChordDensityTextBox.Text; _allTextBoxes.Add(ChordDensityTextBox); inversionIndexSBs = GetSubStrings(bcc.InversionIndicesTextBox.Text, midiChordIndex); this.InversionIndexTextBox.Text = inversionIndexSBs[1].ToString(); _savedInversionIndexTextBoxText = InversionIndexTextBox.Text; _allTextBoxes.Add(InversionIndexTextBox); verticalVelocityFactorSBs = GetSubStrings(bcc.VerticalVelocityFactorsTextBox.Text, midiChordIndex); this.VerticalVelocityFactorTextBox.Text = verticalVelocityFactorSBs[1].ToString(); _savedVerticalVelocityFactorTextBoxText = VerticalVelocityFactorTextBox.Text; _allTextBoxes.Add(VerticalVelocityFactorTextBox); bankIndexSBs = GetSubStrings(paletteForm.BankIndicesTextBox.Text, midiChordIndex); this.BankIndexTextBox.Text = bankIndexSBs[1].ToString(); _savedBankIndexTextBoxText = BankIndexTextBox.Text; _allTextBoxes.Add(BankIndexTextBox); patchIndexSBs = GetSubStrings(paletteForm.PatchIndicesTextBox.Text, midiChordIndex); this.PatchIndexTextBox.Text = patchIndexSBs[1].ToString(); _savedPatchIndexTextBoxText = PatchIndexTextBox.Text; _allTextBoxes.Add(PatchIndexTextBox); pitchwheelDeviationSBs = GetSubStrings(paletteForm.PitchwheelDeviationsTextBox.Text, midiChordIndex); this.PitchwheelDeviationTextBox.Text = pitchwheelDeviationSBs[1].ToString(); _savedPitchwheelDeviationTextBoxText = PitchwheelDeviationTextBox.Text; _allTextBoxes.Add(PitchwheelDeviationTextBox); pitchwheelEnvelopeSBs = GetSubStrings(paletteForm.PitchwheelEnvelopesTextBox.Text, midiChordIndex); this.PitchwheelEnvelopeTextBox.Text = pitchwheelEnvelopeSBs[1].ToString(); _savedPitchwheelEnvelopeTextBoxText = PitchwheelEnvelopeTextBox.Text; _allTextBoxes.Add(PitchwheelEnvelopeTextBox); panEnvelopeSBs = GetSubStrings(paletteForm.PanEnvelopesTextBox.Text, midiChordIndex); this.PanEnvelopeTextBox.Text = panEnvelopeSBs[1].ToString(); _savedPanEnvelopeTextBoxText = PanEnvelopeTextBox.Text; _allTextBoxes.Add(PanEnvelopeTextBox); modulationWheelEnvelopeSBs = GetSubStrings(paletteForm.ModulationWheelEnvelopesTextBox.Text, midiChordIndex); this.ModulationWheelEnvelopeTextBox.Text = modulationWheelEnvelopeSBs[1].ToString(); _savedModulationWheelEnvelopeTextBoxText = ModulationWheelEnvelopeTextBox.Text; _allTextBoxes.Add(ModulationWheelEnvelopeTextBox); expressionEnvelopeSBs = GetSubStrings(paletteForm.ExpressionEnvelopesTextBox.Text, midiChordIndex); this.ExpressionEnvelopeTextBox.Text = expressionEnvelopeSBs[1].ToString(); _savedExpressionEnvelopeTextBoxText = ExpressionEnvelopeTextBox.Text; _allTextBoxes.Add(ExpressionEnvelopeTextBox); ornamentNumberSBs = GetSubStrings(paletteForm.OrnamentNumbersTextBox.Text, midiChordIndex); this.OrnamentNumberTextBox.Text = ornamentNumberSBs[1].ToString(); _savedOrnamentNumberTextBoxText = OrnamentNumberTextBox.Text; _allTextBoxes.Add(OrnamentNumberTextBox); minMsDurationsSBs = GetSubStrings(paletteForm.MinMsDurationsTextBox.Text, midiChordIndex); this.MinMsDurationTextBox.Text = minMsDurationsSBs[1].ToString(); _savedMinMsDurationTextBoxText = MinMsDurationTextBox.Text; _allTextBoxes.Add(MinMsDurationTextBox); }
/************/ #region ReviewableForm #endregion ReviewableForm #region public interface public void WriteOrnamentSettingsForm(XmlWriter w) { w.WriteStartElement("ornamentSettings"); Debug.Assert(!string.IsNullOrEmpty(NumBasicChordDefsTextBox.Text)); w.WriteStartElement("numBasicChordDefs"); w.WriteString(NumBasicChordDefsTextBox.Text); w.WriteEndElement(); BasicChordControl.WriteBasicChordControl(w); if (!string.IsNullOrEmpty(this.BankIndicesTextBox.Text)) { w.WriteStartElement("bankIndices"); w.WriteString(BankIndicesTextBox.Text.Replace(" ", "")); w.WriteEndElement(); } if (!string.IsNullOrEmpty(this.PatchIndicesTextBox.Text)) { w.WriteStartElement("patchIndices"); w.WriteString(PatchIndicesTextBox.Text.Replace(" ", "")); w.WriteEndElement(); } Debug.Assert(!string.IsNullOrEmpty(NumberOfOrnamentsTextBox.Text)); w.WriteStartElement("numOrnaments"); w.WriteString(NumberOfOrnamentsTextBox.Text); w.WriteEndElement(); w.WriteStartElement("ornaments"); for (int i = 1; i <= _ornaments.Count; ++i) { #region write ornament elements w.WriteStartElement("ornament"); switch (i) { case 1: w.WriteString(this.Ornament1TextBox.Text.Replace(" ", "")); break; case 2: w.WriteString(this.Ornament2TextBox.Text.Replace(" ", "")); break; case 3: w.WriteString(this.Ornament3TextBox.Text.Replace(" ", "")); break; case 4: w.WriteString(this.Ornament4TextBox.Text.Replace(" ", "")); break; case 5: w.WriteString(this.Ornament5TextBox.Text.Replace(" ", "")); break; case 6: w.WriteString(this.Ornament6TextBox.Text.Replace(" ", "")); break; case 7: w.WriteString(this.Ornament7TextBox.Text.Replace(" ", "")); break; case 8: w.WriteString(this.Ornament8TextBox.Text.Replace(" ", "")); break; case 9: w.WriteString(this.Ornament9TextBox.Text.Replace(" ", "")); break; case 10: w.WriteString(this.Ornament10TextBox.Text.Replace(" ", "")); break; case 11: w.WriteString(this.Ornament11TextBox.Text.Replace(" ", "")); break; case 12: w.WriteString(this.Ornament12TextBox.Text.Replace(" ", "")); break; } w.WriteEndElement(); // end of ornament #endregion } w.WriteEndElement(); // end of ornaments w.WriteEndElement(); // end of ornamentSettings _fsf.SetSettingsAreSaved(this, M.HasError(_allTextBoxes), ConfirmButton, RevertToSavedButton); }