Пример #1
0
 public void ShowPaletteChordForm(int midiChordIndex)
 {
     if (M.HasError(_allTextBoxes))
     {
         MessageBox.Show("Can't create a palette chord form because this palette contains errors.");
     }
     else
     {
         _paletteChordForm = new PaletteChordForm(this, _bcc, midiChordIndex, _fsf);
         _paletteChordForm.Show();
         _hostForm.SetAllFormsExceptChordFormEnabledState(false);
         BringPaletteChordFormToFront();
     }
 }
Пример #2
0
        /// <summary>
        /// A temporary palette containing a single DurationDef.
        /// Used just to construct the single DurationDef with the existing code.
        /// </summary>
        /// <param name="paletteChordForm"></param>
        public Palette(PaletteChordForm paletteChordForm)
        {
            BasicChordFormSettings bcfs = new BasicChordFormSettings();

            bcfs.Durations               = M.StringToIntList(paletteChordForm.DurationTextBox.Text, ',');
            bcfs.Velocities              = M.StringToByteList(paletteChordForm.VelocityTextBox.Text, ',');
            bcfs.MidiPitches             = M.StringToByteList(paletteChordForm.BaseMidiPitchTextBox.Text, ',');
            bcfs.ChordOffs               = M.StringToBoolList(paletteChordForm.ChordOffTextBox.Text, ',');
            bcfs.ChordDensities          = M.StringToByteList(paletteChordForm.ChordDensityTextBox.Text, ',');
            bcfs.Inversions              = paletteChordForm.PaletteForm.GetLinearInversions(paletteChordForm.PaletteForm.BasicChordControl.RootInversionTextBox.Text);
            bcfs.InversionIndices        = M.StringToIntList(paletteChordForm.InversionIndexTextBox.Text, ',');
            bcfs.VerticalVelocityFactors = M.StringToFloatList(paletteChordForm.VerticalVelocityFactorTextBox.Text, ',');

            _basicChordMidiSettings = new BasicChordMidiSettings(bcfs);

            _bankIndices          = M.StringToByteList(paletteChordForm.BankIndexTextBox.Text, ',');
            _patchIndices         = M.StringToByteList(paletteChordForm.PatchIndexTextBox.Text, ',');
            _pitchwheelDeviations = M.StringToByteList(paletteChordForm.PitchwheelDeviationTextBox.Text, ',');

            _pitchwheelEnvelopes      = M.StringToByteLists(paletteChordForm.PitchwheelEnvelopeTextBox.Text);
            _panEnvelopes             = M.StringToByteLists(paletteChordForm.PanEnvelopeTextBox.Text);
            _modulationWheelEnvelopes = M.StringToByteLists(paletteChordForm.ModulationWheelEnvelopeTextBox.Text);
            _expressionEnvelopes      = M.StringToByteLists(paletteChordForm.ExpressionEnvelopeTextBox.Text);

            _ornamentNumbers        = M.StringToIntList(paletteChordForm.OrnamentNumberTextBox.Text, ',');
            _ornamentMinMsDurations = M.StringToIntList(paletteChordForm.MinMsDurationTextBox.Text, ',');

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

            DurationDef dd = GetDurationDef(0);

            _durationDefs.Add(dd);
        }
Пример #3
0
        /// <summary>
        /// A temporary palette containing a single DurationDef.
        /// Used just to construct the single DurationDef with the existing code.
        /// </summary>
        /// <param name="paletteChordForm"></param>
        public Palette(PaletteChordForm paletteChordForm)
        {
            BasicChordFormSettings bcfs = new BasicChordFormSettings();
            bcfs.Durations = M.StringToIntList(paletteChordForm.DurationTextBox.Text, ',');
            bcfs.Velocities = M.StringToByteList(paletteChordForm.VelocityTextBox.Text, ',');
            bcfs.MidiPitches = M.StringToByteList(paletteChordForm.BaseMidiPitchTextBox.Text,  ',');
            bcfs.ChordOffs = M.StringToBoolList(paletteChordForm.ChordOffTextBox.Text, ',');
            bcfs.ChordDensities = M.StringToByteList(paletteChordForm.ChordDensityTextBox.Text, ',');
            bcfs.Inversions = paletteChordForm.PaletteForm.GetLinearInversions(paletteChordForm.PaletteForm.BasicChordControl.RootInversionTextBox.Text);
            bcfs.InversionIndices = M.StringToIntList(paletteChordForm.InversionIndexTextBox.Text, ',');
            bcfs.VerticalVelocityFactors = M.StringToFloatList(paletteChordForm.VerticalVelocityFactorTextBox.Text, ',');

            _basicChordMidiSettings = new BasicChordMidiSettings(bcfs);

            _bankIndices = M.StringToByteList(paletteChordForm.BankIndexTextBox.Text, ',');
            _patchIndices = M.StringToByteList(paletteChordForm.PatchIndexTextBox.Text, ',');
            _pitchwheelDeviations = M.StringToByteList(paletteChordForm.PitchwheelDeviationTextBox.Text, ',');

            _pitchwheelEnvelopes = M.StringToByteLists(paletteChordForm.PitchwheelEnvelopeTextBox.Text);
            _panEnvelopes = M.StringToByteLists(paletteChordForm.PanEnvelopeTextBox.Text);
            _modulationWheelEnvelopes = M.StringToByteLists(paletteChordForm.ModulationWheelEnvelopeTextBox.Text);
            _expressionEnvelopes = M.StringToByteLists(paletteChordForm.ExpressionEnvelopeTextBox.Text);

            _ornamentNumbers = M.StringToIntList(paletteChordForm.OrnamentNumberTextBox.Text, ',');
            _ornamentMinMsDurations = M.StringToIntList(paletteChordForm.MinMsDurationTextBox.Text, ',');

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

            DurationDef dd = GetDurationDef(0);
            _durationDefs.Add(dd);
        }
Пример #4
0
        internal void ClosePaletteChordForm(int chordIndex)
        {
            Debug.Assert(this.Enabled);
            _paletteChordForm.Close();
            _paletteChordForm = null;

            _hostForm.SetAllFormsExceptChordFormEnabledState(true);

            // If an OrnamentSettingsForm exists, it is brought in front of Visual Studio.
            if(_ornamentsForm != null)
            {
                _ornamentsForm.BringToFront();
            }

            this.BringToFront();
            this.PaletteButtonsControl.PaletteChordFormButtons[chordIndex].Select();
        }
Пример #5
0
 public void ShowPaletteChordForm(int midiChordIndex)
 {
     if(M.HasError(_allTextBoxes))
     {
         MessageBox.Show("Can't create a palette chord form because this palette contains errors.");
     }
     else
     {
         _paletteChordForm = new PaletteChordForm(this, _bcc, midiChordIndex, _fsf);
         _paletteChordForm.Show();
         _hostForm.SetAllFormsExceptChordFormEnabledState(false);
         BringPaletteChordFormToFront();
     }
 }