Esempio n. 1
0
 public OrnamentsForm(XmlReader r, PaletteForm paletteForm, IPaletteFormsHostForm acForm, FormStateFunctions fsf)
 {
     _isLoading = true;
     InitializeOrnamentSettingsForm(r, paletteForm, acForm, fsf);
     _fsf.SetSettingsAreSaved(this, M.HasError(_allTextBoxes), ConfirmButton, RevertToSavedButton);
     _isLoading = false;
 }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
 public OrnamentsForm(XmlReader r, PaletteForm paletteForm, IPaletteFormsHostForm acForm, FormStateFunctions fsf)
 {
     _isLoading = true;
     InitializeOrnamentSettingsForm(r, paletteForm, acForm, fsf);
     _fsf.SetSettingsAreSaved(this, M.HasError(_allTextBoxes), ConfirmButton, RevertToSavedButton);
     _isLoading = false;
 }
Esempio n. 4
0
        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();
        }
Esempio n. 5
0
        public OrnamentsForm(PaletteForm paletteForm, IPaletteFormsHostForm acForm, FormStateFunctions fsf)
        {
            InitializeOrnamentSettingsForm(null, paletteForm, acForm, fsf);

            _fsf.SetFormState(this, SavedState.unconfirmed);
            ConfirmButton.Enabled = false;
            RevertToSavedButton.Enabled = false;
            RevertToSavedButton.Hide();
        }
Esempio n. 6
0
        public OrnamentsForm(PaletteForm paletteForm, IPaletteFormsHostForm acForm, FormStateFunctions fsf)
        {
            InitializeOrnamentSettingsForm(null, paletteForm, acForm, fsf);

            _fsf.SetFormState(this, SavedState.unconfirmed);
            ConfirmButton.Enabled       = false;
            RevertToSavedButton.Enabled = false;
            RevertToSavedButton.Hide();
        }
Esempio n. 7
0
        internal PaletteButtonsControl(int domain, Point location, PaletteForm paletteForm, string audioFolder)
        {
            InitializeComponent();

            _paletteForm = paletteForm;
            _audioFolder = audioFolder;
            this.SuspendLayout();
            this.Location = location;
            this.Size = new Size(domain * 33, 75);
            AddPaletteButtons(domain);
            this.ResumeLayout(false);
            this.PerformLayout();
        }
Esempio n. 8
0
        public OrnamentSettings(PaletteForm paletteform)
        {
            OrnamentsForm osf = paletteform.OrnamentsForm;

            Debug.Assert(osf != null && osf.Ornaments != null);

            BasicChordFormSettings bcs = new BasicChordFormSettings();

            /// relative durations
            bcs.Durations = M.StringToIntList(osf.BasicChordControl.DurationsTextBox.Text, ',');
            /// velocity increments
            bcs.Velocities = M.StringToByteList(osf.BasicChordControl.VelocitiesTextBox.Text, ',');
            /// transposition intervals
            bcs.MidiPitches             = M.StringToByteList(osf.BasicChordControl.MidiPitchesTextBox.Text, ',');
            bcs.ChordOffs               = M.StringToBoolList(osf.BasicChordControl.ChordOffsTextBox.Text, ',');
            bcs.ChordDensities          = M.StringToByteList(osf.BasicChordControl.ChordDensitiesTextBox.Text, ',');
            bcs.Inversions              = paletteform.GetLinearInversions(osf.BasicChordControl.RootInversionTextBox.Text);
            bcs.InversionIndices        = M.StringToIntList(osf.BasicChordControl.InversionIndicesTextBox.Text, ',');
            bcs.VerticalVelocityFactors = M.StringToFloatList(osf.BasicChordControl.VerticalVelocityFactorsTextBox.Text, ',');

            BasicChordMidiSettings = new BasicChordMidiSettings(bcs);
            // if BankIndices or PatchIndices != null, their values override the values in the upper BasicMidiChord
            if (osf.BankIndicesTextBox.Text == "")
            {
                BankIndices = null;
            }
            else
            {
                BankIndices = M.StringToByteList(osf.BankIndicesTextBox.Text, ',');
            }
            if (osf.PatchIndicesTextBox.Text == "")
            {
                PatchIndices = null;
            }
            else
            {
                PatchIndices = M.StringToByteList(osf.PatchIndicesTextBox.Text, ',');
            }

            OrnamentValues = osf.Ornaments;
        }
Esempio n. 9
0
        public Palette(PaletteForm paletteForm)
        {
            BasicChordFormSettings bcfs = new BasicChordFormSettings();

            bcfs.Durations               = M.StringToIntList(paletteForm.BasicChordControl.DurationsTextBox.Text, ',');
            bcfs.Velocities              = M.StringToByteList(paletteForm.BasicChordControl.VelocitiesTextBox.Text, ',');
            bcfs.MidiPitches             = M.StringToByteList(paletteForm.BasicChordControl.MidiPitchesTextBox.Text, ',');
            bcfs.ChordOffs               = M.StringToBoolList(paletteForm.BasicChordControl.ChordOffsTextBox.Text, ',');
            bcfs.ChordDensities          = M.StringToByteList(paletteForm.BasicChordControl.ChordDensitiesTextBox.Text, ',');
            bcfs.Inversions              = paletteForm.GetLinearInversions(paletteForm.BasicChordControl.RootInversionTextBox.Text);
            bcfs.InversionIndices        = M.StringToIntList(paletteForm.BasicChordControl.InversionIndicesTextBox.Text, ',');
            bcfs.VerticalVelocityFactors = M.StringToFloatList(paletteForm.BasicChordControl.VerticalVelocityFactorsTextBox.Text, ',');

            _basicChordMidiSettings = new BasicChordMidiSettings(bcfs);

            _bankIndices              = M.StringToByteList(paletteForm.BankIndicesTextBox.Text, ',');
            _patchIndices             = M.StringToByteList(paletteForm.PatchIndicesTextBox.Text, ',');
            _pitchwheelDeviations     = M.StringToByteList(paletteForm.PitchwheelDeviationsTextBox.Text, ',');
            _pitchwheelEnvelopes      = M.StringToByteLists(paletteForm.PitchwheelEnvelopesTextBox.Text);
            _panEnvelopes             = M.StringToByteLists(paletteForm.PanEnvelopesTextBox.Text);
            _modulationWheelEnvelopes = M.StringToByteLists(paletteForm.ModulationWheelEnvelopesTextBox.Text);
            _expressionEnvelopes      = M.StringToByteLists(paletteForm.ExpressionEnvelopesTextBox.Text);

            _ornamentNumbers        = M.StringToIntList(paletteForm.OrnamentNumbersTextBox.Text, ',');
            _ornamentMinMsDurations = M.StringToIntList(paletteForm.MinMsDurationsTextBox.Text, ',');

            _ornamentSettings = null;
            if (paletteForm.OrnamentsForm != null)
            {
                _ornamentSettings = new OrnamentSettings(paletteForm);
            }

            for (int chordIndex = 0; chordIndex < _basicChordMidiSettings.Durations.Count; ++chordIndex)
            {
                DurationDef dd = GetDurationDef(chordIndex);
                _durationDefs.Add(dd);
            }

            _isPercussionPalette = paletteForm.IsPercussionPalette;
        }
Esempio n. 10
0
        private void InitializeOrnamentSettingsForm(XmlReader r, PaletteForm paletteForm, IPaletteFormsHostForm acForm, FormStateFunctions fsf)
        {
            InitializeComponent();
            _paletteForm           = paletteForm;
            _fsf                   = fsf;
            _assistantComposerForm = acForm;
            ConnectBasicChordControl();

            Text = paletteForm.SavedName + " : ornaments";
            if (r != null)
            {
                _numberOfBasicChordDefs = ReadOrnamentSettingsForm(r);
            }

            _allNonOrnamentTextBoxes = GetNonOrnamentTextBoxes();
            _12OrnamentTextBoxes     = Get12OrnamentTextBoxes();
            _allTextBoxes            = new List <TextBox>();
            _allTextBoxes.AddRange(_allNonOrnamentTextBoxes);
            _allTextBoxes.AddRange(_12OrnamentTextBoxes);

            NumBasicChordDefsTextBox_Leave(NumBasicChordDefsTextBox, null);
            TouchAllTextBoxes();
        }
Esempio n. 11
0
        private void GetPalettes(XmlReader r)
        {
            Debug.Assert(r.Name == "palettes");
            M.ReadToXmlElementTag(r, "palette");
            this.PalettesListBox.SuspendLayout();
            this.PalettesListBox.Items.Clear();
            while(r.Name == "palette")
            {
                if(r.NodeType != XmlNodeType.EndElement)
                {
                    string name = "";
                    int domain = 1;
                    bool isPercussionPalette = false;

                    int count = r.AttributeCount;
                    for(int i = 0; i < count; i++)
                    {
                        r.MoveToAttribute(i);
                        switch(r.Name)
                        {
                            case "name":
                                name = r.Value;
                                break;
                            case "domain":
                                domain = int.Parse(r.Value);
                                break;
                            case "percussion":
                                if(r.Value == "1")
                                    isPercussionPalette = true;
                                break;
                        }
                    }

                    PaletteForm paletteForm = new PaletteForm(r, this, name, domain, isPercussionPalette, _fsf);

                    PalettesListBox.Items.Add(paletteForm);

                    M.ReadToXmlElementTag(r, "palette", "palettes");
                }
            }
            this.PalettesListBox.ResumeLayout();
            Debug.Assert(r.Name == "palettes");
            SetGroupBoxIsSaved(PalettesGroupBox, null, RevertPalettesListButton,
                (SavedState)NotationGroupBox.Tag, (SavedState)KrystalsGroupBox.Tag);
            PalettesListBox.Refresh();
        }
Esempio n. 12
0
        private void InitializeOrnamentSettingsForm(XmlReader r, PaletteForm paletteForm, IPaletteFormsHostForm acForm, FormStateFunctions fsf)
        {
            InitializeComponent();
            _paletteForm = paletteForm;
            _fsf = fsf;
            _assistantComposerForm = acForm;
            ConnectBasicChordControl();

            Text = paletteForm.SavedName + " : ornaments";
            if(r != null)
            {
                _numberOfBasicChordDefs = ReadOrnamentSettingsForm(r);
            }

            _allNonOrnamentTextBoxes = GetNonOrnamentTextBoxes();
            _12OrnamentTextBoxes = Get12OrnamentTextBoxes();
            _allTextBoxes = new List<TextBox>();
            _allTextBoxes.AddRange(_allNonOrnamentTextBoxes);
            _allTextBoxes.AddRange(_12OrnamentTextBoxes);

            NumBasicChordDefsTextBox_Leave(NumBasicChordDefsTextBox, null);
            TouchAllTextBoxes();
        }
Esempio n. 13
0
        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);
        }
Esempio n. 14
0
        public Palette(PaletteForm paletteForm)
        {
            Name = paletteForm.PaletteName;

            BasicChordFormSettings bcfs = new BasicChordFormSettings();
            bcfs.Durations = M.StringToIntList(paletteForm.BasicChordControl.DurationsTextBox.Text, ',');
            bcfs.Velocities = M.StringToByteList(paletteForm.BasicChordControl.VelocitiesTextBox.Text, ',');
            bcfs.MidiPitches = M.StringToByteList(paletteForm.BasicChordControl.MidiPitchesTextBox.Text, ',');
            bcfs.ChordOffs = M.StringToBoolList(paletteForm.BasicChordControl.ChordOffsTextBox.Text, ',');
            bcfs.ChordDensities = M.StringToByteList(paletteForm.BasicChordControl.ChordDensitiesTextBox.Text, ',');
            bcfs.Inversions = paletteForm.GetLinearInversions(paletteForm.BasicChordControl.RootInversionTextBox.Text);
            bcfs.InversionIndices = M.StringToIntList(paletteForm.BasicChordControl.InversionIndicesTextBox.Text, ',');
            bcfs.VerticalVelocityFactors = M.StringToFloatList(paletteForm.BasicChordControl.VerticalVelocityFactorsTextBox.Text, ',');

            _basicChordMidiSettings = new BasicChordMidiSettings(bcfs);

            _bankIndices = M.StringToByteList(paletteForm.BankIndicesTextBox.Text, ',');
            _patchIndices = M.StringToByteList(paletteForm.PatchIndicesTextBox.Text, ',');
            _pitchwheelDeviations = M.StringToByteList(paletteForm.PitchwheelDeviationsTextBox.Text, ',');
            _pitchwheelEnvelopes = M.StringToByteLists(paletteForm.PitchwheelEnvelopesTextBox.Text);
            _panEnvelopes = M.StringToByteLists(paletteForm.PanEnvelopesTextBox.Text);
            _modulationWheelEnvelopes = M.StringToByteLists(paletteForm.ModulationWheelEnvelopesTextBox.Text);
            _expressionEnvelopes = M.StringToByteLists(paletteForm.ExpressionEnvelopesTextBox.Text);

            _ornamentNumbers = M.StringToIntList(paletteForm.OrnamentNumbersTextBox.Text, ',');
            _ornamentMinMsDurations = M.StringToIntList(paletteForm.MinMsDurationsTextBox.Text, ',');

            _ornamentSettings = null;
            if(paletteForm.OrnamentsForm != null)
            {
                _ornamentSettings = new OrnamentSettings(paletteForm);
            }

            for(int chordIndex = 0; chordIndex < _basicChordMidiSettings.Durations.Count; ++chordIndex)
            {
                DurationDef dd = GetDurationDef(chordIndex);
                _durationDefs.Add(dd);
            }

            _isPercussionPalette = paletteForm.IsPercussionPalette;
        }
Esempio n. 15
0
        public OrnamentSettings(PaletteForm paletteform)
        {
            OrnamentsForm osf = paletteform.OrnamentsForm;
            Debug.Assert(osf != null && osf.Ornaments != null);

            BasicChordFormSettings bcs = new BasicChordFormSettings();
            /// relative durations
            bcs.Durations = M.StringToIntList(osf.BasicChordControl.DurationsTextBox.Text, ',');
            /// velocity increments
            bcs.Velocities = M.StringToByteList(osf.BasicChordControl.VelocitiesTextBox.Text, ',');
            /// transposition intervals
            bcs.MidiPitches = M.StringToByteList(osf.BasicChordControl.MidiPitchesTextBox.Text, ',');
            bcs.ChordOffs = M.StringToBoolList(osf.BasicChordControl.ChordOffsTextBox.Text, ',');
            bcs.ChordDensities = M.StringToByteList(osf.BasicChordControl.ChordDensitiesTextBox.Text, ',');
            bcs.Inversions = paletteform.GetLinearInversions(osf.BasicChordControl.RootInversionTextBox.Text);
            bcs.InversionIndices = M.StringToIntList(osf.BasicChordControl.InversionIndicesTextBox.Text, ',');
            bcs.VerticalVelocityFactors = M.StringToFloatList(osf.BasicChordControl.VerticalVelocityFactorsTextBox.Text, ',');

            BasicChordMidiSettings = new BasicChordMidiSettings(bcs);
            // if BankIndices or PatchIndices != null, their values override the values in the upper BasicMidiChord
            if(osf.BankIndicesTextBox.Text == "")
            {
                BankIndices = null;
            }
            else
            {
                BankIndices = M.StringToByteList(osf.BankIndicesTextBox.Text, ',');
            }
            if(osf.PatchIndicesTextBox.Text == "")
            {
                PatchIndices = null;
            }
            else
            {
                PatchIndices = M.StringToByteList(osf.PatchIndicesTextBox.Text, ',');
            }

            OrnamentValues = osf.Ornaments;
        }
Esempio n. 16
0
        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);
        }
Esempio n. 17
0
        private void AddPaletteButton_Click(object sender, EventArgs e)
        {
            NewPaletteDialog dialog = new NewPaletteDialog();
            if(dialog.ShowDialog() == DialogResult.OK)
            {
                List<PaletteForm> currentPaletteForms = CurrentPaletteForms;
                if(PaletteNameAlreadyExists(dialog, currentPaletteForms))
                {
                    MessageBox.Show("That name already exists!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    PaletteForm paletteForm = new PaletteForm(this, dialog.PaletteName, dialog.PaletteDomain, _fsf);
                    currentPaletteForms.Add(paletteForm);
                    CurrentPaletteForms = currentPaletteForms;
                    PalettesListBox.SelectedIndex = PalettesListBox.Items.Count - 1;
                    paletteForm.Show();
                    paletteForm.BringToFront();

                    SetGroupBoxIsUnconfirmed(PalettesGroupBox, null, RevertPalettesListButton);
                }
            }
        }
Esempio n. 18
0
        private void FindEmptyDefaultControls()
        {
            _emptyDefaultLabels     = new List <Label>();
            _emptyDefaultTextBoxes  = new List <TextBox>();
            _emptyDefaultHelpLabels = new List <Label>();

            if (string.IsNullOrEmpty(_bcc.ChordOffsTextBox.Text))
            {
                _emptyDefaultLabels.Add(this.ChordOffLabel);
                _emptyDefaultTextBoxes.Add(this.ChordOffTextBox);
                _emptyDefaultHelpLabels.Add(this.ChordOffHelpLabel);
            }

            if (string.IsNullOrEmpty(_bcc.InversionIndicesTextBox.Text))
            {
                _emptyDefaultLabels.Add(this.InversionIndexLabel);
                _emptyDefaultTextBoxes.Add(this.InversionIndexTextBox);
                _emptyDefaultHelpLabels.Add(this.InversionIndexHelpLabel);
            }

            if (string.IsNullOrEmpty(_bcc.VerticalVelocityFactorsTextBox.Text))
            {
                _emptyDefaultLabels.Add(this.VerticalVelocityFactorLabel);
                _emptyDefaultTextBoxes.Add(this.VerticalVelocityFactorTextBox);
                _emptyDefaultHelpLabels.Add(this.VerticalVelocityFactorHelpLabel);
            }

            PaletteForm pf = _paletteForm;

            if (string.IsNullOrEmpty(pf.BankIndicesTextBox.Text))
            {
                _emptyDefaultLabels.Add(this.BankIndexLabel);
                _emptyDefaultTextBoxes.Add(this.BankIndexTextBox);
                _emptyDefaultHelpLabels.Add(this.BankIndexHelpLabel);
            }

            if (string.IsNullOrEmpty(pf.PitchwheelDeviationsTextBox.Text))
            {
                _emptyDefaultLabels.Add(this.PitchwheelDeviationLabel);
                _emptyDefaultTextBoxes.Add(this.PitchwheelDeviationTextBox);
                _emptyDefaultHelpLabels.Add(this.PitchwheelDeviationHelpLabel);
            }

            if (string.IsNullOrEmpty(pf.PitchwheelEnvelopesTextBox.Text))
            {
                _emptyDefaultLabels.Add(this.PitchwheelEnvelopeLabel);
                _emptyDefaultTextBoxes.Add(this.PitchwheelEnvelopeTextBox);
                _emptyDefaultHelpLabels.Add(this.PitchwheelEnvelopeHelpLabel);
            }

            if (string.IsNullOrEmpty(pf.PanEnvelopesTextBox.Text))
            {
                _emptyDefaultLabels.Add(this.PanEnvelopeLabel);
                _emptyDefaultTextBoxes.Add(this.PanEnvelopeTextBox);
                _emptyDefaultHelpLabels.Add(this.PanEnvelopeHelpLabel);
            }

            if (string.IsNullOrEmpty(pf.ModulationWheelEnvelopesTextBox.Text))
            {
                _emptyDefaultLabels.Add(this.ModulationWheelEnvelopeLabel);
                _emptyDefaultTextBoxes.Add(this.ModulationWheelEnvelopeTextBox);
                _emptyDefaultHelpLabels.Add(this.ModulationWheelEnvelopeHelpLabel);
            }

            if (string.IsNullOrEmpty(pf.ExpressionEnvelopesTextBox.Text))
            {
                _emptyDefaultLabels.Add(this.ExpressionEnvelopeLabel);
                _emptyDefaultTextBoxes.Add(this.ExpressionEnvelopeTextBox);
                _emptyDefaultHelpLabels.Add(this.ExpressionEnvelopeHelpLabel);
            }

            if (string.IsNullOrEmpty(pf.MinMsDurationsTextBox.Text))
            {
                _emptyDefaultLabels.Add(this.MinMsDurationLabel);
                _emptyDefaultTextBoxes.Add(this.MinMsDurationTextBox);
                _emptyDefaultHelpLabels.Add(this.MinMsDurationHelpLabel);
            }
        }